thedesk/app/js/ui/layout.js

944 lines
32 KiB
JavaScript
Raw Normal View History

2018-01-28 23:22:43 +11:00
//レイアウトの設定
2019-11-09 00:52:54 +11:00
var websocketOld = []
var websocket = []
2019-11-09 04:05:15 +11:00
var wsHome = []
var wsLocal = []
2019-11-09 00:52:54 +11:00
var websocketNotf = []
2018-01-28 23:22:43 +11:00
2018-03-27 13:39:35 +11:00
//カラム追加ボックストグル
function addColumnMenu() {
2020-04-22 00:56:04 +10:00
$('#left-menu a').removeClass('active')
2019-11-09 00:52:54 +11:00
$('#addColumnMenu').addClass('active')
$('.menu-content').addClass('hide')
$('#add-box').removeClass('hide')
2018-03-27 13:39:35 +11:00
addselCk()
}
2020-05-07 01:31:11 +10:00
$('.type').click(function () {
2019-11-09 00:52:54 +11:00
$('.type').removeClass('active')
$(this).addClass('active')
$('#type-sel').val($(this).attr('data-type'))
})
2018-01-28 23:22:43 +11:00
//最初、カラム変更時に発火
function parseColumn(target, dontclose) {
if (target === 0) {
//this is kuso
2019-11-09 00:52:54 +11:00
target = 'zero'
}
2019-11-09 00:52:54 +11:00
console.log('%c Parse column', 'color:red;font-size:125%')
var size = localStorage.getItem('size')
2018-03-27 13:39:35 +11:00
if (size) {
2020-05-23 14:54:51 +10:00
$('#timeline-container').css('font-size', size + 'px')
$('.toot-reset').css('font-size', size + 'px')
$('.cont-series').css('font-size', size + 'px')
2018-03-27 13:39:35 +11:00
}
2019-11-09 00:52:54 +11:00
if (localStorage.getItem('menu-done')) {
$('#fukidashi').addClass('hide')
2019-04-23 00:16:57 +10:00
}
if (!dontclose && !target) {
2019-11-09 00:52:54 +11:00
tlCloser()
2019-05-11 02:31:15 +10:00
}
2019-11-09 00:52:54 +11:00
var multi = localStorage.getItem('multi')
2019-04-11 02:52:01 +10:00
if (multi) {
2019-11-09 00:52:54 +11:00
var obj = JSON.parse(multi)
var templete
2020-05-07 01:31:11 +10:00
Object.keys(obj).forEach(function (key) {
2019-11-09 00:52:54 +11:00
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)
2021-01-19 06:06:13 +11:00
localStorage.setItem('acct_' + key + '_rt', acct.rt ? acct.rt : null)
2021-04-18 05:28:10 +10:00
if (!target) mastodonBaseStreaming(key)
2019-11-09 00:52:54 +11:00
ckdb(key)
2018-07-17 01:39:06 +10:00
//フィルターデータ読もう
2019-11-09 00:52:54 +11:00
getFilter(key)
var domain = localStorage.getItem('domain_' + key)
if (localStorage.getItem('mode_' + domain) == 'misskey') {
localStorage.removeItem('misskey_wss_' + key)
2019-07-09 01:27:18 +10:00
connectMisskey(key, false)
2019-05-11 02:31:15 +10:00
}
2019-11-09 00:52:54 +11:00
localStorage.removeItem('emoji_' + key) //カスタム絵文字カテゴリ分け用旧データ削除
})
2018-03-27 13:39:35 +11:00
}
2019-11-09 00:52:54 +11:00
var acctlist = obj
console.table(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
}*/
2019-11-09 00:52:54 +11:00
var col = localStorage.getItem('column')
2018-03-27 13:39:35 +11:00
if (!col) {
2019-11-09 00:52:54 +11:00
var obj = [
{
domain: 0,
2020-09-04 00:17:01 +10:00
type: 'home',
2020-05-07 01:31:11 +10:00
},
2020-09-04 00:17:01 +10:00
{
domain: 0,
type: 'local',
}
2019-11-09 00:52:54 +11:00
]
var json = JSON.stringify(obj)
localStorage.setItem('column', json)
2018-03-27 13:39:35 +11:00
} else {
2019-11-09 00:52:54 +11:00
var obj = JSON.parse(col)
2018-03-27 13:39:35 +11:00
}
var numtarget = false
2019-11-09 00:52:54 +11:00
if (target == 'add') {
var tlidtar = obj.length - 1
obj = [obj[tlidtar]]
} else if (target) {
var tlidtar = target
2019-11-09 00:52:54 +11:00
if (target == 'zero') {
target = 0
}
obj = [obj[target]]
numtarget = true
} else {
var tlidtar = null
2019-11-09 00:52:54 +11:00
if ($('#timeline-container').length) {
$('#timeline-container').html('')
$('.box, .boxIn').resizable('destroy')
}
2018-03-27 13:39:35 +11:00
}
2019-11-09 00:52:54 +11:00
var basekey = 0
2019-05-19 17:39:30 +10:00
for (var key = 0; key < obj.length; key++) {
2019-11-09 00:52:54 +11:00
var next = key + 1
//acctって言いながらタイムライン
2019-11-09 00:52:54 +11:00
var acct = obj[key]
if (tlidtar) {
2019-11-09 00:52:54 +11:00
if (tlidtar == 'zero') {
key = 0
} else {
key = tlidtar
}
}
2019-11-09 00:52:54 +11:00
if (acct.type == 'notf') {
var notf_attr = ' data-notf=' + acct.domain
var if_notf = 'hide'
2019-05-19 17:39:30 +10:00
} else {
2019-11-09 00:52:54 +11:00
var notf_attr = ''
var if_notf = ''
2018-01-28 23:22:43 +11:00
}
2019-11-09 00:52:54 +11:00
if (localStorage.getItem('notification_' + acct.domain)) {
2020-05-07 01:31:11 +10:00
var unique_notf = lang.lang_layout_thisacct.replace('{{notf}}', localStorage.getItem('notification_' + acct.domain))
2019-05-19 17:39:30 +10:00
} else {
2019-11-09 00:52:54 +11:00
if (lang.language == 'ja') {
var notflocale = '通知'
} else if (lang.language == 'en') {
var notflocale = 'Notification'
2018-04-07 14:31:09 +10:00
}
2019-11-09 00:52:54 +11:00
var unique_notf = lang.lang_layout_thisacct.replace('{{notf}}', notflocale)
2019-05-19 17:39:30 +10:00
}
2019-11-09 00:52:54 +11:00
var insert = ''
var icnsert = ''
2019-05-19 17:39:30 +10:00
if (acct.background) {
2019-11-09 00:52:54 +11:00
if (acct.text == 'def') {
2019-05-19 17:39:30 +10:00
} else {
2019-11-09 00:52:54 +11:00
if (acct.text == 'black') {
var txhex = '000000'
var ichex = '9e9e9e'
} else if (acct.text == 'white') {
var txhex = 'ffffff'
var ichex = 'eeeeee'
2019-05-19 17:39:30 +10:00
}
2019-11-09 00:52:54 +11:00
insert = 'background-color:#' + acct.background + '; color: #' + txhex + '; '
icnsert = ' style="color: #' + ichex + '" '
2018-04-07 14:31:09 +10:00
}
}
2019-05-19 17:39:30 +10:00
if (acctlist[acct.domain]) {
2019-11-09 00:52:54 +11:00
if (acctlist[acct.domain].background != 'def') {
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
}
2019-11-09 00:52:54 +11:00
if (acct.type == 'notf' && localStorage.getItem('setasread') == 'no') {
localStorage.setItem('hasNotfC_' + acct.domain, 'true')
2019-05-19 17:39:30 +10:00
} else {
2019-11-09 00:52:54 +11:00
localStorage.removeItem('hasNotfC_' + acct.domain)
2018-08-17 03:21:40 +10:00
}
2020-09-05 00:43:04 +10:00
var css = ''
2019-11-09 00:52:54 +11:00
var width = localStorage.getItem('width')
2019-09-14 03:10:02 +10:00
if (width) {
2020-09-05 00:43:04 +10:00
css = ' min-width:' + width + 'px;'
2020-09-04 00:17:01 +10:00
}
var maxWidth = localStorage.getItem('max-width')
if (maxWidth) {
2021-04-18 05:28:10 +10:00
css = css + 'max-width:' + maxWidth + 'px;'
2019-09-14 03:10:02 +10:00
}
2020-09-05 00:43:04 +10:00
var margin = localStorage.getItem('margin')
if (margin) {
2021-04-18 05:28:10 +10:00
css = css + 'margin-right:' + margin + 'px;'
2019-09-14 03:10:02 +10:00
}
2020-09-05 00:43:04 +10:00
if (acct.width) {
css = css + ' min-width:' + acct.width + 'px !important;max-width:' + acct.width + 'px !important;'
2019-09-14 03:10:02 +10:00
}
2019-11-09 00:52:54 +11:00
if (acct.type == 'webview') {
if (localStorage.getItem('fixwidth')) {
var fixwidth = localStorage.getItem('fixwidth')
var css = ' min-width:' + fixwidth + 'px;'
2019-05-19 17:39:30 +10:00
} else {
2019-11-09 00:52:54 +11:00
var css = ''
2019-02-27 03:51:37 +11:00
}
2019-11-09 00:52:54 +11:00
var html = webviewParse('https://tweetdeck.twitter.com', key, insert, icnsert, css)
$('#timeline-container').append(html)
2021-04-09 17:35:40 +10:00
initWebviewEvent()
2019-11-09 00:52:54 +11:00
} else if (acct.type == 'tootsearch') {
2019-05-19 17:39:30 +10:00
if (!acct.left_fold) {
2019-11-09 00:52:54 +11:00
basekey = key
}
2019-09-14 03:10:02 +10:00
2019-11-09 00:52:54 +11:00
var anime = localStorage.getItem('animation')
if (anime == 'yes' || !anime) {
var animecss = 'box-anime'
2019-05-19 17:39:30 +10:00
} else {
2019-11-09 00:52:54 +11:00
var animecss = ''
}
2020-05-07 01:31:11 +10:00
unstreamingTL(acct.type, key, basekey, insert, icnsert, acct.left_fold, css, animecss, acct.data)
2019-11-25 00:12:14 +11:00
} else if (acct.type == 'bookmark') {
2019-11-16 06:58:37 +11:00
if (!acct.left_fold) {
basekey = key
}
var anime = localStorage.getItem('animation')
if (anime == 'yes' || !anime) {
var animecss = 'box-anime'
} else {
var animecss = ''
}
2020-05-07 01:31:11 +10:00
unstreamingTL(acct.type, key, basekey, insert, icnsert, acct.left_fold, css, animecss, acct.domain)
} else if (acct.type == 'utl') {
if (!acct.left_fold) {
basekey = key
}
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: acct.domain, data: acct.data })
2019-11-25 00:12:14 +11:00
} else {
2019-11-09 00:52:54 +11:00
var anime = localStorage.getItem('animation')
if (anime == 'yes' || !anime) {
var animecss = 'box-anime'
2019-05-19 17:39:30 +10:00
} else {
2019-11-09 00:52:54 +11:00
var animecss = ''
2019-05-19 17:39:30 +10:00
}
2019-11-25 00:12:14 +11:00
var unread = `<a id="unread_${key}" onclick="showUnread('${key}','${acct.type}','${acct.domain}')"
2020-09-08 19:50:05 +10:00
class="setting nex waves-effect" title="${lang.lang_layout_unread}">
2021-04-18 05:28:10 +10:00
<i class="material-icons waves-effect nex">more</i><span>${lang.lang_layout_unread}</span>
2020-09-08 19:50:05 +10:00
</a>`
2019-11-25 00:12:14 +11:00
var notfDomain = acct.domain
var notfKey = key
var if_tag = ''
var if_tag_btn = ''
2019-11-09 00:52:54 +11:00
if (acct.type == 'notf') {
2021-04-18 05:28:10 +10:00
var excludeNotf =
2020-09-08 19:50:05 +10:00
`<div style="border: 1px solid; padding: 5px; margin-top: 5px; margin-bottom: 5px;">${lang.lang_layout_excluded}:<br>
2019-11-09 00:52:54 +11:00
<label>
<input type="checkbox" class="filled-in" id="exc-reply-${key}" ${excludeCk(key, 'mention')} />
<span>
2020-09-08 19:50:05 +10:00
${lang.lang_layout_mention}
2019-11-09 00:52:54 +11:00
</span>
</label>
<label>
<input type="checkbox" class="filled-in" id="exc-fav-${key}" ${excludeCk(key, 'favourite')} />
<span>
2020-09-08 19:50:05 +10:00
${lang.lang_layout_fav}
2019-11-09 00:52:54 +11:00
</span>
</label>
<label>
<input type="checkbox" class="filled-in" id="exc-bt-${key}" ${excludeCk(key, 'reblog')} />
<span>
2020-09-08 19:50:05 +10:00
${lang.lang_layout_bt}
2019-11-09 00:52:54 +11:00
</span>
2020-09-08 19:50:05 +10:00
</label>
2019-11-09 00:52:54 +11:00
<label>
<input type="checkbox" class="filled-in" id="exc-follow-${key}" ${excludeCk(key, 'follow')} />
<span>
2020-09-08 19:50:05 +10:00
${lang.lang_status_follow}
2019-11-09 00:52:54 +11:00
</span>
</label>
<label>
<input type="checkbox" class="filled-in" id="exc-poll-${key}" ${excludeCk(key, 'poll')} />
<span>
2020-09-08 19:50:05 +10:00
${lang.lang_layout_poll}
2019-11-09 00:52:54 +11:00
</span>
2020-09-08 19:50:05 +10:00
</label> <br />
<button class="btn btn-flat waves-effect notf-exclude-btn waves-light" style="width:calc(50% - 11px); padding:0;" onclick="exclude('${key}')">Filter</button>`
2019-06-15 02:32:59 +10:00
if (checkNotfFilter(key)) {
2021-04-18 05:28:10 +10:00
excludeNotf =
excludeNotf +
2020-09-08 19:50:05 +10:00
`<button class="btn btn-flat red-text waves-effect notf-exclude-btn waves-light" style="width:calc(50% - 11px); padding:0;" onclick="resetNotfFilter('${key}')">
2019-11-09 00:52:54 +11:00
Clear all
</button>`
2019-06-15 02:32:59 +10:00
}
2021-04-18 05:28:10 +10:00
excludeNotf = excludeNotf + '</div>'
2019-11-25 00:12:14 +11:00
notfDomain = 'dummy'
notfKey = 'dummy'
2021-04-18 05:28:10 +10:00
var excludeHome =''
2019-11-09 00:52:54 +11:00
} else if (acct.type == 'home') {
2021-04-18 05:28:10 +10:00
var excludeNotf = ''
var excludeHome = `<a onclick="ebtToggle('${key}')" class="setting nex waves-effect">
2020-09-08 19:50:05 +10:00
<i class="fas fa-retweet nex" title="${lang.lang_layout_excludingbt}" style="font-size: 24px"></i>
2021-04-18 05:28:10 +10:00
<span>${lang.lang_layout_excludingbt}</span><span id="sta-bt-${key}">Off</span>
2020-09-08 19:50:05 +10:00
</a>`
2019-11-25 00:12:14 +11:00
} else if (acct.type == 'tag') {
2020-05-07 01:31:11 +10:00
if (acct.data.name) {
2020-04-26 18:55:03 +10:00
var name = acct.data.name
var all = acct.data.all
var any = acct.data.any
var none = acct.data.none
} else {
var name = acct.data
var all = ''
var any = ''
var none = ''
}
2020-05-23 14:54:51 +10:00
if_tag = `<div class="column-hide notf-indv-box" id="tag-box_${key}" style="padding:5px;">
2020-04-26 18:55:03 +10:00
Base: ${name}<br>
<div id="tagManager-${key}">
all: <input type="text" id="all_tm-${key}"" value="${all}">
any: <input type="text" id="any_tm-${key}" value="${any}">
none: <input type="text" id="none_tm-${key}"" value="${none}">
</div>
<button onclick="addTag('${key}')" class="btn waves-effect" style="width: 100%">Refresh</button>
2019-11-25 00:12:14 +11:00
</div>`
if_tag_btn = `<a onclick="setToggleTag('${key}')" class="setting nex"
2020-05-23 14:54:51 +10:00
title="${lang.lang_layout_tagManager}" style="width:30px">
2019-11-25 00:12:14 +11:00
<i class="material-icons waves-effect nex">note_add</i>
</a>`
unread = ''
2021-04-18 05:28:10 +10:00
var excludeNotf = ''
var excludeHome = ''
2020-04-26 18:55:03 +10:00
var if_notf = 'hide'
2019-05-19 17:39:30 +10:00
} else {
2021-04-18 05:28:10 +10:00
var excludeNotf = ''
var excludeHome = ''
2019-11-09 00:52:54 +11:00
unread = ''
2019-05-19 17:39:30 +10:00
}
2019-11-25 00:12:14 +11:00
2019-11-09 00:52:54 +11:00
var markers = localStorage.getItem('markers')
if (markers == 'yes') {
markers = true
2019-09-08 10:39:26 +10:00
} else {
2019-09-22 21:36:11 +10:00
markers = false
2019-09-08 10:39:26 +10:00
}
const smallHeader = localStorage.getItem('smallHeader') === 'yes'
2019-09-08 10:39:26 +10:00
if (!markers) {
2019-11-09 00:52:54 +11:00
unread = ''
2019-09-08 10:39:26 +10:00
}
2019-05-19 17:39:30 +10:00
if (!acct.left_fold) {
2019-11-09 00:52:54 +11:00
basekey = key
if (!numtarget) {
2019-11-25 00:12:14 +11:00
var basehtml = `<div style="${css}" class="box ${animecss}" id="timeline_box_${basekey}_parentBox"></div>`
2019-11-09 00:52:54 +11:00
$('#timeline-container').append(basehtml)
}
2020-09-08 19:50:05 +10:00
var left_hold = `<a onclick="leftFoldSet('${key}')" class="setting nex waves-effect">
2021-04-18 05:28:10 +10:00
<i class="material-icons waves-effect nex" title="${lang.lang_layout_leftFold}">view_agenda</i>
<span>${lang.lang_layout_leftFold}</span></a>`
2019-05-19 17:39:30 +10:00
} else {
2020-09-08 19:50:05 +10:00
var left_hold = `<a onclick="leftFoldRemove('${key}')" class="setting nex waves-effect">
2021-04-18 05:28:10 +10:00
<i class="material-icons waves-effect nex" title="${lang.lang_layout_leftUnfold}">view_column</i>
<span>${lang.lang_layout_leftUnfold}</span></a>`
2019-03-21 06:42:47 +11:00
}
2019-05-19 17:39:30 +10:00
if (key === 0) {
2019-11-09 00:52:54 +11:00
left_hold = ''
2019-03-21 06:42:47 +11:00
}
2020-05-07 01:31:11 +10:00
if (localStorage.getItem('mode_' + localStorage.getItem('domain_' + acct.domain)) == 'misskey') {
2019-11-09 00:52:54 +11:00
var isMisRed = ''
exclude = ''
var if_misskey_hide = 'hide'
2019-05-19 17:39:30 +10:00
} else {
2019-11-09 00:52:54 +11:00
var isMisRed = 'red-text'
var if_misskey_hide = ''
2019-05-08 01:48:59 +10:00
}
2019-11-09 00:52:54 +11:00
if (acct.height) {
var addHeight = ' min-height:' + acct.height + 'px;max-height:' + acct.height + 'px;'
} else {
var addHeight = ''
2019-09-14 03:10:02 +10:00
}
2020-05-10 20:39:49 +10:00
if (acct.type != 'pub' && acct.type != 'pub-media') {
2020-09-08 19:50:05 +10:00
var mediaFil = `<a onclick="mediaToggle('${key}')" class="setting nex waves-effect">
<i class="material-icons nex" title="${lang.lang_layout_mediafil}">perm_media</i>
2021-04-18 05:28:10 +10:00
<span>${lang.lang_layout_mediafil}</span/><span id="sta-media-${key}">On</span></a>`
2020-05-10 20:39:49 +10:00
} else {
2020-09-08 19:50:05 +10:00
var mediaFil = `<a onclick="remoteOnly('${key}','${acct.type}')" class="setting nex waves-effect">
<i class="material-icons nex" title="${lang.lang_layout_remoteOnly}">perm_media</i><br />
2020-05-10 20:39:49 +10:00
<span id="sta-remote-${key}">Off</span>
2020-09-08 19:50:05 +10:00
${lang.lang_layout_remoteOnly}</a>`
2020-05-10 20:39:49 +10:00
}
2019-11-25 00:12:14 +11:00
var html = `
2019-11-09 00:52:54 +11:00
<div class="boxIn" id="timeline_box_${key}_box" tlid="${key}" data-acct="${acct.domain}" style="${addHeight}">
<div class="notice-box ${smallHeader ? 'small-header' : ''} z-depth-2" id="menu_${key}" style="${insert}">
2019-11-09 00:52:54 +11:00
<div class="area-notice">
<i class="material-icons waves-effect ${isMisRed} notice_icon_acct_${acct.domain} top-icon" id="notice_icon_${key}" ${notf_attr}
2019-11-09 00:52:54 +11:00
onclick="checkStr('${acct.type}','${data}','${acct.domain}', '${key}', '${delc}','${voice}',null)"
2020-04-22 00:56:04 +10:00
title="${lang.lang_layout_gotop}" aria-hidden="true">
2019-11-09 00:52:54 +11:00
</i>
</div>
<div class="area-notice_name">
<span id="notice_${key}" class="tl-title"></span>
</div>
<div class="area-a1">
<a onclick="notfToggle('${acct.domain}','${key}')" class="setting nex ${if_notf}"
title="${unique_notf}" ${icnsert}>
2020-04-22 00:56:04 +10:00
<i class="material-icons waves-effect nex notf-icon_${acct.domain}" aria-hidden="true">notifications</i>
<span class="voice">${unique_notf}</span>
2019-11-09 00:52:54 +11:00
</a>
2020-01-30 01:22:53 +11:00
<span class="cbadge hide notf-announ_${acct.domain}" style="margin-right:0"
onclick="notfToggle('${acct.domain}','${key}')" title="${lang.lang_layout_announ}">
<i class="fas fa-bullhorn"></i>
2020-01-30 01:22:53 +11:00
<span class="notf-announ_${acct.domain}_ct"></span>
2020-04-22 00:56:04 +10:00
<span class="voice">${lang.lang_layout_announ}</span>
</span>
2019-11-25 00:12:14 +11:00
${if_tag_btn}
2019-11-09 00:52:54 +11:00
</div>
<div class="area-sta">
<span class="new badge teal notf-reply_${acct.domain} hide" data-badge-caption="Rp" aria-hidden="true">0</span>
<span class="new badge yellow black-text notf-fav_${acct.domain} hide" data-badge-caption="Fv" aria-hidden="true">0</span>
2020-04-22 00:56:04 +10:00
<span class="new badge blue notf-bt_${acct.domain} hide" data-badge-caption="BT" aria-hidden="true">0</span>
<span class="new badge orange notf-follow_${acct.domain} hide" data-badge-caption="Fw" aria-hidden="true">0</span>
2019-11-09 00:52:54 +11:00
</div>
<div class="area-a2">
<a onclick="removeColumn('${key}')" class="setting nex">
2020-04-22 00:56:04 +10:00
<i class="material-icons waves-effect nex" title="${lang.lang_layout_delthis}" ${icnsert} aria-hidden="true">cancel</i>
<span class="voice">${lang.lang_layout_delthis}</span>
2019-11-09 00:52:54 +11:00
</a>
</div>
<div class="area-a3">
<a onclick="setToggle('${key}')" class="setting nex" title="${lang.lang_layout_setthis}" ${icnsert}>
2020-04-22 00:56:04 +10:00
<i class="material-icons waves-effect nex" aria-hidden="true">settings</i>
<span class="voice">${lang.lang_layout_setthis}</span>
2019-11-09 00:52:54 +11:00
</a>
</div>
</div>
2019-11-16 05:42:23 +11:00
<div class="column-hide notf-indv-box z-depth-4" id="notf-box_${notfKey}">
2020-09-05 00:54:49 +10:00
<div class="announce_${acct.domain}" style="border: 1px solid"></div>
2019-11-16 05:42:23 +11:00
<div id="notifications_${notfKey}" data-notf="${notfDomain}" data-type="notf" class="notf-timeline">
2019-11-09 00:52:54 +11:00
</div>
</div>
2020-05-23 14:54:51 +10:00
<div class="column-hide notf-indv-box" id="util-box_${key}" style="padding:5px;">
2021-04-18 05:28:10 +10:00
${excludeNotf}
<div class="columnSettings">
${excludeHome}
${unread}
2020-09-08 19:50:05 +10:00
${left_hold}
${mediaFil}
<a onclick="cardToggle('${key}')" class="setting nex waves-effect">
<i class="material-icons nex" title="${lang.lang_layout_linkanades}">link</i>
2021-04-18 05:28:10 +10:00
<span>${lang.lang_layout_linkana}</span><span id="sta-card-${key}">On</span>
2019-11-09 00:52:54 +11:00
</a>
2020-09-08 19:50:05 +10:00
<a onclick="voiceToggle('${key}')" class="setting nex waves-effect">
<i class="material-icons nex" title="${lang.lang_layout_tts}">hearing</i>
2021-04-18 05:28:10 +10:00
<span>${lang.lang_layout_tts}TL</span/><span id="sta-voice-${key}">On</span>
</a>
2020-09-08 19:50:05 +10:00
<a onclick="columnReload('${key}','${acct.type}')" class="setting nex ${if_misskey_hide} waves-effect">
<i class="material-icons nex" title="${lang.lang_layout_reconnect}">refresh</i>
2021-04-18 05:28:10 +10:00
<span>${lang.lang_layout_reconnect}</span>
2021-01-09 17:47:20 +11:00
</a>
<a onclick="resetWidth('${key}')" class="setting nex waves-effect">
2021-04-18 05:28:10 +10:00
<i class="material-icons nex rotate-90" title="${lang.lang_layout_resetWidth}">height</i>
<span>${lang.lang_layout_resetWidth}</span>
</a></div>
<p>${lang.lang_layout_headercolor}</p>
2019-11-09 00:52:54 +11:00
<div id="picker_${key}" class="color-picker"></div>
2019-11-25 00:12:14 +11:00
</div>${if_tag}
2019-11-09 00:52:54 +11:00
<div class="tl-box" tlid="${key}">
<div id="timeline_${key}" 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>`
if (numtarget) {
$('timeline_box_' + key + '_box').html(html)
} else {
$('#timeline_box_' + basekey + '_parentBox').append(html)
}
2019-11-09 00:52:54 +11:00
localStorage.removeItem('pool_' + key)
2019-05-19 17:39:30 +10:00
if (acct.data) {
2019-11-09 00:52:54 +11:00
var data = acct.data
2019-05-19 17:39:30 +10:00
} else {
2019-11-09 00:52:54 +11:00
var data = ''
2019-05-19 17:39:30 +10:00
}
2019-11-09 00:52:54 +11:00
if (localStorage.getItem('catch_' + key)) {
var delc = 'true'
2019-05-19 17:39:30 +10:00
} else {
2019-11-09 00:52:54 +11:00
var delc = 'false'
2019-05-19 17:39:30 +10:00
}
2018-07-22 23:03:46 +10:00
2019-11-09 00:52:54 +11:00
if (localStorage.getItem('voice_' + key)) {
var voice = true
2019-05-19 17:39:30 +10:00
} else {
2019-11-09 00:52:54 +11:00
var voice = false
2019-05-19 17:39:30 +10:00
}
2019-11-09 00:52:54 +11:00
tl(acct.type, data, acct.domain, key, delc, voice, '')
cardCheck(key)
ebtCheck(key)
mediaCheck(key)
catchCheck(key)
voiceCheck(key)
var css = ''
2018-09-10 03:06:00 +10:00
}
2019-03-21 06:42:47 +11:00
}
2019-11-09 00:52:54 +11:00
var box = localStorage.getItem('box')
if (box == 'absolute') {
setTimeout(show, 1000)
2018-03-27 13:39:35 +11:00
}
2019-11-09 00:52:54 +11:00
if (localStorage.getItem('reverse')) {
$('#bottom').removeClass('reverse')
$('.leftside').removeClass('reverse')
2018-09-11 04:59:44 +10:00
}
2019-11-09 00:52:54 +11:00
$('#bottom').removeClass('hide')
if (localStorage.getItem('sec') && localStorage.getItem('sec') != 'nothing') {
secvis(localStorage.getItem('sec'))
2018-09-17 21:55:00 +10:00
}
2019-11-09 00:52:54 +11:00
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')
2019-05-19 17:39:30 +10:00
if (cwt) {
2019-11-09 00:52:54 +11:00
$('#cw-text').val(cwt)
2018-08-05 13:36:23 +10:00
}
}
}
2019-11-09 00:52:54 +11:00
$('.box, .boxIn').resizable({
2019-09-14 03:10:02 +10:00
minHeight: 50,
minWidth: 50,
grid: 50,
2020-05-07 01:31:11 +10:00
resize: function (event, ui) {
2019-11-09 00:52:54 +11:00
$(this).css('min-width', ui.size.width + 'px')
$(this).css('max-width', ui.size.width + 'px')
$(this).css('min-height', ui.size.height + 'px')
$(this).css('max-height', ui.size.height + 'px')
2019-09-14 03:10:02 +10:00
},
2020-05-07 01:31:11 +10:00
stop: function (event, ui) {
2019-11-09 00:52:54 +11:00
var col = localStorage.getItem('column')
var o = JSON.parse(col)
2019-09-14 03:10:02 +10:00
var width = ui.size.width
var height = ui.size.height
2019-11-09 00:52:54 +11:00
if ($(this).hasClass('boxIn')) {
2019-09-14 03:10:02 +10:00
//縦幅。その縦幅を持つカラムのidは
2019-11-09 00:52:54 +11:00
console.log('tate')
var key = $(this).attr('tlid')
var obj = o[key]
obj.height = height
o[key] = obj
2019-09-14 03:10:02 +10:00
} else {
//横幅。その縦幅を持つカラムのidは
2019-11-09 00:52:54 +11:00
console.log('yoko')
2020-05-07 01:31:11 +10:00
var key = $(this).find('.boxIn').attr('tlid')
2019-11-09 00:52:54 +11:00
var obj = o[key]
obj.width = width
o[key] = obj
2019-09-14 03:10:02 +10:00
}
2019-11-09 00:52:54 +11:00
var json = JSON.stringify(o)
localStorage.setItem('column', json)
2020-05-07 01:31:11 +10:00
},
2019-11-09 00:52:54 +11:00
})
2018-03-27 13:39:35 +11:00
}
2019-05-19 17:39:30 +10:00
function checkStr(type, data, acct_id, key, delc, voice) {
2019-11-09 00:52:54 +11:00
if ($('#notice_icon_' + key).hasClass('red-text') && type != 'notf' && type != 'mix') {
goTop(key)
tlDiff(type, data, acct_id, key, delc, voice, '')
2019-05-19 17:39:30 +10:00
} else {
2019-11-09 00:52:54 +11:00
goTop(key)
2019-04-08 01:14:06 +10:00
}
}
2018-09-17 21:55:00 +10:00
//セカンダリートゥートボタン
2019-05-19 17:39:30 +10:00
function secvis(set) {
2019-11-09 00:52:54 +11:00
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')
2018-09-17 21:55:00 +10:00
}
2019-11-09 00:52:54 +11:00
$('#toot-sec-btn').removeClass('hide')
2018-09-17 21:55:00 +10:00
}
2018-01-28 23:22:43 +11:00
//カラム追加
2018-03-27 13:39:35 +11:00
function addColumn() {
2019-11-09 00:52:54 +11:00
var acct = $('#add-acct-sel').val()
if (acct != 'webview' && acct != 'noauth') {
localStorage.setItem('last-use', acct)
2019-05-20 23:34:58 +10:00
}
2019-11-09 00:52:54 +11:00
var type = $('#type-sel').val()
if (acct == 'noauth') {
acct = $('#noauth-url').val()
type = 'noauth'
} 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,
2020-05-07 01:31:11 +10:00
type: type,
2019-11-09 00:52:54 +11:00
}
var multi = localStorage.getItem('column')
var obj = JSON.parse(multi)
2019-05-19 17:39:30 +10:00
if (!obj) {
2019-11-09 00:52:54 +11:00
var leng = 0
var json = JSON.stringify([add])
localStorage.setItem('column', json)
2019-05-19 17:39:30 +10:00
} else {
2019-11-09 00:52:54 +11:00
var leng = obj.length
obj.push(add)
var json = JSON.stringify(obj)
localStorage.setItem('column', json)
2018-04-07 14:31:09 +10:00
}
2019-05-19 17:39:30 +10:00
2019-11-09 00:52:54 +11:00
parseColumn('add')
2018-03-27 13:39:35 +11:00
}
2019-05-19 17:39:30 +10:00
function addselCk() {
2019-11-09 00:52:54 +11:00
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')
2019-05-19 17:39:30 +10:00
} else {
2019-11-09 00:52:54 +11:00
$('#auth').removeClass('hide')
$('#noauth').addClass('hide')
$('#webview-add').addClass('hide')
2018-01-28 23:22:43 +11:00
}
2019-11-09 00:52:54 +11:00
if (domain == 'knzk.me' || domain == 'mstdn.y-zu.org') {
2020-05-07 01:31:11 +10:00
$('#type-sel').append('<option value="dm" data-trans="dm" id="direct-add">' + lang.layout_dm + '</option>')
2019-05-19 17:39:30 +10:00
} else {
2019-11-09 00:52:54 +11:00
$('#direct-add').remove()
2018-05-02 14:14:03 +10:00
}
2018-03-27 13:39:35 +11:00
}
//カラム削除
function removeColumn(tlid) {
2019-11-09 00:52:54 +11:00
$('#sort-box').addClass('hide')
$('#sort-box').removeClass('show')
2019-06-26 01:52:15 +10:00
Swal.fire({
title: lang.lang_layout_deleteColumn,
text: lang.lang_layout_deleteColumnDesc,
type: 'warning',
showCancelButton: true,
confirmButtonText: lang.lang_yesno,
2020-05-07 01:31:11 +10:00
cancelButtonText: lang.lang_no,
}).then((result) => {
2019-06-26 01:52:15 +10:00
if (result.value) {
2019-11-09 00:52:54 +11:00
var multi = localStorage.getItem('column')
var obj = JSON.parse(multi)
2020-06-13 02:40:32 +10:00
var data = obj[tlid]
2019-11-09 00:52:54 +11:00
obj.splice(tlid, 1)
var json = JSON.stringify(obj)
localStorage.setItem('column', json)
2019-06-26 01:52:15 +10:00
sortLoad()
2020-06-10 13:09:17 +10:00
$('#timeline_box_' + tlid + '_box').remove()
2020-08-05 13:46:10 +10:00
if (!data.left_fold) {
2020-06-13 02:40:32 +10:00
$('#timeline_box_' + tlid + '_parentBox').remove()
}
2019-06-26 01:52:15 +10:00
}
2019-11-09 00:52:54 +11:00
$('#sort-box').removeClass('hide')
$('#sort-box').addClass('show')
})
2018-04-07 14:31:09 +10:00
}
//設定トグル
function setToggle(tlid) {
2019-11-09 00:52:54 +11:00
colorpicker(tlid)
if ($('#util-box_' + tlid).hasClass('column-hide')) {
$('#util-box_' + tlid).css('display', 'block')
$('#util-box_' + tlid).animate(
{
2020-05-07 01:31:11 +10:00
height: '200px',
2019-11-09 00:52:54 +11:00
},
{
duration: 300,
2020-05-07 01:31:11 +10:00
complete: function () {
2019-11-09 00:52:54 +11:00
$('#util-box_' + tlid).css('overflow-y', 'scroll')
$('#util-box_' + tlid).removeClass('column-hide')
2020-05-07 01:31:11 +10:00
},
2019-09-08 02:44:28 +10:00
}
2019-11-09 00:52:54 +11:00
)
2019-05-19 17:39:30 +10:00
} else {
2019-11-09 00:52:54 +11:00
$('#util-box_' + tlid).css('overflow-y', 'hidden')
$('#util-box_' + tlid).animate(
{
2020-05-07 01:31:11 +10:00
height: '0',
2019-11-09 00:52:54 +11:00
},
{
duration: 300,
2020-05-07 01:31:11 +10:00
complete: function () {
2019-11-09 00:52:54 +11:00
$('#util-box_' + tlid).addClass('column-hide')
$('#util-box_' + tlid).css('display', 'none')
2020-05-07 01:31:11 +10:00
},
2019-09-08 02:44:28 +10:00
}
2019-11-09 00:52:54 +11:00
)
2018-08-10 01:18:35 +10:00
}
2018-04-07 14:31:09 +10:00
}
2019-11-25 00:12:14 +11:00
//タグトグル
//設定トグル
function setToggleTag(tlid) {
if ($('#tag-box_' + tlid).hasClass('column-hide')) {
$('#tag-box_' + tlid).css('display', 'block')
$('#tag-box_' + tlid).animate(
{
2020-05-07 01:31:11 +10:00
height: '200px',
2019-11-25 00:12:14 +11:00
},
{
duration: 300,
2020-05-07 01:31:11 +10:00
complete: function () {
2019-11-25 00:12:14 +11:00
$('#tag-box_' + tlid).css('overflow-y', 'scroll')
$('#tag-box_' + tlid).removeClass('column-hide')
2020-05-07 01:31:11 +10:00
},
2019-11-25 00:12:14 +11:00
}
)
} else {
$('#tag-box_' + tlid).css('overflow-y', 'hidden')
$('#tag-box_' + tlid).animate(
{
2020-05-07 01:31:11 +10:00
height: '0',
2019-11-25 00:12:14 +11:00
},
{
duration: 300,
2020-05-07 01:31:11 +10:00
complete: function () {
2019-11-25 00:12:14 +11:00
$('#tag-box_' + tlid).addClass('column-hide')
$('#tag-box_' + tlid).css('display', 'none')
2020-05-07 01:31:11 +10:00
},
2019-11-25 00:12:14 +11:00
}
)
}
}
2019-05-19 17:39:30 +10:00
function colorpicker(key) {
2019-11-25 00:12:14 +11:00
temp = `<div onclick="coloradd('${key}','def','def')" class="pointer">Default</div>
2019-11-09 00:52:54 +11:00
<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)
2018-04-07 14:31:09 +10:00
}
2019-05-19 17:39:30 +10:00
function coloradd(key, bg, txt) {
2019-11-09 00:52:54 +11:00
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', '')
$('#menu_' + key + ' .nex').css('color', '')
2019-05-19 17:39:30 +10:00
} else {
2019-11-09 00:52:54 +11:00
$('#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'
2019-05-19 17:39:30 +10:00
}
2019-11-09 00:52:54 +11:00
$('#menu_' + key + ' .nex').css('color', '#' + ichex)
$('#menu_' + key).css('color', '#' + bghex)
2018-04-07 14:31:09 +10:00
}
2018-09-10 03:06:00 +10:00
}
//禁断のTwitter
2019-05-19 17:39:30 +10:00
function webviewParse(url, key, insert, icnsert, css) {
2019-11-25 00:12:14 +11:00
var html = `<div class="box" id="timeline_box_${key}_box" tlid="${key}" style="${css}">
2019-11-09 00:52:54 +11:00
<div class="notice-box z-depth-2" id="menu_${key}" style="${insert}">
<div class="area-notice">
2020-05-23 14:54:51 +10:00
<i class="fab fa-twitter waves-effect" id="notice_icon_${key}" style="font-size:40px; padding-top:25%;"></i>
2019-11-09 00:52:54 +11:00
</div>
<div class="area-notice_name tl-title">WebView('${url}')</div>
2020-08-05 13:46:10 +10:00
<div class="area-sta">
</div>
2019-11-09 00:52:54 +11:00
<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 z-depth-4" id="notf-box_${key}"></div>
2020-05-23 14:54:51 +10:00
<div class="column-hide notf-indv-box" id="util-box_${key}" style="padding:5px;">
2019-11-09 00:52:54 +11:00
${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}" 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>`
return html
2019-03-21 06:42:47 +11:00
}
2019-11-16 06:58:37 +11:00
function unstreamingTL(type, key, basekey, insert, icnsert, left_fold, css, animecss, data) {
//type名が関数名
2019-05-19 17:39:30 +10:00
if (!left_fold) {
2019-11-25 00:12:14 +11:00
var basehtml = `<div style="${css}" class="box ${animecss}" id="timeline_box_${basekey}_parentBox"></div>`
2019-11-09 00:52:54 +11:00
$('#timeline-container').append(basehtml)
2019-11-25 00:12:14 +11:00
var left_hold = `<a onclick="leftFoldSet('${key}')" class="setting nex">
2019-11-16 06:58:37 +11:00
<i class="material-icons waves-effect nex" title="${lang.lang_layout_leftFold}">view_agenda</i>
</a>
${lang.lang_layout_leftFold}
</span><br>`
2019-05-19 17:39:30 +10:00
} else {
2019-11-25 00:12:14 +11:00
var left_hold = `<a onclick="leftFoldRemove('${key}')" class="setting nex">
2019-11-16 06:58:37 +11:00
<i class="material-icons waves-effect nex" title="${lang.lang_layout_leftUnfold}">view_column</i>
</a>
${lang.lang_layout_leftUnfold}
</span><br>`
}
2020-08-05 13:46:10 +10:00
if (type == 'utl') {
2020-05-10 22:52:01 +10:00
var dataHtml = false
} else {
var dataHtml = data
}
2019-11-25 00:12:14 +11:00
var html = `<div class="boxIn" id="timeline_box_${key}_box" tlid="${key}">
2019-11-16 06:58:37 +11:00
<div class="notice-box z-depth-2" id="menu_${key}" style="${insert} ">
<div class="area-notice">
2020-05-23 14:54:51 +10:00
<i class="material-icons waves-effect" id="notice_icon_${key}" style="font-size:40px; padding-top:25%;"
2020-05-10 22:52:01 +10:00
onclick="${type}('${key}','${dataHtml}');" title="${lang.lang_layout_gotop}"></i>
2019-11-16 06:58:37 +11:00
</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>
2020-05-23 14:54:51 +10:00
<div class="column-hide notf-indv-box" id="util-box_${key}" style="padding:5px;">
2019-11-16 06:58:37 +11:00
${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="${data}">
<div id="landing_${key}" style="text-align:center">
${lang.lang_layout_nodata}
</div>
</div>
</div>`
2019-11-09 00:52:54 +11:00
$('#timeline_box_' + basekey + '_parentBox').append(html)
2019-11-25 00:12:14 +11:00
if (type == 'tootsearch') {
2019-11-16 06:58:37 +11:00
tootsearch(key, data)
2019-11-25 00:12:14 +11:00
} else if (type == 'bookmark') {
2019-11-16 06:58:37 +11:00
console.log(key, data)
bookmark(key, data)
2020-05-07 01:31:11 +10:00
} else if (type == 'utl') {
utl(key, data.acct, data.data)
2019-11-16 06:58:37 +11:00
}
2019-11-09 00:52:54 +11:00
cardCheck(key)
ebtCheck(key)
mediaCheck(key)
catchCheck(key)
voiceCheck(key)
return true
}
2019-11-25 00:12:14 +11:00
function bookmark(key, data) {
2019-11-16 06:58:37 +11:00
console.log(key, data)
if (localStorage.getItem('voice_' + key)) {
var voice = true
} else {
var voice = false
}
tl('bookmark', '', data, key, 'false', voice, '')
}
2020-05-07 01:31:11 +10:00
function utl(key, acct_id, data) {
2020-08-05 13:46:10 +10:00
if (!data) {
2020-05-10 22:52:01 +10:00
var multi = localStorage.getItem('column')
var obj = JSON.parse(multi)
data = obj[key].data
acct_id = obj[key].domain
}
2020-08-05 13:46:10 +10:00
2020-05-07 01:31:11 +10:00
console.log(key, data)
if (localStorage.getItem('voice_' + key)) {
var voice = true
} else {
var voice = false
}
tl('utl', data, acct_id, key, 'false', voice, '')
}
2019-05-19 17:39:30 +10:00
function leftFoldSet(key) {
2019-11-09 00:52:54 +11:00
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()
2019-03-21 06:42:47 +11:00
}
2019-05-19 17:39:30 +10:00
function leftFoldRemove(key) {
2019-11-09 00:52:54 +11:00
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()
}
2021-01-09 17:47:20 +11:00
function resetWidth(key) {
var multi = localStorage.getItem('column')
var obj = JSON.parse(multi)
obj[key].width = null
var json = JSON.stringify(obj)
localStorage.setItem('column', json)
$(`#timeline_box_${key}_parentBox`).attr('style', '')
}