//Integrated TL function mixtl(acct_id, tlid, type) { console.log(type); localStorage.removeItem("morelock") localStorage.setItem("now", type); todo("Integrated TL Loading...(Local)"); //まずLocal var domain = localStorage.getItem("domain_" + acct_id); var at = localStorage.getItem(domain + "_at"); var start = "https://" + domain + "/api/v1/timelines/public?local=true"; fetch(start, { method: 'GET', headers: { 'content-type': 'application/json', 'Authorization': 'Bearer ' + at }, }).then(function(response) { return response.json(); }).catch(function(error) { todo(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) { return response.json(); }).catch(function(error) { todo(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; if(date(a.created_at,"unix")