tag add all/none/any
This commit is contained in:
parent
2761cc23b0
commit
5e035dc239
|
@ -180,6 +180,9 @@ function makeNewFilter() {
|
||||||
if ($('#conv_filter:checked').val()) {
|
if ($('#conv_filter:checked').val()) {
|
||||||
cont.push('thread')
|
cont.push('thread')
|
||||||
}
|
}
|
||||||
|
if ($('#prof_filter:checked').val()) {
|
||||||
|
cont.push('profiles')
|
||||||
|
}
|
||||||
if (!cont.length) {
|
if (!cont.length) {
|
||||||
$('#filtered-words').html('Error:' + lang.lang_filter_errordegree)
|
$('#filtered-words').html('Error:' + lang.lang_filter_errordegree)
|
||||||
}
|
}
|
||||||
|
@ -229,6 +232,7 @@ function makeNewFilter() {
|
||||||
$('#local_filter').prop('checked', false)
|
$('#local_filter').prop('checked', false)
|
||||||
$('#notf_filter').prop('checked', false)
|
$('#notf_filter').prop('checked', false)
|
||||||
$('#conv_filter').prop('checked', false)
|
$('#conv_filter').prop('checked', false)
|
||||||
|
$('#prof_filter').prop('checked', false)
|
||||||
$('#except_filter').prop('checked', false)
|
$('#except_filter').prop('checked', false)
|
||||||
$('#wholeword_filter').prop('checked', false)
|
$('#wholeword_filter').prop('checked', false)
|
||||||
$('#days_filter').val('0')
|
$('#days_filter').val('0')
|
||||||
|
|
|
@ -198,3 +198,28 @@ function tagFeature(name, acct_id) {
|
||||||
M.toast({ html: 'Complete: ' + escapeHTML(name), displayLength: 3000 })
|
M.toast({ html: 'Complete: ' + escapeHTML(name), displayLength: 3000 })
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
//タグのフィルタ
|
||||||
|
function addTag(id) {
|
||||||
|
var columns = JSON.parse(localStorage.getItem('column'))
|
||||||
|
var column = columns[id]
|
||||||
|
if(!column.data.name) {
|
||||||
|
var name = column.data
|
||||||
|
} else {
|
||||||
|
var name = column.data.name
|
||||||
|
}
|
||||||
|
var col = localStorage.getItem('column')
|
||||||
|
var o = JSON.parse(col)
|
||||||
|
var obj = o[id]
|
||||||
|
obj.data = {
|
||||||
|
'name': name,
|
||||||
|
'all': $(`#all_tm-${id}`).val(),
|
||||||
|
'any': $(`#any_tm-${id}`).val(),
|
||||||
|
'none': $(`#none_tm-${id}`).val(),
|
||||||
|
}
|
||||||
|
o[id] = obj
|
||||||
|
var json = JSON.stringify(o)
|
||||||
|
console.log(json)
|
||||||
|
localStorage.setItem('column',json)
|
||||||
|
columnReload(id, 'tag')
|
||||||
|
}
|
||||||
|
|
||||||
|
|
284
app/js/tl/tl.js
284
app/js/tl/tl.js
|
@ -10,10 +10,18 @@ function tl(type, data, acct_id, tlid, delc, voice, mode) {
|
||||||
if (tlid == 'add') {
|
if (tlid == 'add') {
|
||||||
console.log('add new column')
|
console.log('add new column')
|
||||||
var newtab = $('.box').length
|
var newtab = $('.box').length
|
||||||
|
if (type == 'tag') {
|
||||||
|
data = {
|
||||||
|
name: data,
|
||||||
|
any: [],
|
||||||
|
all: [],
|
||||||
|
none: [],
|
||||||
|
}
|
||||||
|
}
|
||||||
var add = {
|
var add = {
|
||||||
domain: acct_id,
|
domain: acct_id,
|
||||||
type: type,
|
type: type,
|
||||||
data: data
|
data: data,
|
||||||
}
|
}
|
||||||
var multi = localStorage.getItem('column')
|
var multi = localStorage.getItem('column')
|
||||||
var obj = JSON.parse(multi)
|
var obj = JSON.parse(multi)
|
||||||
|
@ -35,7 +43,11 @@ function tl(type, data, acct_id, tlid, delc, voice, mode) {
|
||||||
if (type == 'mix' && localStorage.getItem('mode_' + domain) != 'misskey') {
|
if (type == 'mix' && localStorage.getItem('mode_' + domain) != 'misskey') {
|
||||||
//Integratedなら飛ばす
|
//Integratedなら飛ばす
|
||||||
$('#notice_' + tlid).text(
|
$('#notice_' + tlid).text(
|
||||||
'Integrated TL(' + localStorage.getItem('user_' + acct_id) + '@' + domain + ')'
|
'Integrated TL(' +
|
||||||
|
localStorage.getItem('user_' + acct_id) +
|
||||||
|
'@' +
|
||||||
|
domain +
|
||||||
|
')'
|
||||||
)
|
)
|
||||||
$('#notice_icon_' + tlid).text('merge_type')
|
$('#notice_icon_' + tlid).text('merge_type')
|
||||||
mixtl(acct_id, tlid, 'integrated', delc, voice)
|
mixtl(acct_id, tlid, 'integrated', delc, voice)
|
||||||
|
@ -43,7 +55,11 @@ function tl(type, data, acct_id, tlid, delc, voice, mode) {
|
||||||
} else if (type == 'plus') {
|
} else if (type == 'plus') {
|
||||||
//Local+なら飛ばす
|
//Local+なら飛ばす
|
||||||
$('#notice_' + tlid).text(
|
$('#notice_' + tlid).text(
|
||||||
'Local+ TL(' + localStorage.getItem('user_' + acct_id) + '@' + domain + ')'
|
'Local+ TL(' +
|
||||||
|
localStorage.getItem('user_' + acct_id) +
|
||||||
|
'@' +
|
||||||
|
domain +
|
||||||
|
')'
|
||||||
)
|
)
|
||||||
$('#notice_icon_' + tlid).text('people_outline')
|
$('#notice_icon_' + tlid).text('people_outline')
|
||||||
mixtl(acct_id, tlid, 'plus', delc, voice)
|
mixtl(acct_id, tlid, 'plus', delc, voice)
|
||||||
|
@ -52,7 +68,12 @@ function tl(type, data, acct_id, tlid, delc, voice, mode) {
|
||||||
//通知なら飛ばす
|
//通知なら飛ばす
|
||||||
notf(acct_id, tlid, 'direct')
|
notf(acct_id, tlid, 'direct')
|
||||||
$('#notice_' + tlid).text(
|
$('#notice_' + tlid).text(
|
||||||
cap(type, data, acct_id) + '(' + localStorage.getItem('user_' + acct_id) + '@' + domain + ')'
|
cap(type, data, acct_id) +
|
||||||
|
'(' +
|
||||||
|
localStorage.getItem('user_' + acct_id) +
|
||||||
|
'@' +
|
||||||
|
domain +
|
||||||
|
')'
|
||||||
)
|
)
|
||||||
$('#notice_icon_' + tlid).text('notifications')
|
$('#notice_icon_' + tlid).text('notifications')
|
||||||
return
|
return
|
||||||
|
@ -60,13 +81,18 @@ function tl(type, data, acct_id, tlid, delc, voice, mode) {
|
||||||
//ブックマークなら飛ばす
|
//ブックマークなら飛ばす
|
||||||
getBookmark(acct_id, tlid)
|
getBookmark(acct_id, tlid)
|
||||||
$('#notice_' + tlid).text(
|
$('#notice_' + tlid).text(
|
||||||
cap(type, data, acct_id) + '(' + localStorage.getItem('user_' + acct_id) + '@' + domain + ')'
|
cap(type, data, acct_id) +
|
||||||
|
'(' +
|
||||||
|
localStorage.getItem('user_' + acct_id) +
|
||||||
|
'@' +
|
||||||
|
domain +
|
||||||
|
')'
|
||||||
)
|
)
|
||||||
$('#notice_icon_' + tlid).text('bookmark')
|
$('#notice_icon_' + tlid).text('bookmark')
|
||||||
return
|
return
|
||||||
} else if (type == 'home') {
|
} else if (type == 'home') {
|
||||||
//ホームならお知らせ「も」取りに行く
|
//ホームならお知らせ「も」取りに行く
|
||||||
announ(acct_id, tlid);
|
announ(acct_id, tlid)
|
||||||
}
|
}
|
||||||
localStorage.setItem('now', type)
|
localStorage.setItem('now', type)
|
||||||
todo(cap(type) + ' TL Loading...')
|
todo(cap(type) + ' TL Loading...')
|
||||||
|
@ -74,14 +100,19 @@ function tl(type, data, acct_id, tlid, delc, voice, mode) {
|
||||||
if (type != 'noauth') {
|
if (type != 'noauth') {
|
||||||
var hdr = {
|
var hdr = {
|
||||||
'content-type': 'application/json',
|
'content-type': 'application/json',
|
||||||
Authorization: 'Bearer ' + at
|
Authorization: 'Bearer ' + at,
|
||||||
}
|
}
|
||||||
$('#notice_' + tlid).text(
|
$('#notice_' + tlid).text(
|
||||||
cap(type, data, acct_id) + '(' + localStorage.getItem('user_' + acct_id) + '@' + domain + ')'
|
cap(type, data, acct_id) +
|
||||||
|
'(' +
|
||||||
|
localStorage.getItem('user_' + acct_id) +
|
||||||
|
'@' +
|
||||||
|
domain +
|
||||||
|
')'
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
var hdr = {
|
var hdr = {
|
||||||
'content-type': 'application/json'
|
'content-type': 'application/json',
|
||||||
}
|
}
|
||||||
domain = acct_id
|
domain = acct_id
|
||||||
$('#notice_' + tlid).text('Glance TL(' + domain + ')')
|
$('#notice_' + tlid).text('Glance TL(' + domain + ')')
|
||||||
|
@ -110,7 +141,7 @@ function tl(type, data, acct_id, tlid, delc, voice, mode) {
|
||||||
var i = {
|
var i = {
|
||||||
method: method,
|
method: method,
|
||||||
headers: hdr,
|
headers: hdr,
|
||||||
body: JSON.stringify(req)
|
body: JSON.stringify(req),
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
var misskey = false
|
var misskey = false
|
||||||
|
@ -129,7 +160,7 @@ function tl(type, data, acct_id, tlid, delc, voice, mode) {
|
||||||
var method = 'GET'
|
var method = 'GET'
|
||||||
var i = {
|
var i = {
|
||||||
method: method,
|
method: method,
|
||||||
headers: hdr
|
headers: hdr,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -190,7 +221,12 @@ function reload(type, cc, acct_id, tlid, data, mute, delc, voice, mode) {
|
||||||
if (localStorage.getItem('mode_' + domain) == 'misskey') {
|
if (localStorage.getItem('mode_' + domain) == 'misskey') {
|
||||||
var misskey = true
|
var misskey = true
|
||||||
var key = localStorage.getItem('misskey_wss_' + acct_id)
|
var key = localStorage.getItem('misskey_wss_' + acct_id)
|
||||||
var send = '{"type":"connect","body":{"channel":"' + typePs(type) + '","id":"' + tlid + '"}}'
|
var send =
|
||||||
|
'{"type":"connect","body":{"channel":"' +
|
||||||
|
typePs(type) +
|
||||||
|
'","id":"' +
|
||||||
|
tlid +
|
||||||
|
'"}}'
|
||||||
var mskyset = setInterval(function () {
|
var mskyset = setInterval(function () {
|
||||||
if (misskeywsstate[key]) {
|
if (misskeywsstate[key]) {
|
||||||
misskeyws[key].send(send)
|
misskeyws[key].send(send)
|
||||||
|
@ -209,12 +245,16 @@ function reload(type, cc, acct_id, tlid, data, mute, delc, voice, mode) {
|
||||||
} else if (type == 'pub') {
|
} else if (type == 'pub') {
|
||||||
var start = wss + '/api/v1/streaming/?stream=public&access_token=' + at
|
var start = wss + '/api/v1/streaming/?stream=public&access_token=' + at
|
||||||
} else if (type == 'pub-media') {
|
} else if (type == 'pub-media') {
|
||||||
var start = wss + '/api/v1/streaming/?stream=public:media&access_token=' + at
|
var start =
|
||||||
|
wss + '/api/v1/streaming/?stream=public:media&access_token=' + at
|
||||||
} else if (type == 'local') {
|
} else if (type == 'local') {
|
||||||
var start = wss + '/api/v1/streaming/?stream=public:local&access_token=' + at
|
var start =
|
||||||
|
wss + '/api/v1/streaming/?stream=public:local&access_token=' + at
|
||||||
} else if (type == 'local-media') {
|
} else if (type == 'local-media') {
|
||||||
var start =
|
var start =
|
||||||
wss + '/api/v1/streaming/?stream=public:local:media&only_media=true&access_token=' + at
|
wss +
|
||||||
|
'/api/v1/streaming/?stream=public:local:media&only_media=true&access_token=' +
|
||||||
|
at
|
||||||
} else if (type == 'tag') {
|
} else if (type == 'tag') {
|
||||||
if (type == 'tag') {
|
if (type == 'tag') {
|
||||||
var tag = localStorage.getItem('tag-range')
|
var tag = localStorage.getItem('tag-range')
|
||||||
|
@ -222,11 +262,21 @@ function reload(type, cc, acct_id, tlid, data, mute, delc, voice, mode) {
|
||||||
data = data + '&local=true'
|
data = data + '&local=true'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var start = wss + '/api/v1/streaming/?stream=hashtag&tag=' + data + '&access_token=' + at
|
var start =
|
||||||
|
wss +
|
||||||
|
'/api/v1/streaming/?stream=hashtag&tag=' +
|
||||||
|
data +
|
||||||
|
'&access_token=' +
|
||||||
|
at
|
||||||
} else if (type == 'noauth') {
|
} else if (type == 'noauth') {
|
||||||
var start = 'wss://' + acct_id + '/api/v1/streaming/?stream=public:local'
|
var start = 'wss://' + acct_id + '/api/v1/streaming/?stream=public:local'
|
||||||
} else if (type == 'list') {
|
} else if (type == 'list') {
|
||||||
var start = wss + '/api/v1/streaming/?stream=list&list=' + data + '&access_token=' + at
|
var start =
|
||||||
|
wss +
|
||||||
|
'/api/v1/streaming/?stream=list&list=' +
|
||||||
|
data +
|
||||||
|
'&access_token=' +
|
||||||
|
at
|
||||||
} else if (type == 'dm') {
|
} else if (type == 'dm') {
|
||||||
var start = wss + '/api/v1/streaming/?stream=direct&access_token=' + at
|
var start = wss + '/api/v1/streaming/?stream=direct&access_token=' + at
|
||||||
}
|
}
|
||||||
|
@ -238,7 +288,7 @@ function reload(type, cc, acct_id, tlid, data, mute, delc, voice, mode) {
|
||||||
tlid: tlid,
|
tlid: tlid,
|
||||||
type: 'Connect Streaming API' + type,
|
type: 'Connect Streaming API' + type,
|
||||||
domain: domain,
|
domain: domain,
|
||||||
message: [mess]
|
message: [mess],
|
||||||
})
|
})
|
||||||
errorct = 0
|
errorct = 0
|
||||||
$('#notice_icon_' + tlid).removeClass('red-text')
|
$('#notice_icon_' + tlid).removeClass('red-text')
|
||||||
|
@ -254,7 +304,7 @@ function reload(type, cc, acct_id, tlid, data, mute, delc, voice, mode) {
|
||||||
websocketNotf[acct_id].send(
|
websocketNotf[acct_id].send(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
type: 'capture',
|
type: 'capture',
|
||||||
id: obj.id
|
id: obj.id,
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
var templete = misskeyParse([obj], type, acct_id, tlid, '', mute)
|
var templete = misskeyParse([obj], type, acct_id, tlid, '', mute)
|
||||||
|
@ -273,26 +323,40 @@ function reload(type, cc, acct_id, tlid, data, mute, delc, voice, mode) {
|
||||||
if (typeA == 'delete') {
|
if (typeA == 'delete') {
|
||||||
var obj = JSON.parse(mess.data).payload
|
var obj = JSON.parse(mess.data).payload
|
||||||
if (delc == 'true') {
|
if (delc == 'true') {
|
||||||
$('#timeline_' + tlid + ' [unique-id=' + JSON.parse(mess.data).payload + ']').addClass(
|
$(
|
||||||
'emphasized'
|
'#timeline_' +
|
||||||
)
|
tlid +
|
||||||
$('#timeline_' + tlid + ' [unique-id=' + JSON.parse(mess.data).payload + ']').addClass(
|
' [unique-id=' +
|
||||||
'by_delcatch'
|
JSON.parse(mess.data).payload +
|
||||||
)
|
']'
|
||||||
|
).addClass('emphasized')
|
||||||
|
$(
|
||||||
|
'#timeline_' +
|
||||||
|
tlid +
|
||||||
|
' [unique-id=' +
|
||||||
|
JSON.parse(mess.data).payload +
|
||||||
|
']'
|
||||||
|
).addClass('by_delcatch')
|
||||||
} else {
|
} else {
|
||||||
$('[unique-id=' + JSON.parse(mess.data).payload + ']').hide()
|
$('[unique-id=' + JSON.parse(mess.data).payload + ']').hide()
|
||||||
$('[unique-id=' + JSON.parse(mess.data).payload + ']').remove()
|
$('[unique-id=' + JSON.parse(mess.data).payload + ']').remove()
|
||||||
}
|
}
|
||||||
} else if (typeA == 'update' || typeA == 'conversation') {
|
} else if (typeA == 'update' || typeA == 'conversation') {
|
||||||
if (!$('#unread_' + tlid + ' .material-icons').hasClass('teal-text')) {
|
if (
|
||||||
|
!$('#unread_' + tlid + ' .material-icons').hasClass('teal-text')
|
||||||
|
) {
|
||||||
//markers show中はダメ
|
//markers show中はダメ
|
||||||
var obj = JSON.parse(JSON.parse(mess.data).payload)
|
var obj = JSON.parse(JSON.parse(mess.data).payload)
|
||||||
if ($('#timeline_' + tlid + ' [toot-id=' + obj.id + ']').length < 1) {
|
if (
|
||||||
|
$('#timeline_' + tlid + ' [toot-id=' + obj.id + ']').length < 1
|
||||||
|
) {
|
||||||
if (voice) {
|
if (voice) {
|
||||||
say(obj.content)
|
say(obj.content)
|
||||||
}
|
}
|
||||||
var templete = parse([obj], type, acct_id, tlid, '', mute, type)
|
var templete = parse([obj], type, acct_id, tlid, '', mute, type)
|
||||||
if ($('timeline_box_' + tlid + '_box .tl-box').scrollTop() === 0) {
|
if (
|
||||||
|
$('timeline_box_' + tlid + '_box .tl-box').scrollTop() === 0
|
||||||
|
) {
|
||||||
$('#timeline_' + tlid).prepend(templete)
|
$('#timeline_' + tlid).prepend(templete)
|
||||||
} else {
|
} else {
|
||||||
var pool = localStorage.getItem('pool_' + tlid)
|
var pool = localStorage.getItem('pool_' + tlid)
|
||||||
|
@ -376,13 +440,17 @@ function moreload(type, tlid) {
|
||||||
if (sid && !moreloading) {
|
if (sid && !moreloading) {
|
||||||
if (
|
if (
|
||||||
type == 'mix' &&
|
type == 'mix' &&
|
||||||
localStorage.getItem('mode_' + localStorage.getItem('domain_' + acct_id)) != 'misskey'
|
localStorage.getItem(
|
||||||
|
'mode_' + localStorage.getItem('domain_' + acct_id)
|
||||||
|
) != 'misskey'
|
||||||
) {
|
) {
|
||||||
mixmore(tlid, 'integrated')
|
mixmore(tlid, 'integrated')
|
||||||
return
|
return
|
||||||
} else if (
|
} else if (
|
||||||
type == 'plus' &&
|
type == 'plus' &&
|
||||||
localStorage.getItem('mode_' + localStorage.getItem('domain_' + acct_id)) != 'misskey'
|
localStorage.getItem(
|
||||||
|
'mode_' + localStorage.getItem('domain_' + acct_id)
|
||||||
|
) != 'misskey'
|
||||||
) {
|
) {
|
||||||
mixmore(tlid, 'plus')
|
mixmore(tlid, 'plus')
|
||||||
return
|
return
|
||||||
|
@ -404,19 +472,19 @@ function moreload(type, tlid) {
|
||||||
var at = localStorage.getItem('acct_' + acct_id + '_at')
|
var at = localStorage.getItem('acct_' + acct_id + '_at')
|
||||||
var hdr = {
|
var hdr = {
|
||||||
'content-type': 'application/json',
|
'content-type': 'application/json',
|
||||||
Authorization: 'Bearer ' + at
|
Authorization: 'Bearer ' + at,
|
||||||
}
|
}
|
||||||
var domain = localStorage.getItem('domain_' + acct_id)
|
var domain = localStorage.getItem('domain_' + acct_id)
|
||||||
} else {
|
} else {
|
||||||
var hdr = {
|
var hdr = {
|
||||||
'content-type': 'application/json'
|
'content-type': 'application/json',
|
||||||
}
|
}
|
||||||
domain = acct_id
|
domain = acct_id
|
||||||
}
|
}
|
||||||
if (localStorage.getItem('mode_' + domain) == 'misskey') {
|
if (localStorage.getItem('mode_' + domain) == 'misskey') {
|
||||||
var misskey = true
|
var misskey = true
|
||||||
hdr = {
|
hdr = {
|
||||||
'content-type': 'application/json'
|
'content-type': 'application/json',
|
||||||
}
|
}
|
||||||
var url = misskeycom(type, data)
|
var url = misskeycom(type, data)
|
||||||
var start = 'https://' + domain + '/api/notes/' + url
|
var start = 'https://' + domain + '/api/notes/' + url
|
||||||
|
@ -439,18 +507,25 @@ function moreload(type, tlid) {
|
||||||
var i = {
|
var i = {
|
||||||
method: method,
|
method: method,
|
||||||
headers: hdr,
|
headers: hdr,
|
||||||
body: JSON.stringify(req)
|
body: JSON.stringify(req),
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
var misskey = false
|
var misskey = false
|
||||||
var start = 'https://' + domain + '/api/v1/timelines/' + com(type, data) + 'max_id=' + sid
|
var start =
|
||||||
|
'https://' +
|
||||||
|
domain +
|
||||||
|
'/api/v1/timelines/' +
|
||||||
|
com(type, data) +
|
||||||
|
'max_id=' +
|
||||||
|
sid
|
||||||
if (type == 'dm') {
|
if (type == 'dm') {
|
||||||
var start = 'https://' + domain + '/api/v1/conversations?' + 'max_id=' + sid
|
var start =
|
||||||
|
'https://' + domain + '/api/v1/conversations?' + 'max_id=' + sid
|
||||||
}
|
}
|
||||||
var method = 'GET'
|
var method = 'GET'
|
||||||
var i = {
|
var i = {
|
||||||
method: method,
|
method: method,
|
||||||
headers: hdr
|
headers: hdr,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fetch(start, i)
|
fetch(start, i)
|
||||||
|
@ -508,12 +583,16 @@ function tlDiff(type, data, acct_id, tlid, delc, voice, mode) {
|
||||||
if (sid && !moreloading) {
|
if (sid && !moreloading) {
|
||||||
if (
|
if (
|
||||||
type == 'mix' &&
|
type == 'mix' &&
|
||||||
localStorage.getItem('mode_' + localStorage.getItem('domain_' + acct_id)) != 'misskey'
|
localStorage.getItem(
|
||||||
|
'mode_' + localStorage.getItem('domain_' + acct_id)
|
||||||
|
) != 'misskey'
|
||||||
) {
|
) {
|
||||||
return
|
return
|
||||||
} else if (
|
} else if (
|
||||||
type == 'plus' &&
|
type == 'plus' &&
|
||||||
localStorage.getItem('mode_' + localStorage.getItem('domain_' + acct_id)) != 'misskey'
|
localStorage.getItem(
|
||||||
|
'mode_' + localStorage.getItem('domain_' + acct_id)
|
||||||
|
) != 'misskey'
|
||||||
) {
|
) {
|
||||||
return
|
return
|
||||||
} else if (type == 'notf') {
|
} else if (type == 'notf') {
|
||||||
|
@ -526,19 +605,19 @@ function tlDiff(type, data, acct_id, tlid, delc, voice, mode) {
|
||||||
var at = localStorage.getItem('acct_' + acct_id + '_at')
|
var at = localStorage.getItem('acct_' + acct_id + '_at')
|
||||||
var hdr = {
|
var hdr = {
|
||||||
'content-type': 'application/json',
|
'content-type': 'application/json',
|
||||||
Authorization: 'Bearer ' + at
|
Authorization: 'Bearer ' + at,
|
||||||
}
|
}
|
||||||
var domain = localStorage.getItem('domain_' + acct_id)
|
var domain = localStorage.getItem('domain_' + acct_id)
|
||||||
} else {
|
} else {
|
||||||
var hdr = {
|
var hdr = {
|
||||||
'content-type': 'application/json'
|
'content-type': 'application/json',
|
||||||
}
|
}
|
||||||
domain = acct_id
|
domain = acct_id
|
||||||
}
|
}
|
||||||
if (localStorage.getItem('mode_' + domain) == 'misskey') {
|
if (localStorage.getItem('mode_' + domain) == 'misskey') {
|
||||||
var misskey = true
|
var misskey = true
|
||||||
hdr = {
|
hdr = {
|
||||||
'content-type': 'application/json'
|
'content-type': 'application/json',
|
||||||
}
|
}
|
||||||
var url = misskeycom(type, data)
|
var url = misskeycom(type, data)
|
||||||
var start = 'https://' + domain + '/api/notes/' + url
|
var start = 'https://' + domain + '/api/notes/' + url
|
||||||
|
@ -561,18 +640,25 @@ function tlDiff(type, data, acct_id, tlid, delc, voice, mode) {
|
||||||
var i = {
|
var i = {
|
||||||
method: method,
|
method: method,
|
||||||
headers: hdr,
|
headers: hdr,
|
||||||
body: JSON.stringify(req)
|
body: JSON.stringify(req),
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
var misskey = false
|
var misskey = false
|
||||||
var start = 'https://' + domain + '/api/v1/timelines/' + com(type, data) + 'since_id=' + sid
|
var start =
|
||||||
|
'https://' +
|
||||||
|
domain +
|
||||||
|
'/api/v1/timelines/' +
|
||||||
|
com(type, data) +
|
||||||
|
'since_id=' +
|
||||||
|
sid
|
||||||
if (type == 'dm') {
|
if (type == 'dm') {
|
||||||
var start = 'https://' + domain + '/api/v1/conversations?' + 'since_id=' + sid
|
var start =
|
||||||
|
'https://' + domain + '/api/v1/conversations?' + 'since_id=' + sid
|
||||||
}
|
}
|
||||||
var method = 'GET'
|
var method = 'GET'
|
||||||
var i = {
|
var i = {
|
||||||
method: method,
|
method: method,
|
||||||
headers: hdr
|
headers: hdr,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -634,7 +720,10 @@ function tlCloser() {
|
||||||
Object.keys(wsLocal).forEach(function (tlid) {
|
Object.keys(wsLocal).forEach(function (tlid) {
|
||||||
if (wsLocal[tlid]) {
|
if (wsLocal[tlid]) {
|
||||||
wsLocal[tlid].close()
|
wsLocal[tlid].close()
|
||||||
console.log('%c Close Streaming API:Integrated Local' + tlid, 'color:blue')
|
console.log(
|
||||||
|
'%c Close Streaming API:Integrated Local' + tlid,
|
||||||
|
'color:blue'
|
||||||
|
)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
wsLocal = []
|
wsLocal = []
|
||||||
|
@ -674,7 +763,11 @@ function cap(type, data, acct_id) {
|
||||||
}
|
}
|
||||||
} else if (type == 'local-media') {
|
} else if (type == 'local-media') {
|
||||||
if (localStorage.getItem('local_' + acct_id) && !locale) {
|
if (localStorage.getItem('local_' + acct_id) && !locale) {
|
||||||
var response = localStorage.getItem('local_' + acct_id) + '(' + lang.lang_tl_media + ')'
|
var response =
|
||||||
|
localStorage.getItem('local_' + acct_id) +
|
||||||
|
'(' +
|
||||||
|
lang.lang_tl_media +
|
||||||
|
')'
|
||||||
} else {
|
} else {
|
||||||
var response = 'Local TL(Media)'
|
var response = 'Local TL(Media)'
|
||||||
}
|
}
|
||||||
|
@ -686,12 +779,22 @@ function cap(type, data, acct_id) {
|
||||||
}
|
}
|
||||||
} else if (type == 'pub-media') {
|
} else if (type == 'pub-media') {
|
||||||
if (localStorage.getItem('public_' + acct_id) && !locale) {
|
if (localStorage.getItem('public_' + acct_id) && !locale) {
|
||||||
var response = localStorage.getItem('public_' + acct_id) + '(' + lang.lang_tl_media + ')'
|
var response =
|
||||||
|
localStorage.getItem('public_' + acct_id) +
|
||||||
|
'(' +
|
||||||
|
lang.lang_tl_media +
|
||||||
|
')'
|
||||||
} else {
|
} else {
|
||||||
var response = 'Federated TL(Media)'
|
var response = 'Federated TL(Media)'
|
||||||
}
|
}
|
||||||
} else if (type == 'tag') {
|
} else if (type == 'tag') {
|
||||||
|
if (data) {
|
||||||
|
if (data.name) {
|
||||||
|
var response = '#' + escapeHTML(data.name)
|
||||||
|
} else {
|
||||||
var response = '#' + escapeHTML(data)
|
var response = '#' + escapeHTML(data)
|
||||||
|
}
|
||||||
|
}
|
||||||
} else if (type == 'list') {
|
} else if (type == 'list') {
|
||||||
var ltitle = localStorage.getItem('list_' + data + '_' + acct_id)
|
var ltitle = localStorage.getItem('list_' + data + '_' + acct_id)
|
||||||
var response = 'List(' + ltitle + ')'
|
var response = 'List(' + ltitle + ')'
|
||||||
|
@ -706,7 +809,11 @@ function cap(type, data, acct_id) {
|
||||||
} else if (type == 'dm') {
|
} else if (type == 'dm') {
|
||||||
var response = 'DM'
|
var response = 'DM'
|
||||||
} else if (type == 'mix') {
|
} else if (type == 'mix') {
|
||||||
if (localStorage.getItem('mode_' + localStorage.getItem('domain_' + acct_id)) == 'misskey') {
|
if (
|
||||||
|
localStorage.getItem(
|
||||||
|
'mode_' + localStorage.getItem('domain_' + acct_id)
|
||||||
|
) == 'misskey'
|
||||||
|
) {
|
||||||
var response = 'Social TL'
|
var response = 'Social TL'
|
||||||
} else {
|
} else {
|
||||||
var response = 'Integrated'
|
var response = 'Integrated'
|
||||||
|
@ -736,7 +843,21 @@ function com(type, data) {
|
||||||
} else if (type == 'pub-media') {
|
} else if (type == 'pub-media') {
|
||||||
return 'public?only_media=true&'
|
return 'public?only_media=true&'
|
||||||
} else if (type == 'tag') {
|
} else if (type == 'tag') {
|
||||||
return 'tag/' + data + '?'
|
if (data.name) {
|
||||||
|
var name = data.name
|
||||||
|
var all = data.all
|
||||||
|
var any = data.any
|
||||||
|
var none = data.none
|
||||||
|
} else {
|
||||||
|
var name = data
|
||||||
|
var all = ''
|
||||||
|
var any = ''
|
||||||
|
var none = ''
|
||||||
|
}
|
||||||
|
return `tag/${name}?${buildQuery('all', all)}${buildQuery(
|
||||||
|
'any',
|
||||||
|
any
|
||||||
|
)}${buildQuery('none', none)}`.slice(0, -1)
|
||||||
} else if (type == 'list') {
|
} else if (type == 'list') {
|
||||||
return 'list/' + data + '?'
|
return 'list/' + data + '?'
|
||||||
} else if (type == 'dm') {
|
} else if (type == 'dm') {
|
||||||
|
@ -897,8 +1018,8 @@ function getMarker(tlid, type, acct_id) {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
'content-type': 'application/json',
|
'content-type': 'application/json',
|
||||||
Authorization: 'Bearer ' + at
|
Authorization: 'Bearer ' + at,
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
.then(function (response) {
|
.then(function (response) {
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
|
@ -909,7 +1030,10 @@ function getMarker(tlid, type, acct_id) {
|
||||||
return response.json()
|
return response.json()
|
||||||
})
|
})
|
||||||
.catch(function (error) {
|
.catch(function (error) {
|
||||||
$('#unread_' + tlid).attr('title', lang.lang_layout_unread + ':' + lang.lang_nothing)
|
$('#unread_' + tlid).attr(
|
||||||
|
'title',
|
||||||
|
lang.lang_layout_unread + ':' + lang.lang_nothing
|
||||||
|
)
|
||||||
$('#unread_' + tlid).attr('data-id', '')
|
$('#unread_' + tlid).attr('data-id', '')
|
||||||
return false
|
return false
|
||||||
})
|
})
|
||||||
|
@ -919,15 +1043,25 @@ function getMarker(tlid, type, acct_id) {
|
||||||
json = json[add]
|
json = json[add]
|
||||||
$('#unread_' + tlid).attr(
|
$('#unread_' + tlid).attr(
|
||||||
'title',
|
'title',
|
||||||
lang.lang_layout_unread + ':' + json.updated_at + ' v' + json.version
|
lang.lang_layout_unread +
|
||||||
|
':' +
|
||||||
|
json.updated_at +
|
||||||
|
' v' +
|
||||||
|
json.version
|
||||||
)
|
)
|
||||||
$('#unread_' + tlid).attr('data-id', json.last_read_id)
|
$('#unread_' + tlid).attr('data-id', json.last_read_id)
|
||||||
} else {
|
} else {
|
||||||
$('#unread_' + tlid).attr('title', lang.lang_layout_unread + ':' + lang.lang_nothing)
|
$('#unread_' + tlid).attr(
|
||||||
|
'title',
|
||||||
|
lang.lang_layout_unread + ':' + lang.lang_nothing
|
||||||
|
)
|
||||||
$('#unread_' + tlid).attr('data-id', '')
|
$('#unread_' + tlid).attr('data-id', '')
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$('#unread_' + tlid).attr('title', lang.lang_layout_unread + ':' + lang.lang_nothing)
|
$('#unread_' + tlid).attr(
|
||||||
|
'title',
|
||||||
|
lang.lang_layout_unread + ':' + lang.lang_nothing
|
||||||
|
)
|
||||||
$('#unread_' + tlid).attr('data-id', '')
|
$('#unread_' + tlid).attr('data-id', '')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -951,8 +1085,8 @@ function showUnread(tlid, type, acct_id) {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
'content-type': 'application/json',
|
'content-type': 'application/json',
|
||||||
Authorization: 'Bearer ' + at
|
Authorization: 'Bearer ' + at,
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
.then(function (response) {
|
.then(function (response) {
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
|
@ -1007,8 +1141,8 @@ function ueload(tlid) {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
'content-type': 'application/json',
|
'content-type': 'application/json',
|
||||||
Authorization: 'Bearer ' + at
|
Authorization: 'Bearer ' + at,
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
.then(function (response) {
|
.then(function (response) {
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
|
@ -1062,15 +1196,15 @@ function asRead(callback) {
|
||||||
var id = $('#timeline_' + i + ' .cvo:eq(0)').attr('unique-id')
|
var id = $('#timeline_' + i + ' .cvo:eq(0)').attr('unique-id')
|
||||||
var poster = {
|
var poster = {
|
||||||
home: {
|
home: {
|
||||||
last_read_id: id
|
last_read_id: id,
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
var id = $('#timeline_' + i + ' .cvo:eq(0)').attr('data-notf')
|
var id = $('#timeline_' + i + ' .cvo:eq(0)').attr('data-notf')
|
||||||
var poster = {
|
var poster = {
|
||||||
notifications: {
|
notifications: {
|
||||||
last_read_id: id
|
last_read_id: id,
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1117,8 +1251,8 @@ function asReadEnd() {
|
||||||
onBeforeOpen: () => {
|
onBeforeOpen: () => {
|
||||||
Swal.showLoading()
|
Swal.showLoading()
|
||||||
},
|
},
|
||||||
onClose: () => {}
|
onClose: () => {},
|
||||||
}).then(result => {})
|
}).then((result) => {})
|
||||||
} else {
|
} else {
|
||||||
postMessage(['asReadComp', ''], '*')
|
postMessage(['asReadComp', ''], '*')
|
||||||
}
|
}
|
||||||
|
@ -1159,7 +1293,11 @@ function getBookmark(acct_id, tlid, more) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var templete = parse(json, 'bookmark', acct_id, tlid, -1, null)
|
var templete = parse(json, 'bookmark', acct_id, tlid, -1, null)
|
||||||
templete = templete + '<div class="hide notif-marker" data-maxid="' + max_id + '"></div>'
|
templete =
|
||||||
|
templete +
|
||||||
|
'<div class="hide notif-marker" data-maxid="' +
|
||||||
|
max_id +
|
||||||
|
'"></div>'
|
||||||
if (more) {
|
if (more) {
|
||||||
$('#timeline_' + tlid).append(templete)
|
$('#timeline_' + tlid).append(templete)
|
||||||
} else {
|
} else {
|
||||||
|
@ -1211,3 +1349,13 @@ function announ(acct_id, tlid) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//buildQuery
|
||||||
|
function buildQuery(name, data) {
|
||||||
|
if(!data || data == '') return ''
|
||||||
|
var arr = data.split(',')
|
||||||
|
var str = ''
|
||||||
|
for (var i = 0; i < arr.length; i++) {
|
||||||
|
str = str + `${name}[]=${arr[i]}&`
|
||||||
|
}
|
||||||
|
return str
|
||||||
|
}
|
||||||
|
|
|
@ -292,16 +292,33 @@ function parseColumn(target, dontclose) {
|
||||||
${lang.lang_layout_excludingbt}
|
${lang.lang_layout_excludingbt}
|
||||||
<br>`
|
<br>`
|
||||||
} else if (acct.type == 'tag') {
|
} else if (acct.type == 'tag') {
|
||||||
|
if(acct.data.name) {
|
||||||
|
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 = ''
|
||||||
|
}
|
||||||
if_tag = `<div class="column-hide notf-indv-box" id="tag-box_${key}" style="padding:5px;">
|
if_tag = `<div class="column-hide notf-indv-box" id="tag-box_${key}" style="padding:5px;">
|
||||||
Base: ${acct.data}<br>
|
Base: ${name}<br>
|
||||||
<div id="tagManager-${key}"></div>
|
<div id="tagManager-${key}">
|
||||||
<button onclick="addTag('${key}')" class="btn waves-effect" style="width: 100%">Add</button>
|
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>
|
||||||
</div>`
|
</div>`
|
||||||
if_tag_btn = `<a onclick="setToggleTag('${key}')" class="setting nex"
|
if_tag_btn = `<a onclick="setToggleTag('${key}')" class="setting nex"
|
||||||
title="${lang.lang_layout_tagManager}" style="width:30px">
|
title="${lang.lang_layout_tagManager}" style="width:30px">
|
||||||
<i class="material-icons waves-effect nex">note_add</i>
|
<i class="material-icons waves-effect nex">note_add</i>
|
||||||
</a>`
|
</a>`
|
||||||
unread = ''
|
unread = ''
|
||||||
|
var exclude = ''
|
||||||
|
var if_notf = 'hide'
|
||||||
} else {
|
} else {
|
||||||
var exclude = ''
|
var exclude = ''
|
||||||
unread = ''
|
unread = ''
|
||||||
|
|
|
@ -1531,6 +1531,10 @@
|
||||||
<input type="checkbox" class="filled-in" id="conv_filter" value="thread" />
|
<input type="checkbox" class="filled-in" id="conv_filter" value="thread" />
|
||||||
<span>@@conver@@</span>
|
<span>@@conver@@</span>
|
||||||
</label>
|
</label>
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" class="filled-in" id="prof_filter" value="profiles" />
|
||||||
|
<span>@@prof@@</span>
|
||||||
|
</label><br />
|
||||||
@@option@@<br />
|
@@option@@<br />
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" class="filled-in" id="wholeword_filter" value="1" />
|
<input type="checkbox" class="filled-in" id="wholeword_filter" value="1" />
|
||||||
|
|
|
@ -140,6 +140,7 @@
|
||||||
"filterWord":"Filtering words",
|
"filterWord":"Filtering words",
|
||||||
"degree":"Filter contexts",
|
"degree":"Filter contexts",
|
||||||
"conver":"Conversations",
|
"conver":"Conversations",
|
||||||
|
"prof":"Profiles",
|
||||||
"option":"Options",
|
"option":"Options",
|
||||||
"matchWord":"Whole word",
|
"matchWord":"Whole word",
|
||||||
"warnMatchWord":"Nice for Latin language",
|
"warnMatchWord":"Nice for Latin language",
|
||||||
|
|
|
@ -138,6 +138,7 @@
|
||||||
"listLocale":"一覧",
|
"listLocale":"一覧",
|
||||||
"degree":"適応範囲",
|
"degree":"適応範囲",
|
||||||
"conver":"会話",
|
"conver":"会話",
|
||||||
|
"prof":"プロフィール",
|
||||||
"option":"オプション",
|
"option":"オプション",
|
||||||
"matchWord":"単語マッチ",
|
"matchWord":"単語マッチ",
|
||||||
"warnMatchWord":"非ラテン系の文字列では「単語マッチ」はせん方がええで。(これはフリかも知れん)",
|
"warnMatchWord":"非ラテン系の文字列では「単語マッチ」はせん方がええで。(これはフリかも知れん)",
|
||||||
|
|
|
@ -140,6 +140,7 @@
|
||||||
"listLocale":"一覧",
|
"listLocale":"一覧",
|
||||||
"degree":"適応範囲",
|
"degree":"適応範囲",
|
||||||
"conver":"会話",
|
"conver":"会話",
|
||||||
|
"prof":"プロフィール",
|
||||||
"option":"オプション",
|
"option":"オプション",
|
||||||
"matchWord":"単語マッチ",
|
"matchWord":"単語マッチ",
|
||||||
"warnMatchWord":"非ラテン系の文字列では「単語マッチ」は推奨されません。",
|
"warnMatchWord":"非ラテン系の文字列では「単語マッチ」は推奨されません。",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user