thedesk/app/js/ui/layout.js

512 lines
22 KiB
JavaScript
Raw Normal View History

2018-01-28 23:22:43 +11:00
//レイアウトの設定
2018-03-27 13:39:35 +11:00
var websocketOld = [];
var websocket = [];
var websocketHome = [];
var websocketLocal = [];
var websocketNotf = [];
2018-01-28 23:22:43 +11:00
2018-03-27 13:39:35 +11:00
//カラム追加ボックストグル
function addColumnMenu() {
$("#left-menu div").removeClass("active");
$("#addColumnMenu").addClass("active");
$(".menu-content").addClass("hide");
$("#add-box").removeClass("hide");
2018-03-27 13:39:35 +11:00
addselCk()
}
$('.type').click(function() {
2019-03-16 02:40:20 +11:00
$(".type").removeClass("active");
$(this).addClass("active");
$("#type-sel").val($(this).attr("data-type"))
})
2018-01-28 23:22:43 +11:00
//最初、カラム変更時に発火
2018-03-27 13:39:35 +11:00
function parseColumn() {
2018-08-05 02:26:34 +10:00
console.log("parse");
2018-03-27 13:39:35 +11:00
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");
}
2019-04-23 00:16:57 +10:00
if(localStorage.getItem("menu-done")){
$("#fukidashi").addClass("hide")
}
2018-03-27 13:39:35 +11:00
tlCloser();
var multi = localStorage.getItem("multi");
2019-04-11 02:52:01 +10:00
if (multi) {
2018-03-27 13:39:35 +11:00
var obj = JSON.parse(multi);
2018-01-28 23:22:43 +11:00
2018-03-27 13:39:35 +11:00
var templete;
2018-01-28 23:22:43 +11:00
Object.keys(obj).forEach(function(key) {
var acct = obj[key];
2018-03-27 13:39:35 +11:00
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);
2018-07-07 03:51:48 +10:00
localStorage.setItem("acct_"+ key + "_at", acct.at);
2018-03-27 13:39:35 +11:00
notf(key, 0);
ckdb(key);
2018-07-17 01:39:06 +10:00
//フィルターデータ読もう
getFilter(key);
2018-01-28 23:22:43 +11:00
});
2018-03-27 13:39:35 +11:00
}
2018-06-18 00:26:45 +10:00
var acctlist=obj;
2018-07-07 03:51:48 +10:00
console.log(obj);
2019-03-19 02:24:46 +11:00
/*var xed=localStorage.getItem("xed");
2018-03-27 13:39:35 +11:00
if(xed){
xpand();
2019-03-19 01:01:45 +11:00
}*/
2018-03-27 13:39:35 +11:00
var col = localStorage.getItem("column");
if (!col) {
var obj = [{
domain: 0,
type: 'local'
}];
var json = JSON.stringify(obj);
localStorage.setItem("column", json);
} else {
var obj = JSON.parse(col);
}
if ($("#timeline-container").length) {
$("#timeline-container").html("");
}
2019-03-21 06:42:47 +11:00
var basekey=0;
for(var key=0;key<obj.length;key++){
var next=key+1;
2018-03-27 13:39:35 +11:00
var acct = obj[key];
if(acct.type=="notf"){
var notf_attr=' data-notf='+acct.domain;
2018-08-11 01:58:00 +10:00
var if_notf="hide";
2018-03-27 13:39:35 +11:00
}else{
var notf_attr='';
2018-08-11 01:58:00 +10:00
var if_notf="";
2018-01-28 23:22:43 +11:00
}
2018-03-27 13:39:35 +11:00
if(localStorage.getItem("notification_" + acct.domain)){
2019-01-26 14:23:53 +11:00
var unique_notf=lang.lang_layout_thisacct.replace("{{notf}}" ,localStorage.getItem("notification_" + acct.domain));
2018-03-27 13:39:35 +11:00
}else{
2019-01-26 14:23:53 +11:00
if(lang.language=="ja"){
2018-07-29 19:43:08 +10:00
var notflocale="通知";
2019-01-26 14:23:53 +11:00
}else if(lang.language=="en"){
2018-07-29 19:43:08 +10:00
var notflocale="Notification";
}
2019-01-26 14:23:53 +11:00
var unique_notf=lang.lang_layout_thisacct.replace("{{notf}}" ,notflocale);
2018-01-28 23:22:43 +11:00
}
2018-04-07 14:31:09 +10:00
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"
}
2018-06-18 00:26:45 +10:00
insert='background-color:#'+acct.background+'; color: #'+txhex+'; ';
2018-04-07 14:31:09 +10:00
icnsert=' style="color: #'+ichex+'" ';
}
}
2019-03-21 06:42:47 +11:00
console.log(acct);
2018-07-07 03:51:48 +10:00
if(acctlist[acct.domain]){
if(acctlist[acct.domain].background!="def"){
2019-02-27 03:51:37 +11:00
insert=insert+" border-bottom:medium solid #"+acctlist[acct.domain].background+";";
2018-07-07 03:51:48 +10:00
}
2018-06-18 00:26:45 +10:00
}
2018-08-17 03:21:40 +10:00
if(acct.type=="notf" && localStorage.getItem("setasread")=="no"){
localStorage.setItem("hasNotfC_" + acct.domain,"true");
}else{
localStorage.removeItem("hasNotfC_" + acct.domain);
}
2018-09-10 03:06:00 +10:00
if(acct.type=="webview"){
2019-02-27 03:51:37 +11:00
if(localStorage.getItem("fixwidth")){
var fixwidth=localStorage.getItem("fixwidth");
var css=" min-width:"+fixwidth+"px;"
}else{
var css="";
}
2019-03-21 16:21:02 +11:00
var html =webviewParse("https://tweetdeck.twitter.com",key,insert,icnsert,css);
2018-09-10 03:06:00 +10:00
$("#timeline-container").append(html);
}else if(acct.type=="tootsearch"){
if(!acct.left_fold){
basekey=key;
}
var width = localStorage.getItem("width");
if (width) {
var css=" min-width:"+width+"px;"
}
var anime = localStorage.getItem("animation");
if (anime=="yes" || !anime) {
var animecss="box-anime";
}else{
var animecss="";
}
unstreamingTL(acct.type,key,basekey,insert,icnsert,acct.left_fold,css,animecss,acct.data);
2018-09-10 03:06:00 +10:00
}else{
2019-02-27 03:51:37 +11:00
var width = localStorage.getItem("width");
if (width) {
var css=" min-width:"+width+"px;"
}
2019-03-06 19:08:48 +11:00
var anime = localStorage.getItem("animation");
if (anime=="yes" || !anime) {
var animecss="box-anime";
}else{
var animecss="";
}
2019-01-26 14:23:53 +11:00
if(acct.type=="notf"){
2019-04-13 13:41:58 +10:00
var exclude=lang.lang_excluded+':<br><input type="checkbox" class="filled-in" id="exc-reply-'+key+'" '+excludeCk(key,"mention")+' /><label for="exc-reply-'+key+'" class="exc-chb"><i class="fas fa-share exc-icons"></i></label> '+
'<input type="checkbox" class="filled-in" id="exc-fav-'+key+'" '+excludeCk(key,"favourite")+' /><label for="exc-fav-'+key+'" class="exc-chb"><i class="fas fa-star exc-icons"></i></label> '+
'<input type="checkbox" class="filled-in" id="exc-bt-'+key+'" '+excludeCk(key,"reblog")+' /><label for="exc-bt-'+key+'" class="exc-chb" ><i class="fas fa-retweet exc-icons"></i></label> '+
'<input type="checkbox" class="filled-in" id="exc-follow-'+key+'" '+excludeCk(key,"follow")+' /><label for="exc-follow-'+key+'" class="exc-chb" ><i class="fas fa-users exc-icons"></i></label> '+
'<input type="checkbox" class="filled-in" id="exc-follow-'+key+'" '+excludeCk(key,"poll")+' /><label for="exc-poll-'+key+'" class="exc-chb" ><i class="fas fa-tasks exc-icons"></i></label> '+
2019-01-26 14:23:53 +11:00
'<button class="btn waves-effect" style="width:60px; padding:0;" onclick="exclude('+key+')">Filter</button><br>';
2019-02-28 04:02:23 +11:00
}else if(acct.type=="home"){
var exclude='<a onclick="ebtToggle(' + key +
2019-04-13 13:41:58 +10:00
')" class="setting nex"><i class="fas fa-retweet waves-effect nex" title="'+lang.lang_layout_excludingbt +'" style="font-size:24px"></i><span id="sta-bt-' +
2019-02-28 04:02:23 +11:00
key + '">Off</span></a>'+lang.lang_layout_excludingbt+'<br>';
2019-01-26 14:23:53 +11:00
}else{
var exclude="";
}
2019-03-21 06:42:47 +11:00
if(!acct.left_fold){
basekey=key;
var basehtml = '<div style="'+css+'" class="box '+animecss+'" id="timeline_box_' + basekey + '_parentBox"></div>';
$("#timeline-container").append(basehtml);
var left_hold='<a onclick="leftFoldSet(' + key +')" class="setting nex"><i class="material-icons waves-effect nex" title="'+lang.lang_layout_leftFold+'">view_agenda</i></a>'+lang.lang_layout_leftFold+'</span><br>';
}else{
var left_hold='<a onclick="leftFoldRemove(' + key +')" class="setting nex"><i class="material-icons waves-effect nex" title="'+lang.lang_layout_leftUnfold+'">view_column</i></a>'+lang.lang_layout_leftUnfold+'</span><br>';
}
if(key===0){
left_hold='';
}
var html='<div class="boxIn" id="timeline_box_' + key + '_box" tlid="' + key +
2019-02-27 03:51:37 +11:00
'" data-acct="'+acct.domain+'"><div class="notice-box z-depth-2" id="menu_'+key+'" style="'+insert+' ">'+
2019-04-08 01:14:06 +10:00
'<div class="area-notice"><i class="material-icons waves-effect red-text" id="notice_icon_' + key + '"'+notf_attr+' style="font-size:40px; padding-top:25%;" onclick="checkStr(\''+acct.type+'\', \''+data+'\', \''+acct.domain+'\', \''+key+'\', \''+delc+'\',\''+voice+'\',null)" title="'+lang.lang_layout_gotop +'"></i></div>'+
2018-04-07 14:31:09 +10:00
'<div class="area-notice_name"><span id="notice_' + key + '" class="tl-title"></span></div>'+
2018-03-27 13:39:35 +11:00
'<div class="area-a1"><a onclick="notfToggle(' + acct.domain + ',' + key +
2018-08-11 01:58:00 +10:00
')" class="setting nex '+if_notf+'" title="'+unique_notf+'"'+icnsert+'><i class="material-icons waves-effect nex notf-icon_' +
2018-07-28 07:25:12 +10:00
acct.domain + '">notifications</i></div><div class="area-sta"><span class="new badge teal notf-reply_'+acct.domain+' hide" data-badge-caption="Reply">0</span><span class="new badge yellow black-text notf-fav_'+acct.domain+' hide" data-badge-caption="Fav">0</span><span class="new badge blue notf-bt_'+acct.domain+' hide" data-badge-caption="BT">0</span><span class="new badge orange notf-follow_'+acct.domain+' hide" data-badge-caption="Follow">0</span></a></div>'+
2018-03-27 13:39:35 +11:00
'<div class="area-a2"><a onclick="removeColumn(' + key +
2019-01-26 14:23:53 +11:00
')" class="setting nex"><i class="material-icons waves-effect nex" title="'+lang.lang_layout_delthis +'"'+icnsert+'>cancel</i></a></div>'+
2018-04-07 14:31:09 +10:00
'<div class="area-a3"><a onclick="setToggle(' + key +
2019-01-26 14:23:53 +11:00
')" class="setting nex" title="'+lang.lang_layout_setthis +'"'+icnsert+'><i class="material-icons waves-effect nex">settings</i></a></div></div>'+
2018-08-10 01:18:35 +10:00
'<div class="column-hide notf-indv-box z-depth-4" id="notf-box_' + key +
2018-03-27 13:39:35 +11:00
'"><div id="notifications_' + key +
2019-04-11 13:52:38 +10:00
'" data-notf="' + acct.domain + '" data-type="notf" class="notf-timeline"></div></div><div class="column-hide notf-indv-box" id="util-box_' + key +
2019-03-21 06:42:47 +11:00
'" style="padding:5px;">'+exclude+left_hold+'<a onclick="mediaToggle(' + key +
2019-01-26 14:23:53 +11:00
')" class="setting nex"><i class="material-icons waves-effect nex" title="'+lang.lang_layout_mediafil +'">perm_media</i><span id="sta-media-' +
key + '">On</span></a>'+lang.lang_layout_mediafil +'<br><a onclick="cardToggle(' + key +
')" class="setting nex"><i class="material-icons waves-effect nex" title="'+lang.lang_layout_linkanades +'">link</i><span id="sta-card-' +
key + '">On</span></a>'+lang.lang_layout_linkana +'<br><a onclick="voiceToggle(' + key +
')" class="setting nex"><i class="material-icons waves-effect nex" title="'+lang.lang_layout_tts +'">hearing</i><span id="sta-voice-' +
key + '">On</span></a>'+lang.lang_layout_tts +'TL<br><a onclick="reconnector(' + key +
2019-04-23 00:16:57 +10:00
',\''+acct.type+'\',\''+acct.domain+'\',\''+escapeHTML(acct.data)+'\')" class="setting nex '+if_notf+'"><i class="material-icons waves-effect nex '+if_notf+'" title="'+lang.lang_layout_reconnect+'">low_priority</i></a><span class="'+if_notf+'">'+lang.lang_layout_reconnect+'</span><br>'+lang.lang_layout_headercolor +'<br><div id="picker_'+key+'" class="color-picker"></div></div><div class="tl-box" tlid="' + key + '"><div id="timeline_' + key +
2019-04-20 01:59:31 +10:00
'" class="tl '+acct.type+'-timeline " tlid="' + key + '" data-type="' + acct.type + '" data-acct="'+acct.domain+'" data-const="' + acct.type + '_'+acct.domain+'"><div id="landing_'+key+'" style="text-align:center">'+lang.lang_layout_nodata +'</div></div></div>'
2019-03-21 06:42:47 +11:00
$('#timeline_box_' + basekey + '_parentBox').append(html);
2018-03-27 13:39:35 +11:00
localStorage.removeItem("pool_" + key);
if (acct.data) {
var data = acct.data;
} else {
var data = "";
}
2018-07-22 23:03:46 +10:00
if(localStorage.getItem("catch_" + key)){
2018-07-17 01:39:06 +10:00
var delc="true";
}else{
var delc="false";
}
2018-07-22 23:03:46 +10:00
if(localStorage.getItem("voice_" + key)){
var voice=true;
}else{
var voice=false;
}
2018-08-21 04:26:14 +10:00
tl(acct.type, data, acct.domain, key, delc,voice,"");
2018-03-27 13:39:35 +11:00
cardCheck(key);
2019-02-28 04:02:23 +11:00
ebtCheck(key);
2018-03-27 13:39:35 +11:00
mediaCheck(key);
2018-07-28 07:25:12 +10:00
catchCheck(key);
voiceCheck(key);
2018-09-10 03:06:00 +10:00
}
2019-03-21 06:42:47 +11:00
}
2018-03-27 13:39:35 +11:00
var box = localStorage.getItem("box");
2018-08-05 13:36:23 +10:00
if (box == "absolute") {
2018-08-10 12:35:21 +10:00
setTimeout(show, 1000);
2018-03-27 13:39:35 +11:00
}
2018-09-11 04:59:44 +10:00
if(localStorage.getItem("reverse")){
$("#bottom").removeClass("reverse");
$(".leftside").removeClass("reverse");
}
2018-09-17 21:55:00 +10:00
if(localStorage.getItem("sec") && localStorage.getItem("sec")!="nothing"){
secvis(localStorage.getItem("sec"));
}
2018-03-27 13:39:35 +11:00
favTag();
2018-08-05 13:36:23 +10:00
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);
}
}
}
2018-03-27 13:39:35 +11:00
}
2019-04-08 01:14:06 +10:00
function checkStr(type, data, acct_id, key, delc,voice){
if($('#notice_icon_' + key).hasClass("red-text") && type!="notf" && type!="mix"){
console.log("sabun-get")
goTop(key);
tlDiff(type, data, acct_id, key, delc,voice,"");
}else{
goTop(key);
}
}
2018-09-17 21:55:00 +10:00
//セカンダリートゥートボタン
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");
}
2018-01-28 23:22:43 +11:00
//カラム追加
2018-03-27 13:39:35 +11:00
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"
2018-09-10 03:06:00 +10:00
}else if(acct=="webview"){
acct="";
type="webview"
2018-01-28 23:22:43 +11:00
}
2018-03-27 13:39:35 +11:00
var add = {
domain: acct,
type: type
};
var multi = localStorage.getItem("column");
var obj = JSON.parse(multi);
2018-04-07 14:31:09 +10:00
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);
}
2018-03-27 13:39:35 +11:00
parseColumn();
}
function addselCk(){
var acct = $("#add-acct-sel").val();
2018-05-02 14:14:03 +10:00
var domain=localStorage.getItem("domain_" + acct);
2018-09-10 03:06:00 +10:00
if(acct=="webview"){
$("#auth").addClass("hide");
$("#noauth").addClass("hide");
$("#webview-add").removeClass("hide");
}else if(acct=="noauth"){
2018-03-27 13:39:35 +11:00
$("#auth").addClass("hide");
$("#noauth").removeClass("hide");
2018-09-10 03:06:00 +10:00
$("#webview-add").addClass("hide");
2018-03-27 13:39:35 +11:00
}else{
$("#auth").removeClass("hide");
$("#noauth").addClass("hide");
2018-09-10 03:06:00 +10:00
$("#webview-add").addClass("hide");
2018-01-28 23:22:43 +11:00
}
2018-05-02 14:14:03 +10:00
if(domain=="knzk.me" || domain=="mstdn.y-zu.org"){
2019-01-26 14:23:53 +11:00
$("#type-sel").append('<option value="dm" data-trans="dm" id="direct-add">'+lang.layout_dm +'</option>');
2018-05-02 14:14:03 +10:00
}else{
$("#direct-add").remove();
}
2018-03-27 13:39:35 +11:00
}
//カラム削除
function removeColumn(tlid) {
2018-07-29 17:37:54 +10:00
$("#sort-box").addClass("hide");
$("#sort-box").removeClass("show");
2018-03-27 13:39:35 +11:00
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);
2019-03-08 05:19:26 +11:00
if(arg===1){
2018-03-27 13:39:35 +11:00
localStorage.removeItem("card_" + tlid);
obj.splice(tlid, 1);
2018-07-05 11:26:07 +10:00
for(var i=0;i<obj.length;i++){
localStorage.setItem("card_" + i,"true");
2018-07-22 23:03:46 +10:00
localStorage.removeItem("catch_" + i);
2018-07-05 11:26:07 +10:00
}
2018-03-27 13:39:35 +11:00
var json = JSON.stringify(obj);
localStorage.setItem("column", json);
parseColumn();
sortload()
}
})
2018-04-07 14:31:09 +10:00
}
//設定トグル
function setToggle(tlid) {
colorpicker(tlid);
2018-08-10 01:18:35 +10:00
if($("#util-box_" + tlid).hasClass("column-hide")){
$("#util-box_" + tlid).css("display","block")
$("#util-box_" + tlid).animate({
'height': '200px'
},{
'duration': 300,
'complete': function(){
$("#util-box_" + tlid).css("overflow-y","scroll")
$("#util-box_" + tlid).removeClass("column-hide")
}
});
}else{
$("#util-box_" + tlid).css("overflow-y","hidden")
$("#util-box_" + tlid).animate({
'height': '0'
},{
'duration': 300,
'complete': function(){
$("#util-box_" + tlid).addClass("column-hide")
$("#util-box_" + tlid).css("display","none")
}
});
}
2018-04-07 14:31:09 +10:00
}
function colorpicker(key){
temp=
'<div onclick="coloradd('+key+',\'def\',\'def\')" class="pointer">Default</div>'+
'<div onclick="coloradd('+key+',\'f44336\',\'white\')" class="red white-text pointer">Red</div>'+
'<div onclick="coloradd('+key+',\'e91e63\',\'white\')" class="pink white-text pointer">Pink</div>'+
'<div onclick="coloradd('+key+',\'9c27b0\',\'white\')" class="purple white-text pointer">Purple</div>'+
'<div onclick="coloradd('+key+',\'673ab7\',\'white\')" class="deep-purple white-text pointer">Deep-purple</div>'+
'<div onclick="coloradd('+key+',\'3f51b5\',\'white\')" class="indigo white-text pointer">Indigo</div>'+
'<div onclick="coloradd('+key+',\'2196f3\',\'white\')" class="blue white-text pointer">Blue</div>'+
'<div onclick="coloradd('+key+',\'03a9f4\',\'black\')" class="light-blue black-text pointer">Light-blue</div>'+
'<div onclick="coloradd('+key+',\'00bcd4\',\'black\')" class="cyan black-text pointer">Cyan</div>'+
'<div onclick="coloradd('+key+',\'009688\',\'white\')" class="teal white-text pointer">Teal</div>'+
'<div onclick="coloradd('+key+',\'4caf50\',\'black\')" class="green black-text pointer">Green</div>'+
'<div onclick="coloradd('+key+',\'8bc34a\',\'black\')" class="light-green black-text pointer">Light-green</div>'+
'<div onclick="coloradd('+key+',\'cddc39\',\'black\')" class="lime black-text pointer">Lime</div>'+
'<div onclick="coloradd('+key+',\'ffeb3b\',\'black\')" class="yellow black-text pointer">Yellow</div>'+
'<div onclick="coloradd('+key+',\'ffc107\',\'black\')" class="amber black-text pointer">Amber</div>'+
'<div onclick="coloradd('+key+',\'ff9800\',\'black\')" class="orange black-text pointer">Orange</div>'+
'<div onclick="coloradd('+key+',\'ff5722\',\'white\')" class="deep-orange white-text pointer">Deep-orange</div>'+
'<div onclick="coloradd('+key+',\'795548\',\'white\')" class="brown white-text pointer">Brown</div>'+
'<div onclick="coloradd('+key+',\'9e9e9e\',\'white\')" class="grey white-text pointer">Grey</div>'+
'<div onclick="coloradd('+key+',\'607d8b\',\'white\')" class="blue-grey white-text pointer">Blue-grey</div>'+
'<div onclick="coloradd('+key+',\'000000\',\'white\')" class="black white-text pointer">Black</div>'+
'<div onclick="coloradd('+key+',\'ffffff\',\'black\')" class="white black-text pointer">White</div>';
$("#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"){
2018-06-18 00:26:45 +10:00
$("#menu_"+key).css("background-color","");
$("#menu_"+key).css("color","");
2018-04-07 14:31:09 +10:00
}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);
}
2018-09-10 03:06:00 +10:00
}
//禁断のTwitter
2019-03-21 16:21:02 +11:00
function webviewParse(url,key,insert,icnsert,css){
2018-09-10 03:06:00 +10:00
var html = '<div class="box" id="timeline_box_' + key + '_box" tlid="' + key +
2019-02-27 03:51:37 +11:00
'" style="'+css+'"><div class="notice-box z-depth-2" id="menu_'+key+'" style="'+insert+'">'+
2019-04-13 13:41:58 +10:00
'<div class="area-notice"><i class="fab fa-twitter waves-effect" id="notice_icon_' + key + '" style="font-size:40px; padding-top:25%;"></i></div>'+
2018-09-10 03:06:00 +10:00
'<div class="area-notice_name tl-title">WebView('+url+')</div>'+
2019-01-26 14:23:53 +11:00
'<div class="area-sta"><input type="checkbox" id="webviewsel" value="true" class="filled-in"><label for="webviewsel">'+lang.lang_layout_webviewmode +'</label></div>'+
2018-09-10 03:06:00 +10:00
'<div class="area-a2"><a onclick="removeColumn(' + key +
2019-01-26 14:23:53 +11:00
')" class="setting nex"><i class="material-icons waves-effect nex" title="'+lang.lang_layout_delthis +'"'+icnsert+'>cancel</i></a></div>'+
2018-09-10 03:06:00 +10:00
'<div class="area-a3"><a onclick="setToggle(' + key +
2019-01-26 14:23:53 +11:00
')" class="setting nex" title="'+lang.lang_layout_setthis +'"'+icnsert+'><i class="material-icons waves-effect nex">settings</i></a></div></div>'+
2018-09-10 03:06:00 +10:00
'<div class="column-hide notf-indv-box z-depth-4" id="notf-box_' + key +
'"></div><div class="column-hide notf-indv-box" id="util-box_' + key +
2019-03-29 20:10:15 +11:00
'" style="padding:5px;">'+lang.lang_layout_headercolor +'<br><div id="picker_'+key+'" class="color-picker"></div></div><div class="tl-box" tlid="' + key + '" style="width:100%;height:100%;"><div id="timeline_' + key +
2018-09-11 04:59:44 +10:00
'" class="tl" tlid="' + key + '" data-type="webview" style="width:100%;height:100%;"><webview src="'+url+'" style="width:100%;height:100%;" id="webview" preload="./js/platform/twitter.js"></webview></div></div></div>';
2018-09-10 03:06:00 +10:00
return html;
2019-03-21 06:42:47 +11:00
}
function unstreamingTL(type,key,basekey,insert,icnsert,left_fold,css,animecss,q){
if(!left_fold){
var basehtml = '<div style="'+css+'" class="box '+animecss+'" id="timeline_box_' + basekey + '_parentBox"></div>';
$("#timeline-container").append(basehtml);
var left_hold='<a onclick="leftFoldSet(' + key +')" class="setting nex"><i class="material-icons waves-effect nex" title="'+lang.lang_layout_leftFold+'">view_agenda</i></a>'+lang.lang_layout_leftFold+'</span><br>';
}else{
var left_hold='<a onclick="leftFoldRemove(' + key +')" class="setting nex"><i class="material-icons waves-effect nex" title="'+lang.lang_layout_leftUnfold+'">view_column</i></a>'+lang.lang_layout_leftUnfold+'</span><br>';
}
var html='<div class="boxIn" id="timeline_box_' + key + '_box" tlid="' + key +
'"><div class="notice-box z-depth-2" id="menu_'+key+'" style="'+insert+' ">'+
2019-04-11 13:52:38 +10:00
'<div class="area-notice"><i class="material-icons waves-effect" id="notice_icon_' + key + '" style="font-size:40px; padding-top:25%;" onclick="tootsearch('+key+',\''+q+'\');" title="'+lang.lang_layout_gotop +'"></i></div>'+
'<div class="area-notice_name"><span id="notice_' + key + '" class="tl-title"></span></div>'+
'<div class="area-a1"></div><div class="area-sta"></div>'+
'<div class="area-a2"><a onclick="removeColumn(' + key +
')" class="setting nex"><i class="material-icons waves-effect nex" title="'+lang.lang_layout_delthis +'"'+icnsert+'>cancel</i></a></div>'+
'<div class="area-a3"><a onclick="setToggle(' + key +
')" class="setting nex" title="'+lang.lang_layout_setthis +'"'+icnsert+'><i class="material-icons waves-effect nex">settings</i></a></div></div>'+
'<div class="column-hide notf-indv-box" id="util-box_' + key +
'" style="padding:5px;">'+left_hold+'<a onclick="mediaToggle(' + key +
')" class="setting nex"><i class="material-icons waves-effect nex" title="'+lang.lang_layout_mediafil +'">perm_media</i><span id="sta-media-' +
key + '">On</span></a>'+lang.lang_layout_mediafil +'<br>'+lang.lang_layout_headercolor +'<br><div id="picker_'+key+'" class="color-picker"></div></div><div class="tl-box" tlid="' + key + '"><div id="timeline_' + key +
'" class="tl '+type+'-timeline " tlid="' + key + '" data-type="' + type + '" data-acct="nostr"><div id="landing_'+key+'" style="text-align:center">'+lang.lang_layout_nodata +'</div></div></div>'
$('#timeline_box_' + basekey + '_parentBox').append(html);
tootsearch(key,q);
cardCheck(key);
ebtCheck(key);
mediaCheck(key);
catchCheck(key);
voiceCheck(key);
return true;
}
2019-03-21 06:42:47 +11:00
function leftFoldSet(key){
var multi = localStorage.getItem("column");
var obj = JSON.parse(multi);
obj[key].left_fold=true;
var json = JSON.stringify(obj);
localStorage.setItem("column", json);
parseColumn();
}
function leftFoldRemove(key){
var multi = localStorage.getItem("column");
var obj = JSON.parse(multi);
obj[key].left_fold=false;
var json = JSON.stringify(obj);
localStorage.setItem("column", json);
parseColumn();
2019-03-29 20:10:15 +11:00
}