Add dropdown and bookmark
This commit is contained in:
parent
31472e3206
commit
f7dbeaef84
|
@ -415,6 +415,38 @@ iframe,
|
|||
color: var(--color);
|
||||
transition: 0.5s;
|
||||
}
|
||||
#contextWrap {
|
||||
position: fixed;
|
||||
width: 199vw;
|
||||
height: 100vh;
|
||||
z-index: 9998;
|
||||
}
|
||||
.contextMenu {
|
||||
position: fixed;
|
||||
background-color: var(--box);
|
||||
z-index: 9999;
|
||||
border-radius: 5px;
|
||||
padding: 5px;
|
||||
}
|
||||
.contextMenu.bottom:before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
right: 27px;
|
||||
border: 15px solid transparent;
|
||||
border-top: 15px solid var(--box);
|
||||
}
|
||||
.contextMenu.top:before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: -30px;
|
||||
right: 27px;
|
||||
border: 15px solid transparent;
|
||||
border-bottom: 15px solid var(--box);
|
||||
}
|
||||
.contextMenu .btn-flat {
|
||||
text-transform: none !important;
|
||||
}
|
||||
|
||||
.gray {
|
||||
color: var(--gray);
|
||||
|
|
|
@ -115,6 +115,50 @@ function boostWith(vis) {
|
|||
var acct_id = $('#tootmodal').attr('data-acct')
|
||||
rt(id, acct_id, false, vis)
|
||||
}
|
||||
//ブックマーク
|
||||
function bkm(id, acct_id, remote) {
|
||||
if ($('#pub_' + id).hasClass('bkmed')) {
|
||||
var flag = 'unbookmark'
|
||||
} else {
|
||||
var flag = 'bookmark'
|
||||
}
|
||||
var domain = localStorage.getItem('domain_' + acct_id)
|
||||
var at = localStorage.getItem('acct_' + acct_id + '_at')
|
||||
var start = 'https://' + domain + '/api/v1/statuses/' + id + '/' + flag
|
||||
var httpreq = new XMLHttpRequest()
|
||||
httpreq.open('POST', start, true)
|
||||
httpreq.setRequestHeader('Content-Type', 'application/json')
|
||||
httpreq.setRequestHeader('Authorization', 'Bearer ' + at)
|
||||
httpreq.responseType = 'json'
|
||||
httpreq.send()
|
||||
httpreq.onreadystatechange = function() {
|
||||
if (httpreq.readyState === 4) {
|
||||
var json = httpreq.response
|
||||
if (this.status !== 200) {
|
||||
setLog(start, this.status, json)
|
||||
}
|
||||
if (json.reblog) {
|
||||
json = json.reblog
|
||||
}
|
||||
if (remote != 'remote') {
|
||||
var fav = json.favourites_count
|
||||
$('[toot-id=' + id + '] .fav_ct').text(fav)
|
||||
$('[toot-id=' + id + '] .rt_ct').text(json.reblogs_count)
|
||||
if (flag == 'unbookmark') {
|
||||
$('.bkmStr_' + id).text(lang.lang_parse_bookmark)
|
||||
$('.bkm_' + id).removeClass('red-text')
|
||||
$('[toot-id=' + id + ']').removeClass('bkmed')
|
||||
} else {
|
||||
$('.bkmStr_' + id).text(lang.lang_parse_unbookmark)
|
||||
$('.bkm_' + id).addClass('red-text')
|
||||
$('[toot-id=' + id + ']').addClass('bkmed')
|
||||
}
|
||||
} else {
|
||||
M.toast({ html: lang.lang_status_favWarn, displayLength: 1000 })
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//フォロー
|
||||
async function follow(acct_id, resolve) {
|
||||
|
@ -406,12 +450,14 @@ function pin(id, acct_id) {
|
|||
setLog(start, this.status, this.response)
|
||||
}
|
||||
console.log(['Success: pinned', json])
|
||||
if ($('[toot-id=' + id + ']').hasClass('pined')) {
|
||||
if (flag == 'unpin') {
|
||||
$('[toot-id=' + id + ']').removeClass('pined')
|
||||
$('.pin_' + id).removeClass('blue-text')
|
||||
$('.pinStr_' + id).text(lang.lang_parse_pin)
|
||||
} else {
|
||||
$('[toot-id=' + id + ']').addClass('pined')
|
||||
$('.pin_' + id).addClass('blue-text')
|
||||
$('.pinStr_' + id).text(lang.lang_parse_unpin)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -574,23 +620,30 @@ function staEx(mode) {
|
|||
})
|
||||
return
|
||||
}
|
||||
function toggleAction(id, tlid, acct_id) {
|
||||
if (tlid == 'notf') {
|
||||
var tlide = '[data-acct=' + acct_id + '] .notf-timeline'
|
||||
} else if (tlid == 'user') {
|
||||
var tlide = '#his-tl-contents'
|
||||
function toggleAction(elem, height) {
|
||||
var cont = elem.parents('.cvo').find('.contextMenu')
|
||||
if (cont.hasClass('hide')) {
|
||||
$('#contextWrap').removeClass('hide')
|
||||
var left = elem.offset().left + 60
|
||||
var top = elem.offset().top - height
|
||||
if (top < 75) {
|
||||
top = elem.offset().top + 45
|
||||
cont.removeClass('bottom')
|
||||
cont.addClass('top')
|
||||
} else {
|
||||
cont.removeClass('top')
|
||||
cont.addClass('bottom')
|
||||
}
|
||||
cont.css('top', top + 'px')
|
||||
cont.css('right', `calc(100vw - ${left}px)`)
|
||||
cont.removeClass('hide')
|
||||
elem
|
||||
.parents('.cvo')
|
||||
.find('.act-icon')
|
||||
.text('expand_less')
|
||||
} else {
|
||||
var tlide = '[tlid=' + tlid + ']'
|
||||
}
|
||||
if (!$(tlide + ' [toot-id=' + id + ']').hasClass('ext-mode')) {
|
||||
$(tlide + ' [toot-id=' + id + '] .type-a').hide()
|
||||
$(tlide + ' [toot-id=' + id + '] .type-b').show()
|
||||
$(tlide + ' [toot-id=' + id + ']').addClass('ext-mode')
|
||||
$(tlide + ' [toot-id=' + id + '] .act-icon').text('expand_less')
|
||||
} else {
|
||||
$(tlide + ' [toot-id=' + id + '] .type-b').hide()
|
||||
$(tlide + ' [toot-id=' + id + '] .type-a').show()
|
||||
$(tlide + ' [toot-id=' + id + ']').removeClass('ext-mode')
|
||||
$(tlide + ' [toot-id=' + id + '] .act-icon').text('expand_more')
|
||||
$('#contextWrap').addClass('hide')
|
||||
$('.contextMenu').addClass('hide')
|
||||
$('.act-icon').text('expand_more')
|
||||
}
|
||||
}
|
||||
|
|
|
@ -278,10 +278,10 @@ function cardHtml(json, acct_id, id) {
|
|||
if(isHad) {
|
||||
var prved = `<img class="emoji" draggable="false" alt="✅"
|
||||
src="https://twemoji.maxcdn.com/v/12.1.3/72x72/2705.png">`
|
||||
var title = lang.lang_cards_link
|
||||
var title = lang.lang_cards_transted
|
||||
}else{
|
||||
var prved = ''
|
||||
var title = ''
|
||||
var prved = '<img class="emoji" draggable="false" alt="⚠️" src="https://twemoji.maxcdn.com/v/12.1.4/72x72/26a0.png">'
|
||||
var title = lang.lang_cards_untransted
|
||||
}
|
||||
analyze =`<a onclick="cardHtmlShow('${acct_id}','${id}')" class="add-show pointer" title="${title}">
|
||||
${lang.lang_parse_html}(${domain})${prved}
|
||||
|
|
|
@ -8,12 +8,12 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
|
|||
localStorage.setItem('lastunix_' + tlid, date(obj[0].created_at, 'unix'))
|
||||
}
|
||||
|
||||
var actb = 're,rt,fav,qt,del,pin,red'
|
||||
var actb = 're,rt,fav,qt,bkm'
|
||||
if (actb) {
|
||||
var actb = actb.split(',')
|
||||
var disp = {}
|
||||
for (var k = 0; k < actb.length; k++) {
|
||||
if (k < 4) {
|
||||
if (k < 5) {
|
||||
var tp = 'type-a'
|
||||
} else {
|
||||
var tp = 'type-b'
|
||||
|
@ -35,6 +35,12 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
|
|||
var qtClass = ''
|
||||
}
|
||||
}
|
||||
var bkm = localStorage.getItem('bookmark')
|
||||
if (bkm == 'no' || !bkm) {
|
||||
var bkmClass = 'hide'
|
||||
} else {
|
||||
var bkmClass = ''
|
||||
}
|
||||
var datetype = localStorage.getItem('datetype')
|
||||
var nsfwtype = localStorage.getItem('nsfw')
|
||||
var sent = localStorage.getItem('sentence')
|
||||
|
@ -148,13 +154,13 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
|
|||
var wordmute = []
|
||||
}
|
||||
//via通知
|
||||
var viashow = localStorage.getItem('viashow')
|
||||
if (!viashow) {
|
||||
viashow = 'via-hide'
|
||||
}
|
||||
if (viashow == 'hide') {
|
||||
viashow = 'via-hide'
|
||||
var viashowVal = localStorage.getItem('viashow')
|
||||
if (viashowVal == 'yes') {
|
||||
var viashowSet = true
|
||||
} else {
|
||||
var viashowSet = false
|
||||
}
|
||||
var viashow = ''
|
||||
//認証なしTL
|
||||
if (mix == 'noauth') {
|
||||
var noauth = 'hide'
|
||||
|
@ -460,6 +466,11 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
|
|||
var via = ''
|
||||
viashow = 'hide'
|
||||
} else {
|
||||
if (viashowSet) {
|
||||
viashow = ''
|
||||
} else {
|
||||
viashow = 'hide'
|
||||
}
|
||||
var via = escapeHTML(toot.application.name)
|
||||
if (empCli) {
|
||||
//強調チェック
|
||||
|
@ -733,7 +744,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
|
|||
}
|
||||
if (toot.account.acct == localStorage.getItem('user_' + acct_id)) {
|
||||
var if_mine = ''
|
||||
var mine_via = 'type-b'
|
||||
var mine_via = ''
|
||||
var can_rt = ''
|
||||
} else {
|
||||
var if_mine = 'hide'
|
||||
|
@ -756,9 +767,20 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
|
|||
if (toot.pinned) {
|
||||
var if_pin = 'blue-text'
|
||||
var pin_app = 'pinnedToot'
|
||||
var pinStr = lang.lang_parse_unpin
|
||||
} else {
|
||||
var if_pin = ''
|
||||
var pin_app = ''
|
||||
var pinStr = lang.lang_parse_pin
|
||||
}
|
||||
if (toot.bookmarked) {
|
||||
var if_bkm = 'red-text'
|
||||
var bkm_app = 'bkmed'
|
||||
var bkmStr = lang.lang_parse_unbookmark
|
||||
} else {
|
||||
var if_bkm = ''
|
||||
var bkm_app = ''
|
||||
var bkmStr = lang.lang_parse_bookmark
|
||||
}
|
||||
//アニメ再生
|
||||
if (gif == 'yes') {
|
||||
|
@ -851,10 +873,10 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
|
|||
}
|
||||
//日本語じゃない
|
||||
if (toot.language != lang.language && toot.language) {
|
||||
var trans = `<div class="action pin">
|
||||
var trans = `<div class="">
|
||||
<a onclick="trans('${toot.language}','${lang.language}')"
|
||||
class="waves-effect waves-dark btn-flat actct" style="padding:0" title="${lang.lang_parse_trans}">
|
||||
<i class="material-icons">g_translate</i>
|
||||
class="waves-effect waves-dark btn-flat actct" style="padding:0">
|
||||
<i class="material-icons">g_translate</i>${lang.lang_parse_trans}
|
||||
</a>
|
||||
</div>`
|
||||
} else {
|
||||
|
@ -925,11 +947,25 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
|
|||
</div>
|
||||
</div>`
|
||||
}
|
||||
//menuは何個?
|
||||
var menuct = 1
|
||||
if (viashow != 'hide') {
|
||||
menuct++
|
||||
}
|
||||
if (if_mine != 'hide') {
|
||||
menuct = menuct + 3
|
||||
}
|
||||
if (noauth == 'hide') {
|
||||
menuct = 0
|
||||
}
|
||||
if (trans != '') {
|
||||
menuct++
|
||||
}
|
||||
templete =
|
||||
templete +
|
||||
`<div
|
||||
id="pub_${toot.id}"
|
||||
class="cvo ${mouseover} ${boostback} ${fav_app} ${rt_app} ${pin_app} ${hasmedia} ${animecss}"
|
||||
class="cvo ${mouseover} ${boostback} ${fav_app} ${rt_app} ${pin_app} ${bkm_app} ${hasmedia} ${animecss}"
|
||||
toot-id="${id}" unique-id="${uniqueid}" data-medias="${media_ids}" unixtime="${date(
|
||||
obj[key].created_at,
|
||||
'unix'
|
||||
|
@ -939,15 +975,15 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
|
|||
onclick="mov('${toot.id}','${tlid}','cl')"
|
||||
onmouseout="resetmv('mv')"
|
||||
>
|
||||
<div class="area-notice"><span class="gray sharesta">${notice}${home}</span></div>
|
||||
<div class="area-icon">
|
||||
<div class="area-notice grid"><span class="gray sharesta">${notice}${home}</span></div>
|
||||
<div class="area-icon grid">
|
||||
<a onclick="udg('${toot.account.id}','${acct_id}');" user="${toot.account.acct}" class="udg">
|
||||
<img draggable="false" src="${avatar}" width="40" class="prof-img"
|
||||
user="${toot.account.acct}" onerror="this.src='../../img/loading.svg'"/>
|
||||
</a>
|
||||
${noticeavatar}
|
||||
</div>
|
||||
<div class="area-display_name">
|
||||
<div class="area-display_name grid">
|
||||
<div class="flex-name">
|
||||
<span class="user">${dis_name}</span>
|
||||
<span class="sml gray" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis; cursor:text;">
|
||||
|
@ -961,7 +997,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
|
|||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="area-toot">
|
||||
<div class="area-toot grid">
|
||||
${tickerdom}
|
||||
<span class="${api_spoil} cw_text_${toot.id}">
|
||||
<span class="cw_text">${spoil}</span>
|
||||
|
@ -970,12 +1006,12 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
|
|||
<div class="toot ${spoiler}">${content}</div>
|
||||
${poll}${viewer}
|
||||
</div>
|
||||
<div class="area-additional">
|
||||
<div class="area-additional grid">
|
||||
<span class="additional">${analyze}</span>
|
||||
${mentions}${tags}
|
||||
</div>
|
||||
<div class="area-vis">${vis}</div>
|
||||
<div class="area-actions">
|
||||
<div class="area-vis grid">${vis}</div>
|
||||
<div class="area-actions grid">
|
||||
<div class="action ${antinoauth}">
|
||||
<a onclick="detEx('${toot.url}','main')" class="waves-effect waves-dark details" style="padding:0">
|
||||
${lang.lang_parse_det}
|
||||
|
@ -1008,6 +1044,13 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
|
|||
<i class="text-darken-3 fas fa-quote-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
<div class="action ${disp['bkm']} ${noauth} ${bkmClass}">
|
||||
<a onclick="bkm('${toot.id}','${acct_id}','${tlid}')"
|
||||
class="waves-effect waves-dark btn-flat actct bkm-btn" style="padding:0"
|
||||
title="${lang.lang_parse_bookmark}">
|
||||
<i class="fas text-darken-3 fa-bookmark bkm_${toot.id} ${if_bkm}"></i>
|
||||
</a>
|
||||
</div>
|
||||
<div class="action ${disp['fav']} ${noauth}">
|
||||
<a onclick="fav('${uniqueid}','${acct_id}','${tlid}')"
|
||||
class="waves-effect waves-dark btn-flat actct fav-btn" style="padding:0"
|
||||
|
@ -1016,44 +1059,54 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
|
|||
<span class="fav_ct">${toot.favourites_count}</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="${if_mine} action ${disp['del']} ${noauth}">
|
||||
<a onclick="del('${toot.id}','${acct_id}')" class="waves-effect waves-dark btn-flat actct"
|
||||
style="padding:0" title="${lang.lang_parse_del}">
|
||||
<i class="fas fa-trash"></i>
|
||||
</a>
|
||||
</div>
|
||||
<div class="${if_mine} action pin ${disp['pin']} ${noauth}">
|
||||
<a onclick="pin('${
|
||||
toot.id
|
||||
}','${acct_id}')" class="waves-effect waves-dark btn-flat actct" style="padding:0"
|
||||
title="${lang.lang_parse_pin}">
|
||||
<i class="fas fa-map-pin pin_${toot.id} ${if_pin}"></i>
|
||||
</a>
|
||||
</div>
|
||||
<div class="${if_mine} action ${disp['red']} ${noauth}">
|
||||
<a onclick="redraft('${toot.id}','${acct_id}')" class="waves-effect waves-dark btn-flat actct"
|
||||
style="padding:0" title="${lang.lang_parse_redraft}">
|
||||
<i class="material-icons">redo</i>
|
||||
</a>
|
||||
</div>
|
||||
${trans}
|
||||
</div>
|
||||
<div class="area-side">
|
||||
<span class="cbadge viabadge waves-effect ${viashow} ${mine_via}" style="max-width:60px;"
|
||||
onclick="client('${$.strip_tags(via)}')" title="via ${$.strip_tags(via)}">${via}</span>
|
||||
<div class="action ${if_mine} ${noauth}">
|
||||
<a onclick="toggleAction('${
|
||||
toot.id
|
||||
}','${tlid}','${acct_id}')" class="waves-effect waves-dark btn-flat" style="padding:0">
|
||||
<div class="action ${noauth}">
|
||||
<a onclick="toggleAction($(this), ${menuct * 39 + 6})"
|
||||
class="ctxMenu 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}','${tlid}','normal')"
|
||||
class="waves-effect waves-dark btn-flat details ${dmHide}" style="padding:0">
|
||||
<i class="text-darken-3 material-icons">more_vert</i></a>
|
||||
<a onclick="details('${toot.id}','${acct_id}','${tlid}','normal')"
|
||||
class="waves-effect waves-dark btn-flat details ${dmHide}" style="padding:0">
|
||||
<i class="text-darken-3 material-icons">more_vert</i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="contextMenu hide z-depth-4">
|
||||
<div class="${viashow}">
|
||||
via ${escapeHTML(via)}<br>
|
||||
<a onclick="client('${$.strip_tags(via)}')" class="pointer">${lang.lang_parse_clientop}</a>
|
||||
</div>
|
||||
<div>
|
||||
<a onclick="bkm('${toot.id}','${acct_id}','${tlid}')"
|
||||
class="waves-effect waves-dark btn-flat actct bkm-btn" style="padding:0">
|
||||
<i class="fas text-darken-3 fa-bookmark bkm_${toot.id} ${if_bkm}"></i>
|
||||
<span class="bkmStr_${toot.id}">${bkmStr}</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="${if_mine}">
|
||||
<a onclick="del('${toot.id}','${acct_id}')" class="waves-effect waves-dark btn-flat actct"
|
||||
style="padding:0">
|
||||
<i class="fas fa-trash"></i>${lang.lang_parse_del}
|
||||
</a>
|
||||
</div>
|
||||
<div class="${if_mine}">
|
||||
<a onclick="pin('${
|
||||
toot.id
|
||||
}','${acct_id}')" class="waves-effect waves-dark btn-flat actct" style="padding:0">
|
||||
<i class="fas fa-map-pin pin_${toot.id} ${if_pin}"></i>
|
||||
<span class="pinStr_${toot.id}">${pinStr}</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="${if_mine}">
|
||||
<a onclick="redraft('${toot.id}','${acct_id}')" class="waves-effect waves-dark btn-flat actct"
|
||||
style="padding:0">
|
||||
<i class="material-icons">redo</i>${lang.lang_parse_redraft}
|
||||
</a>
|
||||
</div>
|
||||
${trans}
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
}
|
||||
|
@ -1077,7 +1130,6 @@ function userparse(obj, auth, acct_id, tlid, popup) {
|
|||
Object.keys(obj).forEach(function(key) {
|
||||
var toot = obj[key]
|
||||
if (toot) {
|
||||
console.log(['Parsing', toot])
|
||||
if (!toot.username) {
|
||||
var raw = toot
|
||||
toot = toot.account
|
||||
|
@ -1093,8 +1145,7 @@ function userparse(obj, auth, acct_id, tlid, popup) {
|
|||
var locked = ''
|
||||
}
|
||||
if (auth == 'request') {
|
||||
var authhtml =
|
||||
`<i class="material-icons gray pointer" onclick="request('${toot.id}','authorize','${acct_id}')" title="Accept">
|
||||
var authhtml = `<i class="material-icons gray pointer" onclick="request('${toot.id}','authorize','${acct_id}')" title="Accept">
|
||||
person_add
|
||||
</i>
|
||||
<i class="material-icons gray pointer" onclick="request('${toot.id}','reject','${acct_id}')" title="Reject">
|
||||
|
@ -1165,11 +1216,9 @@ function userparse(obj, auth, acct_id, tlid, popup) {
|
|||
var avatar = '../../img/missing.svg'
|
||||
}
|
||||
if (tlid == 'dir' && acct_id == 'noauth') {
|
||||
var udg =
|
||||
`<a onclick="udgEx('${toot.url}','main');" user="${toot.acct}" class="udg">`
|
||||
var udg = `<a onclick="udgEx('${toot.url}','main');" user="${toot.acct}" class="udg">`
|
||||
} else {
|
||||
var udg =
|
||||
`<a onclick="udg('${toot.id}','${acct_id}');" user="${toot.acct}" class="udg">`
|
||||
var udg = `<a onclick="udg('${toot.id}','${acct_id}');" user="${toot.acct}" class="udg">`
|
||||
}
|
||||
var latest = date(toot.last_status_at, 'relative')
|
||||
if (toot.last_status_at) {
|
||||
|
@ -1224,6 +1273,7 @@ function userparse(obj, auth, acct_id, tlid, popup) {
|
|||
}
|
||||
//クライアントダイアログ
|
||||
function client(name) {
|
||||
$('#contextWrap').addClass('hide')
|
||||
if (name != 'Unknown') {
|
||||
//聞く
|
||||
Swal.fire({
|
||||
|
@ -1300,8 +1350,7 @@ function pollParse(poll, acct_id) {
|
|||
var myvote = lang.lang_parse_endedvote
|
||||
var result_hide = ''
|
||||
} else {
|
||||
var myvote =
|
||||
`<a onclick="voteMastodon('${acct_id}','${poll.id}')" class="votebtn">${lang.lang_parse_vote}</a><br>`
|
||||
var myvote = `<a onclick="voteMastodon('${acct_id}','${poll.id}')" class="votebtn">${lang.lang_parse_vote}</a><br>`
|
||||
if (choices[0].votes_count === 0 || choices[0].votes_count > 0) {
|
||||
myvote =
|
||||
myvote +
|
||||
|
@ -1341,10 +1390,9 @@ function pollParse(poll, acct_id) {
|
|||
${voteit}
|
||||
</div>`
|
||||
})
|
||||
pollHtml =
|
||||
`<div class="vote_${acct_id}_${poll.id}">
|
||||
pollHtml = `<div class="vote_${acct_id}_${poll.id}">
|
||||
${pollHtml}${myvote}
|
||||
<a onclick="voteMastodonrefresh(${acct_id}','${poll.id}')" class="pointer">
|
||||
<a onclick="voteMastodonrefresh('${acct_id}','${poll.id}')" class="pointer">
|
||||
${lang.lang_manager_refresh}
|
||||
</a>
|
||||
<span class="cbadge cbadge-hover" title="${date(poll.expires_at, 'absolute')}">
|
||||
|
|
|
@ -214,6 +214,8 @@ function parseColumn(target, dontclose) {
|
|||
class="setting nex" title="${lang.lang_layout_unread}">
|
||||
<i class="material-icons waves-effect nex">more</i>
|
||||
</a>`
|
||||
var notfDomain = acct.domain
|
||||
var notfKey = key
|
||||
if (acct.type == 'notf') {
|
||||
var exclude =
|
||||
lang.lang_excluded +
|
||||
|
@ -257,6 +259,8 @@ function parseColumn(target, dontclose) {
|
|||
</button>`
|
||||
}
|
||||
exclude = exclude + '<br>'
|
||||
notfDomain = "dummy"
|
||||
notfKey = "dummy"
|
||||
} else if (acct.type == 'home') {
|
||||
var exclude =
|
||||
`<a onclick="ebtToggle('${key}')" class="setting nex">
|
||||
|
@ -353,8 +357,8 @@ function parseColumn(target, dontclose) {
|
|||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="column-hide notf-indv-box z-depth-4" id="notf-box_${key}">
|
||||
<div id="notifications_${key}" data-notf="${acct.domain}" data-type="notf" class="notf-timeline">
|
||||
<div class="column-hide notf-indv-box z-depth-4" id="notf-box_${notfKey}">
|
||||
<div id="notifications_${notfKey}" data-notf="${notfDomain}" data-type="notf" class="notf-timeline">
|
||||
</div>
|
||||
</div>
|
||||
<div class="column-hide notf-indv-box" id="util-box_${key}" style="padding:5px;">
|
||||
|
|
|
@ -1,135 +1,140 @@
|
|||
/*ささやきボックス(Cr民並感)*/
|
||||
//✕隠す
|
||||
function hide() {
|
||||
$("#right-side").hide()
|
||||
$("#right-side").css("width", "300px")
|
||||
$("#left-side").css("width", "100%")
|
||||
var width = localStorage.getItem("postbox-width");
|
||||
if(width){
|
||||
width = width.replace("px", "") * 1
|
||||
$('#right-side').hide()
|
||||
$('#right-side').css('width', '300px')
|
||||
$('#left-side').css('width', '100%')
|
||||
var width = localStorage.getItem('postbox-width')
|
||||
if (width) {
|
||||
width = width.replace('px', '') * 1
|
||||
} else {
|
||||
width = 300
|
||||
}
|
||||
$("#post-box").css("width", width)
|
||||
$('#post-box').css('width', width)
|
||||
$('#post-box').fadeOut()
|
||||
$("#post-box").removeClass("appear")
|
||||
$("#emoji").addClass("hide")
|
||||
$("#left-side").show();
|
||||
$("#default-emoji").show();
|
||||
$("#unreact").show();
|
||||
$("#addreact").addClass("hide");
|
||||
$('#post-box').removeClass('appear')
|
||||
$('#emoji').addClass('hide')
|
||||
$('#left-side').show()
|
||||
$('#default-emoji').show()
|
||||
$('#unreact').show()
|
||||
$('#addreact').addClass('hide')
|
||||
}
|
||||
//最小化
|
||||
function mini() {
|
||||
$("body").toggleClass("mini-post");
|
||||
if ($("body").hasClass("mini-post")) {
|
||||
$(".mini-btn").text("expand_less");
|
||||
$('body').toggleClass('mini-post')
|
||||
if ($('body').hasClass('mini-post')) {
|
||||
$('.mini-btn').text('expand_less')
|
||||
} else {
|
||||
$(".mini-btn").text("expand_more");
|
||||
$('.mini-btn').text('expand_more')
|
||||
}
|
||||
}
|
||||
//最小化時に展開
|
||||
function show() {
|
||||
$("#post-box").addClass("appear")
|
||||
$("#textarea").focus();
|
||||
console.log("show" + localStorage.getItem("postbox-left"));
|
||||
var left = localStorage.getItem("postbox-left");
|
||||
$('#post-box').addClass('appear')
|
||||
$('#textarea').focus()
|
||||
console.log('show' + localStorage.getItem('postbox-left'))
|
||||
var left = localStorage.getItem('postbox-left')
|
||||
if (left > $('body').width() - $('#post-box').width()) {
|
||||
left = $('body').width() - $('#post-box').width();
|
||||
left = $('body').width() - $('#post-box').width()
|
||||
} else if (left < 0) {
|
||||
left = 0;
|
||||
left = 0
|
||||
}
|
||||
var top = localStorage.getItem("postbox-top");
|
||||
var top = localStorage.getItem('postbox-top')
|
||||
if (top > $('body').height() - $('#post-box').height()) {
|
||||
top = $('body').height() - $('#post-box').height();
|
||||
top = $('body').height() - $('#post-box').height()
|
||||
} else if (top < 0) {
|
||||
top = 0;
|
||||
top = 0
|
||||
}
|
||||
$('#post-box').css("left", left + "px")
|
||||
$('#post-box').css("top", top + "px")
|
||||
var width = localStorage.getItem("postbox-width");
|
||||
$('#post-box').css('left', left + 'px')
|
||||
$('#post-box').css('top', top + 'px')
|
||||
var width = localStorage.getItem('postbox-width')
|
||||
if (width) {
|
||||
$('#post-box').css("width", width + "px")
|
||||
$('#post-box').css('width', width + 'px')
|
||||
} else {
|
||||
$('#post-box').css("width", "300px")
|
||||
$('#post-box').css('width', '300px')
|
||||
}
|
||||
$('#post-box').fadeIn();
|
||||
$('#textarea').characterCounter();
|
||||
$('#post-box').fadeIn()
|
||||
$('#textarea').characterCounter()
|
||||
mdCheck()
|
||||
}
|
||||
|
||||
$(function () {
|
||||
$("#post-box").draggable({
|
||||
handle: "#post-bar",
|
||||
stop: function () {
|
||||
var left = $('#post-box').offset().left;
|
||||
$(function() {
|
||||
$('#post-box').draggable({
|
||||
handle: '#post-bar',
|
||||
stop: function() {
|
||||
var left = $('#post-box').offset().left
|
||||
if (left > $('body').width() - $('#post-box').width()) {
|
||||
left = $('body').width() - $('#post-box').width();
|
||||
left = $('body').width() - $('#post-box').width()
|
||||
} else if (left < 0) {
|
||||
left = 0;
|
||||
left = 0
|
||||
}
|
||||
var top = $('#post-box').offset().top;
|
||||
var top = $('#post-box').offset().top
|
||||
if (top > $('body').height() - $('#post-box').height()) {
|
||||
top = $('body').height() - $('#post-box').height();
|
||||
top = $('body').height() - $('#post-box').height()
|
||||
} else if (top < 0) {
|
||||
top = 0;
|
||||
top = 0
|
||||
}
|
||||
localStorage.setItem("postbox-left", left);
|
||||
localStorage.setItem("postbox-top", top);
|
||||
localStorage.setItem('postbox-left', left)
|
||||
localStorage.setItem('postbox-top', top)
|
||||
}
|
||||
});
|
||||
$("#post-box").resizable({
|
||||
})
|
||||
$('#post-box').resizable({
|
||||
minHeight: 150,
|
||||
minWidth: 100,
|
||||
stop: function (event, ui) {
|
||||
$("#textarea").blur()
|
||||
localStorage.setItem("postbox-width", ui.size.width);
|
||||
stop: function(event, ui) {
|
||||
$('#textarea').blur()
|
||||
localStorage.setItem('postbox-width', ui.size.width)
|
||||
}
|
||||
});
|
||||
});
|
||||
})
|
||||
})
|
||||
|
||||
//コード受信
|
||||
if (location.search) {
|
||||
var m = location.search.match(/\?mode=([a-zA-Z-0-9]+)\&code=(.+)/);
|
||||
var mode = m[1];
|
||||
var codex = m[2];
|
||||
if (mode == "share") {
|
||||
$('textarea').focus();
|
||||
$("#textarea").val(decodeURI(codex));
|
||||
show();
|
||||
$("body").removeClass("mini-post");
|
||||
$(".mini-btn").text("expand_less");
|
||||
var m = location.search.match(/\?mode=([a-zA-Z-0-9]+)\&code=(.+)/)
|
||||
var mode = m[1]
|
||||
var codex = m[2]
|
||||
if (mode == 'share') {
|
||||
$('textarea').focus()
|
||||
$('#textarea').val(decodeURI(codex))
|
||||
show()
|
||||
$('body').removeClass('mini-post')
|
||||
$('.mini-btn').text('expand_less')
|
||||
}
|
||||
}
|
||||
$('#posttgl').click(function (e) {
|
||||
if (!$('#post-box').hasClass("appear")) {
|
||||
show();
|
||||
$('#posttgl').click(function(e) {
|
||||
if (!$('#post-box').hasClass('appear')) {
|
||||
show()
|
||||
} else {
|
||||
hide();
|
||||
hide()
|
||||
}
|
||||
$('.cvo').removeClass("selectedToot")
|
||||
$('.cvo').removeClass('selectedToot')
|
||||
selectedColumn = 0
|
||||
selectedToot = 0
|
||||
});
|
||||
})
|
||||
|
||||
$("#timeline-container,#group").click(function (e) {
|
||||
if (localStorage.getItem("box") != "absolute") {
|
||||
if ($('#post-box').hasClass("appear") && !localStorage.getItem("nohide")) {
|
||||
hide();
|
||||
$('#timeline-container,#group').click(function(e) {
|
||||
if (localStorage.getItem('box') != 'absolute') {
|
||||
if ($('#post-box').hasClass('appear') && !localStorage.getItem('nohide')) {
|
||||
hide()
|
||||
}
|
||||
}
|
||||
$('.cvo').removeClass("selectedToot")
|
||||
$('.cvo').removeClass('selectedToot')
|
||||
selectedColumn = 0
|
||||
selectedToot = 0
|
||||
localStorage.removeItem("nohide")
|
||||
});
|
||||
$('#textarea,#cw-text').focusout(function (e) {
|
||||
localStorage.setItem("nohide", true)
|
||||
var countup = function () {
|
||||
localStorage.removeItem("nohide")
|
||||
localStorage.removeItem('nohide')
|
||||
})
|
||||
$('#contextWrap').click(function(e) {
|
||||
$('#contextWrap').addClass('hide')
|
||||
$('.contextMenu').addClass('hide')
|
||||
$('.act-icon').text('expand_more')
|
||||
})
|
||||
$('#textarea,#cw-text').focusout(function(e) {
|
||||
localStorage.setItem('nohide', true)
|
||||
var countup = function() {
|
||||
localStorage.removeItem('nohide')
|
||||
}
|
||||
//setTimeout(remove, 100);
|
||||
$('.cvo').removeClass("selectedToot")
|
||||
$('.cvo').removeClass('selectedToot')
|
||||
selectedColumn = 0
|
||||
selectedToot = 0
|
||||
});
|
||||
})
|
||||
|
|
|
@ -84,6 +84,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="contextWrap" class="hide"></div>
|
||||
<div id="post-box" class="z-depth-5">
|
||||
<div id="post-bar" class="drag-bar"><span id="unreact">@@post-new@@</span><span id="addreact"
|
||||
class="hide">Reaction</span></div>
|
||||
|
|
|
@ -182,8 +182,11 @@
|
|||
"lang_parse_bt": "Boost this toot",
|
||||
"lang_parse_fav": "Favourite this toot",
|
||||
"lang_parse_quote": "Quote this toot",
|
||||
"lang_parse_del": "Delete this toot",
|
||||
"lang_parse_pin": "Pin this toot",
|
||||
"lang_parse_bookmark": "Bookmark this",
|
||||
"lang_parse_unbookmark": "Unbookmark this",
|
||||
"lang_parse_del": "Delete this",
|
||||
"lang_parse_pin": "Pin this",
|
||||
"lang_parse_unpin": "Unpin this",
|
||||
"lang_parse_det": "Details via your main account.",
|
||||
"lang_parse_redraft": "Delete & re-draft",
|
||||
"lang_parse_followed": "Followed you",
|
||||
|
|
|
@ -181,9 +181,12 @@
|
|||
"lang_parse_replyto": "このトゥートに返信",
|
||||
"lang_parse_bt": "このトゥートをブースト",
|
||||
"lang_parse_fav": "このトゥートをお気に入り登録",
|
||||
"lang_parse_bookmark": "ブックマークに追加",
|
||||
"lang_parse_unbookmark": "ブックマークから削除",
|
||||
"lang_parse_quote": "このトゥートを引用",
|
||||
"lang_parse_del": "このトゥートを削除",
|
||||
"lang_parse_pin": "このトゥートをピン留め",
|
||||
"lang_parse_del": "削除",
|
||||
"lang_parse_pin": "ピン留めする",
|
||||
"lang_parse_unpin": "ピン留めを解除する",
|
||||
"lang_parse_det": "詳細(メインアカウント経由)",
|
||||
"lang_parse_redraft": "このトゥートを削除して再編集",
|
||||
"lang_parse_followed": "フォローされました。",
|
||||
|
|
Loading…
Reference in New Issue
Block a user