diff --git a/.gitignore b/.gitignore index 1ab6dd1c..34481849 100644 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,4 @@ app/build.js app/view/make/make.js app/view/make/makeCli.ts app/.env +app/view/make/index.generated.html diff --git a/app/css/master.css b/app/css/master.css index 705e200f..b3a3fe0b 100644 --- a/app/css/master.css +++ b/app/css/master.css @@ -86,6 +86,7 @@ option { #imagemodal .modal-footer { overflow-x: hidden; overflow-y: hidden; + height: 56px; } #imagewrap { diff --git a/app/css/userdata.css b/app/css/userdata.css index ab3de24d..ac95cb0e 100644 --- a/app/css/userdata.css +++ b/app/css/userdata.css @@ -1,172 +1,219 @@ /*アイコンをクリックした時とかにでてくるユーザーデータ*/ + #his-data { - background-repeat: no-repeat; - background-image: url('../img/loading.svg'); - overflow-y: hidden; + background-repeat: no-repeat; + background-image: url('../img/loading.svg'); + overflow-y: hidden; } + #his-data .btn .material-icons { - float: left; + float: left; } + #his-data-content { - display: flex; - justify-content: center; + display: flex; + justify-content: center; } + #his-name { - font-size: 1.5rem; + font-size: 1.5rem; } + #his-prof { - width: 7.7rem; - margin-right: 0.4rem; + width: 7.7rem; + margin-right: 0.4rem; } + .his-float { - overflow-y: scroll; - padding: 0.4rem; + overflow-y: scroll; + padding: 0.4rem; } + #his-float-data { - height: 100%; - overflow-y: hidden; + height: 100%; + overflow-y: hidden; } + #his-leftside { - width: 28.4rem; - max-width: 30vw; + width: 28.4rem; + max-width: 30vw; } + #his-float-timeline { - max-width: 47.5rem; - width: calc(100% - 28.4rem); - height: 100%; - overflow-y: hidden; + max-width: 47.5rem; + width: calc(100% - 28.4rem); + height: 100%; + overflow-y: hidden; } + #his-basic-prof { - display: flex; - min-height: 10rem; + display: flex; + min-height: 10rem; } + #his-field { - vertical-align: baseline; - text-align: center; - padding: 0; + vertical-align: baseline; + text-align: center; + padding: 0; } + #his-field tr { - height: 1.5rem; + height: 1.5rem; } + .his-field-title { - height: 1.5rem; - padding: 0; - background-color: #757575; - text-align: center; - padding: 0.4rem; - margin-bottom: 1px; - width: 30%; + height: 1.5rem; + padding: 0; + background-color: #757575; + text-align: center; + padding: 0.4rem; + margin-bottom: 1px; + width: 30%; } + .his-field-content { - height: 1.5rem; - padding: 0; - padding-left: 0.4rem; + height: 1.5rem; + padding: 0; + padding-left: 0.4rem; } + .his-var-content a span.ellipsis:after { - content: '...'; + content: '...'; } + .his-var-content a:not(.mention) span:last-of-type { - display: none; + display: none; } + #his-data a .rep_ct, #his-data a .rt_ct, #his-data a .fav_ct { - display: inline !important; + display: inline !important; } + #his-data-show { - margin: 1.5rem; - margin-left: 3.8rem; - margin-right: 3.8rem; - background-color: var(--his-data); - height: calc(100% - 1.5rem); - margin-bottom: 0; - padding: 0.4rem; + margin: 1.5rem; + margin-left: 3.8rem; + margin-right: 3.8rem; + background-color: var(--his-data); + height: calc(100% - 1.5rem); + margin-bottom: 0; + padding: 0.4rem; } + #his-data-wrap { - display: flex; + display: flex; } + .his-var-content { - overflow-y: scroll; - overflow-x: hidden; - height: calc(100% - 3.4rem); - padding-bottom: 60px; + overflow-y: scroll; + overflow-x: hidden; + height: calc(100% - 3.4rem); + padding-bottom: 60px; } + #my-data-nav .btn { - width: 10.6rem; + width: 10.6rem; } + #my-data-nav .active-back { - display: none; + display: none; } + #his-name .emojione, #his-name .emoji-img { - width: 1.538rem; + width: 1.538rem; } + #his-plus-action .btn { - padding-right: 0.4rem; - padding-left: 0.4rem; + padding-right: 0.4rem; + padding-left: 0.4rem; } + .tabs { - display: flex; + display: flex; } + .tabs .tab a { - padding: 0.6rem 0.9rem; + padding: 0.6rem 0.9rem; } + #his-des { - max-height: 17.7rem; - overflow-y: scroll; + max-height: 17.7rem; + overflow-y: scroll; + user-select: text; + cursor: text; } + #his-sign-action { - border: 1px solid; - border-radius: 0.4rem; - display: flex; - align-items: center; - padding-left: 0.75rem; - padding-right: 0.75rem; - flex-wrap: wrap; + border: 1px solid; + border-radius: 0.4rem; + display: flex; + align-items: center; + padding-left: 0.75rem; + padding-right: 0.75rem; + flex-wrap: wrap; } -#his-sign-action .btn { - flex-basis: calc(50% - 10.6px); + +#his-sign-action .shrinker { + margin-right: 0.5rem; + flex-basis: calc(50% - 1rem); } + +#his-sign-action .shrinker.btn { + width: 100%; +} + #his-sign-action .dropdown-trigger { - flex-basis: 100%; + flex-basis: 100%; } + #his-des .mention { - color: #039be5; - cursor: pointer; + color: #039be5; + cursor: pointer; } + #his-table { - max-height: 11.538rem; - overflow-y: scroll; + max-height: 9.2rem; + overflow-y: scroll; + user-select: text; } + #his-float-blocked { - display: flex; - justify-content: center; - align-items: center; - font-size: 2rem; - height: 100%; + display: flex; + justify-content: center; + align-items: center; + font-size: 2rem; + height: 100%; } + #hisdropdown { - background-color: var(--bg); + background-color: var(--bg); } + #hisdropdown li a { - color: var(--text); + color: var(--text); } + #hisdropdown li:hover { - background-color: var(--active); + background-color: var(--active); } + #his-data-title-wrap { - width: 100%; - text-align: center; - font-size: 1.5rem; - display: flex; - justify-content: center; - align-items: center; + width: 100%; + text-align: center; + font-size: 1.5rem; + display: flex; + justify-content: center; + align-items: center; } + #his-data-title .material-icons { - position: relative; - top: 5px; - margin-right: 3px; + position: relative; + top: 5px; + margin-right: 3px; } + #his-data-title a { - color: white; + color: white; } \ No newline at end of file diff --git a/app/js/post/status.js b/app/js/post/status.js index 4cbf0984..7326bc97 100644 --- a/app/js/post/status.js +++ b/app/js/post/status.js @@ -340,13 +340,23 @@ function muteDo(acct_id) { var id = $('#his-data').attr('user-id') var domain = localStorage.getItem('domain_' + acct_id) var at = localStorage.getItem('acct_' + acct_id + '_at') + const days = parseInt($('#days_mute').val(), 10) + const hours = parseInt($('#hours_mute').val(), 10) + const mins = parseInt($('#mins_mute').val(), 10) + const notf = $('#notf_mute:checked').val() === '1' + let duration = days * 24 * 60 * 60 + hours * 60 + mins if (localStorage.getItem('mode_' + domain) == 'misskey') { var start = 'https://' + domain + '/api/mute/' + flagm var ent = { i: at, userId: id } var rq = JSON.stringify(ent) } else { var start = 'https://' + domain + '/api/v1/accounts/' + id + '/' + flag - var rq = '' + const q = { + notifications: notf + } + if (duration > 0) q.duration = duration * 60 + if (days < 0 || hours < 0 || mins < 0) return Swal.fire('Invalid number') + var rq = JSON.stringify(q) } var httpreq = new XMLHttpRequest() httpreq.open('POST', start, true) @@ -371,6 +381,15 @@ function muteDo(acct_id) { } }) } +function muteMenu() { + $('#muteDuration').toggleClass('hide') + !$('#muteDuration').hasClass('hide') ? $('#his-des').css('max-height', '112px') : $('#his-des').css('max-height', '196px') +} +function muteTime(day, hour, min) { + $('#days_mute').val(day) + $('#hours_mute').val(hour) + $('#mins_mute').val(min) +} //投稿削除 function del(id, acct_id) { diff --git a/app/js/ui/img.js b/app/js/ui/img.js index e96296a8..6cb937ee 100644 --- a/app/js/ui/img.js +++ b/app/js/ui/img.js @@ -76,7 +76,12 @@ function imgCont(type) { } } function imageXhr(id, key, murl) { + let time = 0 var startTime = new Date() + const timer = setInterval(function() { + time = time + 1 + $('#imgsec').text(time) + }, 10) $('#imgmodal-progress div').removeClass('determinate') $('#imgmodal-progress div').addClass('indeterminate') $('#imgmodal-progress').removeClass('hide') @@ -89,6 +94,7 @@ function imageXhr(id, key, murl) { if (event.lengthComputable) { var total = event.total var now = event.loaded + $('#imgbyte').text(`${Math.floor(now / 1024)}KB/${Math.floor(total / 1024)}`) var per = (now / total) * 100 $('#imgmodal-progress div').removeClass('indeterminate') $('#imgmodal-progress div').addClass('determinate') @@ -147,6 +153,7 @@ function imageXhr(id, key, murl) { } element.src = b64 var endTime = new Date() + clearInterval(timer) var proctime = endTime.getTime() - startTime.getTime() $('#imgsec').text(proctime) $('#imgmodal').attr('src', b64) diff --git a/app/js/userdata/showOnTL.js b/app/js/userdata/showOnTL.js index 9229ce50..454e849f 100644 --- a/app/js/userdata/showOnTL.js +++ b/app/js/userdata/showOnTL.js @@ -190,7 +190,7 @@ function udg(user, acct_id, isSwal) { if (json.fields) { var table = '' if (json.fields.length > 0) { - $('#his-des').css('max-height', '250px') + $('#his-des').css('max-height', '196px') table = '' for (var i = 0; i < json.fields.length; i++) { var fname = json.fields[i].name diff --git a/app/view/make/components/bottomBarHtml.html b/app/view/make/components/bottomBarHtml.html new file mode 100644 index 00000000..ebd32d44 --- /dev/null +++ b/app/view/make/components/bottomBarHtml.html @@ -0,0 +1,56 @@ + +
+
+
+ +
+ +
+
+ + +
+
\ No newline at end of file diff --git a/app/view/make/components/index.html b/app/view/make/components/index.html new file mode 100644 index 00000000..1d2f00f1 --- /dev/null +++ b/app/view/make/components/index.html @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + @@comment-start@@ + + + @@comment-end@@ @@pwa@@ @@store@@ + + + + + @@preTL@@ @@starterAndDragHandler@@ @@postBox@@ @@tootModal@@ @@userDataModal@@ @@mediaModal@@ @@releaseNote@@ + +
+ chevron_right + expand_less + close +
+
+ @@menuHtml@@ +
+ +
+
+ + +
+
+
+ @@bottomBarHtml@@ @@supportMe@@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/view/make/components/index.json b/app/view/make/components/index.json new file mode 100644 index 00000000..16b4ce54 --- /dev/null +++ b/app/view/make/components/index.json @@ -0,0 +1,12 @@ +[ + "bottomBarHtml", + "mediaModal", + "menuHtml", + "postBox", + "preTL", + "releaseNote", + "starterAndDragHandler", + "supportMe", + "tootModal", + "userDataModal" +] \ No newline at end of file diff --git a/app/view/make/components/mediaModal.html b/app/view/make/components/mediaModal.html new file mode 100644 index 00000000..6e1ae818 --- /dev/null +++ b/app/view/make/components/mediaModal.html @@ -0,0 +1,54 @@ + + + + \ No newline at end of file diff --git a/app/view/make/components/menuHtml.html b/app/view/make/components/menuHtml.html new file mode 100644 index 00000000..f479452d --- /dev/null +++ b/app/view/make/components/menuHtml.html @@ -0,0 +1,229 @@ + + \ No newline at end of file diff --git a/app/view/make/components/postBox.html b/app/view/make/components/postBox.html new file mode 100644 index 00000000..60869034 --- /dev/null +++ b/app/view/make/components/postBox.html @@ -0,0 +1,247 @@ +
+
@@post-new@@Reaction
+ +
+
+
+ + + +
+
+ +
+ + cancel + + +
+
+
+ format_bold + format_italic + format_underlined + strikethrough_s + format_quote + short_text + code + format_list_bulleted + format_list_numbered + + + autorenew + flare + swap_vert + swap_horiz + + Markdownエディタを隠す + +
+ format_size + px + color_lens + +
+ link +   + +
+ image +   + +
+
+
+
+ + Edit + +
+
+ + +
+ +
+ + Preview + + + Markdownエディタを表示 + +
+
+ visibility_off + public + CW + photo_library + tag_faces + more_vert + clear +
+
+
+
+ @@replyMode@@: @@no@@/@@temp@@: + @@nothing@@ + @@stamp@@: Off /@@poll@@: + @@no@@ + public + +
+ +
+ @@postat@@
@@scheduleWarn@@Expire mode(beta)
+ +
+
+
+ + + + + + + + + + +
+
+ + +
+
+
+
+ +
+ @@emojiWarn@@ + @@refreshEmoji@@ +
+
+
+
+ + / + + +
+ +
+ +
+
+ + + + + + + @@days@@ + @@hours@@ + @@mins@@ +
+
+
+
diff --git a/app/view/make/components/preTL.html b/app/view/make/components/preTL.html new file mode 100644 index 00000000..a73f37a9 --- /dev/null +++ b/app/view/make/components/preTL.html @@ -0,0 +1,17 @@ + + +
+
+
@@webSrc@@
+
@@tsSrc@@
+
@@copy@@
+
@@toot@@
+
+
+ + + + Feature +
+
@@nowOffline@@
+
@@reOnline@@
\ No newline at end of file diff --git a/app/view/make/components/releaseNote.html b/app/view/make/components/releaseNote.html new file mode 100644 index 00000000..c36a1749 --- /dev/null +++ b/app/view/make/components/releaseNote.html @@ -0,0 +1,38 @@ + + \ No newline at end of file diff --git a/app/view/make/components/starterAndDragHandler.html b/app/view/make/components/starterAndDragHandler.html new file mode 100644 index 00000000..fcd7e73b --- /dev/null +++ b/app/view/make/components/starterAndDragHandler.html @@ -0,0 +1,50 @@ +
+ + +
+
+

@@demoBottomBtns@@

+ @@lookAtBottom@@ + +
+ account_circle: @@acctMan@@
@@acctManDesc@@ +
+ settings: @@setting@@
@@settingDesc@@ +
+ remove_from_queue: TheDesk Nano @@nanoDes@@
@@nanoDescPlus@@ +
+ apps: @@menu@@
@@menuDesc@@ +
+
+ +
+
+ +
+
+ @@draghere@@ +
+ +
+
+
\ No newline at end of file diff --git a/app/view/make/components/supportMe.html b/app/view/make/components/supportMe.html new file mode 100644 index 00000000..8e301448 --- /dev/null +++ b/app/view/make/components/supportMe.html @@ -0,0 +1,33 @@ + +
+
+
ご支援いただけませんか?
+ (これは支援の有無に関わらず定期的に出ます。過去のバージョン等で何度も表示される等のバグを確認しております。)
あなたのMastodon, Misskeyライフを邪魔してしまって申し訳ありません。
乞食のようなマネをしてご支援をお願いするのもどうかと思いますが、少々お時間をください。 +
+
TheDeskになぜ金銭が発生するかについて: 詳細は省きますが、開発者から緊急の連絡をしたりするのに使われます。 +
+ 全てのユーザーが安心してTheDeskを使っていただける環境のためにも、ぜひご支援をご検討ください。ご支援いただけなくても使用不可能になることは全くありません。
+ @@TheDeskDes@@ +
+
+
Support me
+ It may disturb your Mastodon life, but your support is required to keep TheDesk awesome!
+ @@TheDeskDes@@ +
+
+
@@monthly@@
+ @@PixivSupport@@ + @@PatreonSupport@@ + Liberapay +
+
+
@@once@@
+ @@AWLSupport@@ +
@@SendAmazonGift1@@ web-pro@cutls.com@@SendAmazonGift2@@
Kyash +
+
+
+
+ +
+
\ No newline at end of file diff --git a/app/view/make/components/tootModal.html b/app/view/make/components/tootModal.html new file mode 100644 index 00000000..2dc894ba --- /dev/null +++ b/app/view/make/components/tootModal.html @@ -0,0 +1,96 @@ + + \ No newline at end of file diff --git a/app/view/make/components/userDataModal.html b/app/view/make/components/userDataModal.html new file mode 100644 index 00000000..b8a9fe5a --- /dev/null +++ b/app/view/make/components/userDataModal.html @@ -0,0 +1,210 @@ + + diff --git a/app/view/make/index.sample.html b/app/view/make/index.sample.html deleted file mode 100644 index d59d7102..00000000 --- a/app/view/make/index.sample.html +++ /dev/null @@ -1,1119 +0,0 @@ - - - - - - - - - - - - - - - - - @@comment-start@@ - - - @@comment-end@@ @@pwa@@ @@store@@ - - - - - - -
-
-
@@webSrc@@
-
@@tsSrc@@
-
@@copy@@
-
@@toot@@
-
-
- - - - Feature -
-
@@nowOffline@@
-
@@reOnline@@
-
- - -
-
-

@@demoBottomBtns@@

- @@lookAtBottom@@ - -
- account_circle: @@acctMan@@
@@acctManDesc@@ -
- settings: @@setting@@
@@settingDesc@@ -
- remove_from_queue: TheDesk Nano @@nanoDes@@
@@nanoDescPlus@@ -
- apps: @@menu@@
@@menuDesc@@ -
-
- -
-
- -
-
- @@draghere@@ -
- -
-
-
-
-
@@post-new@@Reaction
- -
-
-
- - - -
-
- -
- - cancel - - -
-
-
- format_bold - format_italic - format_underlined - strikethrough_s - format_quote - short_text - code - format_list_bulleted - format_list_numbered - - - autorenew - flare - swap_vert - swap_horiz - - Markdownエディタを隠す - -
- format_size - px - color_lens - -
- link -   - -
- image -   - -
-
-
-
- - Edit - -
-
- - -
- -
- - Preview - - - Markdownエディタを表示 - -
-
- visibility_off - public - CW - photo_library - tag_faces - more_vert - clear -
-
-
-
- @@replyMode@@: @@no@@/@@temp@@: - @@nothing@@ - @@stamp@@: Off /@@poll@@: - @@no@@ - public - -
- -
- @@postat@@
@@scheduleWarn@@Expire mode(beta)
- -
-
-
- - - - - - - - - - -
-
- - -
-
-
-
- -
- @@emojiWarn@@ - @@refreshEmoji@@ -
-
-
-
- - / - - -
- -
- -
-
- - - - - - - @@days@@ - @@hours@@ - @@mins@@ -
-
-
-
- - - - - - - - - - - -
- chevron_right - expand_less - close -
-
- - -
- -
-
- - -
-
-
- -
-
-
- -
- -
-
- - -
-
- -
-
-
ご支援いただけませんか?
- (これは支援の有無に関わらず定期的に出ます。過去のバージョン等で何度も表示される等のバグを確認しております。)
あなたのMastodon, Misskeyライフを邪魔してしまって申し訳ありません。
乞食のようなマネをしてご支援をお願いするのもどうかと思いますが、少々お時間をください。 -
-
TheDeskになぜ金銭が発生するかについて: 詳細は省きますが、開発者から緊急の連絡をしたりするのに使われます。 -
- 全てのユーザーが安心してTheDeskを使っていただける環境のためにも、ぜひご支援をご検討ください。ご支援いただけなくても使用不可能になることは全くありません。
- @@TheDeskDes@@ -
-
-
Support me
- It may disturb your Mastodon life, but your support is required to keep TheDesk awesome!
- @@TheDeskDes@@ -
-
-
@@monthly@@
- @@PixivSupport@@ - @@PatreonSupport@@ - Liberapay -
-
-
@@once@@
- @@AWLSupport@@ -
@@SendAmazonGift1@@ web-pro@cutls.com@@SendAmazonGift2@@
Kyash -
-
-
-
- -
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/view/make/language/en/index.json b/app/view/make/language/en/index.json index cb5e6326..b56b16bb 100644 --- a/app/view/make/language/en/index.json +++ b/app/view/make/language/en/index.json @@ -86,6 +86,8 @@ "makeNew": "Save", "blocks": "Blocks", "mutes": "Mutes", + "notfMute": "Mute their notifications too", + "zeroSetToInfinity": "Mute duration: 0 min to set Infinity", "block": "Block", "mute": "Mute", "domainBlock": "Domain block", diff --git a/app/view/make/language/ja-KS/index.json b/app/view/make/language/ja-KS/index.json index 0749a859..49b97a03 100644 --- a/app/view/make/language/ja-KS/index.json +++ b/app/view/make/language/ja-KS/index.json @@ -84,6 +84,8 @@ "makeNew": "新しいやつ", "blocks": "ブロック", "mutes": "ミュート", + "notfMute": "通知もミュート", + "zeroSetToInfinity": "ミュート期間: 0分にしたらずっとミュートするで。", "block": "ブロック", "mute": "ミュート", "domainBlock": "ドメインブロック", diff --git a/app/view/make/language/ja/index.json b/app/view/make/language/ja/index.json index 061b3b7d..5d84172d 100644 --- a/app/view/make/language/ja/index.json +++ b/app/view/make/language/ja/index.json @@ -86,6 +86,8 @@ "makeNew": "新規作成", "blocks": "ブロック", "mutes": "ミュート", + "notfMute": "通知もミュート", + "zeroSetToInfinity": "ミュート期間: 0分に設定すると無制限にミュートします。", "block": "ブロック", "mute": "ミュート", "domainBlock": "ドメインブロック", diff --git a/app/view/make/make.js b/app/view/make/make.js index 4eaaa338..7a61efa7 100644 --- a/app/view/make/make.js +++ b/app/view/make/make.js @@ -1,153 +1,165 @@ const fs = require('fs') function construct(ver, basefile, pwa, store) { - const execSync = require('child_process').execSync - let gitHash = execSync('git rev-parse HEAD') - .toString() - .trim() - console.log('Constructing view files ' + ver) - const langs = ['ja', 'ja-KS', 'en', 'bg', 'cs', 'de', - 'es-AR', 'it-IT', 'zh-CN', 'fr-FR', 'zh-TW', 'no-NO', 'pt-BR', 'ru-RU', 'es-ES','pl-PL', 'ps'] - const langsh = [ - '日本語', - '日本語(関西)', - 'English', - 'български', - 'Česky', - 'Deutsch', - 'Español, argentina', - 'italiano', - '简体中文', - 'français', - '繁體中文(β)', - 'norsk(β)', - 'Português, brasileiro(β)', - 'русский(β)', - 'Español(β)', - 'Polskie(β)', - 'Crowdin translate system(beta)' - ] - const simples = ['acct', 'index', 'setting', 'update', 'setting'] - const samples = [ - 'acct.sample.html', - 'index.sample.html', - 'setting.sample.html', - 'update.sample.html', - 'setting.sample.js' - ] - const pages = ['acct.html', 'index.html', 'setting.html', 'update.html', 'setting.vue.js'] - let langstr = '' - let refKey = [] - const enJson = JSON.parse(fs.readFileSync(basefile + 'view/make/language/en/main.json', 'utf8')) - const jaJson = JSON.parse(fs.readFileSync(basefile + 'view/make/language/ja/main.json', 'utf8')) - for (let n = 0; n < langs.length; n++) { - let lang = langs[n] - let targetDir = basefile + 'view/' + lang - if (!fs.existsSync(targetDir)) { - fs.mkdirSync(targetDir) - } - langstr = - langstr + `` - let mainJson = JSON.parse( - fs.readFileSync(basefile + 'view/make/language/' + lang + '/main.json', 'utf8') - ) - if (lang == 'ja-KS') { - Object.keys(jaJson).forEach(function (key) { - if (!mainJson[key]) { - mainJson[key] = jaJson[key] - } - }) - } else if (lang != 'en') { - Object.keys(enJson).forEach(function (key) { - if (!mainJson[key]) { - mainJson[key] = enJson[key] - } - }) - } - mainJson.language = lang - fs.writeFileSync( - basefile + 'view/' + lang + '/main.js', - JSON.stringify(mainJson).replace(/^{/, 'var lang = {') - ) - } - for (let i = 0; i < samples.length; i++) { - let sample = samples[i] - let sourceParent = fs.readFileSync(basefile + 'view/make/' + sample, 'utf8') - let englishRefer = JSON.parse( - fs.readFileSync(basefile + 'view/make/language/en/' + simples[i] + '.json', 'utf8') - ) - let jaRefer = JSON.parse( - fs.readFileSync(basefile + 'view/make/language/ja/' + simples[i] + '.json', 'utf8') - ) - for (let j = 0; j < langs.length; j++) { - let source = sourceParent - let lang = langs[j] - let target = JSON.parse( - fs.readFileSync( - basefile + 'view/make/language/' + lang + '/' + simples[i] + '.json', - 'utf8' - ) - ) - if (lang == 'ja') { - Object.keys(target).forEach(function (key) { - refKey.push(key) - let str = target[key] - if (pages[i] == 'setting.vue.js') { - str = str.replace(/'/g, "\\'") - } - var regExp = new RegExp('@@' + key + '@@', 'g') - source = source.replace(regExp, str) - }) - } else { - for (let k = 0; k < refKey.length; k++) { - let tarKey = refKey[k] - if (target[tarKey]) { - var str = target[tarKey] - } else { - if (lang == 'ja-KS') { - var str = jaRefer[tarKey] - } else { - var str = englishRefer[tarKey] - } - } - if (pages[i] == 'setting.vue.js') { - if (str) { - str = str.replace(/'/g, "\\'") - } - } - var regExp = new RegExp('@@' + tarKey + '@@', 'g') - source = source.replace(regExp, str) - } - } - if (lang == 'ps') { - source = source.replace(/@@comment-start@@/g, '') - source = source.replace(/@@comment-end@@/g, '') - } else { - source = source.replace(/@@comment-start@@/g, '') - } - source = source.replace(/@@versionLetter@@/g, ver) - source = source.replace(/@@gitHash@@/g, gitHash) - source = source.replace(/@@gitHashShort@@/g, gitHash.slice(0, 7)) - source = source.replace(/@@lang@@/g, lang) - source = source.replace(/@@langlist@@/g, langstr) - if (pwa) { - source = source.replace(/@@pwa@@/g, ` + const execSync = require('child_process').execSync + let gitHash = execSync('git rev-parse HEAD') + .toString() + .trim() + console.log('Constructing view files ' + ver) + genIndexHtml(basefile) + const langs = ['ja', 'ja-KS', 'en', 'bg', 'cs', 'de', + 'es-AR', 'it-IT', 'zh-CN', 'fr-FR', 'zh-TW', 'no-NO', 'pt-BR', 'ru-RU', 'es-ES', 'pl-PL', 'ps' + ] + const langsh = [ + '日本語', + '日本語(関西)', + 'English', + 'български', + 'Česky', + 'Deutsch', + 'Español, argentina', + 'italiano', + '简体中文', + 'français', + '繁體中文(β)', + 'norsk(β)', + 'Português, brasileiro(β)', + 'русский(β)', + 'Español(β)', + 'Polskie(β)', + 'Crowdin translate system(beta)' + ] + const simples = ['acct', 'index', 'setting', 'update', 'setting'] + const samples = [ + 'acct.sample.html', + 'index.generated.html', + 'setting.sample.html', + 'update.sample.html', + 'setting.sample.js' + ] + const pages = ['acct.html', 'index.html', 'setting.html', 'update.html', 'setting.vue.js'] + let langstr = '' + let refKey = [] + const enJson = JSON.parse(fs.readFileSync(basefile + 'view/make/language/en/main.json', 'utf8')) + const jaJson = JSON.parse(fs.readFileSync(basefile + 'view/make/language/ja/main.json', 'utf8')) + for (let n = 0; n < langs.length; n++) { + let lang = langs[n] + let targetDir = basefile + 'view/' + lang + if (!fs.existsSync(targetDir)) { + fs.mkdirSync(targetDir) + } + langstr = + langstr + `` + let mainJson = JSON.parse( + fs.readFileSync(basefile + 'view/make/language/' + lang + '/main.json', 'utf8') + ) + if (lang == 'ja-KS') { + Object.keys(jaJson).forEach(function(key) { + if (!mainJson[key]) { + mainJson[key] = jaJson[key] + } + }) + } else if (lang != 'en') { + Object.keys(enJson).forEach(function(key) { + if (!mainJson[key]) { + mainJson[key] = enJson[key] + } + }) + } + mainJson.language = lang + fs.writeFileSync( + basefile + 'view/' + lang + '/main.js', + JSON.stringify(mainJson).replace(/^{/, 'var lang = {') + ) + } + for (let i = 0; i < samples.length; i++) { + let sample = samples[i] + let sourceParent = fs.readFileSync(basefile + 'view/make/' + sample, 'utf8') + let englishRefer = JSON.parse( + fs.readFileSync(basefile + 'view/make/language/en/' + simples[i] + '.json', 'utf8') + ) + let jaRefer = JSON.parse( + fs.readFileSync(basefile + 'view/make/language/ja/' + simples[i] + '.json', 'utf8') + ) + for (let j = 0; j < langs.length; j++) { + let source = sourceParent + let lang = langs[j] + let target = JSON.parse( + fs.readFileSync( + basefile + 'view/make/language/' + lang + '/' + simples[i] + '.json', + 'utf8' + ) + ) + if (lang == 'ja') { + Object.keys(target).forEach(function(key) { + refKey.push(key) + let str = target[key] + if (pages[i] == 'setting.vue.js') { + str = str.replace(/'/g, "\\'") + } + var regExp = new RegExp('@@' + key + '@@', 'g') + source = source.replace(regExp, str) + }) + } else { + for (let k = 0; k < refKey.length; k++) { + let tarKey = refKey[k] + if (target[tarKey]) { + var str = target[tarKey] + } else { + if (lang == 'ja-KS') { + var str = jaRefer[tarKey] + } else { + var str = englishRefer[tarKey] + } + } + if (pages[i] == 'setting.vue.js') { + if (str) { + str = str.replace(/'/g, "\\'") + } + } + var regExp = new RegExp('@@' + tarKey + '@@', 'g') + source = source.replace(regExp, str) + } + } + if (lang == 'ps') { + source = source.replace(/@@comment-start@@/g, '') + source = source.replace(/@@comment-end@@/g, '') + } else { + source = source.replace(/@@comment-start@@/g, '') + } + source = source.replace(/@@versionLetter@@/g, ver) + source = source.replace(/@@gitHash@@/g, gitHash) + source = source.replace(/@@gitHashShort@@/g, gitHash.slice(0, 7)) + source = source.replace(/@@lang@@/g, lang) + source = source.replace(/@@langlist@@/g, langstr) + if (pwa) { + source = source.replace(/@@pwa@@/g, ``) - source = source.replace(/@@node_base@@/g, 'dependencies') - source = source.replace(/@@pwaClass@@/g, 'pwaView') - } else { - source = source.replace(/@@pwa@@/g, '') - source = source.replace(/@@node_base@@/g, 'node_modules') - source = source.replace(/@@pwaClass@@/g, '') - } - if (store) { - source = source.replace(/@@store@@/g, '') - } else { - source = source.replace(/@@store@@/g, '') - } - fs.writeFileSync(basefile + 'view/' + lang + '/' + pages[i], source) - } - } + source = source.replace(/@@node_base@@/g, 'dependencies') + source = source.replace(/@@pwaClass@@/g, 'pwaView') + } else { + source = source.replace(/@@pwa@@/g, '') + source = source.replace(/@@node_base@@/g, 'node_modules') + source = source.replace(/@@pwaClass@@/g, '') + } + if (store) { + source = source.replace(/@@store@@/g, '') + } else { + source = source.replace(/@@store@@/g, '') + } + fs.writeFileSync(basefile + 'view/' + lang + '/' + pages[i], source) + } + } +} + +function genIndexHtml(basefile) { + const index = JSON.parse(fs.readFileSync(`${basefile}view/make/components/index.json`, 'utf8')) + let raw = fs.readFileSync(`${basefile}view/make/components/index.html`, 'utf8') + for (const component of index) { + const componentHtml = fs.readFileSync(`${basefile}view/make/components/${component}.html`, 'utf8') + raw = raw.replace(`@@${component}@@`, componentHtml) + } + fs.writeFileSync(`${basefile}view/make/index.generated.html`, raw) } module.exports = construct \ No newline at end of file diff --git a/app/view/make/makeCli.js b/app/view/make/makeCli.js index c42fb32a..70c15db9 100644 --- a/app/view/make/makeCli.js +++ b/app/view/make/makeCli.js @@ -31,7 +31,7 @@ if (process.argv.indexOf('--watch') !== -1) { 'watch mode(not hot-watch): when construction files are changed, refresh view files but not reload. Please reload manually.' ) const watcher = chokidar.watch(basefile + 'view/make', { - ignored: 'view/make/make.js', + ignored: /view\/make\/(make.*\.js|.*\.generated\.html)/, persistent: true }) watcher.on('ready', function () { diff --git a/app/view/pl-PL/index.html b/app/view/pl-PL/index.html index 424abec2..290f9d69 100644 --- a/app/view/pl-PL/index.html +++ b/app/view/pl-PL/index.html @@ -1,1119 +1,1143 @@ + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - -
-
-
Szukaj w Internecie
-
Search on tootsearch
-
Copy
-
Toot
-
-
- - - - Feature -
-
OFFLINE: all of your post is in the draft box and you should reload after re-connect to the Internet
-
Now we are in the Internet, you should reload...
-
- - -
-
-

Przewodnik powitalny

- Look at the bottom of this window. Here is some tips about it. -
- -
- + + + + +
+
+
Szukaj w Internecie
+
Search on tootsearch
+
Copy
+
Toot
+
+
+ + + + Feature +
+
OFFLINE: all of your post is in the draft box and you should reload after re-connect to the Internet
+
Now we are in the Internet, you should reload...
+ + +
+
+

Przewodnik powitalny

+ Look at the bottom of this window. Here is some tips about it. +
+ + -
- account_circle: Menadżer konta
Add more accounts and logout them. -
- settings: Ustawienia
Many and many preferences here. You will couldn't check it all! -
- remove_from_queue: TheDesk Nano The smallest Mastodon,
Mini window client(experimental) -
- apps: Menu
All daily TheDesk and Mastodon tuning like add and sort columns, list and filter check. -
-
- -
-
- -
-
- Przeciągnij tutaj by przesłać -
- -
-
-
-
-
Post newReaction
- -
-
-
- - - -
-
- -
- - cancel - - -
-
-
- format_bold - format_italic - format_underlined - strikethrough_s - format_quote - short_text - code - format_list_bulleted - format_list_numbered - - - autorenew - flare - swap_vert - swap_horiz - - Markdownエディタを隠す - -
- format_size - px - color_lens - -
- link -   - -
- image -   - -
-
-
-
- - Edit - -
-
- - -
- -
- - Preview - - - Markdownエディタを表示 - -
-
- visibility_off - public - CW - photo_library - tag_faces - more_vert - clear -
-
-
-
- Reply: Nie/Dołączanie plików: - Brak - Stamp: Off /Poll: - Nie - public - -
- -
- Post at
2.7.0~ Minimum time gap:5min(clock on the server may not be accurate.)Expire mode(beta)
- -
-
-
- - - - - - - - - - -
-
- - -
-
-
-
- -
- - Refresh emojis list -
-
-
-
- - / - - -
- -
- -
-
- - - - - - - dzień (dni) - hour(s) - minute(s) -
-
-
-
- - - - - - - - - - - -
- chevron_right - expand_less - close -
+ +
+
+ Przeciągnij tutaj by przesłać +
+ +
- -
+
Post newReaction
+ +
+
+
+ + + +
+
+ +
+ + cancel - +
+
+ + Edit + +
+
+ - \ No newline at end of file +
+ +
+ + Preview + + + Markdownエディタを表示 + +
+
+ visibility_off + public + CW + photo_library + tag_faces + more_vert + clear +
+
+
+
+ Reply: Nie/Dołączanie plików: + Brak + Stamp: Off /Poll: + Nie + public + +
+ +
+ Post at
2.7.0~ Minimum time gap:5min(clock on the server may not be accurate.)Expire mode(beta)
+ +
+
+
+ + + + + + + + + + +
+
+ + +
+
+
+
+ +
+ + Refresh emojis list +
+
+
+
+ + / + + +
+ +
+ +
+
+ + + + + + + dzień (dni) + hour(s) + minute(s) +
+
+
+
+ + + + + + + + + +
+ chevron_right + expand_less + close +
+
+ + +
+ +
+
+ + +
+
+
+ + +
+
+
ご支援いただけませんか?
+ (これは支援の有無に関わらず定期的に出ます。過去のバージョン等で何度も表示される等のバグを確認しております。)
あなたのMastodon, Misskeyライフを邪魔してしまって申し訳ありません。
乞食のようなマネをしてご支援をお願いするのもどうかと思いますが、少々お時間をください。 +
+
TheDeskになぜ金銭が発生するかについて: 詳細は省きますが、開発者から緊急の連絡をしたりするのに使われます。 +
+ 全てのユーザーが安心してTheDeskを使っていただける環境のためにも、ぜひご支援をご検討ください。ご支援いただけなくても使用不可能になることは全くありません。
+ TheDesk has no ad, you need no charge to unlock premium features. We need your friendly support! +
+
+
Support me
+ It may disturb your Mastodon life, but your support is required to keep TheDesk awesome!
+ TheDesk has no ad, you need no charge to unlock premium features. We need your friendly support! +
+ +
+
Once
+ Amazon Wish List +
Give me Amazon Gift Card: web-pro@cutls.com
Kyash +
+
+
+
+ +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/view/pl-PL/setting.html b/app/view/pl-PL/setting.html index 2190ca87..314ca09f 100644 --- a/app/view/pl-PL/setting.html +++ b/app/view/pl-PL/setting.html @@ -645,7 +645,7 @@ class="material-icons left">listHelp/Docs GitHub Main author: Cutls@1m.cutls.com -
TheDesk @ 679151e8eadafebe68b8c0887e9189caeb94474e - Sprawdź aktualizacje
+
TheDesk @ 4dfad6aa023a018c71d82a59b43872d81e4dc394 - Sprawdź aktualizacje

Kyash

@@ -653,7 +653,7 @@
OSS License
- +
Copyright © TheDesk 2018 Under GNU General Public License v3.0 and