cannot get next fav/flw/fler

This commit is contained in:
cutls 2020-09-06 23:29:12 +09:00
parent 9d0f4096f8
commit 3f95e755b5
3 changed files with 165 additions and 66 deletions

View File

@ -87,6 +87,7 @@
overflow-y: scroll;
overflow-x: hidden;
height: calc(100% - 3.4rem);
padding-bottom: 60px;
}
#my-data-nav .btn {
width: 10.7rem;

View File

@ -1246,7 +1246,6 @@ function userparse(obj, auth, acct_id, tlid, popup) {
} else if (auth == 'request') {
var ftxt = lang.lang_parse_request
}
console.log(auth, ftxt)
if (popup > 0 || popup == -1 || notf) {
var notftext = ftxt + '<br>'
} else {

View File

@ -154,7 +154,7 @@ function flw(user, more, acct_id) {
if (localStorage.getItem("mode_" + domain) == "misskey") {
var req = { i: at }
if (more) {
var sid = $("#his-follow-list .cvo")
var sid = $("#his-follow-list .cusr")
.last()
.attr("user-id")
req.maxId = sid
@ -170,9 +170,7 @@ function flw(user, more, acct_id) {
}
} else {
if (more) {
var sid = $("#his-follow-list .cvo")
.last()
.attr("user-id")
var sid = $("#his-follow-list-contents").attr('max-id')
var plus = "?max_id=" + sid
} else {
var plus = ""
@ -185,6 +183,40 @@ function flw(user, more, acct_id) {
Authorization: "Bearer " + at
}
}
var httpreq = new XMLHttpRequest()
httpreq.open("GET", 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 (localStorage.getItem("mode_" + domain) == "misskey") {
var templete = misskeyUserparse(json, "", acct_id)
} else {
var templete = userparse(json, "", acct_id)
}
if (templete == "") {
templete = lang.lang_details_nodata + "<br>"
}
var linkHeader = httpreq.getResponseHeader("link")
let link
if (linkHeader) {
console.log(linkHeader)
link = linkHeader.match(/[?&]{1}max_id=([0-9]+)/)[1]
console.log(link)
}
$("#his-follow-list-contents").attr('max-id', link)
if (more) {
$("#his-follow-list-contents").append(templete)
} else {
$("#his-follow-list-contents").html(templete)
}
jQuery("time.timeago").timeago()
}
}
return false
}
fetch(start, i)
.then(function (response) {
@ -231,7 +263,7 @@ function fer(user, more, acct_id) {
if (localStorage.getItem("mode_" + domain) == "misskey") {
var req = { i: at }
if (more) {
var sid = $("#his-follower-list .cvo")
var sid = $("#his-follow-list .cusr")
.last()
.attr("user-id")
req.maxId = sid
@ -247,9 +279,7 @@ function fer(user, more, acct_id) {
}
} else {
if (more) {
var sid = $("#his-follower-list .cvo")
.last()
.attr("user-id")
var sid = $("#his-followr-list-contents").attr('max-id')
var plus = "?max_id=" + sid
} else {
var plus = ""
@ -262,6 +292,40 @@ function fer(user, more, acct_id) {
Authorization: "Bearer " + at
}
}
var httpreq = new XMLHttpRequest()
httpreq.open("GET", 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 (localStorage.getItem("mode_" + domain) == "misskey") {
var templete = misskeyUserparse(json, "", acct_id)
} else {
var templete = userparse(json, "", acct_id)
}
if (templete == "") {
templete = lang.lang_details_nodata + "<br>"
}
var linkHeader = httpreq.getResponseHeader("link")
let link
if (linkHeader) {
console.log(linkHeader)
link = linkHeader.match(/[?&]{1}max_id=([0-9]+)/)[1]
console.log(link)
}
$("#his-follower-list-contents").attr('max-id', link)
if (more) {
$("#his-follower-list-contents").append(templete)
} else {
$("#his-follower-list-contents").html(templete)
}
jQuery("time.timeago").timeago()
}
}
return false
}
fetch(start, i)
.then(function (response) {
@ -286,6 +350,14 @@ function fer(user, more, acct_id) {
if (templete == "") {
templete = lang.lang_details_nodata + "<br>"
}
var linkHeader = httpreq.getResponseHeader("link")
let link
if (linkHeader) {
console.log(linkHeader)
link = linkHeader.match(/[?&]{1}max_id=([0-9]+)/)[1]
console.log(link)
}
$("#his-follower-list-contents").attr('max-id', link)
if (more) {
$("#his-follower-list-contents").append(templete)
} else {
@ -305,9 +377,7 @@ function showFav(more, acct_id) {
var at = localStorage.getItem("acct_" + acct_id + "_at")
if (localStorage.getItem("mode_" + domain) != "misskey") {
if (more) {
var sid = $("#his-fav-list .cvo")
.last()
.attr("toot-id")
var sid = $("#his-fav-list-contents").attr('max-id')
var plus = "?max_id=" + sid
} else {
var plus = ""
@ -320,6 +390,35 @@ function showFav(more, acct_id) {
Authorization: "Bearer " + at
}
}
var httpreq = new XMLHttpRequest()
httpreq.open("GET", 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
var linkHeader = httpreq.getResponseHeader("link")
let link
if (linkHeader) {
console.log(linkHeader)
link = linkHeader.match(/[?&]{1}max_id=([0-9]+)/)[1]
console.log(link)
}
var template = parse(json, "", acct_id, "user")
if (!json[0]) {
template = lang.lang_details_nodata + "<br>"
}
$("#his-fav-list-contents").attr('max-id', link)
if (more) {
$("#his-fav-list-contents").append(template)
} else {
$("#his-fav-list-contents").html(template)
}
jQuery("time.timeago").timeago()
}
}
} else {
var req = { i: at }
if (more) {