diff --git a/README.md b/README.md index 5bd1b26f..12d01140 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,8 @@ The icon is provided under [Creative Commons BY-NC-SA](https://creativecommons.o * [ico](https://dl.thedesk.top/press/TheDesk.ico) * [icns](https://dl.thedesk.top/press/TheDesk.icns) +The default sound of notifications is provided [Creative Commons BY](https://creativecommons.org/licenses/by/4.0/) + ## Terms of Use/利用規約 * [利用規約(Terms of Use(ja))](https://thedesk.top/tos.html) diff --git a/app/css/master.css b/app/css/master.css index 74e7b81c..e4ece881 100644 --- a/app/css/master.css +++ b/app/css/master.css @@ -30,6 +30,8 @@ option { } #mainView { padding: 10px; + overflow:scroll; + height: auto; } #message { display: none; diff --git a/app/css/tl.css b/app/css/tl.css index 42df4407..754ea4cd 100644 --- a/app/css/tl.css +++ b/app/css/tl.css @@ -249,6 +249,29 @@ grid-area: toot; margin:2px; grid-area: side; } + +.quote-renote{ + display: grid; + grid-template-columns: 43px 2fr 1fr; + grid-template-areas: 'ricon ruser' 'ricon rtext'; + border: 1px solid; + margin-top: 3px; + padding: 1px; + border-radius: 3px; +} +.renote-icon{ + grid-area: ricon; +} +.renote-icon img{ + width:43px; +} +.renote-user{ + grid-area: ruser; +} +.renote-text{ + grid-area: rtext; +} + .btn-flat{ color:var(--color); } diff --git a/app/js/platform/end.js b/app/js/platform/end.js index 4e9adaf2..7bb937c1 100644 --- a/app/js/platform/end.js +++ b/app/js/platform/end.js @@ -181,4 +181,21 @@ const { } = require('electron'); webviewDom.addEventListener('new-window', function(e) { shell.openExternal(e.url); -}); \ No newline at end of file +}); +function playSound() { + window.AudioContext = window.AudioContext || window.webkitAudioContext; + context = new AudioContext(); + context.createBufferSource().start(0); + context.decodeAudioData(request.response, function (buf) { + console.log(source) + source.buffer = buf; + source.loop = false; + }); + source = context.createBufferSource(); + volumeControl = context.createGain(); + source.connect(volumeControl); + volumeControl.connect(context.destination); + volumeControl.gain.value=0.8 + console.log(volumeControl) + source.start(0); +} \ No newline at end of file diff --git a/app/js/tl/misskeyparse.js b/app/js/tl/misskeyparse.js index 8164ab1a..761e4d96 100644 --- a/app/js/tl/misskeyparse.js +++ b/app/js/tl/misskeyparse.js @@ -296,7 +296,9 @@ function misskeyParse(obj, mix, acct_id, tlid, popup, mutefilter) { ")
"; var boostback = "shared"; var uniqueid=toot.id; - var toot = toot.renote; + if(!toot.text){ + var toot = toot.renote; + } var dis_name=escapeHTMLtemp(toot.user.name); var uniqueid=toot.id; var actemojick=false @@ -636,9 +638,11 @@ function misskeyParse(obj, mix, acct_id, tlid, popup, mutefilter) { }); poll='
'+poll+'
'; } - /* - - */ + //引用Renote + if(toot.renote){ + poll=poll+'
'+escapeHTML(toot.renote.user.name)+'
'+escapeHTML(toot.renote.text)+'
' + } if(localStorage.getItem("emojiReaction_" + acct_id)=="disabled"){ var freeReact="hide"; }else{ @@ -667,7 +671,7 @@ function misskeyParse(obj, mix, acct_id, tlid, popup, mutefilter) { var emoji = obj[i]; if (":"+emoji.shortcode+":"==keye) { if (emoji) { - addReact=addReact+ ''+thisReact+ ''; } diff --git a/app/js/tl/parse.js b/app/js/tl/parse.js index 54e73beb..e2f29ddf 100644 --- a/app/js/tl/parse.js +++ b/app/js/tl/parse.js @@ -251,16 +251,19 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) { $(".notf-reply_" + acct_id).text(replyct*1-(-1)); localStorage.setItem("notf-reply_" + acct_id,replyct*1-(-1)) $(".notf-reply_" + acct_id).removeClass("hide") + var sound=localStorage.getItem("replySound"); }else if (toot.type == "reblog") { var btct=localStorage.getItem("notf-bt_" + acct_id) $(".notf-bt_" + acct_id).text(btct*1-(-1)); localStorage.setItem("notf-bt_" + acct_id,btct*1-(-1)) $(".notf-bt_" + acct_id).removeClass("hide") + var sound=localStorage.getItem("btSound"); }else if (toot.type == "favourite") { var favct=localStorage.getItem("notf-fav_" + acct_id) $(".notf-fav_" + acct_id).text(favct*1-(-1)); localStorage.setItem("notf-fav_" + acct_id,favct*1-(-1)) $(".notf-fav_" + acct_id).removeClass("hide") + var sound=localStorage.getItem("favSound"); } } @@ -268,6 +271,25 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) { if(popup>0){ Materialize.toast("["+domain+"]"+escapeHTML(toot.account.display_name)+what, popup * 1000); } + //通知音 + if(sound=="default" || !sound){ + var file="../../source/notif.wav" + }else if(sound=="c1"){ + var file=localStorage.getItem("custom1"); + }else if(sound=="c2"){ + var file=localStorage.getItem("custom2"); + }else if(sound=="c3"){ + var file=localStorage.getItem("custom3"); + }else if(sound=="c4"){ + var file=localStorage.getItem("custom4"); + } + if(file){ + request = new XMLHttpRequest(); + request.open("GET", file, true); + request.responseType = "arraybuffer"; + request.onload = playSound; + request.send(); + } if(native=="yes"){ var electron = require("electron"); var ipc = electron.ipcRenderer; @@ -738,6 +760,10 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) { '">' + ended+ ''; } + //Quote + if(toot.quote){ + poll=poll+'
'+escapeHTML(toot.quote.account.display_name)+'
'+toot.quote.content+'
' + } templete = templete + '
{ + localStorage.setItem("custom"+key,fileNames[0]); + $("#c1-file").text(fileNames[0]) + }); +} window.onload = function() { //最初に読む load(); diff --git a/app/source/notif.wav b/app/source/notif.wav new file mode 100644 index 00000000..78700e70 Binary files /dev/null and b/app/source/notif.wav differ diff --git a/app/view/en/setting.html b/app/view/en/setting.html index 1ccba3f0..5e655d7b 100644 --- a/app/view/en/setting.html +++ b/app/view/en/setting.html @@ -1,5 +1,5 @@ - + Settings - TheDesk @@ -56,8 +56,8 @@