//レイアウトの設定 var websocketOld = []; var websocket = []; var websocketHome = []; var websocketLocal = []; var websocketNotf = []; //カラム追加ボックストグル function addToggle() { $("#add-box").toggleClass("hide"); addselCk() $("#add-box").css("bottom","40px"); $("#add-box").css("left",$('#add-tgl').offset().left-$('#add-box').width()/2+"px"); $("#add-box").toggleClass("show"); } //最初、カラム変更時に発火 function parseColumn() { console.log("parse"); var size = localStorage.getItem("size"); if (size) { $("#timeline-container").css("font-size", size + "px"); $(".toot-reset").css("font-size", size + "px"); $(".cont-series").css("font-size", size + "px"); } tlCloser(); var multi = localStorage.getItem("multi"); if (!multi) { var obj = []; var json = JSON.stringify(obj); localStorage.setItem("multi", json); } else { var obj = JSON.parse(multi); var templete; Object.keys(obj).forEach(function(key) { var acct = obj[key]; localStorage.setItem("name_" + key, acct.name); localStorage.setItem("user_" + key, acct.user); localStorage.setItem("user-id_" + key, acct.id); localStorage.setItem("prof_" + key, acct.prof); localStorage.setItem("domain_" + key, acct.domain); localStorage.setItem("acct_"+ key + "_at", acct.at); notf(key, 0); ckdb(key); //フィルターデータ読もう getFilter(key); }); } var acctlist=obj; console.log(obj); var xed=localStorage.getItem("xed"); if(xed){ xpand(); } var col = localStorage.getItem("column"); if (!col) { var obj = [{ domain: 0, type: 'local' }]; localStorage.setItem("card_0","true"); var json = JSON.stringify(obj); localStorage.setItem("column", json); } else { var obj = JSON.parse(col); } if ($("#timeline-container").length) { $("#timeline-container").html(""); } Object.keys(obj).forEach(function(key) { var acct = obj[key]; if(acct.type=="notf"){ var notf_attr=' data-notf='+acct.domain; var if_notf="hide"; }else{ var notf_attr=''; var if_notf=""; } if(localStorage.getItem("notification_" + acct.domain)){ var unique_notf=lang.lang_layout_thisacct.replace("{{notf}}" ,localStorage.getItem("notification_" + acct.domain)); }else{ if(lang.language=="ja"){ var notflocale="通知"; }else if(lang.language=="en"){ var notflocale="Notification"; } var unique_notf=lang.lang_layout_thisacct.replace("{{notf}}" ,notflocale); } var insert=""; var icnsert=""; if(acct.background){ if(acct.text=="def"){ }else{ if(acct.text=="black"){ var txhex="000000"; var ichex="9e9e9e" }else if(acct.text=="white"){ var txhex="ffffff"; var ichex="eeeeee" } insert='background-color:#'+acct.background+'; color: #'+txhex+'; '; icnsert=' style="color: #'+ichex+'" '; } } console.log(acct.domain); if(acctlist[acct.domain]){ if(acctlist[acct.domain].background!="def"){ insert=insert+" border-bottom:medium solid #"+acctlist[acct.domain].background; } } if(acct.type=="notf" && localStorage.getItem("setasread")=="no"){ localStorage.setItem("hasNotfC_" + acct.domain,"true"); }else{ localStorage.removeItem("hasNotfC_" + acct.domain); } if(acct.type=="webview"){ var html =webview("https://tweetdeck.twitter.com",key,insert,icnsert); $("#timeline-container").append(html); }else{ if(acct.type=="notf"){ var exclude=lang.lang_excluded+':
'+ ' '+ ' '+ ' '+ '
'; }else{ var exclude=""; } var html = '
'+ '
'+exclude+'perm_mediaOn'+lang.lang_layout_mediafil +'
linkOn'+lang.lang_layout_linkana +'
hearingOn'+lang.lang_layout_tts +'TL
low_priority'+lang.lang_layout_reconnect[lang]+'
'+lang.lang_layout_headercolor +'
'+lang.lang_layout_nodata +'
'; $("#timeline-container").append(html); localStorage.removeItem("pool_" + key); if (acct.data) { var data = acct.data; } else { var data = ""; } if(localStorage.getItem("catch_" + key)){ var delc="true"; }else{ var delc="false"; } if(localStorage.getItem("voice_" + key)){ var voice=true; }else{ var voice=false; } tl(acct.type, data, acct.domain, key, delc,voice,""); cardCheck(key); mediaCheck(key); catchCheck(key); voiceCheck(key); } }); var width = localStorage.getItem("width"); if (width) { $(".box").css("min-width", width + "px"); } var box = localStorage.getItem("box"); if (box == "absolute") { setTimeout(show, 1000); } if(localStorage.getItem("reverse")){ $("#bottom").removeClass("reverse"); $(".leftside").removeClass("reverse"); } if(localStorage.getItem("sec") && localStorage.getItem("sec")!="nothing"){ secvis(localStorage.getItem("sec")); } favTag(); var cw = localStorage.getItem("always-cw"); if (cw == "yes") { if(!$("#cw").hasClass("cw-avail")){ $("#cw-text").show(); $("#cw").addClass("yellow-text"); $("#cw").addClass("cw-avail"); var cwt=localStorage.getItem("cw-text"); if(cwt){ $("#cw-text").val(cwt); } } } } //セカンダリートゥートボタン function secvis(set){ if(set=="public"){ $("#toot-sec-icon").text("public"); $("#toot-sec-btn").addClass("purple"); }else if(set=="unlisted"){ $("#toot-sec-icon").text("lock_open"); $("#toot-sec-btn").addClass("blue"); }else if(set=="private"){ $("#toot-sec-icon").text("lock"); $("#toot-sec-btn").addClass("orange"); }else if(set=="direct"){ $("#toot-sec-icon").text("mail"); $("#toot-sec-btn").addClass("red"); }else if(set=="limited"){ $("#toot-sec-icon").text("group"); $("#toot-sec-btn").addClass("teal"); }else if(set=="local"){ $("#toot-sec-icon").text("visibility"); $("#toot-sec-btn").addClass("light-blue"); } $("#toot-sec-btn").removeClass("hide"); } //カラム追加 function addColumn() { var acct = $("#add-acct-sel").val(); localStorage.setItem("last-use", acct); var type = $("#type-sel").val(); if(acct=="noauth"){ acct=$("#noauth-url").val(); type="noauth" }else if(acct=="webview"){ acct=""; type="webview" } var add = { domain: acct, type: type }; var multi = localStorage.getItem("column"); var obj = JSON.parse(multi); if(!obj){ var leng=0; var json = JSON.stringify([add]); localStorage.setItem("column", json); }else{ var leng=obj.length; obj.push(add); var json = JSON.stringify(obj); localStorage.setItem("column", json); } parseColumn(); } function addselCk(){ var acct = $("#add-acct-sel").val(); var domain=localStorage.getItem("domain_" + acct); if(acct=="webview"){ $("#auth").addClass("hide"); $("#noauth").addClass("hide"); $("#webview-add").removeClass("hide"); }else if(acct=="noauth"){ $("#auth").addClass("hide"); $("#noauth").removeClass("hide"); $("#webview-add").addClass("hide"); }else{ $("#auth").removeClass("hide"); $("#noauth").addClass("hide"); $("#webview-add").addClass("hide"); } if(domain=="knzk.me" || domain=="mstdn.y-zu.org"){ $("#type-sel").append(''); $('#type-sel').material_select('update'); }else{ $("#direct-add").remove(); $('#type-sel').material_select('update'); } } //カラム削除 function removeColumn(tlid) { $("#sort-box").addClass("hide"); $("#sort-box").removeClass("show"); var multi = localStorage.getItem("column"); var obj = JSON.parse(multi); //聞く var electron = require("electron"); var ipc = electron.ipcRenderer; ipc.send('column-del', ""); ipc.on('column-del-reply', function (event, arg) { console.log(arg); if(arg==1){ localStorage.removeItem("card_" + tlid); obj.splice(tlid, 1); for(var i=0;iDefault'+ '
Red
'+ '
Pink
'+ '
Purple
'+ '
Deep-purple
'+ '
Indigo
'+ '
Blue
'+ '
Light-blue
'+ '
Cyan
'+ '
Teal
'+ '
Green
'+ '
Light-green
'+ '
Lime
'+ '
Yellow
'+ '
Amber
'+ '
Orange
'+ '
Deep-orange
'+ '
Brown
'+ '
Grey
'+ '
Blue-grey
'+ '
Black
'+ '
White
'; $("#picker_"+key).html(temp); } function coloradd(key,bg,txt){ var col = localStorage.getItem("column"); var o = JSON.parse(col); var obj=o[key]; obj.background=bg; obj.text=txt; o[key]=obj; var json = JSON.stringify(o); localStorage.setItem("column", json); if(txt=="def"){ $("#menu_"+key).css("background-color",""); $("#menu_"+key).css("color",""); }else{ $("#menu_"+key).css('background-color','#'+bg); if(txt=="black"){ var bghex="000000"; var ichex="9e9e9e" }else if(txt=="white"){ var bghex="ffffff"; var ichex="eeeeee" } $("#menu_"+key+" .nex").css('color','#'+ichex); $("#menu_"+key).css('color','#'+bghex); } } //禁断のTwitter function webview(url,key,insert,icnsert){ var html = '
'+ '
'+lang.lang_layout_headercolor +'
'; return html; }