2018-01-28 23:22:43 +11:00
|
|
|
|
//オブジェクトパーサー(トゥート)
|
2018-02-26 00:37:04 +11:00
|
|
|
|
function parse(obj, mix, acct_id, tlid, popup) {
|
2018-01-28 23:22:43 +11:00
|
|
|
|
var templete = '';
|
2018-05-02 14:14:03 +10:00
|
|
|
|
var actb = localStorage.getItem("action_btns");
|
|
|
|
|
var actb='re,rt,fav,qt,del,pin';
|
|
|
|
|
if(actb){
|
|
|
|
|
var actb = actb.split(',');
|
|
|
|
|
var disp={};
|
|
|
|
|
for(var k=0;k<actb.length;k++){
|
|
|
|
|
if(k<4){
|
|
|
|
|
var tp="type-a";
|
|
|
|
|
}else{
|
|
|
|
|
var tp="type-b";
|
|
|
|
|
}
|
|
|
|
|
disp[actb[k]]=tp;
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-01-28 23:22:43 +11:00
|
|
|
|
var datetype = localStorage.getItem("datetype");
|
|
|
|
|
var nsfwtype = localStorage.getItem("nsfw");
|
|
|
|
|
var sent = localStorage.getItem("sentence");
|
2018-02-24 03:02:44 +11:00
|
|
|
|
var ltr = localStorage.getItem("letters");
|
2018-02-18 18:29:06 +11:00
|
|
|
|
var gif = localStorage.getItem("gif");
|
2018-03-11 01:22:59 +11:00
|
|
|
|
var imh = localStorage.getItem("img-height");
|
2018-03-27 13:39:35 +11:00
|
|
|
|
//独自ロケール
|
|
|
|
|
var locale = localStorage.getItem("locale");
|
|
|
|
|
if(locale=="yes"){
|
|
|
|
|
var locale=false;
|
|
|
|
|
}
|
2018-03-31 13:39:06 +11:00
|
|
|
|
//ネイティブ通知
|
|
|
|
|
var native=localStorage.getItem("nativenotf");
|
|
|
|
|
if(!native){
|
|
|
|
|
native="yes";
|
|
|
|
|
}
|
2018-03-11 01:22:59 +11:00
|
|
|
|
//クライアント強調
|
|
|
|
|
var emp = localStorage.getItem("client_emp");
|
|
|
|
|
if(emp){
|
|
|
|
|
var emp = JSON.parse(emp);
|
|
|
|
|
}
|
|
|
|
|
//クライアントミュート
|
|
|
|
|
var mute = localStorage.getItem("client_mute");
|
|
|
|
|
if(mute){
|
|
|
|
|
var mute = JSON.parse(mute);
|
|
|
|
|
}
|
|
|
|
|
//ユーザー強調
|
|
|
|
|
var useremp = localStorage.getItem("user_emp");
|
|
|
|
|
if(useremp){
|
|
|
|
|
var useremp = JSON.parse(useremp);
|
|
|
|
|
}
|
|
|
|
|
//ワード強調
|
|
|
|
|
var wordemp = localStorage.getItem("word_emp");
|
|
|
|
|
if(wordemp){
|
|
|
|
|
var wordemp = JSON.parse(wordemp);
|
|
|
|
|
}
|
|
|
|
|
//ワードミュート
|
|
|
|
|
var wordmute = localStorage.getItem("word_mute");
|
|
|
|
|
if(wordmute){
|
|
|
|
|
var wordmute = JSON.parse(wordmute);
|
|
|
|
|
}
|
2018-01-28 23:22:43 +11:00
|
|
|
|
if (!sent) {
|
|
|
|
|
var sent = 500;
|
|
|
|
|
}
|
2018-02-26 00:37:04 +11:00
|
|
|
|
if (!ltr) {
|
|
|
|
|
var ltr = 500;
|
|
|
|
|
}
|
2018-01-28 23:22:43 +11:00
|
|
|
|
if (!nsfwtype || nsfwtype == "yes") {
|
|
|
|
|
var nsfw = "ok";
|
|
|
|
|
} else {
|
|
|
|
|
var nsfw;
|
|
|
|
|
}
|
|
|
|
|
var cwtype = localStorage.getItem("cw");
|
|
|
|
|
if (!cwtype || cwtype == "yes") {
|
|
|
|
|
var cw = "ok";
|
|
|
|
|
} else {
|
|
|
|
|
var cw;
|
|
|
|
|
}
|
|
|
|
|
if (!datetype) {
|
|
|
|
|
datetype = "absolute";
|
|
|
|
|
}
|
2018-02-24 03:02:44 +11:00
|
|
|
|
if (!gif) {
|
|
|
|
|
var gif = "yes";
|
2018-02-18 18:29:06 +11:00
|
|
|
|
}
|
2018-03-11 01:22:59 +11:00
|
|
|
|
if (!imh) {
|
|
|
|
|
var imh = "200";
|
|
|
|
|
}
|
|
|
|
|
if(!emp){
|
|
|
|
|
var emp=[];
|
|
|
|
|
}
|
|
|
|
|
if(!mute){
|
|
|
|
|
var mute=[];
|
|
|
|
|
}
|
|
|
|
|
if(!useremp){
|
|
|
|
|
var useremp=[];
|
|
|
|
|
}
|
|
|
|
|
if(!wordemp){
|
|
|
|
|
var wordemp=[];
|
|
|
|
|
}
|
|
|
|
|
if(!wordmute){
|
|
|
|
|
var wordmute=[];
|
|
|
|
|
}
|
2018-05-02 14:14:03 +10:00
|
|
|
|
//via通知
|
|
|
|
|
var viashow=localStorage.getItem("viashow");
|
|
|
|
|
if(!viashow){
|
|
|
|
|
viashow="hide";
|
|
|
|
|
}
|
2018-03-27 13:39:35 +11:00
|
|
|
|
//認証なしTL
|
|
|
|
|
if(mix=="noauth"){
|
|
|
|
|
var noauth="hide";
|
2018-05-20 16:17:10 +10:00
|
|
|
|
var antinoauth="";
|
2018-03-27 13:39:35 +11:00
|
|
|
|
}else{
|
|
|
|
|
var noauth="";
|
2018-05-20 16:17:10 +10:00
|
|
|
|
var antinoauth="hide";
|
2018-03-27 13:39:35 +11:00
|
|
|
|
}
|
2018-05-02 14:14:03 +10:00
|
|
|
|
//マウスオーバーのみ
|
|
|
|
|
var mouseover=localStorage.getItem("mouseover");
|
|
|
|
|
if(!mouseover){
|
|
|
|
|
mouseover="";
|
|
|
|
|
}else if(mouseover=="yes"){
|
|
|
|
|
mouseover="hide";
|
|
|
|
|
}else if(mouseover=="no"){
|
|
|
|
|
mouseover="";
|
|
|
|
|
}
|
2018-01-28 23:22:43 +11:00
|
|
|
|
var local = [];
|
2018-03-11 01:22:59 +11:00
|
|
|
|
var times=[];
|
2018-01-28 23:22:43 +11:00
|
|
|
|
Object.keys(obj).forEach(function(key) {
|
|
|
|
|
var toot = obj[key];
|
2018-05-10 01:33:08 +10:00
|
|
|
|
var dis_name=escapeHTML(toot.account.display_name);
|
|
|
|
|
if(toot.account.emojis){
|
|
|
|
|
var actemojick = toot.account.emojis[0];
|
|
|
|
|
}else{
|
|
|
|
|
var actemojick=false;
|
|
|
|
|
}
|
|
|
|
|
//絵文字があれば
|
|
|
|
|
if (actemojick) {
|
|
|
|
|
Object.keys(toot.account.emojis).forEach(function(key5) {
|
|
|
|
|
var emoji = toot.account.emojis[key5];
|
|
|
|
|
var shortcode = emoji.shortcode;
|
|
|
|
|
var emoji_url = '<img src="' + emoji.url +
|
|
|
|
|
'" class="emoji-img" data-emoji="'+shortcode+'">';
|
|
|
|
|
var regExp = new RegExp(":" + shortcode + ":", "g");
|
|
|
|
|
dis_name = dis_name.replace(regExp, emoji_url);
|
2018-05-10 02:01:06 +10:00
|
|
|
|
|
2018-05-10 01:33:08 +10:00
|
|
|
|
});
|
|
|
|
|
}
|
2018-03-20 15:55:25 +11:00
|
|
|
|
if (mix == "notf") {
|
2018-02-26 00:37:04 +11:00
|
|
|
|
if (toot.type == "mention") {
|
2018-03-27 13:39:35 +11:00
|
|
|
|
var what = "が返信しました";
|
2018-02-26 00:37:04 +11:00
|
|
|
|
} else if (toot.type == "reblog") {
|
2018-03-27 13:39:35 +11:00
|
|
|
|
var what = "がブーストしました";
|
|
|
|
|
if(localStorage.getItem("domain_" + acct_id)=="imastodon.net" && !locale){
|
|
|
|
|
what = ":「わかるわ」";
|
|
|
|
|
}else if(localStorage.getItem("domain_" + acct_id)=="mstdn.osaka" && !locale){
|
|
|
|
|
what = "がしばきました";
|
|
|
|
|
}
|
2018-02-26 00:37:04 +11:00
|
|
|
|
} else if (toot.type == "favourite") {
|
2018-03-27 13:39:35 +11:00
|
|
|
|
var what = "がお気に入り登録しました";
|
|
|
|
|
if(localStorage.getItem("domain_" + acct_id)=="imastodon.net" && !locale){
|
|
|
|
|
what = "の頭にティンときたようです";
|
|
|
|
|
}else if(localStorage.getItem("domain_" + acct_id)=="mstdn.osaka" && !locale){
|
|
|
|
|
what = "がええやんと言いました";
|
|
|
|
|
}
|
2018-02-26 00:37:04 +11:00
|
|
|
|
}
|
|
|
|
|
var noticetext = '<span class="cbadge"title="' + date(toot.created_at,
|
|
|
|
|
'absolute') + '(通知された時間)"><i class="fa fa-clock-o"></i>' + date(toot.created_at,
|
|
|
|
|
datetype) +
|
|
|
|
|
'</span><a onclick="udg(\'' + toot.account.id +
|
2018-05-10 01:33:08 +10:00
|
|
|
|
'\',\'' + acct_id + '\')" class="pointer">' + dis_name +
|
2018-02-26 00:37:04 +11:00
|
|
|
|
"(" + toot.account.acct +
|
2018-03-27 13:39:35 +11:00
|
|
|
|
")</a>" + what;
|
2018-02-26 00:37:04 +11:00
|
|
|
|
var notice = noticetext;
|
|
|
|
|
var memory = localStorage.getItem("notice-mem");
|
|
|
|
|
if (popup >= 0 && obj.length < 5 && noticetext != memory) {
|
2018-03-14 05:31:31 +11:00
|
|
|
|
var domain = localStorage.getItem("domain_" + acct_id);
|
2018-03-20 15:55:25 +11:00
|
|
|
|
if(popup>0){
|
2018-03-31 13:39:06 +11:00
|
|
|
|
if(native=="yes"){
|
|
|
|
|
var electron = require("electron");
|
|
|
|
|
var ipc = electron.ipcRenderer;
|
|
|
|
|
ipc.send('native-notf', ['TheDesk:'+domain,toot.account.display_name+"(" + toot.account.acct +")"+what+"\n\n"+$.strip_tags(toot.status.content),toot.account.avatar]);
|
|
|
|
|
}
|
2018-03-27 13:39:35 +11:00
|
|
|
|
Materialize.toast("["+domain+"より]"+escapeHTML(toot.account.display_name)+what, popup * 1000);
|
2018-03-20 15:55:25 +11:00
|
|
|
|
}
|
2018-03-14 05:31:31 +11:00
|
|
|
|
$(".notf-icon_" + acct_id).addClass("red-text");
|
2018-02-26 00:37:04 +11:00
|
|
|
|
localStorage.setItem("notice-mem", noticetext);
|
|
|
|
|
noticetext = "";
|
|
|
|
|
}
|
2018-04-01 00:55:47 +11:00
|
|
|
|
var if_notf='data-notfIndv="'+acct_id+"_"+toot.id+'"';
|
2018-03-11 01:22:59 +11:00
|
|
|
|
var toot = toot.status;
|
2018-05-10 01:33:08 +10:00
|
|
|
|
var dis_name=escapeHTML(toot.account.display_name);
|
|
|
|
|
if(toot.account.emojis){
|
|
|
|
|
var actemojick = toot.account.emojis[0];
|
|
|
|
|
}else{
|
|
|
|
|
var actemojick=false;
|
|
|
|
|
}
|
|
|
|
|
//絵文字があれば
|
|
|
|
|
if (actemojick) {
|
|
|
|
|
Object.keys(toot.account.emojis).forEach(function(key5) {
|
|
|
|
|
var emoji = toot.account.emojis[key5];
|
|
|
|
|
var shortcode = emoji.shortcode;
|
|
|
|
|
var emoji_url = '<img src="' + emoji.url +
|
|
|
|
|
'" class="emoji-img" data-emoji="'+shortcode+'">';
|
|
|
|
|
var regExp = new RegExp(":" + shortcode + ":", "g");
|
|
|
|
|
dis_name = dis_name.replace(regExp, emoji_url);
|
|
|
|
|
});
|
|
|
|
|
}
|
2018-02-26 00:37:04 +11:00
|
|
|
|
}else{
|
2018-04-01 00:55:47 +11:00
|
|
|
|
var if_notf="";
|
2018-02-26 00:37:04 +11:00
|
|
|
|
if (toot.reblog) {
|
2018-03-27 13:39:35 +11:00
|
|
|
|
var rebtxt = "がブースト";
|
|
|
|
|
if(localStorage.getItem("domain_" + acct_id)=="imastodon.net" && !locale){
|
|
|
|
|
rebtxt = ":「わかるわ」";
|
|
|
|
|
}else if(localStorage.getItem("domain_" + acct_id)=="mstdn.osaka" && !locale){
|
|
|
|
|
rebtxt = "がしばいた";
|
|
|
|
|
}
|
2018-05-10 01:33:08 +10:00
|
|
|
|
var notice = dis_name + "(" + toot.account.acct +
|
2018-03-27 13:39:35 +11:00
|
|
|
|
")"+rebtxt+"<br>";
|
2018-03-11 01:22:59 +11:00
|
|
|
|
var boostback = "shared";
|
2018-02-26 00:37:04 +11:00
|
|
|
|
var toot = toot.reblog;
|
2018-05-10 02:01:06 +10:00
|
|
|
|
var dis_name=escapeHTML(toot.account.display_name);
|
|
|
|
|
if(toot.account.emojis){
|
|
|
|
|
var actemojick = toot.account.emojis[0];
|
|
|
|
|
}else{
|
|
|
|
|
var actemojick=false;
|
|
|
|
|
}
|
|
|
|
|
//絵文字があれば
|
|
|
|
|
if (actemojick) {
|
|
|
|
|
Object.keys(toot.account.emojis).forEach(function(key5) {
|
|
|
|
|
var emoji = toot.account.emojis[key5];
|
|
|
|
|
var shortcode = emoji.shortcode;
|
|
|
|
|
var emoji_url = '<img src="' + emoji.url +
|
|
|
|
|
'" class="emoji-img" data-emoji="'+shortcode+'">';
|
|
|
|
|
var regExp = new RegExp(":" + shortcode + ":", "g");
|
|
|
|
|
dis_name = dis_name.replace(regExp, emoji_url);
|
|
|
|
|
});
|
|
|
|
|
}
|
2018-02-26 00:37:04 +11:00
|
|
|
|
} else {
|
|
|
|
|
var notice = "";
|
|
|
|
|
var boostback = "";
|
2018-03-11 01:22:59 +11:00
|
|
|
|
//ユーザー強調
|
|
|
|
|
if(toot.account.username!=toot.account.acct){
|
|
|
|
|
var fullname=toot.account.acct;
|
|
|
|
|
}else{
|
|
|
|
|
var domain = localStorage.getItem("domain_" + acct_id);
|
|
|
|
|
var fullname=toot.account.acct+"@"+domain;
|
|
|
|
|
}
|
|
|
|
|
if(useremp){
|
|
|
|
|
Object.keys(useremp).forEach(function(key10) {
|
|
|
|
|
var user = useremp[key10];
|
|
|
|
|
if(user==fullname){
|
|
|
|
|
boostback = "emphasized";
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
2018-02-26 00:37:04 +11:00
|
|
|
|
}
|
|
|
|
|
}
|
2018-01-28 23:22:43 +11:00
|
|
|
|
var id = toot.id;
|
|
|
|
|
if (mix == "home") {
|
2018-03-27 13:39:35 +11:00
|
|
|
|
var home = ""
|
2018-03-11 01:22:59 +11:00
|
|
|
|
var divider = '<div class="divider"></div>';
|
2018-01-28 23:22:43 +11:00
|
|
|
|
} else {
|
|
|
|
|
var home = "";
|
2018-02-24 03:02:44 +11:00
|
|
|
|
var divider = '<div class="divider"></div>';
|
2018-01-28 23:22:43 +11:00
|
|
|
|
}
|
|
|
|
|
if (toot.account.locked) {
|
|
|
|
|
var locked = ' <i class="fa fa-lock red-text"></i>';
|
|
|
|
|
} else {
|
|
|
|
|
var locked = "";
|
|
|
|
|
}
|
|
|
|
|
if (!toot.application) {
|
2018-02-18 16:43:11 +11:00
|
|
|
|
var via = '<span style="font-style: italic;">Unknown</span>';
|
2018-01-28 23:22:43 +11:00
|
|
|
|
} else {
|
|
|
|
|
var via = toot.application.name;
|
2018-03-11 01:22:59 +11:00
|
|
|
|
//強調チェック
|
|
|
|
|
Object.keys(emp).forEach(function(key6) {
|
|
|
|
|
var cli = emp[key6];
|
|
|
|
|
if(cli == via){
|
|
|
|
|
boostback = "emphasized";
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
//ミュートチェック
|
|
|
|
|
Object.keys(mute).forEach(function(key7) {
|
|
|
|
|
var cli = mute[key7];
|
|
|
|
|
if(cli == via){
|
|
|
|
|
boostback = "hide";
|
|
|
|
|
}
|
|
|
|
|
});
|
2018-01-28 23:22:43 +11:00
|
|
|
|
}
|
|
|
|
|
if (toot.spoiler_text && cw) {
|
|
|
|
|
var content = toot.content;
|
2018-03-15 06:42:48 +11:00
|
|
|
|
var spoil = escapeHTML(toot.spoiler_text);
|
2018-01-28 23:22:43 +11:00
|
|
|
|
var spoiler = "cw cw_hide_" + toot.id;
|
|
|
|
|
var api_spoil = "gray";
|
|
|
|
|
var spoiler_show = '<a href="#" onclick="cw_show(\'' + toot.id +
|
2018-02-26 02:32:10 +11:00
|
|
|
|
'\')" class="nex parsed">見る</a><br>';
|
2018-01-28 23:22:43 +11:00
|
|
|
|
} else {
|
2018-03-20 15:55:25 +11:00
|
|
|
|
var ct1 = toot.content.split('</p>').length + toot.content.split('<br />').length -2;
|
|
|
|
|
var ct2 = toot.content.split('</p>').length + toot.content.split('<br>').length -2;
|
2018-03-18 02:00:53 +11:00
|
|
|
|
if(ct1>ct2){ var ct= ct1; }else{ var ct= ct2; }
|
2018-02-24 03:02:44 +11:00
|
|
|
|
if ((sent < ct && $.mb_strlen($.strip_tags(toot.content)) > 5) || ($.strip_tags(toot.content).length > ltr && $.mb_strlen($.strip_tags(toot.content)) > 5)) {
|
2018-01-28 23:22:43 +11:00
|
|
|
|
var content = '<span class="gray">以下全文</span><br>' + toot.content
|
2018-02-24 03:02:44 +11:00
|
|
|
|
var spoil = '<span class="cw-long-' + toot.id + '">' + $.mb_substr($.strip_tags(
|
|
|
|
|
toot.content), 0, 100) +
|
2018-02-13 06:16:46 +11:00
|
|
|
|
'</span><span class="gray">自動折りたたみ</span>';
|
2018-01-28 23:22:43 +11:00
|
|
|
|
var spoiler = "cw cw_hide_" + toot.id;
|
|
|
|
|
var spoiler_show = '<a href="#" onclick="cw_show(\'' + toot.id +
|
2018-02-24 03:02:44 +11:00
|
|
|
|
'\')" class="nex parsed">続き…</a><br>';
|
2018-01-28 23:22:43 +11:00
|
|
|
|
} else {
|
|
|
|
|
var content = toot.content;
|
2018-03-15 06:42:48 +11:00
|
|
|
|
var spoil = escapeHTML(toot.spoiler_text);
|
2018-01-28 23:22:43 +11:00
|
|
|
|
var spoiler = "";
|
|
|
|
|
var spoiler_show = "";
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-03-20 15:55:25 +11:00
|
|
|
|
var urls = $.strip_tags(content).replace(/\n/g, " ").match(
|
2018-02-24 03:02:44 +11:00
|
|
|
|
/https?:\/\/([-a-zA-Z0-9@.]+)\/?(?!.*((media|tags)|mentions)).*([-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)?/
|
2018-02-13 06:16:46 +11:00
|
|
|
|
);
|
2018-02-24 03:02:44 +11:00
|
|
|
|
if (urls) {
|
|
|
|
|
var analyze = '<a onclick="additionalIndv(\'' + tlid + '\',' + acct_id +
|
|
|
|
|
',\'' + id + '\')" class="add-show pointer">URL解析</a><br>';
|
|
|
|
|
} else {
|
|
|
|
|
var analyze = '';
|
2018-02-13 06:16:46 +11:00
|
|
|
|
}
|
2018-01-28 23:22:43 +11:00
|
|
|
|
var viewer = "";
|
2018-02-24 03:02:44 +11:00
|
|
|
|
var hasmedia = "";
|
2018-01-28 23:22:43 +11:00
|
|
|
|
var youtube = "";
|
2018-03-13 04:41:38 +11:00
|
|
|
|
if(toot.emojis){
|
|
|
|
|
var emojick = toot.emojis[0];
|
|
|
|
|
}else{
|
|
|
|
|
var emojick=false;
|
|
|
|
|
}
|
2018-01-28 23:22:43 +11:00
|
|
|
|
//絵文字があれば
|
|
|
|
|
if (emojick) {
|
|
|
|
|
Object.keys(toot.emojis).forEach(function(key5) {
|
|
|
|
|
var emoji = toot.emojis[key5];
|
|
|
|
|
var shortcode = emoji.shortcode;
|
|
|
|
|
var emoji_url = '<img src="' + emoji.url +
|
2018-03-27 13:39:35 +11:00
|
|
|
|
'" class="emoji-img" data-emoji="'+shortcode+'">';
|
2018-01-28 23:22:43 +11:00
|
|
|
|
var regExp = new RegExp(":" + shortcode + ":", "g");
|
|
|
|
|
content = content.replace(regExp, emoji_url);
|
2018-03-15 06:42:48 +11:00
|
|
|
|
spoil = spoil.replace(regExp, emoji_url);
|
2018-01-28 23:22:43 +11:00
|
|
|
|
});
|
|
|
|
|
}
|
2018-05-10 01:33:08 +10:00
|
|
|
|
|
2018-03-18 02:00:53 +11:00
|
|
|
|
//デフォ絵文字
|
2018-03-27 13:39:35 +11:00
|
|
|
|
content=emojione.unicodeToImage(content);
|
|
|
|
|
if(dis_name){
|
|
|
|
|
dis_name=emojione.unicodeToImage(dis_name);
|
|
|
|
|
}
|
|
|
|
|
if(spoil){
|
|
|
|
|
spoil=emojione.unicodeToImage(spoil);
|
|
|
|
|
}
|
|
|
|
|
if(noticetext){
|
|
|
|
|
noticetext=emojione.unicodeToImage(noticetext);
|
|
|
|
|
}
|
|
|
|
|
if(notice){
|
|
|
|
|
notice=emojione.unicodeToImage(notice);
|
2018-03-18 02:00:53 +11:00
|
|
|
|
}
|
2018-01-28 23:22:43 +11:00
|
|
|
|
var mediack = toot.media_attachments[0];
|
|
|
|
|
//メディアがあれば
|
|
|
|
|
if (mediack) {
|
2018-02-18 03:44:03 +11:00
|
|
|
|
hasmedia = "hasmedia";
|
2018-02-24 03:02:44 +11:00
|
|
|
|
var cwdt = 100 / toot.media_attachments.length
|
2018-01-28 23:22:43 +11:00
|
|
|
|
Object.keys(toot.media_attachments).forEach(function(key2) {
|
|
|
|
|
var media = toot.media_attachments[key2];
|
|
|
|
|
var purl = media.preview_url;
|
|
|
|
|
var url = media.url;
|
|
|
|
|
if (toot.sensitive && nsfw) {
|
|
|
|
|
var sense = "sensitive"
|
|
|
|
|
} else {
|
|
|
|
|
var sense = ""
|
|
|
|
|
}
|
2018-02-24 03:02:44 +11:00
|
|
|
|
viewer = viewer + '<a onclick="imgv(\'' + id + '\',\'' + key2 + '\',' +
|
|
|
|
|
acct_id + ')" id="' + id + '-image-' + key2 + '" data-url="' + url +
|
|
|
|
|
'" data-type="' + media.type + '" class="img-parsed"><img src="' +
|
|
|
|
|
purl + '" class="' + sense +
|
2018-03-11 01:22:59 +11:00
|
|
|
|
' toot-img pointer" style="width:' + cwdt + '%; height:'+imh+'px;"></a></span>';
|
2018-01-28 23:22:43 +11:00
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
viewer = "";
|
2018-02-18 03:44:03 +11:00
|
|
|
|
hasmedia = "nomedia";
|
2018-01-28 23:22:43 +11:00
|
|
|
|
}
|
|
|
|
|
var menck = toot.mentions[0];
|
|
|
|
|
var mentions = "";
|
|
|
|
|
//メンションであれば
|
|
|
|
|
if (menck) {
|
2018-05-12 04:12:25 +10:00
|
|
|
|
mentions = "";
|
2018-01-28 23:22:43 +11:00
|
|
|
|
Object.keys(toot.mentions).forEach(function(key3) {
|
|
|
|
|
var mention = toot.mentions[key3];
|
|
|
|
|
mentions = mentions + '<a onclick="udg(\'' + mention.id + '\',' +
|
|
|
|
|
acct_id + ')" class="pointer">@' + mention.acct + '</a> ';
|
|
|
|
|
});
|
2018-02-24 03:02:44 +11:00
|
|
|
|
mentions = '<div style="float:right">' + mentions + '</div>';
|
2018-01-28 23:22:43 +11:00
|
|
|
|
}
|
|
|
|
|
var tagck = toot.tags[0];
|
|
|
|
|
var tags = "";
|
|
|
|
|
//タグであれば
|
|
|
|
|
if (tagck) {
|
|
|
|
|
Object.keys(toot.tags).forEach(function(key4) {
|
|
|
|
|
var tag = toot.tags[key4];
|
2018-05-12 04:12:25 +10:00
|
|
|
|
tags = tags + '<span class="hide" data-tag="' + tag.name + '">#' + tag.name + ':<a onclick="tl(\'tag\',\'' + tag.name + '\',' + acct_id +
|
2018-03-11 01:22:59 +11:00
|
|
|
|
',\'add\')" class="pointer" title="#' + tag.name + 'のタイムライン">TL</a> <a onclick="brInsert(\'#' + tag.name + '\')" class="pointer" title="#' + tag.name + 'でトゥート">Toot</a> '+
|
|
|
|
|
'<a onclick="tagPin(\'' + tag.name + '\')" class="pointer" title="#' + tag.name + 'をよく使うタグへ">Pin</a></span> ';
|
2018-01-28 23:22:43 +11:00
|
|
|
|
});
|
2018-02-24 03:02:44 +11:00
|
|
|
|
tags = '<div style="float:right">' + tags + '</div>';
|
2018-01-28 23:22:43 +11:00
|
|
|
|
}
|
2018-02-18 16:43:11 +11:00
|
|
|
|
//公開範囲を取得
|
2018-02-24 03:02:44 +11:00
|
|
|
|
var vis = "";
|
|
|
|
|
var visen = toot.visibility;
|
|
|
|
|
if (visen == "public") {
|
|
|
|
|
var vis =
|
2018-05-02 14:14:03 +10:00
|
|
|
|
'<i class="text-darken-3 material-icons gray sml vis-data pointer" title="公開(クリックして本文コピー)" data-vis="public" onclick="staCopy(\''+id+'\')" style="font-size:1rem;">public</i>';
|
2018-02-26 00:37:04 +11:00
|
|
|
|
var can_rt = "";
|
2018-02-24 03:02:44 +11:00
|
|
|
|
} else if (visen == "unlisted") {
|
|
|
|
|
var vis =
|
2018-05-02 14:14:03 +10:00
|
|
|
|
'<i class="text-darken-3 material-icons blue-text vis-data pointer" title="未収載(クリックして本文コピー)" data-vis="unlisted" onclick="staCopy(\''+id+'\')" style="font-size:1rem;">lock_open</i>';
|
2018-02-26 00:37:04 +11:00
|
|
|
|
var can_rt = "";
|
2018-04-16 23:58:14 +10:00
|
|
|
|
} else if (visen == "private") {
|
2018-02-24 03:02:44 +11:00
|
|
|
|
var vis =
|
2018-05-02 14:14:03 +10:00
|
|
|
|
'<i class="text-darken-3 material-icons orange-text vis-data pointer" title="非公開(クリックして本文コピー)" data-vis="private" onclick="staCopy(\''+id+'\')" style="font-size:1rem;">lock</i>';
|
2018-02-26 00:37:04 +11:00
|
|
|
|
var can_rt = "hide";
|
2018-02-24 03:02:44 +11:00
|
|
|
|
} else if (visen == "direct") {
|
|
|
|
|
var vis =
|
2018-05-02 14:14:03 +10:00
|
|
|
|
'<i class="text-darken-3 material-icons red-text vis-data pointer" title="ダイレクト(クリックして本文コピー)" data-vis="direct" onclick="staCopy(\''+id+'\')" style="font-size:1rem;">mail</i>';
|
2018-02-26 00:37:04 +11:00
|
|
|
|
var can_rt = "hide";
|
2018-02-18 16:43:11 +11:00
|
|
|
|
}
|
2018-01-28 23:22:43 +11:00
|
|
|
|
if (toot.account.acct == localStorage.getItem("user_" + acct_id)) {
|
|
|
|
|
var if_mine = "";
|
2018-05-02 14:14:03 +10:00
|
|
|
|
var mine_via="type-b";
|
2018-01-28 23:22:43 +11:00
|
|
|
|
} else {
|
|
|
|
|
var if_mine = "hide";
|
2018-05-02 14:14:03 +10:00
|
|
|
|
var mine_via="";
|
2018-01-28 23:22:43 +11:00
|
|
|
|
}
|
|
|
|
|
if (toot.favourited) {
|
|
|
|
|
var if_fav = " yellow-text";
|
|
|
|
|
var fav_app = "faved";
|
|
|
|
|
} else {
|
|
|
|
|
var if_fav = "";
|
|
|
|
|
var fav_app = "";
|
|
|
|
|
}
|
|
|
|
|
if (toot.reblogged) {
|
|
|
|
|
var if_rt = "teal-text";
|
|
|
|
|
var rt_app = "rted";
|
|
|
|
|
} else {
|
|
|
|
|
var if_rt = "";
|
|
|
|
|
var rt_app = "";
|
|
|
|
|
}
|
2018-03-11 01:22:59 +11:00
|
|
|
|
if (toot.pinned) {
|
|
|
|
|
var if_pin = "blue-text";
|
|
|
|
|
var pin_app = "pinned";
|
|
|
|
|
} else {
|
|
|
|
|
var if_pin = "";
|
|
|
|
|
var pin_app = "";
|
|
|
|
|
}
|
2018-02-18 18:29:06 +11:00
|
|
|
|
//アニメ再生
|
2018-02-24 03:02:44 +11:00
|
|
|
|
if (gif == "yes") {
|
|
|
|
|
var avatar = toot.account.avatar;
|
|
|
|
|
} else {
|
|
|
|
|
var avatar = toot.account.avatar_static;
|
2018-02-18 18:29:06 +11:00
|
|
|
|
}
|
2018-03-11 01:22:59 +11:00
|
|
|
|
//ワードミュート
|
|
|
|
|
if(wordmute){
|
|
|
|
|
Object.keys(wordmute).forEach(function(key8) {
|
|
|
|
|
var worde = wordmute[key8];
|
|
|
|
|
if(worde){
|
|
|
|
|
var word=worde.tag;
|
|
|
|
|
var regExp = new RegExp( word, "g" ) ;
|
2018-05-10 01:33:08 +10:00
|
|
|
|
if($.strip_tags(content).match(regExp)){
|
2018-03-11 01:22:59 +11:00
|
|
|
|
boostback = "hide";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
//ワード強調
|
|
|
|
|
if(wordemp){
|
|
|
|
|
Object.keys(wordemp).forEach(function(key9) {
|
|
|
|
|
var word = wordemp[key9];
|
|
|
|
|
if(word){
|
|
|
|
|
var word=word.tag;
|
|
|
|
|
var regExp = new RegExp( word, "g" ) ;
|
|
|
|
|
content=content.replace(regExp,'<span class="emp">'+word+"</span>");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
2018-03-31 13:39:06 +11:00
|
|
|
|
//日本語じゃない
|
|
|
|
|
if(toot.language!="ja"){
|
|
|
|
|
var trans='<div class="action pin"><a onclick="trans(\''+toot.language+'\')" class="waves-effect waves-dark btn-flat" style="padding:0" title="このトゥートを日本語に翻訳"><i class="material-icons">g_translate</i></a></div>';
|
|
|
|
|
}else{
|
|
|
|
|
var trans="";
|
|
|
|
|
}
|
2018-02-18 16:43:11 +11:00
|
|
|
|
templete = templete + '<div id="pub_' + toot.id + '" class="cvo ' +
|
2018-03-11 01:22:59 +11:00
|
|
|
|
boostback + ' ' + fav_app + ' ' + rt_app + ' ' + pin_app +
|
2018-02-24 03:02:44 +11:00
|
|
|
|
' ' + hasmedia + '" toot-id="' + id + '" unixtime="' + date(obj[
|
2018-05-02 14:14:03 +10:00
|
|
|
|
key].created_at, 'unix') + '" '+if_notf+' onmouseover="mov(\'' + toot.id + '\',\''+tlid+'\')" onmouseout="resetmv()">' +
|
2018-02-24 03:02:44 +11:00
|
|
|
|
'<div class="area-notice"><span class="gray sharesta">' + notice + home +
|
|
|
|
|
'</span></div>' +
|
|
|
|
|
'<div class="area-icon"><a onclick="udg(\'' + toot.account.id +
|
|
|
|
|
'\',' + acct_id + ');" user="' + toot.account.acct + '" class="udg">' +
|
|
|
|
|
'<img src="' + avatar +
|
|
|
|
|
'" width="40" class="prof-img" user="' + toot.account.acct +
|
|
|
|
|
'"></a></div>' +
|
|
|
|
|
'<div class="area-display_name"><span class="user">' +
|
2018-03-27 13:39:35 +11:00
|
|
|
|
dis_name +
|
2018-02-25 18:21:13 +11:00
|
|
|
|
'</span><span class="sml gray" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis; cursor:text;"> @' +
|
2018-02-24 03:02:44 +11:00
|
|
|
|
toot.account.acct + locked + '</span></div>' +
|
2018-02-26 00:37:04 +11:00
|
|
|
|
'<div class="area-acct"><div><span class="cbadge pointer waves-effect" onclick="tootUriCopy(\'' +
|
2018-02-24 03:02:44 +11:00
|
|
|
|
toot.url + '\');" title="' + date(toot.created_at, 'absolute') +
|
|
|
|
|
'(クリックでトゥートURLをコピー)"><i class="fa fa-clock-o"></i>' +
|
2018-05-02 14:14:03 +10:00
|
|
|
|
date(toot.created_at, datetype) + '</span><span style="padding:0;">' +
|
|
|
|
|
vis + '</span></div></div>' +
|
2018-02-24 03:02:44 +11:00
|
|
|
|
'<div class="area-toot"><span class="toot ' + spoiler + '">' + content +
|
|
|
|
|
'</span><span class="' +
|
|
|
|
|
api_spoil + ' cw_text_' + toot.id + '">' + spoil + spoiler_show +
|
|
|
|
|
'</span>' +
|
|
|
|
|
'' + viewer + '' +
|
|
|
|
|
'</div><div class="area-additional"><span class="additional">' + analyze +
|
|
|
|
|
'</span>' +
|
|
|
|
|
'' + mentions + tags + '</div>' +
|
2018-05-02 14:14:03 +10:00
|
|
|
|
'<div class="area-vis"></div>'+
|
2018-05-20 16:17:10 +10:00
|
|
|
|
'<div class="area-actions '+mouseover+'" style="padding:0; margin:0; top:-20px; display:flex; justify-content:space-around; max-width:100%; ">' +
|
|
|
|
|
'<div class="action '+antinoauth+'"><a onclick="detEx(\''+toot.url+'\',\'main\')" class="waves-effect waves-dark details" style="padding:0">詳細(メインアカウント経由)</a></div>' +
|
|
|
|
|
'<div class="action '+disp["re"]+' '+noauth+'"><a onclick="re(\'' + toot.id +
|
2018-02-24 03:02:44 +11:00
|
|
|
|
'\',\'' + toot.account.acct + '\',' +
|
2018-03-14 05:31:31 +11:00
|
|
|
|
acct_id + ',\''+visen+
|
|
|
|
|
'\')" class="waves-effect waves-dark btn-flat" style="padding:0" title="このトゥートに返信"><i class="fa fa-share"></i></a></div>' +
|
2018-05-20 16:17:10 +10:00
|
|
|
|
'<div class="action '+can_rt+' '+disp["rt"]+' '+noauth+'"><a onclick="rt(\'' + toot.id + '\',' + acct_id +
|
2018-02-24 03:02:44 +11:00
|
|
|
|
',\'' + tlid +
|
2018-03-11 01:22:59 +11:00
|
|
|
|
'\')" class="waves-effect waves-dark btn-flat" style="padding:0" title="このトゥートをブースト"><i class="text-darken-3 fa fa-retweet ' +
|
2018-02-24 03:02:44 +11:00
|
|
|
|
if_rt + ' rt_' + toot.id + '"></i><span class="rt_ct">' + toot.reblogs_count +
|
|
|
|
|
'</span></a></div>' +
|
2018-05-20 16:17:10 +10:00
|
|
|
|
'<div class="action '+can_rt+' '+disp["qt"]+' '+noauth+'"><a onclick="qt(\'' + toot.id + '\',' + acct_id +
|
2018-04-07 14:31:09 +10:00
|
|
|
|
',\'' + toot.account.acct +'\',\''+toot.url+
|
|
|
|
|
'\')" class="waves-effect waves-dark btn-flat" style="padding:0" title="このトゥートを引用"><i class="text-darken-3 fa fa-quote-right"></i></a></div>' +
|
2018-05-20 16:17:10 +10:00
|
|
|
|
'<div class="action '+disp["fav"]+' '+noauth+'"><a onclick="fav(\'' + toot.id + '\',' + acct_id +
|
2018-02-24 03:02:44 +11:00
|
|
|
|
',\'' + tlid +
|
2018-03-11 01:22:59 +11:00
|
|
|
|
'\')" class="waves-effect waves-dark btn-flat" style="padding:0" title="このトゥートをお気に入り登録"><i class="fa text-darken-3 fa-star' +
|
2018-02-24 03:02:44 +11:00
|
|
|
|
if_fav + ' fav_' + toot.id + '"></i><span class="fav_ct">' + toot.favourites_count +
|
|
|
|
|
'</a></span></div>' +
|
2018-05-20 16:17:10 +10:00
|
|
|
|
'<div class="' + if_mine + ' action '+disp["del"]+' '+noauth+'"><a onclick="del(\'' + toot.id + '\',' +
|
2018-02-24 03:02:44 +11:00
|
|
|
|
acct_id +
|
2018-03-11 01:22:59 +11:00
|
|
|
|
')" class="waves-effect waves-dark btn-flat" style="padding:0" title="このトゥートを削除"><i class="fa fa-trash-o"></i></a></div>' +
|
2018-05-20 16:17:10 +10:00
|
|
|
|
'<div class="' + if_mine + ' action pin '+disp["pin"]+' '+noauth+'"><a onclick="pin(\'' + toot.id + '\',' +
|
2018-03-11 01:22:59 +11:00
|
|
|
|
acct_id +
|
2018-03-31 13:39:06 +11:00
|
|
|
|
')" class="waves-effect waves-dark btn-flat" style="padding:0" title="このトゥートをピン留め"><i class="fa fa-map-pin pin_' + toot.id + ' '+if_pin+'"></i></a></div>' +trans+
|
2018-05-20 16:17:10 +10:00
|
|
|
|
'<div class="action ' + if_mine + ' '+noauth+'"><a onclick="toggleAction(\'' + toot.id + '\',\''+tlid+'\',\''+acct_id+'\')" class="waves-effect waves-dark btn-flat" style="padding:0"><i class="text-darken-3 material-icons act-icon">expand_more</i></a></div>' +
|
|
|
|
|
'<div class="action '+noauth+'"><a onclick="details(\'' + toot.id + '\',' + acct_id +
|
2018-05-02 14:14:03 +10:00
|
|
|
|
',\''+tlid+'\')" class="waves-effect waves-dark btn-flat details" style="padding:0"><i class="text-darken-3 material-icons">more_vert</i></a></div>' +
|
|
|
|
|
'<span class="cbadge waves-effect '+viashow+' '+mine_via+'" onclick="client(\''+$.strip_tags(via)+'\')" title="via ' + $.strip_tags(via) + '">via ' +
|
2018-02-24 03:02:44 +11:00
|
|
|
|
via +
|
2018-05-02 14:14:03 +10:00
|
|
|
|
'</span></div></div>' +
|
|
|
|
|
'</div></div>' + divider;
|
2018-01-28 23:22:43 +11:00
|
|
|
|
});
|
|
|
|
|
if (mix == "mix") {
|
2018-03-11 01:22:59 +11:00
|
|
|
|
return [templete, local, times]
|
2018-01-28 23:22:43 +11:00
|
|
|
|
} else {
|
|
|
|
|
return templete;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//オブジェクトパーサー(ユーザーデータ)
|
2018-02-26 02:32:10 +11:00
|
|
|
|
function userparse(obj, auth, acct_id, tlid, popup) {
|
2018-03-27 13:39:35 +11:00
|
|
|
|
//独自ロケール
|
|
|
|
|
var locale = localStorage.getItem("locale");
|
|
|
|
|
if(locale=="yes"){
|
|
|
|
|
var locale=false;
|
|
|
|
|
}
|
2018-01-28 23:22:43 +11:00
|
|
|
|
var templete = '';
|
2018-02-24 03:02:44 +11:00
|
|
|
|
var datetype = localStorage.getItem("datetype");
|
2018-01-28 23:22:43 +11:00
|
|
|
|
Object.keys(obj).forEach(function(key) {
|
|
|
|
|
var toot = obj[key];
|
|
|
|
|
if (toot.locked) {
|
|
|
|
|
var locked = ' <i class="fa fa-lock red-text"></i>';
|
|
|
|
|
} else {
|
|
|
|
|
var locked = "";
|
|
|
|
|
}
|
|
|
|
|
if (auth) {
|
|
|
|
|
var auth = '<i class="material-icons gray pointer" onclick="request(\'' +
|
|
|
|
|
toot.id + '\',\'authorize\',' + acct_id + ')">person_add</i>';
|
|
|
|
|
} else {
|
|
|
|
|
var auth = "";
|
|
|
|
|
}
|
2018-03-27 13:39:35 +11:00
|
|
|
|
var ftxt="フォローされました";
|
|
|
|
|
if(localStorage.getItem("domain_" + acct_id)=="imastodon.net" && !locale){
|
|
|
|
|
ftxt = "名刺をいただきました";
|
|
|
|
|
}else if(localStorage.getItem("domain_" + acct_id)=="mstdn.osaka" && !locale){
|
|
|
|
|
ftxt = "ツルまれました";
|
|
|
|
|
}
|
|
|
|
|
if(popup > 0 || popup==-1){
|
2018-02-24 03:02:44 +11:00
|
|
|
|
var notftext='<span class="cbadge"title="' + date(toot.created_at,
|
|
|
|
|
'absolute') + '(通知された時間)"><i class="fa fa-clock-o"></i>' + date(toot.created_at,
|
|
|
|
|
datetype) +
|
2018-03-27 13:39:35 +11:00
|
|
|
|
'</span>'+ftxt+'。<br>';
|
2018-02-24 03:02:44 +11:00
|
|
|
|
}else{
|
|
|
|
|
var notftext="";
|
|
|
|
|
}
|
2018-02-26 02:32:10 +11:00
|
|
|
|
var memory = localStorage.getItem("notice-mem");
|
|
|
|
|
if (popup >= 0 && obj.length < 5 && noticetext != memory) {
|
2018-03-27 13:39:35 +11:00
|
|
|
|
Materialize.toast(escapeHTML(toot.display_name)+"に"+ftxt, popup * 1000);
|
2018-02-26 02:32:10 +11:00
|
|
|
|
$(".notf-icon_" + tlid).addClass("red-text");
|
|
|
|
|
localStorage.setItem("notice-mem", noticetext);
|
|
|
|
|
noticetext = "";
|
|
|
|
|
}
|
2018-01-28 23:22:43 +11:00
|
|
|
|
templete = templete +
|
2018-02-24 03:02:44 +11:00
|
|
|
|
'<div class="" style="padding-top:5px;" user-id="' + toot.id + '">' +
|
|
|
|
|
notftext +
|
2018-01-28 23:22:43 +11:00
|
|
|
|
'<div style="padding:0; margin:0; width:400px; max-width:100%; display:flex; align-items:flex-end;">' +
|
|
|
|
|
'<div style="flex-basis:40px;"><a onclick="udg(\'' + toot.id + '\',' +
|
|
|
|
|
acct_id + ');" user="' + toot.acct + '" class="udg">' +
|
|
|
|
|
'<img src="' + toot.avatar + '" width="40" class="prof-img" user="' + toot
|
|
|
|
|
.acct + '"></a></div>' +
|
2018-02-25 18:21:13 +11:00
|
|
|
|
'<div style="flex-grow:3; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;user-select:auto; cursor:text;"><big>' +
|
2018-03-15 06:42:48 +11:00
|
|
|
|
escapeHTML(toot.display_name) + '</big></div>' +
|
2018-02-25 18:21:13 +11:00
|
|
|
|
'<div class="sml gray" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;user-select:auto; cursor:text;"> @' +
|
2018-01-28 23:22:43 +11:00
|
|
|
|
toot.acct + locked + '</div>' +
|
|
|
|
|
'</div>' + auth +
|
2018-02-24 03:02:44 +11:00
|
|
|
|
'<div style="justify-content:space-around"> <div class="cbadge" style="width:100px;">Follows:' +
|
|
|
|
|
toot.following_count +
|
|
|
|
|
'</div><div class="cbadge" style="width:100px;">Followers:' + toot.followers_count +
|
2018-01-28 23:22:43 +11:00
|
|
|
|
'</div>' +
|
|
|
|
|
'<div class="divider"></div>' +
|
|
|
|
|
'</div>' +
|
|
|
|
|
'</div>';
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
return templete;
|
|
|
|
|
}
|
2018-03-11 01:22:59 +11:00
|
|
|
|
//クライアントダイアログ
|
|
|
|
|
function client(name) {
|
|
|
|
|
if(name!="Unknown"){
|
|
|
|
|
//聞く
|
|
|
|
|
localStorage.removeItem("client_mute");
|
|
|
|
|
var electron = require("electron");
|
|
|
|
|
var remote=electron.remote;
|
|
|
|
|
var dialog=remote.dialog;
|
|
|
|
|
const options = {
|
|
|
|
|
type: 'info',
|
|
|
|
|
title: 'クライアント処理',
|
|
|
|
|
message: name+"に対する処理を選択してください。",
|
|
|
|
|
buttons: ['何もしない','強調表示/解除', 'ミュート']
|
|
|
|
|
}
|
|
|
|
|
dialog.showMessageBox(options, function(arg) {
|
|
|
|
|
if(arg==1){
|
|
|
|
|
var cli = localStorage.getItem("client_emp");
|
|
|
|
|
var obj = JSON.parse(cli);
|
|
|
|
|
if(!obj){
|
|
|
|
|
var obj=[];
|
|
|
|
|
obj.push(name);
|
|
|
|
|
Materialize.toast(name+"を強調表示します。", 2000);
|
|
|
|
|
}else{
|
|
|
|
|
var can;
|
|
|
|
|
Object.keys(obj).forEach(function(key) {
|
|
|
|
|
var cliT = obj[key];
|
|
|
|
|
if(cliT!=name && !can){
|
|
|
|
|
can=false;
|
|
|
|
|
}else{
|
|
|
|
|
can=true;
|
|
|
|
|
obj.splice(key, 1);
|
|
|
|
|
Materialize.toast(name+"の強調表示を解除しました。", 2000);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
if(!can){
|
|
|
|
|
obj.push(name);
|
|
|
|
|
Materialize.toast(name+"を強調表示します。", 2000);
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
var json = JSON.stringify(obj);
|
|
|
|
|
localStorage.setItem("client_emp", json);
|
|
|
|
|
}else if(arg==2){
|
|
|
|
|
var cli = localStorage.getItem("client_mute");
|
|
|
|
|
var obj = JSON.parse(cli);
|
|
|
|
|
if(!obj){
|
|
|
|
|
var obj=[];
|
|
|
|
|
}
|
|
|
|
|
obj.push(name);
|
|
|
|
|
var json = JSON.stringify(obj);
|
|
|
|
|
localStorage.setItem("client_mute", json);
|
|
|
|
|
Materialize.toast(name+"をミュートします。設定から削除できます。", 2000);
|
|
|
|
|
}else{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
parseColumn();
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|