This commit is contained in:
cutls
2021-01-09 21:07:59 +09:00
parent 46bc9474a0
commit 4fbe7218e6
10 changed files with 334 additions and 89 deletions

View File

@@ -1,5 +1,5 @@
//オブジェクトパーサー(トゥート)
function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
function parse(obj, mix, acct_id, tlid, popup, mutefilter, type, onlyContent) {
var splitter = new GraphemeSplitter()
var templete = ''
if (obj[0]) {
@@ -194,7 +194,8 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
}
var local = []
var times = []
Object.keys(obj).forEach(function (key) {
let content
for(let key in obj){
var domain = localStorage.getItem('domain_' + acct_id)
var toot = obj[key]
if (type == 'dm') {
@@ -463,9 +464,9 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
}
}
if (toot.content == '') {
var content = ' '
content = ' '
} else {
var content = toot.content
content = toot.content
}
if (content) {
var id = toot.id
@@ -536,7 +537,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
(sent < ct && $.mb_strlen($.strip_tags(content)) > 5) ||
($.mb_strlen($.strip_tags(content)) > ltr && $.mb_strlen($.strip_tags(content)) > 5)
) {
var content = `<span class="gray">${lang.lang_parse_fulltext}</span><br>` + content
content = `<span class="gray">${lang.lang_parse_fulltext}</span><br>` + content
var spoil = `<span class="cw_long">${$.mb_substr(
$.strip_tags(content),
0,
@@ -1025,7 +1026,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
const meta = getMeta(target.content)
pluginHtml = pluginHtml + `<li><a onclick="execPlugin('${target.id}','buttonOnToot',{id: '${uniqueid}', acct_id: '${acct_id}'});">${escapeHTML(meta.name)}</a></li>`
}
templete =
templete +
`<div
@@ -1177,7 +1178,8 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
</div>
`
}
})
}
if (onlyContent) return content
if (mix == 'mix') {
return [templete, local, times]
} else {