WIP: to null-safety app

This commit is contained in:
cutls 2019-12-12 00:06:40 +09:00
parent 320576f288
commit 9f6c14ced0
2 changed files with 19 additions and 6 deletions

View File

@ -211,6 +211,21 @@ function escapeCsv(str) {
} }
return result return result
} }
function evalAttr(json, attr, lenCk) {
if (json[attr]) {
if (lenCk) {
if (json[attr][0]) {
return true
} else {
return false
}
} else {
return true
}
} else {
return false
}
}
function statusModel(now) { function statusModel(now) {
if (!now) { if (!now) {
var now = new Date().toString() var now = new Date().toString()
@ -248,12 +263,10 @@ function statusModel(now) {
locked: false, locked: false,
bot: false, bot: false,
created_at: now, created_at: now,
note: note: '',
'',
url: '', url: '',
avatar: '', avatar: '',
avatar_static: avatar_static: '',
'',
header: '', header: '',
header_static: '', header_static: '',
followers_count: 0, followers_count: 0,

View File

@ -151,7 +151,7 @@ function media(b64, type, no) {
mediav = mediav.replace(regExp, json['id']) mediav = mediav.replace(regExp, json['id'])
$('#media').val(mediav) $('#media').val(mediav)
} }
if (img == 'url') { if (img == 'url' && json['text_url']) {
$('#textarea').val($('#textarea').val() + ' ' + json['text_url']) $('#textarea').val($('#textarea').val() + ' ' + json['text_url'])
} }
todc() todc()