Fix: Improve: Integrated TL

This commit is contained in:
cutls 2019-11-09 02:05:15 +09:00
parent 083139efa7
commit ef9b851309
10 changed files with 453 additions and 568 deletions

View File

@ -153,11 +153,7 @@ function replyTL(id, acct_id) {
console.error(error) console.error(error)
}) })
.then(function(json) { .then(function(json) {
if (localStorage.getItem('filter_' + acct_id) != 'undefined') { var mute = getFilterTypeByAcct(acct_id, 'thread')
var mute = getFilterType(JSON.parse(localStorage.getItem('filter_' + acct_id)), 'thread')
} else {
var mute = []
}
if (localStorage.getItem('mode_' + domain) == 'misskey') { if (localStorage.getItem('mode_' + domain) == 'misskey') {
var templete = misskeyParse([json], '', acct_id, '', '', mute) var templete = misskeyParse([json], '', acct_id, '', '', mute)
$('#toot-after').prepend(templete) $('#toot-after').prepend(templete)
@ -222,11 +218,7 @@ function getContext(id, acct_id) {
$('#toot-reply .by_filter').removeClass('hide') $('#toot-reply .by_filter').removeClass('hide')
jQuery('time.timeago').timeago() jQuery('time.timeago').timeago()
} else { } else {
if (localStorage.getItem('filter_' + acct_id) != 'undefined') { var mute = getFilterTypeByAcct(acct_id, 'thread')
var mute = getFilterType(JSON.parse(localStorage.getItem('filter_' + acct_id)), 'thread')
} else {
var mute = []
}
var templete = parse(json.descendants, '', acct_id, '', '', mute) var templete = parse(json.descendants, '', acct_id, '', '', mute)
if (templete != '') { if (templete != '') {
$('#toot-after .no-data').hide() $('#toot-after .no-data').hide()

View File

@ -369,12 +369,25 @@ function getFilterType(json, type) {
Object.keys(json).forEach(function(key) { Object.keys(json).forEach(function(key) {
var filterword = json[key] var filterword = json[key]
var phrases = filterword.phrase var phrases = filterword.phrase
if (filterword.context.join(',').indexOf(type) !== -1) { var arr = filterword.context
if (arr.join(',').indexOf(type) !== -1) {
mutedfilters.push(phrases) mutedfilters.push(phrases)
} else if (type == 'mix'){
if (arr.indexOf('home') !== -1 || arr.indexOf('public') !== -1) {
mutedfilters.push(phrases)
}
} }
}) })
return mutedfilters return mutedfilters
} }
function getFilterTypeByAcct(acct_id, type) {
if (localStorage.getItem('filter_' + acct_id) != 'undefined') {
var mute = getFilterType(JSON.parse(localStorage.getItem('filter_' + acct_id)), type)
} else {
var mute = []
}
return mute
}
function filterUpdate(acct_id) { function filterUpdate(acct_id) {
var domain = localStorage.getItem('domain_' + acct_id) var domain = localStorage.getItem('domain_' + acct_id)
var at = localStorage.getItem('acct_' + acct_id + '_at') var at = localStorage.getItem('acct_' + acct_id + '_at')

View File

@ -1,100 +1,48 @@
//Integrated TL //Integrated TL
function mixtl(acct_id, tlid, type, delc, voice) { async function mixtl(acct_id, tlid, type, delc, voice) {
localStorage.removeItem('morelock')
localStorage.setItem('now', type) localStorage.setItem('now', type)
todo('Integrated TL Loading...(Local)') todo('Integrated TL Loading...(Local)')
//まずLocal const domain = localStorage.getItem('domain_' + acct_id)
var domain = localStorage.getItem('domain_' + acct_id) let startLocal = 'https://' + domain + '/api/v1/timelines/public?local=true'
var at = localStorage.getItem('acct_' + acct_id + '_at') let local = await getTL(startLocal, acct_id)
var start = 'https://' + domain + '/api/v1/timelines/public?local=true' let startHome = 'https://' + domain + '/api/v1/timelines/home'
fetch(start, { let home = await getTL(startHome, acct_id)
method: 'GET', let concated = _.concat(local, home)
headers: { let uniqued = _.uniqBy(concated, 'id')
'content-type': 'application/json', let sorted = _.orderBy(uniqued, ['id'], ['desc'])
Authorization: 'Bearer ' + at let integrated = _.slice(sorted, 0, 19)
}
})
.then(function(response) {
if (!response.ok) {
response.text().then(function(text) {
setLog(response.url, response.status, text)
})
}
return response.json()
})
.catch(function(error) {
todo(error)
setLog(start, 'JSON', error)
console.error(error)
})
.then(function(jsonL) {
var start = 'https://' + domain + '/api/v1/timelines/home'
fetch(start, {
method: 'GET',
headers: {
'content-type': 'application/json',
Authorization: 'Bearer ' + at
}
})
.then(function(response) {
if (!response.ok) {
response.text().then(function(text) {
setLog(response.url, response.status, text)
})
}
return response.json()
})
.catch(function(error) {
todo(error)
setLog(start, 'JSON', error)
console.error(error)
})
.then(function(jsonH) {
var homearr = []
var timeline = jsonL.concat(jsonH)
timeline.sort(function(a, b) {
if (date(a.created_at, 'unix') >= date(b.created_at, 'unix')) return -1
if (date(a.created_at, 'unix') < date(b.created_at, 'unix')) return 1
return 0
})
if (type == 'integrated') {
timeline.splice(20)
}
var templete = ''
if (localStorage.getItem('filter_' + acct_id) != 'undefined') {
var mute = getFilterType(JSON.parse(localStorage.getItem('filter_' + acct_id)), 'mix')
} else {
var mute = []
}
Object.keys(timeline).forEach(function(key) {
var pkey = key * 1 + 1
if (pkey < timeline.length) {
if (
date(timeline[key].created_at, 'unix') != date(timeline[pkey].created_at, 'unix')
) {
if (type == 'integrated') {
templete = templete + parse([timeline[key]], '', acct_id, tlid, '', mute, 'mix')
} else if (type == 'plus') {
if (timeline[key].account.acct == timeline[key].account.username) {
templete =
templete + parse([timeline[key]], '', acct_id, tlid, '', mute, 'plus')
}
}
}
}
})
$('#landing_' + tlid).hide() $('#landing_' + tlid).hide()
let mute = getFilterTypeByAcct(acct_id, 'mix')
let templete = parse(integrated, type, acct_id, tlid, '', mute, type)
localStorage.setItem('lastobj_' + tlid, integrated[0].id)
$('#timeline_' + tlid).html(templete) $('#timeline_' + tlid).html(templete)
mixre(acct_id, tlid, type, mute, delc, voice)
additional(acct_id, tlid) additional(acct_id, tlid)
jQuery('time.timeago').timeago() jQuery('time.timeago').timeago()
todc() todc()
mixre(acct_id, tlid, 'mix', mute, voice, '')
$(window).scrollTop(0)
lastId = integrated[0].id
beforeLastId = integrated[1].id
}
async function getTL(start, acct_id) {
const at = localStorage.getItem('acct_' + acct_id + '_at')
let promise = await fetch(start, {
method: 'GET',
headers: {
'content-type': 'application/json',
Authorization: 'Bearer ' + at
}
}) })
if (!promise.ok) {
promise.text().then(function(text) {
setLog(promise.url, promise.status, text)
}) })
} }
return await promise.json()
}
//Streamingに接続 //Streamingに接続
function mixre(acct_id, tlid, TLtype, mute, delc, voice, mode) { function mixre(acct_id, tlid, TLtype, mute, voice, mode) {
var domain = localStorage.getItem('domain_' + acct_id) var domain = localStorage.getItem('domain_' + acct_id)
var at = localStorage.getItem('acct_' + acct_id + '_at') var at = localStorage.getItem('acct_' + acct_id + '_at')
if (localStorage.getItem('streaming_' + acct_id)) { if (localStorage.getItem('streaming_' + acct_id)) {
@ -104,11 +52,11 @@ function mixre(acct_id, tlid, TLtype, mute, delc, voice, mode) {
} }
var startHome = wss + '/api/v1/streaming/?stream=user&access_token=' + at var startHome = wss + '/api/v1/streaming/?stream=user&access_token=' + at
var startLocal = wss + '/api/v1/streaming/?stream=public:local&access_token=' + at var startLocal = wss + '/api/v1/streaming/?stream=public:local&access_token=' + at
var wshid = websocketHome.length var wshid = wsHome.length
var wslid = websocketLocal.length var wslid = wsLocal.length
websocketHome[wshid] = new WebSocket(startHome) wsHome[wshid] = new WebSocket(startHome)
websocketLocal[wslid] = new WebSocket(startLocal) wsLocal[wslid] = new WebSocket(startLocal)
websocketHome[wshid].onopen = function(mess) { wsHome[wshid].onopen = function(mess) {
localStorage.setItem('wssH_' + tlid, wshid) localStorage.setItem('wssH_' + tlid, wshid)
console.table({ console.table({
tlid: tlid, tlid: tlid,
@ -118,7 +66,7 @@ function mixre(acct_id, tlid, TLtype, mute, delc, voice, mode) {
}) })
$('#notice_icon_' + tlid).removeClass('red-text') $('#notice_icon_' + tlid).removeClass('red-text')
} }
websocketLocal[wslid].onopen = function(mess) { wsLocal[wslid].onopen = function(mess) {
localStorage.setItem('wssL_' + tlid, wslid) localStorage.setItem('wssL_' + tlid, wslid)
console.table({ console.table({
tlid: tlid, tlid: tlid,
@ -128,98 +76,15 @@ function mixre(acct_id, tlid, TLtype, mute, delc, voice, mode) {
}) })
$('#notice_icon_' + tlid).removeClass('red-text') $('#notice_icon_' + tlid).removeClass('red-text')
} }
websocketLocal[wslid].onmessage = function(mess) { wsLocal[wslid].onmessage = function(mess) {
console.log(['Receive Streaming API:(Integrated:Local)', obj]) console.log('Receive Streaming API:(Integrated:Local)', mess)
integratedMessage(mess, acct_id, tlid, mute, voice)
var obj = JSON.parse(JSON.parse(mess.data).payload)
var type = JSON.parse(mess.data).event
if (type == 'delete') {
if (delc == 'true') {
$('#timeline_' + tlid + ' [toot-id=' + JSON.parse(mess.data).payload + ']').addClass(
'emphasized'
)
$('#timeline_' + tlid + ' [toot-id=' + JSON.parse(mess.data).payload + ']').addClass(
'by_delcatch'
)
} else {
$('[toot-id=' + JSON.parse(mess.data).payload + ']').hide()
$('[toot-id=' + JSON.parse(mess.data).payload + ']').remove()
} }
} else if (type == 'update') { wsHome[wshid].onmessage = function(mess) {
var templete = parse([obj], '', acct_id, tlid, '', mute) console.log(['Receive Streaming API:(Integrated:Home)', mess])
if ($('#timeline_' + tlid + ' [toot-id=' + obj.id + ']').length < 1) { integratedMessage(mess, acct_id, tlid, mute, voice)
if (voice) {
say(obj.content)
} }
var templete = parse([obj], type, acct_id, tlid, '', mute, 'mix') wsLocal[wslid].onerror = function(error) {
var pool = localStorage.getItem('pool_' + tlid)
if (pool) {
pool = templete + pool
} else {
pool = templete
}
localStorage.setItem('pool_' + tlid, pool)
scrollck()
additional(acct_id, tlid)
jQuery('time.timeago').timeago()
} else {
todo('二重取得発生中')
}
}
}
websocketHome[wshid].onmessage = function(mess) {
console.log(['Receive Streaming API:(Integrated:Home)', obj])
var obj = JSON.parse(JSON.parse(mess.data).payload)
var type = JSON.parse(mess.data).event
if (type == 'delete') {
if (del > 10) {
reconnector(tlid, type, acct_id, data)
} else {
localStorage.setItem('delete', del * 1 + 1)
}
if (delc == 'true') {
$('[toot-id=' + JSON.parse(mess.data).payload + ']').addClass('emphasized')
$('[toot-id=' + JSON.parse(mess.data).payload + ']').addClass('by_delcatch')
} else {
$('[toot-id=' + JSON.parse(mess.data).payload + ']').hide()
$('[toot-id=' + JSON.parse(mess.data).payload + ']').remove()
}
} else if (type == 'update') {
localStorage.removeItem('delete')
if (TLtype == 'integrated') {
var templete = parse([obj], '', acct_id, tlid)
} else if (TLtype == 'plus') {
if (obj.account.acct == obj.account.username) {
var templete = parse([obj], '', acct_id, tlid, '', mute, 'mix')
} else {
var templete = ''
}
}
if ($('#timeline_' + tlid + ' [toot-id=' + obj.id + ']').length < 1) {
if (voice) {
say(obj.content)
}
var templete = parse([obj], type, acct_id, tlid, '', mute, 'mix')
var pool = localStorage.getItem('pool_' + tlid)
if (pool) {
pool = templete + pool
} else {
pool = templete
}
localStorage.setItem('pool_' + tlid, pool)
scrollck()
additional(acct_id, tlid)
jQuery('time.timeago').timeago()
} else {
todo('二重取得発生中')
}
}
}
websocketLocal[wslid].onerror = function(error) {
console.error('WebSocketLocal Error') console.error('WebSocketLocal Error')
console.error(error) console.error(error)
if (mode == 'error') { if (mode == 'error') {
@ -233,7 +98,7 @@ function mixre(acct_id, tlid, TLtype, mute, delc, voice, mode) {
} }
} }
} }
websocketLocal[wslid].onclose = function() { wsLocal[wslid].onclose = function() {
console.warn('WebSocketLocal Closing:' + tlid) console.warn('WebSocketLocal Closing:' + tlid)
if (mode == 'error') { if (mode == 'error') {
$('#notice_icon_' + tlid).addClass('red-text') $('#notice_icon_' + tlid).addClass('red-text')
@ -246,7 +111,7 @@ function mixre(acct_id, tlid, TLtype, mute, delc, voice, mode) {
} }
} }
} }
websocketHome[wshid].onerror = function(error) { wsHome[wshid].onerror = function(error) {
console.error(['WebSocketHome Error', error]) console.error(['WebSocketHome Error', error])
if (mode == 'error') { if (mode == 'error') {
$('#notice_icon_' + tlid).addClass('red-text') $('#notice_icon_' + tlid).addClass('red-text')
@ -259,7 +124,7 @@ function mixre(acct_id, tlid, TLtype, mute, delc, voice, mode) {
} }
} }
} }
websocketHome[wshid].onclose = function() { wsHome[wshid].onclose = function() {
console.warn('WebSocketHome Closing:' + tlid) console.warn('WebSocketHome Closing:' + tlid)
if (mode == 'error') { if (mode == 'error') {
$('#notice_icon_' + tlid).addClass('red-text') $('#notice_icon_' + tlid).addClass('red-text')
@ -273,103 +138,64 @@ function mixre(acct_id, tlid, TLtype, mute, delc, voice, mode) {
} }
} }
} }
function integratedMessage(mess, acct_id, tlid, mute, voice) {
let data = JSON.parse(mess.data)
let type = data.event
let payload = data.payload
if (type == 'delete') {
$('[unique-id=' + payload + ']').hide()
$('[unique-id=' + payload + ']').remove()
} else if (type == 'update') {
let obj = JSON.parse(payload)
if (obj.id != lastId && obj.id != beforeLastId) {
lastId = obj.id
beforeLastId = obj.id
let dom = parse([obj], '', acct_id, tlid, '', mute)
if (voice) say(obj.content)
if ($('timeline_box_' + tlid + '_box .tl-box').scrollTop() === 0) {
$('#timeline_' + tlid).prepend(dom)
} else {
let pool = localStorage.getItem('pool_' + tlid)
if (pool) {
pool = dom + pool
} else {
pool = dom
}
localStorage.setItem('pool_' + tlid, pool)
}
scrollck()
additional(acct_id, tlid)
jQuery('time.timeago').timeago()
}
}
}
//ある程度のスクロールで発火 //ある程度のスクロールで発火
function mixmore(tlid, type) { async function mixmore(tlid, type) {
var multi = localStorage.getItem('column') var multi = localStorage.getItem('column')
var obj = JSON.parse(multi) var obj = JSON.parse(multi)
var acct_id = obj[tlid].domain var acct_id = obj[tlid].domain
moreloading = true moreloading = true
todo('Integrated TL MoreLoading...(Local)') todo('Integrated TL MoreLoading...(Local)')
var domain = localStorage.getItem('domain_' + acct_id) const domain = localStorage.getItem('domain_' + acct_id)
var at = localStorage.getItem('acct_' + acct_id + '_at') const sid = $('#timeline_' + tlid + ' .cvo')
var sid = $('#timeline_' + tlid + ' .cvo')
.last() .last()
.attr('unique-id') .attr('unique-id')
let startLocal = 'https://' + domain + '/api/v1/timelines/public?local=true&max_id=' + sid
var start = 'https://' + domain + '/api/v1/timelines/public?local=true&max_id=' + sid let local = await getTL(startLocal, acct_id)
fetch(start, { let startHome = 'https://' + domain + '/api/v1/timelines/home&max_id=' + sid
method: 'GET', let home = await getTL(startHome, acct_id)
headers: { let concated = _.concat(local, home)
'content-type': 'application/json', let uniqued = _.uniqBy(concated, 'id')
Authorization: 'Bearer ' + at let sorted = _.orderBy(uniqued, ['id'], ['desc'])
} let integrated = _.slice(sorted, 0, 19)
}) $('#landing_' + tlid).hide()
.then(function(response) { let mute = getFilterTypeByAcct(acct_id, 'mix')
if (!response.ok) { let templete = parse(integrated, type, acct_id, tlid, '', mute, type)
response.text().then(function(text) { localStorage.setItem('lastobj_' + tlid, integrated[0].id)
setLog(response.url, response.status, text)
})
}
return response.json()
})
.catch(function(error) {
todo(error)
setLog(start, 'JSON', error)
console.error(error)
})
.then(function(jsonL) {
var start = 'https://' + domain + '/api/v1/timelines/home?max_id=' + sid
fetch(start, {
method: 'GET',
headers: {
'content-type': 'application/json',
Authorization: 'Bearer ' + at
}
})
.then(function(response) {
if (!response.ok) {
response.text().then(function(text) {
setLog(response.url, response.status, text)
})
}
return response.json()
})
.catch(function(error) {
todo(error)
setLog(start, 'JSON', error)
console.error(error)
})
.then(function(jsonH) {
var homearr = []
var timeline = jsonL.concat(jsonH)
timeline.sort(function(a, b) {
if (date(a.created_at, 'unix') > date(b.created_at, 'unix')) return -1
if (date(a.created_at, 'unix') < date(b.created_at, 'unix')) return 1
return 0
})
timeline.splice(20)
var templete = ''
Object.keys(timeline).forEach(function(key) {
var pkey = key * 1 + 1
if (pkey < 20) {
if (
date(timeline[key].created_at, 'unix') != date(timeline[pkey].created_at, 'unix')
) {
if (localStorage.getItem('filter_' + acct_id) != 'undefined') {
var mute = getFilterType(
JSON.parse(localStorage.getItem('filter_' + acct_id)),
'mix'
)
} else {
var mute = []
}
if (type == 'integrated') {
templete = templete + parse([timeline[key]], '', acct_id, tlid, '', mute, 'mix')
} else if (type == 'plus') {
if (timeline[key].account.acct == timeline[key].account.username) {
templete = templete + parse([timeline[key]], '', acct_id, tlid, '', mute, 'mix')
}
}
}
}
})
$('#timeline_' + tlid).append(templete) $('#timeline_' + tlid).append(templete)
additional(acct_id, tlid) additional(acct_id, tlid)
jQuery('time.timeago').timeago() jQuery('time.timeago').timeago()
moreloading = false moreloading = false
todc() todc()
})
})
} }

View File

@ -68,11 +68,7 @@ function notfColumn(acct_id, tlid, sys) {
} }
var n = new Notification('TheDesk:' + domain, options) var n = new Notification('TheDesk:' + domain, options)
} }
if (localStorage.getItem('filter_' + acct_id) != 'undefined') { var mute = getFilterTypeByAcct(acct_id, 'notif')
var mute = getFilterType(JSON.parse(localStorage.getItem('filter_' + acct_id)), 'notif')
} else {
var mute = []
}
if (obj.type != 'follow') { if (obj.type != 'follow') {
if (misskey) { if (misskey) {
templete = templete + misskeyParse([obj], 'notf', acct_id, tlid, -1, mute) templete = templete + misskeyParse([obj], 'notf', acct_id, tlid, -1, mute)
@ -182,11 +178,7 @@ function notfCommon(acct_id, tlid, sys) {
} }
var n = new Notification('TheDesk:' + domain, options) var n = new Notification('TheDesk:' + domain, options)
} }
if (localStorage.getItem('filter_' + acct_id) != 'undefined') { var mute = getFilterTypeByAcct(acct_id, 'notif')
var mute = getFilterType(JSON.parse(localStorage.getItem('filter_' + acct_id)), 'notif')
} else {
var mute = []
}
if (obj.type != 'follow') { if (obj.type != 'follow') {
if (misskey) { if (misskey) {
templete = templete + misskeyParse([obj], 'notf', acct_id, 'notf', -1, mute) templete = templete + misskeyParse([obj], 'notf', acct_id, 'notf', -1, mute)
@ -335,14 +327,7 @@ function notfmore(tlid) {
localStorage.setItem('lastnotf_' + acct_id, json[0].id) localStorage.setItem('lastnotf_' + acct_id, json[0].id)
Object.keys(json).forEach(function(key) { Object.keys(json).forEach(function(key) {
var obj = json[key] var obj = json[key]
if (localStorage.getItem('filter_' + acct_id) != 'undefined') { var mute = getFilterTypeByAcct(acct_id, 'notif')
var mute = getFilterType(
JSON.parse(localStorage.getItem('filter_' + acct_id)),
'notif'
)
} else {
var mute = []
}
if (obj.type != 'follow') { if (obj.type != 'follow') {
if (misskey) { if (misskey) {
templete = templete + misskeyParse([obj], 'notf', acct_id, 'notf', -1, mute) templete = templete + misskeyParse([obj], 'notf', acct_id, 'notf', -1, mute)

View File

@ -1,280 +1,375 @@
//Integrated TL //Integrated TL
function mixtl(acct_id, tlid) { function mixtl(acct_id, tlid, type, delc, voice) {
var type = "mix"; localStorage.removeItem('morelock')
localStorage.removeItem("morelock"); localStorage.setItem('now', type)
localStorage.setItem("now", type); todo('Integrated TL Loading...(Local)')
todo("Integrated TL Loading...(Local)");
var domain = localStorage.getItem("domain_" + acct_id);
var at = localStorage.getItem("acct_" + acct_id + "_at");
//まずLocal //まずLocal
var start = "https://" + domain + "/api/v1/timelines/public?local=true"; var domain = localStorage.getItem('domain_' + acct_id)
var at = localStorage.getItem('acct_' + acct_id + '_at')
var start = 'https://' + domain + '/api/v1/timelines/public?local=true'
fetch(start, { fetch(start, {
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) {
response.text().then(function(text) { response.text().then(function(text) {
setLog(response.url, response.status, text); setLog(response.url, response.status, text)
}); })
} }
return response.json(); return response.json()
}) })
.catch(function(error) { .catch(function(error) {
todo(error); todo(error)
setLog(start, "JSON", error); setLog(start, 'JSON', error)
console.error(error); console.error(error)
}) })
.then(function(json) { .then(function(jsonL) {
//パースして描画 var start = 'https://' + domain + '/api/v1/timelines/home'
var templete = parse(json, "mix", acct_id, tlid);
$("#timeline_" + tlid).html(templete[0]);
jQuery("time.timeago").timeago();
$(window).scrollTop(0);
var locals = templete[1];
var times = templete[2];
todo("Integrated TL Loading...(Home)");
//Home
var start = "https://" + domain + "/api/v1/timelines/home";
fetch(start, { fetch(start, {
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) {
response.text().then(function(text) { response.text().then(function(text) {
setLog(response.url, response.status, text); setLog(response.url, response.status, text)
}); })
} }
return response.json(); return response.json()
}) })
.catch(function(error) { .catch(function(error) {
todo(error); todo(error)
setLog(start, "JSON", error); setLog(start, 'JSON', error)
console.error(error); console.error(error)
}) })
.then(function(obj) { .then(function(jsonH) {
//ホームのオブジェクトをUnix時間で走査 var homearr = []
if (!$("[toot-id=" + obj[0].id + "]").length) { var timeline = jsonL.concat(jsonH)
$("#timeline_" + tlid + " .cvo") timeline.sort(function(a, b) {
.first() if (date(a.created_at, 'unix') >= date(b.created_at, 'unix')) return -1
.before(parse([obj[0]], "home", acct_id)); if (date(a.created_at, 'unix') < date(b.created_at, 'unix')) return 1
//delete obj[0]; return 0
})
if (type == 'integrated') {
timeline.splice(20)
} }
//Localが遅すぎてHomeの全てより過去の場合 var templete = ''
var unixL = date(json[0].created_at, "unix"); if (localStorage.getItem('filter_' + acct_id) != 'undefined') {
var unixH = date(obj[obj.length - 1].created_at, "unix"); var mute = getFilterType(JSON.parse(localStorage.getItem('filter_' + acct_id)), 'mix')
//console.log(unixH+"vs"+unixL)
if (unixH < unixL) {
Object.keys(obj).forEach(function(key) {
var skey = obj.length - key - 1;
var toot = obj[key];
console.log(toot);
var id = toot.id;
if ($("#timeline_" + tlid + " [toot-id=" + toot.id + "]").length < 1) {
//console.log(toot.id);
var tarunix = date(toot.created_at, "unix");
var beforekey2;
var key2;
//console.log(locals)
//ホームのオブジェクトに対してLocalのオブジェクトを時間走査
Object.keys(times).forEach(function(key2) {
if (times[key2] < tarunix) {
var local = json[key2].id;
//console.log($.strip_tags(toot.content));
html = parse([toot], "home", acct_id, tlid);
$("#timeline_" + tlid + " [toot-id=" + local + "]").before(html);
//console.log("#timeline_" + tlid + " [toot-id=" + local + "]");
tarunix = 0;
}
});
}
});
} else { } else {
html = parse(obj, "home", acct_id, tlid); var mute = []
$("#timeline_" + tlid).html(html);
} }
todc(); Object.keys(timeline).forEach(function(key) {
mixre(acct_id, tlid); var pkey = key * 1 + 1
additional(acct_id, tlid); if (pkey < timeline.length) {
jQuery("time.timeago").timeago(); if (
}); date(timeline[key].created_at, 'unix') != date(timeline[pkey].created_at, 'unix')
}); ) {
if (type == 'integrated') {
templete = templete + parse([timeline[key]], '', acct_id, tlid, '', mute, 'mix')
} else if (type == 'plus') {
if (timeline[key].account.acct == timeline[key].account.username) {
templete =
templete + parse([timeline[key]], '', acct_id, tlid, '', mute, 'plus')
}
}
}
}
})
$('#landing_' + tlid).hide()
$('#timeline_' + tlid).html(templete)
mixre(acct_id, tlid, type, mute, delc, voice)
additional(acct_id, tlid)
jQuery('time.timeago').timeago()
todc()
})
})
} }
//Streamingに接続 //Streamingに接続
function mixre(acct_id, tlid) { function mixre(acct_id, tlid, TLtype, mute, delc, voice, mode) {
var domain = localStorage.getItem("domain_" + acct_id); var domain = localStorage.getItem('domain_' + acct_id)
var at = localStorage.getItem("acct_" + acct_id + "_at"); var at = localStorage.getItem('acct_' + acct_id + '_at')
var type = "mix"; if (localStorage.getItem('streaming_' + acct_id)) {
localStorage.setItem("now", type); var wss = localStorage.getItem('streaming_' + acct_id)
var startHome = "wss://" + domain + "/api/v1/streaming/?stream=user&access_token=" + at; } else {
var wss = 'wss://' + domain
var startLocal = "wss://" + domain + "/api/v1/streaming/?stream=public:local&access_token=" + at; }
var wshid = websocketHome.length; var startHome = wss + '/api/v1/streaming/?stream=user&access_token=' + at
var wslid = websocketLocal.length; var startLocal = wss + '/api/v1/streaming/?stream=public:local&access_token=' + at
websocketHome[wshid] = new WebSocket(startHome); var wshid = websocketHome.length
websocketLocal[wslid] = new WebSocket(startLocal); var wslid = websocketLocal.length
websocketHome[wshid] = new WebSocket(startHome)
websocketLocal[wslid] = new WebSocket(startLocal)
websocketHome[wshid].onopen = function(mess) { websocketHome[wshid].onopen = function(mess) {
console.log("Connect Streaming API(Home)"); localStorage.setItem('wssH_' + tlid, wshid)
$("#notice_icon_" + tlid).removeClass("red-text"); console.table({
}; tlid: tlid,
type: 'Connect Streaming API(Integrated:Home)',
domain: domain,
message: mess
})
$('#notice_icon_' + tlid).removeClass('red-text')
}
websocketLocal[wslid].onopen = function(mess) { websocketLocal[wslid].onopen = function(mess) {
console.log("Connect Streaming API(Local)"); localStorage.setItem('wssL_' + tlid, wslid)
$("#notice_icon_" + tlid).removeClass("red-text"); console.table({
}; tlid: tlid,
type: 'Connect Streaming API(Integrated:Local)',
domain: domain,
message: mess
})
$('#notice_icon_' + tlid).removeClass('red-text')
}
websocketLocal[wslid].onmessage = function(mess) { websocketLocal[wslid].onmessage = function(mess) {
console.log("Receive Streaming API:"); console.log(['Receive Streaming API:(Integrated:Local)', obj])
var obj = JSON.parse(JSON.parse(mess.data).payload); var obj = JSON.parse(JSON.parse(mess.data).payload)
console.log(obj); var type = JSON.parse(mess.data).event
var type = JSON.parse(mess.data).event; if (type == 'delete') {
if (type == "delete") { if (delc == 'true') {
$("[toot-id=" + JSON.parse(mess.data).payload + "]").hide(); $('#timeline_' + tlid + ' [toot-id=' + JSON.parse(mess.data).payload + ']').addClass(
$("[toot-id=" + JSON.parse(mess.data).payload + "]").remove(); 'emphasized'
} else if (type == "update") { )
var templete = parse([obj], "", acct_id, tlid); $('#timeline_' + tlid + ' [toot-id=' + JSON.parse(mess.data).payload + ']').addClass(
var pool = localStorage.getItem("pool_" + tlid); 'by_delcatch'
if (pool) { )
pool = templete + pool;
} else { } else {
pool = templete; $('[toot-id=' + JSON.parse(mess.data).payload + ']').hide()
$('[toot-id=' + JSON.parse(mess.data).payload + ']').remove()
}
} else if (type == 'update') {
var templete = parse([obj], '', acct_id, tlid, '', mute)
if ($('#timeline_' + tlid + ' [toot-id=' + obj.id + ']').length < 1) {
if (voice) {
say(obj.content)
}
var templete = parse([obj], type, acct_id, tlid, '', mute, 'mix')
var pool = localStorage.getItem('pool_' + tlid)
if (pool) {
pool = templete + pool
} else {
pool = templete
}
localStorage.setItem('pool_' + tlid, pool)
scrollck()
additional(acct_id, tlid)
jQuery('time.timeago').timeago()
} else {
todo('二重取得発生中')
}
} }
localStorage.setItem("pool_" + tlid, pool);
scrollck();
additional(acct_id, tlid);
jQuery("time.timeago").timeago();
todc();
} }
};
websocketHome[wshid].onmessage = function(mess) { websocketHome[wshid].onmessage = function(mess) {
console.log("Receive Streaming API:(Home)"); console.log(['Receive Streaming API:(Integrated:Home)', obj])
var obj = JSON.parse(JSON.parse(mess.data).payload)
var obj = JSON.parse(JSON.parse(mess.data).payload); var type = JSON.parse(mess.data).event
console.log(obj); if (type == 'delete') {
var type = JSON.parse(mess.data).event; if (del > 10) {
if (type == "delete") { reconnector(tlid, type, acct_id, data)
$("[toot-id=" + JSON.parse(mess.data).payload + "]").hide();
$("[toot-id=" + JSON.parse(mess.data).payload + "]").remove();
} else if (type == "update") {
var templete = parse([obj], "", acct_id, tlid);
if (obj.visibility != "public" || obj.account.acct != obj.account.username) {
var pool = localStorage.getItem("pool_" + tlid);
if (pool) {
pool = templete + pool;
} else { } else {
pool = templete; localStorage.setItem('delete', del * 1 + 1)
}
if (delc == 'true') {
$('[toot-id=' + JSON.parse(mess.data).payload + ']').addClass('emphasized')
$('[toot-id=' + JSON.parse(mess.data).payload + ']').addClass('by_delcatch')
} else {
$('[toot-id=' + JSON.parse(mess.data).payload + ']').hide()
$('[toot-id=' + JSON.parse(mess.data).payload + ']').remove()
}
} else if (type == 'update') {
localStorage.removeItem('delete')
if (TLtype == 'integrated') {
var templete = parse([obj], '', acct_id, tlid)
} else if (TLtype == 'plus') {
if (obj.account.acct == obj.account.username) {
var templete = parse([obj], '', acct_id, tlid, '', mute, 'mix')
} else {
var templete = ''
}
}
if ($('#timeline_' + tlid + ' [toot-id=' + obj.id + ']').length < 1) {
if (voice) {
say(obj.content)
}
var templete = parse([obj], type, acct_id, tlid, '', mute, 'mix')
var pool = localStorage.getItem('pool_' + tlid)
if (pool) {
pool = templete + pool
} else {
pool = templete
}
localStorage.setItem('pool_' + tlid, pool)
scrollck()
additional(acct_id, tlid)
jQuery('time.timeago').timeago()
} else {
todo('二重取得発生中')
} }
localStorage.setItem("pool_" + tlid, pool);
scrollck();
additional(acct_id, tlid);
jQuery("time.timeago").timeago();
} }
} }
};
websocketLocal[wslid].onerror = function(error) { websocketLocal[wslid].onerror = function(error) {
console.error("WebSocket Error " + error); console.error('WebSocketLocal Error')
}; console.error(error)
if (mode == 'error') {
$('#notice_icon_' + tlid).addClass('red-text')
todo('WebSocket Error ' + error)
} else {
var errorct = localStorage.getItem('wserror_' + tlid) * 1 + 1
localStorage.setItem('wserror_' + tlid, errorct)
if (errorct < 3) {
reconnector(tlid, TLtype, acct_id, '', 'error')
}
}
}
websocketLocal[wslid].onclose = function() {
console.warn('WebSocketLocal Closing:' + tlid)
if (mode == 'error') {
$('#notice_icon_' + tlid).addClass('red-text')
todo('WebSocket Closed')
} else {
var errorct = localStorage.getItem('wserror_' + tlid) * 1 + 1
localStorage.setItem('wserror_' + tlid, errorct)
if (errorct < 3) {
reconnector(tlid, TLtype, acct_id, '', 'error')
}
}
}
websocketHome[wshid].onerror = function(error) { websocketHome[wshid].onerror = function(error) {
console.error("WebSocket Error " + error); console.error(['WebSocketHome Error', error])
}; if (mode == 'error') {
$('#notice_icon_' + tlid).addClass('red-text')
todo('WebSocket Error ' + error)
} else {
var errorct = localStorage.getItem('wserror_' + tlid) * 1 + 1
localStorage.setItem('wserror_' + tlid, errorct)
if (errorct < 3) {
reconnector(tlid, TLtype, acct_id, '', 'error')
}
}
}
websocketHome[wshid].onclose = function() {
console.warn('WebSocketHome Closing:' + tlid)
if (mode == 'error') {
$('#notice_icon_' + tlid).addClass('red-text')
todo('WebSocket Closed')
} else {
var errorct = localStorage.getItem('wserror_' + tlid) * 1 + 1
localStorage.setItem('wserror_' + tlid, errorct)
if (errorct < 3) {
reconnector(tlid, TLtype, acct_id, '', 'error')
}
}
}
} }
//ある程度のスクロールで発火 //ある程度のスクロールで発火
function mixmore(tlid) { function mixmore(tlid, type) {
var multi = localStorage.getItem("column"); var multi = localStorage.getItem('column')
var obj = JSON.parse(multi); var obj = JSON.parse(multi)
var acct_id = obj[tlid].domain; var acct_id = obj[tlid].domain
todo("Integrated TL MoreLoading...(Local)"); moreloading = true
var domain = localStorage.getItem("domain_" + acct_id); todo('Integrated TL MoreLoading...(Local)')
var at = localStorage.getItem("acct_" + acct_id + "_at"); var domain = localStorage.getItem('domain_' + acct_id)
var sid = $("#timeline_" + tlid + " .cvo") var at = localStorage.getItem('acct_' + acct_id + '_at')
var sid = $('#timeline_' + tlid + ' .cvo')
.last() .last()
.attr("toot-id"); .attr('unique-id')
var len = $("#timeline_" + tlid + " .cvo").length;
var start = "https://" + domain + "/api/v1/timelines/public?local=true&max_id=" + sid; var start = 'https://' + domain + '/api/v1/timelines/public?local=true&max_id=' + sid
console.log(start);
fetch(start, { fetch(start, {
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) {
response.text().then(function(text) { response.text().then(function(text) {
setLog(response.url, response.status, text); setLog(response.url, response.status, text)
}); })
} }
return response.json(); return response.json()
}) })
.catch(function(error) { .catch(function(error) {
todo(error); todo(error)
setLog(start, "JSON", error); setLog(start, 'JSON', error)
console.error(error); console.error(error)
}) })
.then(function(json) { .then(function(jsonL) {
var templete = parse(json, "mix", acct_id, tlid); var start = 'https://' + domain + '/api/v1/timelines/home?max_id=' + sid
$("#timeline_" + tlid).append(templete[0]);
var locals = templete[1];
todo("Integrated TL MoreLoading...(Home)");
console.log(sid);
var start = "https://" + domain + "/api/v1/timelines/home?max_id=" + sid;
fetch(start, { fetch(start, {
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) {
response.text().then(function(text) { response.text().then(function(text) {
setLog(response.url, response.status, text); setLog(response.url, response.status, text)
}); })
} }
return response.json(); return response.json()
}) })
.catch(function(error) { .catch(function(error) {
todo(error); todo(error)
setLog(start, "JSON", error); setLog(start, 'JSON', error)
console.error(error); console.error(error)
}) })
.then(function(obj) { .then(function(jsonH) {
if ($("[toot-id=" + obj[0].id + "]").length < 1) { var homearr = []
$("#timeline_" + tlid + " .cvo") var timeline = jsonL.concat(jsonH)
.eq(len) timeline.sort(function(a, b) {
.before(parse([obj[0]], "home", acct_id) + '<div class="divider"></div>'); if (date(a.created_at, 'unix') > date(b.created_at, 'unix')) return -1
//delete obj[0]; if (date(a.created_at, 'unix') < date(b.created_at, 'unix')) return 1
return 0
})
timeline.splice(20)
var templete = ''
Object.keys(timeline).forEach(function(key) {
var pkey = key * 1 + 1
if (pkey < 20) {
if (
date(timeline[key].created_at, 'unix') != date(timeline[pkey].created_at, 'unix')
) {
if (localStorage.getItem('filter_' + acct_id) != 'undefined') {
var mute = getFilterType(
JSON.parse(localStorage.getItem('filter_' + acct_id)),
'mix'
)
} else {
var mute = []
} }
Object.keys(obj).forEach(function(key) { if (type == 'integrated') {
var skey = obj.length - key - 1; templete = templete + parse([timeline[key]], '', acct_id, tlid, '', mute, 'mix')
var toot = obj[skey]; } else if (type == 'plus') {
var id = toot.id; if (timeline[key].account.acct == timeline[key].account.username) {
var tarunix = date(toot.created_at, "unix"); templete = templete + parse([timeline[key]], '', acct_id, tlid, '', mute, 'mix')
var beforekey2;
var key2;
Object.keys(locals).forEach(function(key2) {
if ($("[toot-id=" + toot.id + "]").length < 1) {
if (key2 > tarunix) {
var local = locals[key2];
$("#timeline_" + tlid + " [toot-id=" + local + "]").after(parse([toot], "home", acct_id, tlid));
tarunix = 2147483647;
} }
} }
}); }
}); }
additional(acct_id, tlid); })
jQuery("time.timeago").timeago();
todc(); $('#timeline_' + tlid).append(templete)
}); additional(acct_id, tlid)
}); jQuery('time.timeago').timeago()
moreloading = false
todc()
})
})
} }

View File

@ -4,7 +4,6 @@ var errorct = 0
function tl(type, data, acct_id, tlid, delc, voice, mode) { function tl(type, data, acct_id, tlid, delc, voice, mode) {
scrollevent() scrollevent()
$('#unread_' + tlid + ' .material-icons').removeClass('teal-text') $('#unread_' + tlid + ' .material-icons').removeClass('teal-text')
localStorage.removeItem('morelock')
localStorage.removeItem('pool') localStorage.removeItem('pool')
var domain = localStorage.getItem('domain_' + acct_id) var domain = localStorage.getItem('domain_' + acct_id)
//タグとかの場合はカラム追加して描画 //タグとかの場合はカラム追加して描画
@ -148,11 +147,7 @@ function tl(type, data, acct_id, tlid, delc, voice, mode) {
.then(function(json) { .then(function(json) {
console.log(['Result of getting timeline of ' + tlid, json]) console.log(['Result of getting timeline of ' + tlid, json])
$('#landing_' + tlid).hide() $('#landing_' + tlid).hide()
if (localStorage.getItem('filter_' + acct_id) != 'undefined') { var mute = getFilterTypeByAcct(acct_id, type)
var mute = getFilterType(JSON.parse(localStorage.getItem('filter_' + acct_id)), type)
} else {
var mute = []
}
if (misskey) { if (misskey) {
var templete = misskeyParse(json, type, acct_id, tlid, '', mute) var templete = misskeyParse(json, type, acct_id, tlid, '', mute)
} else { } else {
@ -471,11 +466,7 @@ function moreload(type, tlid) {
console.error(error) console.error(error)
}) })
.then(function(json) { .then(function(json) {
if (localStorage.getItem('filter_' + acct_id) != 'undefined') { var mute = getFilterTypeByAcct(acct_id, type)
var mute = getFilterType(JSON.parse(localStorage.getItem('filter_' + acct_id)), type)
} else {
var mute = []
}
if (misskey) { if (misskey) {
var templete = misskeyParse(json, '', acct_id, tlid, '', mute) var templete = misskeyParse(json, '', acct_id, tlid, '', mute)
} else { } else {
@ -631,20 +622,20 @@ function tlCloser() {
} }
}) })
websocket = [] websocket = []
Object.keys(websocketHome).forEach(function(tlid) { Object.keys(wsHome).forEach(function(tlid) {
if (websocketHome[tlid]) { if (wsHome[tlid]) {
websocketHome[tlid].close() wsHome[tlid].close()
console.log('%c Close Streaming API:Integrated Home' + tlid, 'color:blue') console.log('%c Close Streaming API:Integrated Home' + tlid, 'color:blue')
} }
}) })
websocketHome = [] wsHome = []
Object.keys(websocketLocal).forEach(function(tlid) { Object.keys(wsLocal).forEach(function(tlid) {
if (websocketLocal[tlid]) { if (wsLocal[tlid]) {
websocketLocal[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')
} }
}) })
websocketLocal = [] wsLocal = []
Object.keys(websocketNotf).forEach(function(tlid) { Object.keys(websocketNotf).forEach(function(tlid) {
if (websocketNotf[tlid]) { if (websocketNotf[tlid]) {
websocketNotf[tlid].close() websocketNotf[tlid].close()
@ -849,15 +840,11 @@ function reconnector(tlid, type, acct_id, data, mode) {
} else { } else {
var voice = false var voice = false
} }
if (localStorage.getItem('filter_' + acct_id) != 'undefined') { var mute = getFilterTypeByAcct(acct_id, type)
var mute = getFilterType(JSON.parse(localStorage.getItem('filter_' + acct_id)), type)
} else {
var mute = []
}
var wssh = localStorage.getItem('wssH_' + tlid) var wssh = localStorage.getItem('wssH_' + tlid)
websocketHome[wssh].close() wsHome[wssh].close()
var wssl = localStorage.getItem('wssL_' + tlid) var wssl = localStorage.getItem('wssL_' + tlid)
websocketLocal[wssl].close() wsLocal[wssl].close()
mixre(acct_id, tlid, type, mute, '', voice, mode) mixre(acct_id, tlid, type, mute, '', voice, mode)
} else if (type == 'notf') { } else if (type == 'notf') {
notfColumn(acct_id, tlid, '') notfColumn(acct_id, tlid, '')
@ -869,11 +856,7 @@ function reconnector(tlid, type, acct_id, data, mode) {
} else { } else {
var voice = false var voice = false
} }
if (localStorage.getItem('filter_' + acct_id) != 'undefined') { var mute = getFilterTypeByAcct(acct_id, type)
var mute = getFilterType(JSON.parse(localStorage.getItem('filter_' + acct_id)), type)
} else {
var mute = []
}
reload(type, '', acct_id, tlid, data, mute, '', voice, mode) reload(type, '', acct_id, tlid, data, mute, '', voice, mode)
} }
M.toast({ html: lang.lang_tl_reconnect, displayLength: 2000 }) M.toast({ html: lang.lang_tl_reconnect, displayLength: 2000 })
@ -887,11 +870,7 @@ function columnReload(tlid, type) {
} else { } else {
var voice = false var voice = false
} }
if (localStorage.getItem('filter_' + acct_id) != 'undefined') { var mute = getFilterTypeByAcct(acct_id, type)
var mute = getFilterType(JSON.parse(localStorage.getItem('filter_' + acct_id)), type)
} else {
var mute = []
}
var wssh = localStorage.getItem('wssH_' + tlid) var wssh = localStorage.getItem('wssH_' + tlid)
websocketHome[wssh].close() websocketHome[wssh].close()
var wssl = localStorage.getItem('wssL_' + tlid) var wssl = localStorage.getItem('wssL_' + tlid)
@ -908,11 +887,7 @@ function columnReload(tlid, type) {
} else { } else {
var voice = false var voice = false
} }
if (localStorage.getItem('filter_' + acct_id) != 'undefined') { var mute = getFilterTypeByAcct(acct_id, type)
var mute = getFilterType(JSON.parse(localStorage.getItem('filter_' + acct_id)), type)
} else {
var mute = []
}
parseColumn(tlid) parseColumn(tlid)
} }
} }
@ -1005,11 +980,7 @@ function showUnread(tlid, type, acct_id) {
if (!json || !json.length) { if (!json || !json.length) {
columnReload(tlid, type) columnReload(tlid, type)
} }
if (localStorage.getItem('filter_' + acct_id) != 'undefined') { var mute = getFilterTypeByAcct(acct_id, type)
var mute = getFilterType(JSON.parse(localStorage.getItem('filter_' + acct_id)), type)
} else {
var mute = []
}
var templete = parse(json, type, acct_id, tlid, '', mute, type) var templete = parse(json, type, acct_id, tlid, '', mute, type)
var len = json.length - 1 var len = json.length - 1
$('#timeline_' + tlid).html(templete) $('#timeline_' + tlid).html(templete)
@ -1065,11 +1036,7 @@ function ueload(tlid) {
if (!json) { if (!json) {
columnReload(tlid, type) columnReload(tlid, type)
} }
if (localStorage.getItem('filter_' + acct_id) != 'undefined') { var mute = getFilterTypeByAcct(acct_id, type)
var mute = getFilterType(JSON.parse(localStorage.getItem('filter_' + acct_id)), type)
} else {
var mute = []
}
var templete = parse(json, '', acct_id, tlid, '', mute, type) var templete = parse(json, '', acct_id, tlid, '', mute, type)
var len = json.length - 1 var len = json.length - 1
$('#timeline_' + tlid).prepend(templete) $('#timeline_' + tlid).prepend(templete)

View File

@ -2,8 +2,8 @@
var websocketOld = [] var websocketOld = []
var websocket = [] var websocket = []
var websocketHome = [] var wsHome = []
var websocketLocal = [] var wsLocal = []
var websocketNotf = [] var websocketNotf = []
//カラム追加ボックストグル //カラム追加ボックストグル

View File

@ -56,6 +56,7 @@
"jquery": "^3.4.1", "jquery": "^3.4.1",
"jquery-ui-dist": "^1.12.1", "jquery-ui-dist": "^1.12.1",
"json5": "^2.1.1", "json5": "^2.1.1",
"lodash": "^4.17.15",
"materialize-css": "^1.0.0", "materialize-css": "^1.0.0",
"sumchecker": "^3.0.0", "sumchecker": "^3.0.0",
"sweetalert2": "^8.18.6", "sweetalert2": "^8.18.6",

View File

@ -1189,6 +1189,7 @@
<script type="text/javascript" src="../../node_modules/jquery/dist/jquery.js"></script> <script type="text/javascript" src="../../node_modules/jquery/dist/jquery.js"></script>
<script type="text/javascript" src="../../js/platform/first.js"></script> <script type="text/javascript" src="../../js/platform/first.js"></script>
<script type="text/javascript" src="../../node_modules/materialize-css/dist/js/materialize.js"></script> <script type="text/javascript" src="../../node_modules/materialize-css/dist/js/materialize.js"></script>
<script type="text/javascript" src="../../node_modules/lodash/lodash.min.js"></script>
<script type="text/javascript" src="main.js"></script> <script type="text/javascript" src="main.js"></script>
<script type="text/javascript" src="../../js/common/time.js"></script> <script type="text/javascript" src="../../js/common/time.js"></script>
<script type="text/javascript" src="../../js/common/blurhash.js"></script> <script type="text/javascript" src="../../js/common/blurhash.js"></script>

View File

@ -1730,6 +1730,11 @@ lodash.assign@^4.2.0:
resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-4.2.0.tgz#0d99f3ccd7a6d261d19bdaeb9245005d285808e7" resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-4.2.0.tgz#0d99f3ccd7a6d261d19bdaeb9245005d285808e7"
integrity sha1-DZnzzNem0mHRm9rrkkUAXShYCOc= integrity sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=
lodash@^4.17.15:
version "4.17.15"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548"
integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==
log-symbols@^2.2.0: log-symbols@^2.2.0:
version "2.2.0" version "2.2.0"
resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a" resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a"