Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

Commit

Permalink
delete updater
Browse files Browse the repository at this point in the history
  • Loading branch information
cutls committed Jan 23, 2023
1 parent 3f2aec3 commit 93547b5
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 228 deletions.
193 changes: 0 additions & 193 deletions app/js/common/version.js
Original file line number Diff line number Diff line change
@@ -1,199 +1,6 @@
//バージョンチェッカー
async function verck(ver, jp) {
if (store) return false
console.log('%c Welcome😊 ' + ver, 'color: red;font-size:200%;')
$('body').addClass(localStorage.getItem('platform'))
const date = new Date()
let showVer = false
if (localStorage.getItem('ver') != ver && localStorage.getItem('winstore')) {
showVer = true
console.log('%c Thank you for your update🎉', 'color: red;font-size:200%;')
$(document).ready(function () {
if (localStorage.getItem('winstore') && !pwa) {
$('#releasenote').modal('open')
}
let verp = ver.replace('(', '')
verp = verp.replace('.', '-')
verp = verp.replace('.', '-')
verp = verp.replace('[', '-')
verp = verp.replace(']', '')
verp = verp.replace(')', '')
verp = verp.replace(' ', '_')
console.log('%c ' + verp, 'color: red;font-size:200%;')
if (lang.language == 'ja') {
$('#release-' + verp).show()
} else {
$('#release-en').show()
}
})
}
localStorage.setItem('ver', ver)
if (!showVer) {
console.log(showVer)
let nextmonth
if (!localStorage.getItem('showSupportMe')) {
if (date.getMonth() == 11) {
const yrs = date.getFullYear() + 1
nextmonth = yrs * 100 + 1
} else {
const yrs = date.getFullYear()
nextmonth = yrs * 100 + date.getMonth() + 2
}
localStorage.setItem('showSupportMe', nextmonth)
} else {
if (
date.getFullYear() * 100 + date.getMonth() + 1 >= localStorage.getItem('showSupportMe')
) {
if (date.getMonth() == 11) {
const yrs = date.getFullYear() + 1
nextmonth = yrs * 100 + 1
} else {
const yrs = date.getFullYear()
nextmonth = yrs * 100 + date.getMonth() + 2
}
localStorage.setItem('showSupportMe', nextmonth)
if (lang.language != 'ja') {
$('#support-btm-ja').addClass('hide')
$('#support-btm-en').removeClass('hide')
}
$('#support-btm').removeClass('hide')
$('#support-btm').animate(
{
bottom: '0'
},
{
duration: 300
}
)
}
}

}
const platform = localStorage.getItem('platform')
console.log('Your platform:' + platform)
//if (!localStorage.getItem('winstore') && !pwa) {
// $('#start').css('display', 'flex')
//}
const winstore = localStorage.getItem('winstore') == 'brewcask' ||
localStorage.getItem('winstore') == 'snapcraft' ||
localStorage.getItem('winstore') == 'winstore'
const l = 5
// 生成する文字列に含める文字セット
const c = 'abcdefghijklmnopqrstuvwxyz0123456789'
const cl = c.length
let r = ''
for (var i = 0; i < l; i++) {
r += c[Math.floor(Math.random() * cl)]
}
const start1 = 'https://thedesk.top/ver.json'
const response = await fetch(start1, { method: 'GET' })
if (!response.ok) {
response.text().then(function (text) {
setLog(response.url, response.status, text)
})
}
const mess = await response.json()

console.table(mess)
if (mess) {
const platform = localStorage.getItem('platform')
const newest = platform == 'darwin' ? mess.desk_mac : mess.desk
if (newest == ver) {
todo(lang.lang_version_usever.replace('{{ver}}', mess.desk))
//betaかWinstoreならアプデチェックしない
} else if (ver.indexOf('beta') != -1 || winstore) {
} else {
localStorage.removeItem('instance')
if (localStorage.getItem('new-ver-skip')) {
if (localStorage.getItem('next-ver') != newest) {
postMessage(['sendSinmpleIpc', 'update'], '*')
} else {
console.warn(lang.lang_version_skipver)
todo(lang.lang_version_skipver)
}
} else {
postMessage(['sendSinmpleIpc', 'update'], '*')
}
}
}
if (!localStorage.getItem('last-notice-id')) {
localStorage.setItem('last-notice-id', 0)
}
var start = 'https://thedesk.top/notice/index.php?since_id=' + localStorage.getItem('last-notice-id')
fetch(start, {
method: 'GET',
cors: true
})
.then(function (response) {
if (!response.ok) {
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 (mess) {
if (mess.length < 1) {
return false
} else {
var last = localStorage.getItem('last-notice-id')
localStorage.setItem('last-notice-id', mess[0].ID)
for (i = 0; i < mess.length; i++) {
var obj = mess[i]
if (obj.ID * 1 <= last) {
break
} else {
if (obj.type == 'textv2') {
if (~obj.languages.indexOf(lang.language)) {
var showVer = true
if (obj.toot != '') {
var toot =
'<button class="btn-flat toast-action" onclick="detEx(\'' +
obj.toot +
"','main')\">Show</button>"
} else {
var toot = ''
}
if (obj.ver != '') {
if (obj.ver == ver) {
showVer = true
} else {
showVer = false
}
}
if (obj.domain != '') {
var multi = localStorage.getItem('multi')
if (multi) {
showVer = false
var accts = JSON.parse(multi)
Object.keys(accts).forEach(function (key) {
var acct = accts[key]
if (acct.domain == obj.domain) {
showVer = true
}
})
}
}
if (showVer) {
M.toast({
html:
escapeHTML(obj.text) +
toot +
'<span class="sml grey-text">(スライドして消去)</span>',
displayLength: 86400
})
}
}
}
}
}
}
})
}
var infostreaming = false
function infowebsocket() {
Expand Down
2 changes: 1 addition & 1 deletion app/view/make/components/menuHtml.html
Original file line number Diff line number Diff line change
Expand Up @@ -229,5 +229,5 @@
</div>
<a onclick="about()" class="nex waves-effect pwa"> <i class="material-icons menu-icon">info</i>@@about@@ </a>&nbsp;|&nbsp;
<a onclick="bottomReverse()" class="nex waves-effect"> <i class="material-icons menu-icon">swap_horiz</i>@@reverse@@ </a>&nbsp;|&nbsp;
<a href="https://github.com/cutls/TheDesk/releases" class="nex waves-effect"> <i class="material-icons menu-icon">new_releases</i>Release Note </a>
<a href="https://thedesk.top" class="nex waves-effect"> <i class="material-icons menu-icon">new_releases</i>Upgrade to v24</a>
</div>
34 changes: 0 additions & 34 deletions app/view/make/components/releaseNote.html
Original file line number Diff line number Diff line change
@@ -1,34 +0,0 @@
<!-- Modal Structure Release Note-->
<div id="releasenote" class="modal modal-fixed-footer scr">
<div class="modal-content">
<h3>TheDesk</h3>
<a href="https://thedesk.top" target="_blank">HP</a><br />
<a href="https://github.com/cutls/TheDesk" target="_blank">GitHub</a><br />
<br />
<div id="release-22-3-1_Koume" class="release-do" style="display: none">
Pixiv FanboxやPatreonでは支援者様限定で様々なTheDeskに関する記事をご覧いただけます。最低月一更新。<br /> 困ったときは、 <a href="https://docs.thedesk.top">TheDesk Docs</a>をご覧ください。
<h5>Release Note 22.3.1 (Koume)</h5>
<!--上のdivのidや1行上のところも変えてね-->
・時限ミュートに対応した
<a onclick="udgEx('Cutls@2m.cutls.com','main')" class="contributor"><img src="https://media.thedesk.top/accounts/avatars/000/000/001/original/d34ef8bb49d5e011.png" />cutls</a><br /> ・軽微なバグの修正
<a onclick="udgEx('Cutls@2m.cutls.com','main')" class="contributor"><img src="https://media.thedesk.top/accounts/avatars/000/000/001/original/d34ef8bb49d5e011.png" />cutls</a><br />
</div>
<div id="release-en" style="display: none">
<h5>Let's make it native!</h5>
<a href="https://translate.thedesk.top">Crowdin translation project</a>
</div>
<br /><br />
<h3>@@supportme@@</h3>
@@TheDeskDes@@<br />
<a class="btn-share btn waves-effect waves-light red lighten-2" href="https://www.pixiv.net/fanbox/creator/28105985" target="_blank"> @@PixivSupport@@ </a>
<a class="btn-share btn waves-effect waves-light red darken-2" href="https://www.patreon.com/cutls" target="_blank"> @@PatreonSupport@@ </a>
<a class="btn-share btn waves-effect waves-light black-text" href="https://liberapay.com/cutls" target="_blank" style="background-color: #f6c915"> Liberapay </a>
<a class="btn-share btn waves-effect waves-light blue" href="https://www.amazon.co.jp/registry/wishlist/2TV35ZHHJPDSB" target="_blank"> @@AWLSupport@@ </a>
<br /> @@SendAmazonGift1@@ <a href="mailto:web-pro@cutls.com" target="_blank">web-pro@cutls.com</a>@@SendAmazonGift2@@<br /> Kyash
<br />
<img src="../../img/kyash.png" width="100" /><br />
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat">@@close@@</a>
</div>
</div>

0 comments on commit 93547b5

Please sign in to comment.