Merge branch 'master' of https://github.com/cutls/TheDesk into gh-pages
This commit is contained in:
		@@ -137,6 +137,10 @@ $(function ($) {
 | 
			
		||||
			//矢印:選択
 | 
			
		||||
			if (e.code == "ArrowLeft") {
 | 
			
		||||
				//left
 | 
			
		||||
				if ($("#imagemodal").hasClass("open")) {
 | 
			
		||||
					imgCont('next');
 | 
			
		||||
					return false;
 | 
			
		||||
				}
 | 
			
		||||
				if (selectedColumn > 0) {
 | 
			
		||||
					selectedColumn--
 | 
			
		||||
				}
 | 
			
		||||
@@ -144,6 +148,9 @@ $(function ($) {
 | 
			
		||||
				return false;
 | 
			
		||||
			} else if (e.code == "ArrowUp") {
 | 
			
		||||
				//up
 | 
			
		||||
				if ($("#imagemodal").hasClass("open")) {
 | 
			
		||||
					return false;
 | 
			
		||||
				}
 | 
			
		||||
				if (selectedToot > 0) {
 | 
			
		||||
					selectedToot--
 | 
			
		||||
				}
 | 
			
		||||
@@ -151,6 +158,10 @@ $(function ($) {
 | 
			
		||||
				return false;
 | 
			
		||||
			} else if (e.code == "ArrowRight") {
 | 
			
		||||
				//right
 | 
			
		||||
				if ($("#imagemodal").hasClass("open")) {
 | 
			
		||||
					imgCont('prev');
 | 
			
		||||
					return false;
 | 
			
		||||
				}
 | 
			
		||||
				if (selectedColumn < $(".tl-box").length - 1) {
 | 
			
		||||
					selectedColumn++
 | 
			
		||||
				}
 | 
			
		||||
@@ -158,6 +169,9 @@ $(function ($) {
 | 
			
		||||
				return false;
 | 
			
		||||
			} else if (e.code == "ArrowDown") {
 | 
			
		||||
				//down
 | 
			
		||||
				if ($("#imagemodal").hasClass("open")) {
 | 
			
		||||
					return false;
 | 
			
		||||
				}
 | 
			
		||||
				selectedToot++
 | 
			
		||||
				tootSelector(selectedColumn, selectedToot)
 | 
			
		||||
				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 () {
 | 
			
		||||
 
 | 
			
		||||
@@ -174,4 +174,29 @@ $.mb_substr = function (str, begin, end) {
 | 
			
		||||
	}
 | 
			
		||||
	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");
 | 
			
		||||
@@ -160,7 +160,6 @@ ipc.on('memory', function (event, arg) {
 | 
			
		||||
})
 | 
			
		||||
//update.html
 | 
			
		||||
ipc.on('prog', function (event, arg) {
 | 
			
		||||
    console.log(arg)
 | 
			
		||||
    postMessage(["updateProg", arg], "*")
 | 
			
		||||
})
 | 
			
		||||
ipc.on('mess', function (event, arg) {
 | 
			
		||||
 
 | 
			
		||||
@@ -29,7 +29,6 @@ function post(mode, postvis) {
 | 
			
		||||
	}
 | 
			
		||||
	if (domain != "kirishima.cloud") {
 | 
			
		||||
		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) + "...";
 | 
			
		||||
			Swal.fire({
 | 
			
		||||
				title: lang.lang_post_cwtitle,
 | 
			
		||||
@@ -43,7 +42,6 @@ function post(mode, postvis) {
 | 
			
		||||
				showCloseButton: true,
 | 
			
		||||
				focusConfirm: false,
 | 
			
		||||
			}).then((result) => {
 | 
			
		||||
				console.log(result)
 | 
			
		||||
				if (result.dismiss == "cancel") {
 | 
			
		||||
					//btn3:sonomama
 | 
			
		||||
					post("pass")
 | 
			
		||||
 
 | 
			
		||||
@@ -66,7 +66,7 @@ input.addEventListener("focus", function () {
 | 
			
		||||
			}
 | 
			
		||||
			var domain = localStorage.getItem("domain_" + acct_id);
 | 
			
		||||
			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) {
 | 
			
		||||
				console.log("Try to get suggest at " + suggest)
 | 
			
		||||
				fetch(suggest, {
 | 
			
		||||
@@ -81,18 +81,43 @@ input.addEventListener("focus", function () {
 | 
			
		||||
					todo(error);
 | 
			
		||||
					console.error(error);
 | 
			
		||||
				}).then(function (json) {
 | 
			
		||||
					console.log(["Search", json]);
 | 
			
		||||
					//ハッシュタグ
 | 
			
		||||
					if (json.hashtags[0] && tag) {
 | 
			
		||||
						if (tag[1]) {
 | 
			
		||||
							var tags = "";
 | 
			
		||||
							var tags = [];
 | 
			
		||||
							Object.keys(json.hashtags).forEach(function (key4) {
 | 
			
		||||
								var tag = json.hashtags[key4];
 | 
			
		||||
								if (tag != q) {
 | 
			
		||||
									tags = tags + '<a onclick="tagInsert(\'#' + tag + '\',\'#' + q +
 | 
			
		||||
										'\')" class="pointer">#' + tag + '</a><br>';
 | 
			
		||||
								var his = tag.history;
 | 
			
		||||
								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;
 | 
			
		||||
								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()
 | 
			
		||||
							$("#suggest").html("Tags:<br>" + tags);
 | 
			
		||||
							$("#poll").addClass("hide")
 | 
			
		||||
							$("#emoji").addClass("hide")
 | 
			
		||||
						}
 | 
			
		||||
 
 | 
			
		||||
@@ -82,7 +82,7 @@ function details(id, acct_id, tlid, mode) {
 | 
			
		||||
		} else {
 | 
			
		||||
			$("#tootmodal").attr("data-user", scn);
 | 
			
		||||
		}
 | 
			
		||||
		context(id, acct_id);
 | 
			
		||||
		getContext(id, acct_id);
 | 
			
		||||
		var dom = null;
 | 
			
		||||
		if (!local) {
 | 
			
		||||
			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 at = localStorage.getItem("acct_" + acct_id + "_at");
 | 
			
		||||
	if (localStorage.getItem("mode_" + domain) == "misskey") {
 | 
			
		||||
 
 | 
			
		||||
@@ -1001,7 +1001,6 @@ function connectMisskey(acct_id, re) {
 | 
			
		||||
		var mute = [];
 | 
			
		||||
		if (data.body.id.indexOf("notf:") !== -1) {
 | 
			
		||||
			var obj = JSON.parse(mess.data).body;
 | 
			
		||||
			console.log(obj);
 | 
			
		||||
			var popup = localStorage.getItem("popup");
 | 
			
		||||
			if (!popup) {
 | 
			
		||||
				popup = 0;
 | 
			
		||||
 
 | 
			
		||||
@@ -491,10 +491,9 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
 | 
			
		||||
				if (urlCont) {
 | 
			
		||||
					urlindv = urlindv.replace(/[.*+?^=!:${}()|[\]\/\\]/g, "\\$&")
 | 
			
		||||
					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 regExp = new RegExp('href="' + urlindv + '"', "g")
 | 
			
		||||
					console.log(eUrl, regExp)
 | 
			
		||||
					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>' +
 | 
			
		||||
				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 media_ids = "";
 | 
			
		||||
@@ -611,8 +557,8 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
 | 
			
		||||
				if (toot.sensitive && nsfw) {
 | 
			
		||||
					var sense = "sensitive"
 | 
			
		||||
					var blur = media.blurhash
 | 
			
		||||
					nsfwmes = '<div class="nsfw-media">' + lang.lang_parse_nsfw + '</div>'
 | 
			
		||||
					if (blur) {
 | 
			
		||||
						nsfwmes = '<div class="nsfw-media">' + lang.lang_parse_nsfw + '</div>'
 | 
			
		||||
						purl = parseBlur(blur)
 | 
			
		||||
						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 +
 | 
			
		||||
						'" data-type="video" class="img-parsed"><video src="' +
 | 
			
		||||
						purl + '" class="' + sense +
 | 
			
		||||
						' toot-img pointer" style="max-width:100%;"></a></span>';
 | 
			
		||||
						' toot-img pointer" style="max-width:100%;" loop="true"></a></span>';
 | 
			
		||||
				} else {
 | 
			
		||||
					if (media.type == "unknown") {
 | 
			
		||||
						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) {
 | 
			
		||||
			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");
 | 
			
		||||
	Object.keys(obj).forEach(function (key) {
 | 
			
		||||
		var toot = obj[key];
 | 
			
		||||
		console.log(["Parsing", toot])
 | 
			
		||||
		if (!toot.username) {
 | 
			
		||||
			var raw = toot;
 | 
			
		||||
			toot = toot.account;
 | 
			
		||||
			var notf = true;
 | 
			
		||||
		} 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 (toot) {
 | 
			
		||||
			console.log(["Parsing", toot])
 | 
			
		||||
			if (!toot.username) {
 | 
			
		||||
				var raw = toot;
 | 
			
		||||
				toot = toot.account;
 | 
			
		||||
				var notf = true;
 | 
			
		||||
			} else {
 | 
			
		||||
				var notf = false;
 | 
			
		||||
			}
 | 
			
		||||
			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.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") {
 | 
			
		||||
					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) {
 | 
			
		||||
			var dis_name = escapeHTML(toot.display_name);
 | 
			
		||||
		} else {
 | 
			
		||||
			var dis_name = toot.username;
 | 
			
		||||
		}
 | 
			
		||||
		//ネイティブ通知
 | 
			
		||||
			if (toot.display_name) {
 | 
			
		||||
				var dis_name = escapeHTML(toot.display_name);
 | 
			
		||||
			} else {
 | 
			
		||||
				var dis_name = toot.username;
 | 
			
		||||
			}
 | 
			
		||||
			//ネイティブ通知
 | 
			
		||||
 | 
			
		||||
		if (toot.emojis) {
 | 
			
		||||
			var actemojick = toot.emojis[0];
 | 
			
		||||
		} else {
 | 
			
		||||
			var actemojick = false;
 | 
			
		||||
		}
 | 
			
		||||
		//絵文字があれば
 | 
			
		||||
		if (actemojick) {
 | 
			
		||||
			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");
 | 
			
		||||
				dis_name = dis_name.replace(regExp, emoji_url);
 | 
			
		||||
			});
 | 
			
		||||
		}
 | 
			
		||||
		if (dis_name) {
 | 
			
		||||
			dis_name = twemoji.parse(dis_name);
 | 
			
		||||
		}
 | 
			
		||||
		if (toot.avatar) {
 | 
			
		||||
			var avatar = toot.avatar;
 | 
			
		||||
		} else {
 | 
			
		||||
			var avatar = "../../img/missing.svg";
 | 
			
		||||
			if (toot.emojis) {
 | 
			
		||||
				var actemojick = toot.emojis[0];
 | 
			
		||||
			} else {
 | 
			
		||||
				var actemojick = false;
 | 
			
		||||
			}
 | 
			
		||||
			//絵文字があれば
 | 
			
		||||
			if (actemojick) {
 | 
			
		||||
				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");
 | 
			
		||||
					dis_name = dis_name.replace(regExp, emoji_url);
 | 
			
		||||
				});
 | 
			
		||||
			}
 | 
			
		||||
			if (dis_name) {
 | 
			
		||||
				dis_name = twemoji.parse(dis_name);
 | 
			
		||||
			}
 | 
			
		||||
			if (toot.avatar) {
 | 
			
		||||
				var avatar = toot.avatar;
 | 
			
		||||
			} else {
 | 
			
		||||
				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;
 | 
			
		||||
@@ -1046,7 +1049,6 @@ function client(name) {
 | 
			
		||||
			showCloseButton: true,
 | 
			
		||||
			focusConfirm: false,
 | 
			
		||||
		}).then((result) => {
 | 
			
		||||
			console.log(result)
 | 
			
		||||
			if (result.dismiss == "cancel") {
 | 
			
		||||
				//Emp
 | 
			
		||||
				var cli = localStorage.getItem("client_emp");
 | 
			
		||||
 
 | 
			
		||||
@@ -177,12 +177,12 @@ function graphDraw(tag, acct_id) {
 | 
			
		||||
	var zero = 50 - (his[0].uses / max * 50);
 | 
			
		||||
	if (max === 0) {
 | 
			
		||||
		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;
 | 
			
		||||
	} else {
 | 
			
		||||
		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>' +
 | 
			
		||||
			'</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;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -70,7 +70,6 @@ if (location.search) {
 | 
			
		||||
	var mode = m[1];
 | 
			
		||||
	var codex = m[2];
 | 
			
		||||
	if (mode == "share") {
 | 
			
		||||
		console.log(codex);
 | 
			
		||||
		$('textarea').focus();
 | 
			
		||||
		$("#textarea").val(decodeURI(codex));
 | 
			
		||||
		show();
 | 
			
		||||
 
 | 
			
		||||
@@ -357,7 +357,6 @@ function relations(user, acct_id) {
 | 
			
		||||
		console.error(error);
 | 
			
		||||
	}).then(function (json) {
 | 
			
		||||
		var json = json[0];
 | 
			
		||||
		console.log(json);
 | 
			
		||||
		if (json.following) {
 | 
			
		||||
			//自分がフォローしている
 | 
			
		||||
			$("#his-data").addClass("following");
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user