From 7b2254948ba5ccddffc9bd642fbbba8cf3fef5f4 Mon Sep 17 00:00:00 2001 From: osapon Date: Wed, 1 Jan 2020 19:21:35 +0900 Subject: [PATCH 1/9] Use DOM for shortcode replacement. --- app/js/tl/parse.js | 65 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 48 insertions(+), 17 deletions(-) diff --git a/app/js/tl/parse.js b/app/js/tl/parse.js index e78fb055..039fbc35 100644 --- a/app/js/tl/parse.js +++ b/app/js/tl/parse.js @@ -845,23 +845,9 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) { } //絵文字があれば if (emojick) { - Object.keys(toot.emojis).forEach(function(key5) { - var emoji = toot.emojis[key5] - var shortcode = emoji.shortcode - if (gif == 'yes') { - var emoSource = emoji.url - } else { - var emoSource = emoji.static_url - } - var emoji_url = ` -  :${shortcode}: - ` - var regExp = new RegExp(':' + shortcode + ':', 'g') - content = content.replace(regExp, emoji_url) - spoil = spoil.replace(regExp, emoji_url) - poll = poll.replace(regExp, emoji_url) - }) + content = this.customEmojiReplace(content, toot, gif); + spoil = this.customEmojiReplace(spoil, toot, gif); + poll = this.customEmojiReplace(poll, toot, gif); } //ニコフレ絵文字 if (toot.profile_emojis) { @@ -1513,3 +1499,48 @@ function pollParse(poll, acct_id, emojis) { ` return pollHtml } +function customEmojiReplace(content, toot, gif) { + var contentDiv = document.createElement('div'); + contentDiv.style.display = 'none'; + contentDiv.innerHTML = content; + var replace = false; + Object.keys(toot.emojis).forEach(function(key5) { + var emoji = toot.emojis[key5] + var shortcode = emoji.shortcode + if (gif == 'yes') { + var emoSource = emoji.url + } else { + var emoSource = emoji.static_url + } + var nodes = document.evaluate('//text()', contentDiv, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null ); + if ( nodes.snapshotLength == 0 ) return; + + var shortcodeBracket = (':' + shortcode + ':'); + var img = document.createElement('img'); + img.setAttribute('draggable', 'false'); + img.setAttribute('src', emoSource); + img.setAttribute('class', 'emoji-img'); + img.setAttribute('data-emoji', shortcode); + img.setAttribute('alt', shortcodeBracket); + img.setAttribute('title', shortcodeBracket); + img.setAttribute('onclick', "this.classList.toggle('bigemoji');"); + + for ( var i=0; i < nodes.snapshotLength; i++ ) { + var node = nodes.snapshotItem(i); + var txt = node.textContent; + var spos = txt.indexOf(shortcodeBracket); + if (spos == -1) continue; + + var txtBefore = document.createTextNode(txt.substr(0, spos)); + var txtAfter = document.createTextNode(txt.substr(spos + shortcodeBracket.length)); + + node.parentNode.insertBefore(txtBefore, node); + node.parentNode.insertBefore(img, node); + node.parentNode.insertBefore(txtAfter, node); + node.textContent = ''; + replace = true; + } + }) + if (replace) contentDiv.innerHTML = this.customEmojiReplace(contentDiv.innerHTML, toot, gif); + return contentDiv.innerHTML; +} \ No newline at end of file From 2abca19e698b296f705faf0b1d9841b1443cbe6a Mon Sep 17 00:00:00 2001 From: osapon Date: Sat, 19 Nov 2022 11:29:02 +0900 Subject: [PATCH 2/9] fix error thread view --- app/js/tl/datails.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/js/tl/datails.js b/app/js/tl/datails.js index 8be54237..22e92a6d 100644 --- a/app/js/tl/datails.js +++ b/app/js/tl/datails.js @@ -49,6 +49,7 @@ async function details(id, acct_id, tlid, mode) { const json = await response.json() console.log(['Toot data:', json]) if (!$('#timeline_' + tlid + ' #pub_' + id).length) { + var mute = getFilterTypeByAcct(acct_id, 'thread') var html = parse([json], '', acct_id, '', '', mute) $('#toot-this').html(html) jQuery('time.timeago').timeago() @@ -126,7 +127,7 @@ async function details(id, acct_id, tlid, mode) { if (!$('#activator').hasClass('active')) { $('#det-col').collapsible('open', 4) } - } catch (e) { + } catch (error) { todo(error) setLog(start, 'JSON', error) console.error(error) From b4f064e98c75962f0c7388e4c9b0de91f6b31180 Mon Sep 17 00:00:00 2001 From: b-xb <7443583+b-xb@users.noreply.github.com> Date: Wed, 30 Nov 2022 16:41:34 +0000 Subject: [PATCH 3/9] Update tl.css FIx Display Name area so that the Display Name is set to the correct size --- app/css/tl.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/css/tl.css b/app/css/tl.css index b60d7f3c..95fe30ad 100644 --- a/app/css/tl.css +++ b/app/css/tl.css @@ -297,7 +297,7 @@ iframe, .area-display_name { user-select: text; - height: 1.5em; + height: 1.5rem; margin: 0.15rem; margin-left: 0.4rem; overflow: hidden; From b32f3b273053b42c28b7203e0c5757049c25dadf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 30 Nov 2022 20:02:46 +0000 Subject: [PATCH 4/9] Bump sweetalert2 from 11.4.38 to 11.6.15 in /app Bumps [sweetalert2](https://github.com/sweetalert2/sweetalert2) from 11.4.38 to 11.6.15. - [Release notes](https://github.com/sweetalert2/sweetalert2/releases) - [Changelog](https://github.com/sweetalert2/sweetalert2/blob/main/CHANGELOG.md) - [Commits](https://github.com/sweetalert2/sweetalert2/compare/v11.4.38...v11.6.15) --- updated-dependencies: - dependency-name: sweetalert2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- app/package.json | 2 +- app/yarn.lock | 53 ++++++++++++++++++++++++------------------------ 2 files changed, 27 insertions(+), 28 deletions(-) diff --git a/app/package.json b/app/package.json index 1116dd5d..ff343236 100644 --- a/app/package.json +++ b/app/package.json @@ -69,7 +69,7 @@ "lodash": "^4.17.21", "sanitize-html": "^2.7.2", "sumchecker": "^3.0.1", - "sweetalert2": "^11.4.38", + "sweetalert2": "^11.6.15", "system-font-families": "^0.6.0", "textarea-caret": "^3.1.0", "uuid": "^8.3.2", diff --git a/app/yarn.lock b/app/yarn.lock index e3d7a448..75d1343e 100644 --- a/app/yarn.lock +++ b/app/yarn.lock @@ -577,13 +577,6 @@ dependencies: "@types/yargs-parser" "*" -"@types/yauzl@^2.9.1": - version "2.10.0" - resolved "https://registry.yarnpkg.com/@types/yauzl/-/yauzl-2.10.0.tgz#b3248295276cf8c6f153ebe6a9aba0c988cb2599" - integrity sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw== - dependencies: - "@types/node" "*" - JSONStream@^1.0.3: version "1.3.5" resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0" @@ -1444,7 +1437,7 @@ concat-map@0.0.1: resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== -concat-stream@^1.6.0, concat-stream@^1.6.1, concat-stream@~1.6.0: +concat-stream@^1.6.0, concat-stream@^1.6.1, concat-stream@^1.6.2, concat-stream@~1.6.0: version "1.6.2" resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== @@ -1579,7 +1572,7 @@ debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.3, d dependencies: ms "2.1.2" -debug@^2.6.8: +debug@^2.6.8, debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== @@ -1809,7 +1802,7 @@ ejs@^3.1.7: dependencies: jake "^10.8.5" -electron-builder@^23.6.0: +electron-builder@^23.2.0: version "23.6.0" resolved "https://registry.yarnpkg.com/electron-builder/-/electron-builder-23.6.0.tgz#c79050cbdce90ed96c5feb67c34e9e0a21b5331b" integrity sha512-y8D4zO+HXGCNxFBV/JlyhFnoQ0Y0K7/sFH+XwIbj47pqaW8S6PGYQbjoObolKBR1ddQFPt4rwp4CnwMJrW3HAw== @@ -1889,14 +1882,14 @@ electron-rebuild@^3.2.9: tar "^6.0.5" yargs "^17.0.1" -electron@^21.1.0: - version "21.1.0" - resolved "https://registry.yarnpkg.com/electron/-/electron-21.1.0.tgz#7272dfe1a5d6a00fd58d17b26215e541b6ff10dd" - integrity sha512-CM5VZpZPtAoPgTPcmEbRaZWXlxGuD5a5DTeAwm0F0F6/k6R3HZAi8vZnE77gwuHK/Qqcinw4/MAbiCwAKh2W+g== +electron@^19.0.11: + version "19.1.9" + resolved "https://registry.yarnpkg.com/electron/-/electron-19.1.9.tgz#01995eea4014f7cdb2f616f5f3492d4ed6f5e4f0" + integrity sha512-XT5LkTzIHB+ZtD3dTmNnKjVBWrDWReCKt9G1uAFLz6uJMEVcIUiYO+fph5pLXETiBw/QZBx8egduMEfIccLx+g== dependencies: "@electron/get" "^1.14.1" "@types/node" "^16.11.26" - extract-zip "^2.0.1" + extract-zip "^1.0.3" elliptic@^6.5.3: version "6.5.4" @@ -2186,16 +2179,15 @@ ext-name@^5.0.0: ext-list "^2.0.0" sort-keys-length "^1.0.0" -extract-zip@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/extract-zip/-/extract-zip-2.0.1.tgz#663dca56fe46df890d5f131ef4a06d22bb8ba13a" - integrity sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg== +extract-zip@^1.0.3: + version "1.7.0" + resolved "https://registry.yarnpkg.com/extract-zip/-/extract-zip-1.7.0.tgz#556cc3ae9df7f452c493a0cfb51cc30277940927" + integrity sha512-xoh5G1W/PB0/27lXgMQyIhP5DSY/LhoCsOyZgb+6iMmRtCwVBo55uKaMoEYrDCKQhWvqEip5ZPKAc6eFNyf/MA== dependencies: - debug "^4.1.1" - get-stream "^5.1.0" + concat-stream "^1.6.2" + debug "^2.6.9" + mkdirp "^0.5.4" yauzl "^2.10.0" - optionalDependencies: - "@types/yauzl" "^2.9.1" extsprintf@^1.2.0: version "1.4.0" @@ -3456,6 +3448,13 @@ mkdirp@^0.5.1: dependencies: minimist "0.0.8" +mkdirp@^0.5.4: + version "0.5.6" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" + integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw== + dependencies: + minimist "^1.2.6" + mkdirp@^1.0.3, mkdirp@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" @@ -4738,10 +4737,10 @@ supports-color@^7.1.0: dependencies: has-flag "^4.0.0" -sweetalert2@^11.4.38: - version "11.4.38" - resolved "https://registry.yarnpkg.com/sweetalert2/-/sweetalert2-11.4.38.tgz#f8cec3a87b99d7f3edd9756676d11d3c86e46b4a" - integrity sha512-H8FDIiL7hLe7uUEdTO6xwk2Vexvr05IL7FGZAIHEFmjjnZRWtRrSUYm//r+4bL8d6XhjWFRHXBs32ZCwH+ir8g== +sweetalert2@^11.6.15: + version "11.6.15" + resolved "https://registry.yarnpkg.com/sweetalert2/-/sweetalert2-11.6.15.tgz#0459e97100810b0734c62d2cce4d3d41c8f30b0a" + integrity sha512-FqMy1gRGHEI5G145NE5XSP059TziCJu9Xf9/mkki/aKu5pLNcYzjggOzKO5Ex10EBgAGDXQ99jyGfYYzGCYXRQ== syntax-error@^1.1.1: version "1.4.0" From ccc6d9617265b8a1bb48c88bcb1c89d48894e1b5 Mon Sep 17 00:00:00 2001 From: cutls Date: Mon, 5 Dec 2022 23:12:33 +0900 Subject: [PATCH 5/9] newcomer notifiation --- app/js/tl/notification.js | 54 +++++++++++++------------- app/js/tl/parse.js | 4 +- app/view/make/language/en/main.json | 1 + app/view/make/language/ja-KS/main.json | 2 + app/view/make/language/ja/main.json | 1 + 5 files changed, 34 insertions(+), 28 deletions(-) diff --git a/app/js/tl/notification.js b/app/js/tl/notification.js index 2cb3c668..a5ff9de1 100644 --- a/app/js/tl/notification.js +++ b/app/js/tl/notification.js @@ -41,7 +41,7 @@ function notfColumn(acct_id, tlid, sys) { httpreq.responseType = 'json' httpreq.send(body) - httpreq.onreadystatechange = function() { + httpreq.onreadystatechange = function () { if (httpreq.readyState === 4) { var json = httpreq.response if (this.status !== 200) { @@ -56,7 +56,7 @@ function notfColumn(acct_id, tlid, sys) { var templete = '' var lastnotf = localStorage.getItem('lastnotf_' + acct_id) localStorage.setItem('lastnotf_' + acct_id, json[0].id) - Object.keys(json).forEach(function(key) { + Object.keys(json).forEach(function (key) { var obj = json[key] if (lastnotf == obj.id && key > 0 && native == 'yes') { var ct = key @@ -71,8 +71,8 @@ function notfColumn(acct_id, tlid, sys) { var n = new Notification('TheDesk:' + domain, options) } var mute = getFilterTypeByAcct(acct_id, 'notif') - //Pleromaにはmoveというtypeがあるらしい。何が互換APIじゃ - if (obj.type != 'follow' && obj.type != 'move' && obj.type != 'follow_request') { + //Pleromaにはmoveというtypeがあるらしい。何が互換APIじゃ + if (obj.type !== 'follow' && obj.type !== 'move' && obj.type !== 'request' && obj.type !== 'admin.sign_up') { if (misskey) { templete = templete + misskeyParse([obj], 'notf', acct_id, tlid, -1, mute) } else { @@ -90,12 +90,12 @@ function notfColumn(acct_id, tlid, sys) { }) templete = templete + '
' $('#timeline_' + tlid).html(templete) - // $('#landing_' + tlid).hide() + // $('#landing_' + tlid).hide() jQuery('time.timeago').timeago() } $('#notf-box').addClass('fetched') todc() - //Markers + //Markers var markers = localStorage.getItem('markers') if (markers == 'yes') { markers = true @@ -155,10 +155,10 @@ function notfCommon(acct_id, tlid, sys, stream) { return false } fetch(start, i) - .then(function(response) { + .then(function (response) { console.log('header to get param:' + response.headers.get('link')) if (!response.ok) { - response.text().then(function(text) { + response.text().then(function (text) { console.log('notf error', 'div[data-notf=' + acct_id + '] .landing') $('div[data-notf=' + acct_id + '] .landing').append(`
${response.status}
${escapeHTML(text)}`) setLog(response.url, response.status, text) @@ -166,17 +166,17 @@ function notfCommon(acct_id, tlid, sys, stream) { } return response.json() }) - .catch(function(error) { + .catch(function (error) { todo(error) setLog(start, 'JSON', error) console.error(error) }) - .then(function(json) { + .then(function (json) { if (json[0]) { var templete = '' var lastnotf = localStorage.getItem('lastnotf_' + acct_id) localStorage.setItem('lastnotf_' + acct_id, json[0].id) - Object.keys(json).forEach(function(key) { + Object.keys(json).forEach(function (key) { var obj = json[key] if (lastnotf == obj.id && key > 0 && native == 'yes') { var ct = key @@ -191,8 +191,8 @@ function notfCommon(acct_id, tlid, sys, stream) { var n = new Notification('TheDesk:' + domain, options) } var mute = getFilterTypeByAcct(acct_id, 'notif') - //Pleromaにはmoveというtypeがあるらしい。何が互換APIじゃ - if (obj.type != 'follow' && obj.type != 'move') { + //Pleromaにはmoveというtypeがあるらしい。何が互換APIじゃ + if (obj.type !== 'follow' && obj.type !== 'move' && obj.type !== 'request' && obj.type !== 'admin.sign_up') { if (misskey) { templete = templete + misskeyParse([obj], 'notf', acct_id, 'notf', -1, mute) } else { @@ -207,7 +207,7 @@ function notfCommon(acct_id, tlid, sys, stream) { } }) $('div[data-notf=' + acct_id + ']').html(templete) - // $('#landing_' + tlid).hide() + // $('#landing_' + tlid).hide() jQuery('time.timeago').timeago() } $('#notf-box').addClass('fetched') @@ -228,7 +228,7 @@ function notfWS(misskey, acct_id, tlid, domain, at) { var wsid = websocketNotf.length websocketNotf[acct_id] = new WebSocket(start) - websocketNotf[acct_id].onopen = function(mess) { + websocketNotf[acct_id].onopen = function (mess) { console.table({ acct_id: acct_id, type: 'Connect Streaming API(Notf)', @@ -237,9 +237,9 @@ function notfWS(misskey, acct_id, tlid, domain, at) { }) $('i[data-notf=' + acct_id + ']').removeClass('red-text') } - websocketNotf[acct_id].onmessage = function(mess) { + websocketNotf[acct_id].onmessage = function (mess) { $('#landing_' + tlid).hide() - //console.log(["Receive Streaming API(Notf):" + acct_id + "(" + domain + ")", JSON.parse(JSON.parse(mess.data).payload)]); + //console.log(["Receive Streaming API(Notf):" + acct_id + "(" + domain + ")", JSON.parse(JSON.parse(mess.data).payload)]); var popup = localStorage.getItem('popup') if (!popup) { popup = 0 @@ -251,7 +251,7 @@ function notfWS(misskey, acct_id, tlid, domain, at) { localStorage.setItem('lastnotf_' + acct_id, obj.id) if (!$('#unread_' + tlid + ' .material-icons').hasClass('teal-text')) { //markers show中はダメ - if (obj.type != 'follow' && obj.type != 'follow_request') { + if (obj.type !== 'follow' && obj.type !== 'move' && obj.type !== 'request' && obj.type !== 'admin.sign_up') { templete = parse([obj], 'notf', acct_id, 'notf', popup) } else if (obj.type == 'follow_request') { templete = userparse([obj.account], 'request', acct_id, 'notf', -1) @@ -269,7 +269,7 @@ function notfWS(misskey, acct_id, tlid, domain, at) { $('[toot-id=' + obj + ']').remove() } } - websocketNotf[acct_id].onerror = function(error) { + websocketNotf[acct_id].onerror = function (error) { console.error('WebSocket Error ', error) errorct++ console.log(errorct) @@ -277,7 +277,7 @@ function notfWS(misskey, acct_id, tlid, domain, at) { notfWS(misskey, acct_id, tlid, domain, at) } } - websocketNotf[acct_id].onclose = function(error) { + websocketNotf[acct_id].onclose = function (error) { console.error('WebSocket Close ', error) errorct++ console.log(errorct) @@ -331,7 +331,7 @@ function notfmore(tlid) { httpreq.responseType = 'json' httpreq.send(body) - httpreq.onreadystatechange = function() { + httpreq.onreadystatechange = function () { if (httpreq.readyState === 4) { var json = httpreq.response if (this.status !== 200) { @@ -343,10 +343,10 @@ function notfmore(tlid) { var templete = '' var lastnotf = localStorage.getItem('lastnotf_' + acct_id) localStorage.setItem('lastnotf_' + acct_id, json[0].id) - Object.keys(json).forEach(function(key) { + Object.keys(json).forEach(function (key) { var obj = json[key] var mute = getFilterTypeByAcct(acct_id, 'notif') - if (obj.type != 'follow') { + if (obj.type !== 'follow' && obj.type !== 'move' && obj.type !== 'request' && obj.type !== 'admin.sign_up') { if (misskey) { templete = templete + misskeyParse([obj], 'notf', acct_id, 'notf', -1, mute) } else { @@ -363,7 +363,7 @@ function notfmore(tlid) { moreloading = false templete = templete + '
' $('#timeline_' + tlid).append(templete) - // $('#landing_' + tlid).hide() + // $('#landing_' + tlid).hide() jQuery('time.timeago').timeago() } $('#notf-box').addClass('fetched') @@ -381,7 +381,7 @@ function notfToggle(acct, tlid) { height: '400px', }, { duration: 300, - complete: function() { + complete: function () { $('#notf-box_' + tlid).css('overflow-y', 'scroll') $('#notf-box_' + tlid).removeClass('column-hide') }, @@ -392,7 +392,7 @@ function notfToggle(acct, tlid) { height: '0', }, { duration: 300, - complete: function() { + complete: function () { $('#notf-box_' + tlid).addClass('column-hide') $('#notf-box_' + tlid).css('display', 'none') }, @@ -429,7 +429,7 @@ function allNotfRead() { var multi = localStorage.getItem('multi') if (multi) { var obj = JSON.parse(multi) - Object.keys(obj).forEach(function(key) { + Object.keys(obj).forEach(function (key) { notfCanceler(key) }) } diff --git a/app/js/tl/parse.js b/app/js/tl/parse.js index 8bb4418b..cff87050 100644 --- a/app/js/tl/parse.js +++ b/app/js/tl/parse.js @@ -1217,6 +1217,8 @@ function userparse(obj, auth, acct_id, tlid, popup) { var ftxt = lang.lang_parse_moved } else if (auth == 'request') { var ftxt = lang.lang_parse_request + } else if (auth == 'admin.sign_up') { + var ftxt = lang.lang_parse_signup } if (popup > 0 || popup == -1 || notf) { var notftext = ftxt + '
' @@ -1585,7 +1587,7 @@ function mastodonBaseStreaming(acct_id) { if (!popup) { popup = 0 } - if (obj.type != 'follow' && obj.type != 'follow_request') { + if (obj.type !== 'follow' && obj.type !== 'move' && obj.type !== 'request' && obj.type !== 'admin.sign_up') { template = parse([obj], 'notf', acct_id, 'notf', popup) } else if (obj.type == 'follow_request') { template = userparse([obj.account], 'request', acct_id, 'notf', -1) diff --git a/app/view/make/language/en/main.json b/app/view/make/language/en/main.json index a1eb6c2b..dadd225c 100644 --- a/app/view/make/language/en/main.json +++ b/app/view/make/language/en/main.json @@ -176,6 +176,7 @@ "lang_showontl_botacct": "[bot]", "lang_showontl_followed": "Following you", "lang_parse_request": "Follow request", + "lang_parse_signup": "Newface", "lang_showontl_notf": "Notification ", "lang_showontl_domain": "Domain ", "lang_showontl_listwarn": "Follow to add this user to lists.", diff --git a/app/view/make/language/ja-KS/main.json b/app/view/make/language/ja-KS/main.json index e7715cfd..f4bf4d26 100644 --- a/app/view/make/language/ja-KS/main.json +++ b/app/view/make/language/ja-KS/main.json @@ -178,6 +178,8 @@ "lang_showontl_domain": "ドメイン", "lang_showontl_listwarn": "リストに追加すんにはまずフォローしてな。", "lang_showontl_verified": "このサイトはこの人のやつやってわかってる。", + "lang_parse_request": "フォローリクエスト", + "lang_parse_signup": "新規登録", "lang_parse_mentioned": "が返信したで", "lang_parse_faved": "がお気に入り登録したで", "lang_parse_bted": "がブーストしたで", diff --git a/app/view/make/language/ja/main.json b/app/view/make/language/ja/main.json index c33f38fb..240fad8b 100644 --- a/app/view/make/language/ja/main.json +++ b/app/view/make/language/ja/main.json @@ -177,6 +177,7 @@ "lang_showontl_botacct": "botアカウント", "lang_showontl_followed": "フォローされています", "lang_parse_request": "フォローリクエスト", + "lang_parse_signup": "新規登録", "lang_showontl_notf": "通知", "lang_showontl_domain": "ドメイン", "lang_showontl_listwarn": "リストに追加するためにはフォローが必要です。", From 796d422222b2f59508233a809b29f11e7456047a Mon Sep 17 00:00:00 2001 From: osapon Date: Wed, 1 Jan 2020 19:21:35 +0900 Subject: [PATCH 6/9] delete amazonwidhlist --- app/view/make/components/supportMe.html | 1 - 1 file changed, 1 deletion(-) diff --git a/app/view/make/components/supportMe.html b/app/view/make/components/supportMe.html index 8e301448..c728cb1a 100644 --- a/app/view/make/components/supportMe.html +++ b/app/view/make/components/supportMe.html @@ -22,7 +22,6 @@
@@once@@
- @@AWLSupport@@
@@SendAmazonGift1@@ web-pro@cutls.com@@SendAmazonGift2@@
Kyash

From c83079bb80658bb4c8147ccbc92dd92df9e02fa3 Mon Sep 17 00:00:00 2001 From: osapon Date: Sat, 19 Nov 2022 11:29:02 +0900 Subject: [PATCH 7/9] fix error thread view --- app/js/tl/datails.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/js/tl/datails.js b/app/js/tl/datails.js index 8be54237..22e92a6d 100644 --- a/app/js/tl/datails.js +++ b/app/js/tl/datails.js @@ -49,6 +49,7 @@ async function details(id, acct_id, tlid, mode) { const json = await response.json() console.log(['Toot data:', json]) if (!$('#timeline_' + tlid + ' #pub_' + id).length) { + var mute = getFilterTypeByAcct(acct_id, 'thread') var html = parse([json], '', acct_id, '', '', mute) $('#toot-this').html(html) jQuery('time.timeago').timeago() @@ -126,7 +127,7 @@ async function details(id, acct_id, tlid, mode) { if (!$('#activator').hasClass('active')) { $('#det-col').collapsible('open', 4) } - } catch (e) { + } catch (error) { todo(error) setLog(start, 'JSON', error) console.error(error) From 30d4dae0c43d2252e7f55338e8fdaf7c83699fe0 Mon Sep 17 00:00:00 2001 From: cutls Date: Mon, 5 Dec 2022 23:43:15 +0900 Subject: [PATCH 8/9] use translate api --- app/js/tl/datails.js | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/app/js/tl/datails.js b/app/js/tl/datails.js index 22e92a6d..5895d6d1 100644 --- a/app/js/tl/datails.js +++ b/app/js/tl/datails.js @@ -600,28 +600,21 @@ function staCopy(id) { } //翻訳 function trans(tar, to, elem) { - var html = elem.parents('.cvo').find('.toot').html() - if (html.match(/^

(.+)<\/p>$/)) { - html = html.match(/^

(.+)<\/p>$/)[1] - } - html = html.replace(//g, '\n') - html = html.replace(/

/g, '\n') - html = html.replace(/<\/p>/g, '\n') - html = $.strip_tags(html) - if (~tar.indexOf('zh')) { - tar = 'zh' - } + var id = elem.parents('.cvo').attr('toot-id') + alert(id) $('#toot-this .additional').text('Loading...(Powered by Google Translate)') - var exec = - 'https://script.google.com/macros/s/AKfycbxhwW5tjjop9Irg-y1zr_WsXlCKEzwWG6KuoOt_vVRDfEbRv0c/exec?format=json&text=' + - encodeURIComponent(html) + - '&source=' + - tar + - '&target=' + - to - console.log('Try to translate from ' + tar + ' to ' + to + ' at ' + exec) + var domain = localStorage.getItem('domain_' + acct_id) + if (localStorage.getItem('mode_' + domain) == 'misskey') { + return false + } + var at = localStorage.getItem('acct_' + acct_id + '_at') + var exec = `https://${domain}/api/v1/statuses/${id}/translate` fetch(exec, { - method: 'GET' + method: 'POST', + headers: { + 'content-type': 'application/json', + Authorization: 'Bearer ' + at + } }) .then(function (response) { if (!response.ok) { @@ -637,7 +630,8 @@ function trans(tar, to, elem) { console.error(error) }) .then(function (text) { - elem.parents('.cvo').find('.toot').append('' + text.text + '') + console.log(text) + elem.parents('.cvo').find('.toot').append('' + text.content + '') }) } //ブラウザで開く From b825298bc68c8d1ae7ed91689e445b2d435798e7 Mon Sep 17 00:00:00 2001 From: cutls Date: Tue, 6 Dec 2022 00:15:14 +0900 Subject: [PATCH 9/9] 23.0.2 --- app/package.json | 2 +- app/view/make/components/postBox.html | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/app/package.json b/app/package.json index 1116dd5d..9425ec15 100644 --- a/app/package.json +++ b/app/package.json @@ -1,6 +1,6 @@ { "name": "thedesk", - "version": "23.0.1", + "version": "23.0.2", "codename": "Chieri", "description": "TheDesk is a Mastodon client for PC.", "repository": "https://github.com/cutls/TheDesk", diff --git a/app/view/make/components/postBox.html b/app/view/make/components/postBox.html index 60869034..524b980b 100644 --- a/app/view/make/components/postBox.html +++ b/app/view/make/components/postBox.html @@ -138,9 +138,6 @@

  • NowPlaying (iTunes macOS)
  • -
  • - NowPlaying (コントロールセンター) -
  • NowPlaying (Last.fm)