diff --git a/app/js/login/manager.js b/app/js/login/manager.js index 8e9a6c24..b53855bf 100644 --- a/app/js/login/manager.js +++ b/app/js/login/manager.js @@ -302,6 +302,9 @@ function login(url) { $("#compt").hide() if ($('#linux:checked').val() == "on") { var red = "urn:ietf:wg:oauth:2.0:oob" + if(~url.indexOf("pixelfed")){ + red = "https://thedesk.top/hello.html" + } } else { var red = 'thedesk://manager'; } @@ -352,15 +355,14 @@ function versionChecker(url) { }).then(function (json) { var version = json.version if (version) { - var reg = version.match(/^[0-9]\.[0-9]\.[0-9]/u); + var reg = version.match(/^([0-9])\.[0-9]\.[0-9]/u); if (reg) { - reg = reg[0] - versionCompat(url, reg, json.title, version) + versionCompat(reg[1], reg, json.title, reg[0]) } } }); } -function versionCompat(url, ver, title, real) { +function versionCompat(prefix, ver, title, real) { $("#compt-instance").text(title) $("#compt-ver").text(real) if(~real.indexOf("compatible")){ @@ -383,10 +385,13 @@ function versionCompat(url, ver, title, real) { }).then(function (json) { var complete = false var ct = 0 + var jl = 0 + var jl2 = 0 Object.keys(json).forEach(function (key) { var data = json[key]; if (data) { - if (key != ver && !complete) { + jl++ + if (key != real && !complete) { for (var i = 0; i < data.length; i++) { var e = "" if (i == 0) { @@ -396,14 +401,16 @@ function versionCompat(url, ver, title, real) { ct++; e = "" } + jl2++ } else if (!complete) { complete = true } } - var lastkey = key }); - if (lang.language == "ja" && ct > 0) { - $("#compt").show() + if(lang.language == "ja" && ct > 0){ + if (jl2!=jl && prefix!="1") { + $("#compt").show() + } } }); @@ -566,6 +573,10 @@ function code(code) { } return; } else { + var red = "urn:ietf:wg:oauth:2.0:oob" + if(~url.indexOf("pixelfed")){ + red = "https://thedesk.top/hello.html" + } var start = "https://" + url + "/oauth/token"; var id = localStorage.getItem("client_id"); var secret = localStorage.getItem("client_secret"); @@ -575,7 +586,7 @@ function code(code) { httpreq.responseType = "json"; httpreq.send(JSON.stringify({ grant_type: "authorization_code", - redirect_uri: "urn:ietf:wg:oauth:2.0:oob", + redirect_uri: red, client_id: id, client_secret: secret, code: code diff --git a/app/js/platform/end.js b/app/js/platform/end.js index 64384645..56ef9756 100644 --- a/app/js/platform/end.js +++ b/app/js/platform/end.js @@ -18,12 +18,12 @@ $(document).on('click', 'a', e => { //タグのURLぽかったら var tags = []; tags = url.match( - /https:\/\/([^+_]+)\/tags\/([-_.!~*\'()a-zA-Z0-9;\/?:\&=+\$,%#]+)/ + /https:\/\/([^+_]+)\/tags\/([_a-zA-Z0-9\&=+\%]+)/ ); //メンションっぽかったら var ats = []; ats = url.match( - /https:\/\/([^+_]+)\/@([-_.!~*\'()a-zA-Z0-9;\/?:\&=+\$,%#@]+)/ + /https:\/\/([^+_]+)\/@([_a-zA-Z0-9\&=+\%]+)/ ); if (toot) { if (toot[1]) { diff --git a/app/js/tl/parse.js b/app/js/tl/parse.js index b3ceb35a..e65ddfcf 100644 --- a/app/js/tl/parse.js +++ b/app/js/tl/parse.js @@ -188,6 +188,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) { var local = []; var times = []; Object.keys(obj).forEach(function(key) { + var domain = localStorage.getItem("domain_" + acct_id); var toot = obj[key]; if (type == "dm") { var dmid = toot.id; @@ -281,8 +282,6 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) { } } } - - var domain = localStorage.getItem("domain_" + acct_id); if (popup > 0) { M.toast({ html: "[" + domain + "]" + escapeHTML(toot.account.display_name) + what, displayLength: popup * 1000 }); } @@ -542,6 +541,8 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) { } else { var desc = ""; } + console.log("https://"+domain+"/storage/no-preview.png") + if(media.preview_url=="https://"+domain+"/storage/no-preview.png"){ purl=url; nsfwmes = '
Unavailable preview
';} viewer = viewer + "' + nsfwmes + ""; } } @@ -770,7 +771,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) { for (var i = 0; i < tickerdata.length; i++) { var value = tickerdata[i]; if (value.domain == thisdomain) { - var tickerdom = '
' + escapeHTML(value.name) + "
"; + var tickerdom = '
' + escapeHTML(value.name) + "
"; break; } } @@ -784,7 +785,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) { } poll = poll + '
' + '
' + escapeHTML(quoteUser) + '
' + toot.quote.content + '
more_vert
'; } - templete = templete + '
" + '
' + notice + home + "
" + '
' + '' + noticeavatar + "
" + '
' + dis_name + ' @' + toot.account.acct + locked + "
" + '
' + date(toot.created_at, datetype) + "" + "
" + '
' + tickerdom + '' + spoil + "" + spoiler_show + '' + content + "" + poll + "" + viewer + "" + '
' + analyze + "" + "" + mentions + tags + "
" + '
' + vis + "
" + '
' + '" + '" + '" + '" + '
' + '" + '
' + '
' + '' + trans + '
' + via + "" + '' + '' + "
" + ""; + templete = templete + '
" + '
' + notice + home + "
" + '
' + '' + noticeavatar + "
" + '
' + dis_name + ' @' + toot.account.acct + locked + "
" + '
' + date(toot.created_at, datetype) + "" + "
" + '
' + tickerdom + '' + spoil + "" + spoiler_show + '
' + content + "
" + poll + "" + viewer + "" + '
' + analyze + "" + "" + mentions + tags + "
" + '
' + vis + "
" + '
' + '" + '" + '" + '" + '
' + '" + '
' + '
' + '' + trans + '
' + via + "" + '' + '' + "
" + ""; } }); if (mix == "mix") { diff --git a/app/package.json b/app/package.json index 082d0d92..41d4dc2c 100644 --- a/app/package.json +++ b/app/package.json @@ -56,7 +56,6 @@ "jquery-ui-dist": "^1.12.1", "json5": "^2.1.1", "materialize-css": "^1.0.0", - "node-notifier": "^6.0.0", "sumchecker": "^3.0.0", "sweetalert2": "^8.18.3", "vue": "^2.6.10"