fetch the data with dialog
This commit is contained in:
parent
5de0ede4e1
commit
8acf86d9cb
|
@ -29,7 +29,7 @@ $(document).on('click', 'a', e => {
|
||||||
acct_id = 0
|
acct_id = 0
|
||||||
}
|
}
|
||||||
$a.parent().addClass('loadp')
|
$a.parent().addClass('loadp')
|
||||||
$a.parent().text('Loading...')
|
|
||||||
detEx(url, acct_id)
|
detEx(url, acct_id)
|
||||||
}
|
}
|
||||||
} else if (tags) {
|
} else if (tags) {
|
||||||
|
|
|
@ -637,34 +637,22 @@ function brws() {
|
||||||
postMessage(['openUrl', url], '*')
|
postMessage(['openUrl', url], '*')
|
||||||
}
|
}
|
||||||
//外部からトゥート開く
|
//外部からトゥート開く
|
||||||
function detEx(url, acct_id) {
|
async function detEx(url, acct_id) {
|
||||||
if (acct_id == 'main') {
|
if (acct_id == 'main') {
|
||||||
acct_id = localStorage.getItem('main')
|
acct_id = localStorage.getItem('main')
|
||||||
}
|
}
|
||||||
var domain = localStorage.getItem('domain_' + acct_id)
|
Swal.fire({
|
||||||
var at = localStorage.getItem('acct_' + acct_id + '_at')
|
title: 'Loading...',
|
||||||
var start = 'https://' + domain + '/api/v2/search?resolve=true&q=' + encodeURIComponent(url)
|
html: lang.lang_details_fetch,
|
||||||
fetch(start, {
|
showConfirmButton: false,
|
||||||
method: 'GET',
|
showCloseButton: true,
|
||||||
headers: {
|
onBeforeOpen: () => {
|
||||||
'content-type': 'application/json',
|
Swal.showLoading()
|
||||||
Authorization: 'Bearer ' + at
|
},
|
||||||
}
|
onClose: () => { },
|
||||||
})
|
}).then((result) => { })
|
||||||
.then(function(response) {
|
const json = await detExCore(url, acct_id)
|
||||||
if (!response.ok) {
|
Swal.close()
|
||||||
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(json) {
|
|
||||||
if (!json.statuses) {
|
if (!json.statuses) {
|
||||||
postMessage(['openUrl', url], '*')
|
postMessage(['openUrl', url], '*')
|
||||||
} else {
|
} else {
|
||||||
|
@ -673,6 +661,24 @@ function detEx(url, acct_id) {
|
||||||
$('.loadp').removeClass('loadp')
|
$('.loadp').removeClass('loadp')
|
||||||
details(id, acct_id, 0)
|
details(id, acct_id, 0)
|
||||||
}
|
}
|
||||||
})
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
async function detExCore(url, acct_id) {
|
||||||
|
const domain = localStorage.getItem('domain_' + acct_id)
|
||||||
|
const start = 'https://' + domain + '/api/v2/search?resolve=true&q=' + encodeURIComponent(url)
|
||||||
|
const at = localStorage.getItem('acct_' + acct_id + '_at')
|
||||||
|
let promise = await fetch(start, {
|
||||||
|
method: 'GET',
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/json',
|
||||||
|
Authorization: 'Bearer ' + at
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const json = await promise.json()
|
||||||
|
if (json) {
|
||||||
|
return json
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -89,7 +89,7 @@ function list() {
|
||||||
</a>/
|
</a>/
|
||||||
<a onclick="listUser('${list.id}','${acct_id}')" class="pointer">
|
<a onclick="listUser('${list.id}','${acct_id}')" class="pointer">
|
||||||
${lang.lang_list_users}
|
${lang.lang_list_users}
|
||||||
'</a><br>`
|
</a><br>`
|
||||||
})
|
})
|
||||||
$('#lists').html(lists)
|
$('#lists').html(lists)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -659,8 +659,6 @@ function removeColumn(tlid) {
|
||||||
$('#timeline_box_' + tlid + '_parentBox').remove()
|
$('#timeline_box_' + tlid + '_parentBox').remove()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$('#sort-box').removeClass('hide')
|
|
||||||
$('#sort-box').addClass('show')
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -103,6 +103,7 @@
|
||||||
"lang_details_embed": "Embed HTML is cliped.",
|
"lang_details_embed": "Embed HTML is cliped.",
|
||||||
"lang_details_url": "URL of this toot is cliped.",
|
"lang_details_url": "URL of this toot is cliped.",
|
||||||
"lang_details_txt": "Content of this toot is cliped.",
|
"lang_details_txt": "Content of this toot is cliped.",
|
||||||
|
"lang_details_fetch": "Fetcging toot data...",
|
||||||
"lang_filter_nodata": "No data",
|
"lang_filter_nodata": "No data",
|
||||||
"lang_filter_errordegree": "Please check a context",
|
"lang_filter_errordegree": "Please check a context",
|
||||||
"lang_list_nodata": "No data",
|
"lang_list_nodata": "No data",
|
||||||
|
|
|
@ -102,6 +102,7 @@
|
||||||
"lang_details_embed": "埋め込みHTMLがコピーされたで。",
|
"lang_details_embed": "埋め込みHTMLがコピーされたで。",
|
||||||
"lang_details_url": "トゥートURLがコピーされたで。",
|
"lang_details_url": "トゥートURLがコピーされたで。",
|
||||||
"lang_details_txt": "トゥート本文がコピーされたで。",
|
"lang_details_txt": "トゥート本文がコピーされたで。",
|
||||||
|
"lang_details_fetch": "トゥートの情報を引っ張って来とるで…",
|
||||||
"lang_filter_nodata": "フィルターは無いで",
|
"lang_filter_nodata": "フィルターは無いで",
|
||||||
"lang_filter_errordegree": "適応範囲は一つ以上チェックせなあかんで。",
|
"lang_filter_errordegree": "適応範囲は一つ以上チェックせなあかんで。",
|
||||||
"lang_list_nodata": "リストは無いで",
|
"lang_list_nodata": "リストは無いで",
|
||||||
|
|
|
@ -104,6 +104,7 @@
|
||||||
"lang_details_embed": "埋め込みHTMLがコピーされました。",
|
"lang_details_embed": "埋め込みHTMLがコピーされました。",
|
||||||
"lang_details_url": "トゥートURLがコピーされました。",
|
"lang_details_url": "トゥートURLがコピーされました。",
|
||||||
"lang_details_txt": "トゥート本文がコピーされました。",
|
"lang_details_txt": "トゥート本文がコピーされました。",
|
||||||
|
"lang_details_fetch": "トゥートの情報を読み込んでいます",
|
||||||
"lang_filter_nodata": "フィルターはありません",
|
"lang_filter_nodata": "フィルターはありません",
|
||||||
"lang_filter_errordegree": "適応範囲を最低一つ以上チェックしてください。",
|
"lang_filter_errordegree": "適応範囲を最低一つ以上チェックしてください。",
|
||||||
"lang_list_nodata": "リストはありません",
|
"lang_list_nodata": "リストはありません",
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
<body class="">
|
<body class="">
|
||||||
<script>
|
<script>
|
||||||
var ver = '22.2.0 (Koume)'
|
var ver = '22.2.0 (Koume)'
|
||||||
var gitHash = 'b047c8076821314419fdd11573d1f4337567b53d'
|
var gitHash = '5de0ede4e1a99358a9078c5f560f3b650fcf94b8'
|
||||||
//betaを入れるとバージョンチェックしない
|
//betaを入れるとバージョンチェックしない
|
||||||
//var ver="beta";
|
//var ver="beta";
|
||||||
var acct_id = 0
|
var acct_id = 0
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -103,12 +103,10 @@
|
||||||
</div>
|
</div>
|
||||||
<h5>Czcionka</h5>
|
<h5>Czcionka</h5>
|
||||||
Select your favorite font to 'Select'(Windows/ macOS only)<br>
|
Select your favorite font to 'Select'(Windows/ macOS only)<br>
|
||||||
<button class="btn waves-effect" style="width:7.7rem;" onclick="font()">Wybierz</button><br>
|
<button class="btn waves-effect orange darken-2" style="width:7.7rem;" onclick="font()">Wybierz</button>
|
||||||
<div id="fonts" class="hide" style="overflow-y:scroll; width:22rem; height:40rem;"></div>
|
|
||||||
<br>
|
|
||||||
<input type="text" style="width:11.5rem" id="font">
|
<input type="text" style="width:11.5rem" id="font">
|
||||||
<button class="btn waves-effect" style="width:7.7rem;" onclick="settings()">Zapisz</button>
|
<button class="btn waves-effect" style="width:7.7rem;" onclick="settings()">Zapisz</button>
|
||||||
<br>
|
<div id="fonts" class="hide"></div>
|
||||||
<h5>Folder to save</h5>
|
<h5>Folder to save</h5>
|
||||||
TheDesk uses this value when it try to save pictures or take screenshots.<br>
|
TheDesk uses this value when it try to save pictures or take screenshots.<br>
|
||||||
<button class="btn waves-effect" style="width:7.7rem;" onclick="savefolder()">Zmień</button>
|
<button class="btn waves-effect" style="width:7.7rem;" onclick="savefolder()">Zmień</button>
|
||||||
|
@ -690,7 +688,7 @@
|
||||||
style="width:100%; max-width:40rem;"><img src="../../img/desk_full.svg" class="left" width="25"
|
style="width:100%; max-width:40rem;"><img src="../../img/desk_full.svg" class="left" width="25"
|
||||||
style="padding-top:5px;">Main author: Cutls@cutls.com</a>
|
style="padding-top:5px;">Main author: Cutls@cutls.com</a>
|
||||||
<br>
|
<br>
|
||||||
TheDesk @ <a href="https://github.com/cutls/TheDesk/commits/b047c8076821314419fdd11573d1f4337567b53d">b047c8076821314419fdd11573d1f4337567b53d</a> - <a
|
TheDesk @ <a href="https://github.com/cutls/TheDesk/commits/5de0ede4e1a99358a9078c5f560f3b650fcf94b8">5de0ede4e1a99358a9078c5f560f3b650fcf94b8</a> - <a
|
||||||
onclick="checkupd(); return localStorage.removeItem('new-ver-skip'); location.href='index.html';"
|
onclick="checkupd(); return localStorage.removeItem('new-ver-skip'); location.href='index.html';"
|
||||||
class="pointer pwa">Sprawdź aktualizacje</a><br>
|
class="pointer pwa">Sprawdź aktualizacje</a><br>
|
||||||
<br>
|
<br>
|
||||||
|
@ -700,7 +698,7 @@
|
||||||
<img src="https://status.cutls.com/badge-service?site=thedesk.top">
|
<img src="https://status.cutls.com/badge-service?site=thedesk.top">
|
||||||
</a><br>
|
</a><br>
|
||||||
<h5>OSS License</h5>
|
<h5>OSS License</h5>
|
||||||
<a href="https://app.fossa.com/projects/git%2Bgithub.com%2Fcutls%2FTheDesk/refs/branch/master/b047c8076821314419fdd11573d1f4337567b53d"
|
<a href="https://app.fossa.com/projects/git%2Bgithub.com%2Fcutls%2FTheDesk/refs/branch/master/5de0ede4e1a99358a9078c5f560f3b650fcf94b8"
|
||||||
alt="FOSSA Status"><img
|
alt="FOSSA Status"><img
|
||||||
src="https://app.fossa.com/api/projects/git%2Bgithub.com%2Fcutls%2FTheDesk.svg?type=small" /></a>
|
src="https://app.fossa.com/api/projects/git%2Bgithub.com%2Fcutls%2FTheDesk.svg?type=small" /></a>
|
||||||
<br>
|
<br>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user