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 = '