From e4414f60514d11c79dd0685ec87d9598f0fbfbbd Mon Sep 17 00:00:00 2001 From: cutls Date: Wed, 2 May 2018 13:14:03 +0900 Subject: [PATCH] TheDesk Mio (ver.1 beta) --- app/css/post.css | 10 +- app/css/tl.css | 20 +- app/index.html | 272 +++++++++--------- app/js/login/login.js | 9 +- app/js/post/img.js | 10 +- app/js/post/post.js | 8 +- app/js/post/secure.js | 46 ++- app/js/post/status.js | 19 ++ app/js/tl/card.js | 34 +++ app/js/tl/datails.js | 34 ++- app/js/tl/notification.js | 12 +- app/js/tl/parse.js | 69 +++-- app/js/tl/tl.js | 15 +- app/js/ui/layout.js | 8 + app/js/ui/pip.js | 2 +- app/js/ui/radio.js | 21 +- app/js/ui/settings.js | 27 ++ app/js/userdata/showOnTL.js | 18 +- app/main.js | 28 +- app/node_modules/about-window/.npmignore | 5 - .../about-window/.stylelintrc.json | 3 - app/node_modules/about-window/LICENSE.txt | 19 -- app/node_modules/about-window/README.md | 100 ------- app/node_modules/about-window/about.html | 27 -- app/node_modules/about-window/index.d.ts | 18 -- app/node_modules/about-window/package.json | 105 ------- app/node_modules/about-window/src/index.js | 115 -------- .../about-window/src/index.js.map | 1 - app/node_modules/about-window/src/index.ts | 134 --------- app/node_modules/about-window/src/lib.d.ts | 37 --- app/node_modules/about-window/src/renderer.js | 65 ----- .../about-window/src/renderer.js.map | 1 - app/node_modules/about-window/src/renderer.ts | 73 ----- .../about-window/src/tsconfig.json | 20 -- app/node_modules/about-window/styles/ui.css | 64 ----- app/node_modules/about-window/tslint.json | 127 -------- app/node_modules/electron-dl/index.js | 42 +-- app/node_modules/electron-dl/package.json | 78 ++--- app/node_modules/electron-dl/readme.md | 16 +- app/node_modules/mime-db/HISTORY.md | 8 + app/node_modules/mime-db/db.json | 85 ++++-- app/node_modules/mime-db/package.json | 73 ++--- app/package-lock.json | 21 +- app/package.json | 5 +- app/setting.html | 15 +- 45 files changed, 599 insertions(+), 1320 deletions(-) delete mode 100644 app/node_modules/about-window/.npmignore delete mode 100644 app/node_modules/about-window/.stylelintrc.json delete mode 100644 app/node_modules/about-window/LICENSE.txt delete mode 100644 app/node_modules/about-window/README.md delete mode 100644 app/node_modules/about-window/about.html delete mode 100644 app/node_modules/about-window/index.d.ts delete mode 100644 app/node_modules/about-window/package.json delete mode 100644 app/node_modules/about-window/src/index.js delete mode 100644 app/node_modules/about-window/src/index.js.map delete mode 100644 app/node_modules/about-window/src/index.ts delete mode 100644 app/node_modules/about-window/src/lib.d.ts delete mode 100644 app/node_modules/about-window/src/renderer.js delete mode 100644 app/node_modules/about-window/src/renderer.js.map delete mode 100644 app/node_modules/about-window/src/renderer.ts delete mode 100644 app/node_modules/about-window/src/tsconfig.json delete mode 100644 app/node_modules/about-window/styles/ui.css delete mode 100644 app/node_modules/about-window/tslint.json diff --git a/app/css/post.css b/app/css/post.css index 3e1cbe2e..d2d6365f 100644 --- a/app/css/post.css +++ b/app/css/post.css @@ -6,18 +6,18 @@ background-color: white; border: thin solid gray; z-index: 500; - width: 350px; - min-width:350px; + width: 300px; + min-width:300px; max-width:100%; padding: 5px; } .cancel { - position: absolute; - top: 3px; - right: 3px; font-size: 0.5rem; color: gray; cursor: pointer; + position: absolute; + width: 60px; + right: 0px; } .more-show { display: none; diff --git a/app/css/tl.css b/app/css/tl.css index a96598c2..9fb30e9a 100644 --- a/app/css/tl.css +++ b/app/css/tl.css @@ -19,10 +19,11 @@ flex-wrap:wrap; } #sidebar-top{ - height:70vh; + height:calc(100vh - 100px); display:flex; flex-wrap:wrap; - align-content:center; + align-content:flex-start; + overflow-y:scroll; } #sidebar-btm{ height:9em; @@ -50,7 +51,7 @@ font-size:12px; vertical-align: 0.6rem; } -#sidebar #side-dead{ +#sidebar .side-dead{ height:30px; } @@ -81,7 +82,7 @@ iframe { } .user{ cursor:text; - font-size:1.2em; + font-size:1.2rem; } .emojione,.emoji-img{ width: 20px; @@ -106,7 +107,7 @@ iframe { width: 100%; display: grid; grid-template-columns: 43px 2fr 1fr; - grid-template-areas: 'notice notice notice' 'icon display_name acct' 'icon toot toot' 'icon additional additional' 'actions actions date_via'; + grid-template-areas: 'notice notice notice' 'icon display_name acct' 'icon toot toot' 'vis additional additional' 'actions actions actions'; } .area-notice { @@ -161,6 +162,11 @@ grid-area: toot; margin:2px; grid-area: actions; } +.area-vis { + margin:2px; + font-size:0.5rem !important; + grid-area: vis; + } .action i{ font-size:1rem; @@ -199,6 +205,7 @@ font-size:1rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; + height:calc(0.8em + 8px); } p { margin: 0; @@ -307,6 +314,9 @@ p:not(:last-child){ color: black; cursor: text; } +.type-b{ + display:none; +} /*black theme*/ .blacktheme .notf-box,.blacktheme .modal-footer,.blacktheme #sidebar { diff --git a/app/index.html b/app/index.html index d429eaf2..be7782c5 100644 --- a/app/index.html +++ b/app/index.html @@ -26,9 +26,9 @@ - @@ -762,4 +721,31 @@ var tlid=0; - \ No newline at end of file + + \ No newline at end of file diff --git a/app/js/login/login.js b/app/js/login/login.js index e9355025..ced07b7d 100644 --- a/app/js/login/login.js +++ b/app/js/login/login.js @@ -9,7 +9,7 @@ var idata={ "kirishima.cloud":"instance", "kirishima.cloud_name":"アスタルテ", "kirishima.cloud_letters":"6229", - "kirishima.cloud_bbcode":"enabled", + "kirishima.cloud_bbcode":"disabled", "kirishima.cloud_markdown":"disabled", "minohdon.jp":"instance", "minohdon.jp_name":"箕面丼", @@ -30,7 +30,7 @@ var idata={ "dev.kirishima.cloud_name":"アスタルテ(Dev)", "dev.kirishima.cloud_letters":"6229", "dev.kirishima.cloud_bbcode":"enabled", - "dev.kirishima.cloud_markdown":"disabled", + "dev.kirishima.cloud_markdown":"enabled", "mstdn.y-zu.org":"instance", "mstdn.y-zu.org_name":"Yづドン!(502 BadGateway)", "mstdn.y-zu.org_letters":"500", @@ -393,6 +393,11 @@ function multi() { }else{ $("#textarea").attr("data-length", 500) } + if(domain=="knzk.me" || domain=="mstdn.y-zu.org"){ + $("#type-sel").append(''); + }else{ + $("#direct-add").remove(); + } var profimg=localStorage.getItem("prof_"+key); var domain=localStorage.getItem("domain_"+key); if(!profimg){ diff --git a/app/js/post/img.js b/app/js/post/img.js index 310edab3..b9425627 100644 --- a/app/js/post/img.js +++ b/app/js/post/img.js @@ -195,4 +195,12 @@ element.addEventListener("paste", function(e){ fr.readAsDataURL(imageFile); // 画像以外がペーストされたときのために、元に戻しておく -}); \ No newline at end of file +}); +//Adobeフォトエディタ +function adobe(){ + var agree = localStorage.getItem("adobeagree"); + ipc.send('adobe', agree); +} +ipc.on('adobeagree', function (event, arg) { + localStorage.setItem("adobeagree",arg); + }); \ No newline at end of file diff --git a/app/js/post/post.js b/app/js/post/post.js index 1e288c52..1881dcd0 100644 --- a/app/js/post/post.js +++ b/app/js/post/post.js @@ -71,8 +71,7 @@ function clear() { } else { $("#cw-text").val(""); } - $("#cw").addClass("blue"); - $("#cw").removeClass("yellow"); + $("#cw").removeClass("yellow-text"); $("#cw").removeClass("cw-avail"); $("#rec").text("いいえ"); $("#mec").text("なし"); @@ -86,9 +85,8 @@ function clear() { vis(vist); } } - $("#nsfw").addClass("blue"); - $("#nsfw").removeClass("yellow"); - $("#nsi").html("lock_open"); + $("#nsfw").removeClass("yellow-text"); + $("#nsfw").html("visibility_off"); $("#nsfw").removeClass("nsfw-avail"); $("#nsc").text("なし"); $("#drag").css("background-color", "#e0e0e0"); diff --git a/app/js/post/secure.js b/app/js/post/secure.js index e3cc2f94..da35d968 100644 --- a/app/js/post/secure.js +++ b/app/js/post/secure.js @@ -2,42 +2,38 @@ //画像保護 function nsfw(){ if($("#nsfw").hasClass("nsfw-avail")){ - $("#nsfw").addClass("blue"); - $("#nsfw").removeClass("yellow"); - $("#nsi").html("lock_open"); + $("#nsfw").removeClass("yellow-text"); + $("#nsfw").html("visibility_off"); $("#nsfw").removeClass("nsfw-avail"); - $("#nsc").text("なし"); }else{ - $("#nsfw").removeClass("blue"); - $("#nsfw").addClass("yellow"); - $("#nsi").html("lock_outline"); + $("#nsfw").addClass("yellow-text"); + $("#nsfw").html("visibility"); $("#nsfw").addClass("nsfw-avail"); - $("#nsc").text("あり"); } } //投稿公開範囲 function vis(set){ $("#vis").text(set); - $("#vis-icon").removeClass("red"); - $("#vis-icon").removeClass("orange"); - $("#vis-icon").removeClass("blue"); - $("#vis-icon").removeClass("purple"); + $("#vis-icon").removeClass("red-text"); + $("#vis-icon").removeClass("orange-text"); + $("#vis-icon").removeClass("blue-text"); + $("#vis-icon").removeClass("purple-text"); if(set=="public"){ - $("#vis-icon i").text("public"); - $("#vis-icon").addClass("purple"); + $("#vis-icon").text("public"); + $("#vis-icon").addClass("purple-text"); }else if(set=="unlisted"){ - $("#vis-icon i").text("lock_open"); - $("#vis-icon").addClass("blue"); + $("#vis-icon").text("lock_open"); + $("#vis-icon").addClass("blue-text"); }else if(set=="private"){ - $("#vis-icon i").text("lock"); - $("#vis-icon").addClass("orange"); + $("#vis-icon").text("lock"); + $("#vis-icon").addClass("orange-text"); }else if(set=="direct"){ - $("#vis-icon i").text("mail"); - $("#vis-icon").addClass("red"); + $("#vis-icon").text("mail"); + $("#vis-icon").addClass("red-text"); }else if(set=="limited"){ - $("#vis-icon i").text("group"); - $("#vis-icon").addClass("teal"); + $("#vis-icon").text("group"); + $("#vis-icon").addClass("teal-text"); } var vis=localStorage.getItem("vis"); if(vis=="memory"){ @@ -67,13 +63,11 @@ function cw(){ if($("#cw").hasClass("cw-avail")){ $("#cw-text").val(); $("#cw-text").hide(); - $("#cw").addClass("blue"); - $("#cw").removeClass("yellow"); + $("#cw").removeClass("yellow-text"); $("#cw").removeClass("cw-avail"); }else{ $("#cw-text").show(); - $("#cw").removeClass("blue"); - $("#cw").addClass("yellow"); + $("#cw").addClass("yellow-text"); $("#cw").addClass("cw-avail"); var cwt=localStorage.getItem("cw-text"); if(cwt){ diff --git a/app/js/post/status.js b/app/js/post/status.js index 209bf716..a7d31595 100644 --- a/app/js/post/status.js +++ b/app/js/post/status.js @@ -364,4 +364,23 @@ function staEx(mode){ } }); return; +} +function toggleAction(id,tlid,acct_id){ + if(tlid=="notf"){ + var tlide="[data-notf="+acct_id+"]"; + }else{ + var tlide="[tlid="+tlid+"]"; + } + if(!$(tlide+" [toot-id="+id+"]").hasClass("ext-mode")){ + $(tlide+" [toot-id="+id+"] .type-a").hide(); + $(tlide+" [toot-id="+id+"] .type-b").show(); + $(tlide+" [toot-id="+id+"]").addClass("ext-mode") + $(tlide+" [toot-id="+id+"] .act-icon").text("expand_less"); + }else{ + $(tlide+" [toot-id="+id+"] .type-b").hide(); + $(tlide+" [toot-id="+id+"] .type-a").show(); + $(tlide+" [toot-id="+id+"]").removeClass("ext-mode") + $(tlide+" [toot-id="+id+"] .act-icon").text("expand_more"); + } + } \ No newline at end of file diff --git a/app/js/tl/card.js b/app/js/tl/card.js index de0f453e..6f100ca0 100644 --- a/app/js/tl/card.js +++ b/app/js/tl/card.js @@ -172,3 +172,37 @@ function cardCheck(tlid) { $("#sta-card-" + tlid).css("color",'red'); } } + +function mov(id,tlid){ + if(tlid=="notf"){ + var tlide="[data-notf="+acct_id+"]"; + }else{ + var tlide="[tlid="+tlid+"]"; + } + var mouseover=localStorage.getItem("mouseover"); + if(!mouseover){ + mouseover=""; + }else if(mouseover=="yes"){ + mouseover="hide"; + }else if(mouseover=="no"){ + mouseover=""; + } + if(mouseover=="hide"){ + $(tlide+" [toot-id="+id+"] .area-actions").removeClass("hide") + } +} + +function resetmv(){ + var mouseover=localStorage.getItem("mouseover"); + if(!mouseover){ + mouseover=""; + }else if(mouseover=="yes"){ + mouseover="hide"; + }else if(mouseover=="no"){ + mouseover=""; + } + if(mouseover=="hide"){ + $(".area-actions").addClass("hide"); + } + +} \ No newline at end of file diff --git a/app/js/tl/datails.js b/app/js/tl/datails.js index 3758a82d..e411e56b 100644 --- a/app/js/tl/datails.js +++ b/app/js/tl/datails.js @@ -37,10 +37,12 @@ function details(id, acct_id, tlid) { replyTL(json.in_reply_to_id, acct_id); } context(id, acct_id); + beforeToot(id, acct_id); + userToot(id, acct_id, json.account.id); faved(id, acct_id); rted(id, acct_id); if(!$("#activator").hasClass("active")){ - $('#det-col').collapsible('open', 2); + $('#det-col').collapsible('open', 1); } }); @@ -63,7 +65,7 @@ function replyTL(id, acct_id) { todo(error); console.error(error); }).then(function(json) { - var templete = parse([json]); + var templete = parse([json], '', acct_id); $("#toot-reply").prepend(templete); jQuery("time.timeago").timeago(); if (json.in_reply_to_id) { @@ -89,9 +91,9 @@ function context(id, acct_id) { todo(error); console.error(error); }).then(function(json) { - var templete = parse(json.descendants); + var templete = parse(json.descendants, '', acct_id); $("#toot-after").html(templete); - beforeToot(id, acct_id); + jQuery("time.timeago").timeago(); }); } @@ -114,11 +116,33 @@ function beforeToot(id, acct_id) { todo(error); console.error(error); }).then(function(json) { - var templete = parse(json); + var templete = parse(json, '', acct_id); $("#toot-before").html(templete); jQuery("time.timeago").timeago(); }); } +//前のユーザーのトゥート +function userToot(id, acct_id, user) { + var domain = localStorage.getItem("domain_" + acct_id); + var at = localStorage.getItem(domain + "_at"); + var start = "https://" + domain + "/api/v1/accounts/" + user + "/statuses?max_id=" + id; + fetch(start, { + method: 'GET', + headers: { + 'content-type': 'application/json', + 'Authorization': 'Bearer ' + at + }, + }).then(function(response) { + return response.json(); + }).catch(function(error) { + todo(error); + console.error(error); + }).then(function(json) { + var templete = parse(json, '', acct_id); + $("#user-before").html(templete); + jQuery("time.timeago").timeago(); + }); +} //ふぁぼ一覧 function faved(id, acct_id) { diff --git a/app/js/tl/notification.js b/app/js/tl/notification.js index ac9b9a6a..fe1ce7fa 100644 --- a/app/js/tl/notification.js +++ b/app/js/tl/notification.js @@ -28,8 +28,8 @@ function notf(acct_id, tlid, sys) { Object.keys(json).forEach(function(key) { var obj = json[key]; if(lastnotf==obj.id && key>0 && native=="yes"){ - var ct=key+1; - if(key==14){ + var ct=key; + if(key>14){ ct="15+"; } var electron = require("electron"); @@ -37,9 +37,9 @@ function notf(acct_id, tlid, sys) { ipc.send('native-notf', ['TheDesk:'+domain,ct+"件の新しい通知",localStorage.getItem("prof_"+acct_id)]); } if(obj.type!="follow"){ - templete = templete+parse([obj], 'notf', acct_id, tlid, -1); + templete = templete+parse([obj], 'notf', acct_id, 'notf', -1); }else{ - templete = templete+userparse([obj.account], 'notf', acct_id, tlid, -1); + templete = templete+userparse([obj.account], 'notf', acct_id, 'notf', -1); } }); @@ -80,9 +80,9 @@ function notf(acct_id, tlid, sys) { var templete=""; localStorage.setItem("lastnotf_" + acct_id,obj.id); if(obj.type!="follow"){ - templete = parse([obj], 'notf', acct_id, tlid, popup); + templete = parse([obj], 'notf', acct_id, 'notf', popup); }else{ - templete = userparse([obj], 'notf', acct_id, tlid, popup); + templete = userparse([obj], 'notf', acct_id, 'notf', popup); } if(!$("div[data-notfIndv=" + acct_id +"_"+obj.id+"]").length){ $("div[data-notf=" + acct_id +"]").prepend(templete); diff --git a/app/js/tl/parse.js b/app/js/tl/parse.js index 388cf0ab..3ca3b8a3 100644 --- a/app/js/tl/parse.js +++ b/app/js/tl/parse.js @@ -1,6 +1,20 @@ //オブジェクトパーサー(トゥート) function parse(obj, mix, acct_id, tlid, popup) { var templete = ''; + var actb = localStorage.getItem("action_btns"); + var actb='re,rt,fav,qt,del,pin'; + if(actb){ + var actb = actb.split(','); + var disp={}; + for(var k=0;kpublic'; + 'public'; var can_rt = ""; } else if (visen == "unlisted") { var vis = - 'lock_open'; + 'lock_open'; var can_rt = ""; } else if (visen == "private") { var vis = - 'lock'; + 'lock'; var can_rt = "hide"; } else if (visen == "direct") { var vis = - 'mail'; + 'mail'; var can_rt = "hide"; } if (toot.account.acct == localStorage.getItem("user_" + acct_id)) { var if_mine = ""; + var mine_via="type-b"; } else { var if_mine = "hide"; + var mine_via=""; } if (toot.favourited) { var if_fav = " yellow-text"; @@ -407,7 +437,7 @@ function parse(obj, mix, acct_id, tlid, popup) { templete = templete + '
' + + key].created_at, 'unix') + '" '+if_notf+' onmouseover="mov(\'' + toot.id + '\',\''+tlid+'\')" onmouseout="resetmv()">' + '
' + notice + home + '
' + '' + + date(toot.created_at, datetype) + '' + + vis + '
' + '
' + content + '' + spoil + spoiler_show + @@ -431,38 +462,38 @@ function parse(obj, mix, acct_id, tlid, popup) { '
' + analyze + '' + '' + mentions + tags + '
' + - '
' + - '
' + - vis + '
'+ + '
' + + '
' + - '' + - '
' + - '' + - '
' + - '
' +trans+ + '' + '' + - '
' + - '
via ' + + ',\''+tlid+'\')" class="waves-effect waves-dark btn-flat details" style="padding:0">more_vert
' + + 'via ' + via + - '
' + - '' + divider; + '' + + '' + divider; }); if (mix == "mix") { return [templete, local, times] diff --git a/app/js/tl/tl.js b/app/js/tl/tl.js index 3ea4cdef..de8cf276 100644 --- a/app/js/tl/tl.js +++ b/app/js/tl/tl.js @@ -131,6 +131,9 @@ function reload(type, cc, acct_id, tlid, data) { } else if (type=="list"){ var start = "wss://" + domain + "/api/v1/streaming/?stream=list&list=" + data +"&access_token=" + at; + } else if (type=="dm"){ + var start = "wss://" + domain + + "/api/v1/streaming/?stream=direct&access_token=" + at; } console.log(start); var wsid = websocket.length; @@ -321,6 +324,8 @@ function cap(type, data, acct_id) { } } else if (type == "noauth") { var response= "Glance TL" + } else if (type == "dm") { + var response= "DM" } return response; } @@ -335,9 +340,10 @@ function com(type, data) { return "public?" } else if (type == "tag") { return "tag/" + data + "?" - } - if (type == "list") { + }else if (type == "list") { return "list/" + data + "?" + }else if (type="dm") { + return "direct?" } } @@ -353,8 +359,9 @@ function icon(type) { return "search" } else if (type == "list") { return "view_headline" - } - if (type == "list") { + }else if (type == "list") { return "subject" + }else if (type == "dm") { + return "mail" } } \ No newline at end of file diff --git a/app/js/ui/layout.js b/app/js/ui/layout.js index 26dabe77..07679dd8 100644 --- a/app/js/ui/layout.js +++ b/app/js/ui/layout.js @@ -170,6 +170,7 @@ function addColumn() { } function addselCk(){ var acct = $("#add-acct-sel").val(); + var domain=localStorage.getItem("domain_" + acct); if(acct=="noauth"){ $("#auth").addClass("hide"); $("#noauth").removeClass("hide"); @@ -177,6 +178,13 @@ function addselCk(){ $("#auth").removeClass("hide"); $("#noauth").addClass("hide"); } + if(domain=="knzk.me" || domain=="mstdn.y-zu.org"){ + $("#type-sel").append(''); + $('#type-sel').material_select('update'); + }else{ + $("#direct-add").remove(); + $('#type-sel').material_select('update'); + } } //カラム削除 function removeColumn(tlid) { diff --git a/app/js/ui/pip.js b/app/js/ui/pip.js index 484fbc78..39cd7505 100644 --- a/app/js/ui/pip.js +++ b/app/js/ui/pip.js @@ -3,7 +3,7 @@ function pip(id){ $("#pip").removeClass("hide"); } function endPip(){ - $("#pip-content").html(); + $("#pip-content").html(""); $("#pip").addClass("hide"); } diff --git a/app/js/ui/radio.js b/app/js/ui/radio.js index 0c84e047..3e27f149 100644 --- a/app/js/ui/radio.js +++ b/app/js/ui/radio.js @@ -34,4 +34,23 @@ function Rselect(){ function Rinput(){ var url=$("#radio-url").val(); Rplay(url,url) -} \ No newline at end of file +} +/* + +
+NowPlaying +Listen.moe +AnimeNfo Radio +LoFi hip hop Radio +Linn Classical +Linn Jazz +Jazz FM +canal-jazz.eu +Others +
+
+ + + +
+*/ \ No newline at end of file diff --git a/app/js/ui/settings.js b/app/js/ui/settings.js index 86db50e7..d9c45a8a 100644 --- a/app/js/ui/settings.js +++ b/app/js/ui/settings.js @@ -126,6 +126,21 @@ function settings() { Materialize.toast("引用形式を" + qtt + "に設定しました。", 3000); } localStorage.setItem("quote", qtd); + + var viad = $("[name=via]:checked").val(); + var viat = $("[for=via_"+viad+"]").text(); + if (viad != localStorage.getItem("viashow")) { + Materialize.toast("via表示を" + viat + "に設定しました。", 3000); + } + localStorage.setItem("viashow", viad); + + var movd = $("[name=mov]:checked").val(); + var movt = $("[for=mov_"+movd+"]").text(); + if (movd != localStorage.getItem("mouseover")) { + Materialize.toast("マウスオーバー・ヒディングを" + movt + "に設定しました。", 3000); + } + localStorage.setItem("mouseover", movd); + } //読み込み時の設定ロード @@ -247,6 +262,18 @@ function load() { var qt = "simple"; } $("#q_" + qt).prop("checked", true); + + var viat = localStorage.getItem("viashow"); + if (!viat) { + var viat = "hide"; + } + $("#via_" + viat).prop("checked", true); + + var movt = localStorage.getItem("mouseover"); + if (!movt) { + var movt = "no"; + } + $("#mov_" + movt).prop("checked", true); } //最初に読む load(); diff --git a/app/js/userdata/showOnTL.js b/app/js/userdata/showOnTL.js index 5ffd5df5..70719840 100644 --- a/app/js/userdata/showOnTL.js +++ b/app/js/userdata/showOnTL.js @@ -97,14 +97,18 @@ function udg(user, acct_id) { $("#his-follower").text(json.followers_count); $("#his-since").text(crat(json.created_at)); if(json.fields){ - var note=json.note+'My Fields
' - for(var i=0;i'; + if(json.fields.length>0){ + var note=json.note+'My Fields
'+fname+''+fval+'
' + for(var i=0;i'; + } + note=note+'
'+fname+''+fval+'
' + $("#his-des").html(note); + }else{ + $("#his-des").html(json.note); } - note=note+'' - $("#his-des").html(note); }else{ $("#his-des").html(json.note); } diff --git a/app/main.js b/app/main.js index 585a15a3..4e06d0e0 100644 --- a/app/main.js +++ b/app/main.js @@ -26,7 +26,6 @@ const BrowserWindow = electron.BrowserWindow; const { download } = require('electron-dl'); -const openAboutWindow = require('about-window').default; const join = require('path').join; // メインウィンドウはGCされないようにグローバル宣言 let mainWindow; @@ -395,6 +394,33 @@ ipc.on('nano', function (e, x, y) { window.setPosition(0, 0); return "true" }) + ipc.on('adobe', (e, arg) => { + if(!arg){ + const options = { + type: 'info', + title: 'Adobeフォトエディタ', + message: "「許可」または「永続的に許可」をクリックするとTheDeskとAdobeで情報を共有します。", + buttons: ['拒否', '許可','永続的に許可'] + } + dialog.showMessageBox(options, function(index) { + if(index==2){ + mainWindow.webContents.send('adobeagree', "true"); + } + if(index>0){ + adobeWindow(); + } + }) + }else{ + adobeWindow(); + } +}); +function adobeWindow(){ + var window = new BrowserWindow({ + width: 1000, + height: 750 + }); + window.loadURL('file://' + __dirname + '/adobe.html'); +} app.setAsDefaultProtocolClient('thedesk') \ No newline at end of file diff --git a/app/node_modules/about-window/.npmignore b/app/node_modules/about-window/.npmignore deleted file mode 100644 index d2ffd5c6..00000000 --- a/app/node_modules/about-window/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -/typings -/.git -/example -npm-debug.log -node_modules diff --git a/app/node_modules/about-window/.stylelintrc.json b/app/node_modules/about-window/.stylelintrc.json deleted file mode 100644 index 40db42c6..00000000 --- a/app/node_modules/about-window/.stylelintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "stylelint-config-standard" -} diff --git a/app/node_modules/about-window/LICENSE.txt b/app/node_modules/about-window/LICENSE.txt deleted file mode 100644 index 67f4d981..00000000 --- a/app/node_modules/about-window/LICENSE.txt +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2015 rhysd - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/app/node_modules/about-window/README.md b/app/node_modules/about-window/README.md deleted file mode 100644 index 00ba9a6c..00000000 --- a/app/node_modules/about-window/README.md +++ /dev/null @@ -1,100 +0,0 @@ -'About This App' Window for [Electron](https://github.com/atom/electron) Apps -============================================================================= -[![npm version](https://badge.fury.io/js/about-window.svg)](https://www.npmjs.com/package/about-window) - -[This package](https://www.npmjs.com/package/about-window) provides 'About This App' window for [Electron](https://github.com/atom/electron) applications. - -- [x] Create 'About This App' window from given parameters - - [x] Icon path - - [x] Copy right - - [x] App name and Versions - - [x] Description -- [x] Gather package information from package.json -- [x] Automatically detect package.json -- [x] Adjust window size to its contents automatically -- [x] CSS customizability - -You can install this module via [npm](https://www.npmjs.com/). - -```sh -$ npm install about-window -``` - -Only one function is exported as default. Please see [TypeScript type definition](index.d.ts). -The function can be called from both main process and renderer process. - -```typescript -export default function openAboutWindow(info: { - icon_path: string; - package_json_dir?: string; - bug_report_url?: string; - copyright?: string; - homepage?: string; - description?: string; - license?: string; - css_path?: string; - adjust_window_size?: boolean; - win_options?: BrowserWindowOptions; -}): BrowserWindow -``` - -Only `icon_path` property is required, others are optional. -I recommend to specify as below to extract information from package.json as much as possible. -Path to package.json is also automatically detected if possible. - -```typescript -openAboutWindow({ - icon_path: 'path/to/icon.png' -}); -``` - -You can check [an example app](example) to know how to use this package. - -```sh -$ git clone https://github.com/rhysd/about-window.git -$ cd about-window/example -$ npm install -$ npm start - -# Or for debug -$ npm run debug -``` - -### Parameter's properties of `openAboutWindow()` - -| Name | Description | Type | -|------|-------------|------| -| `icon_path` | Path to icon file of the application. The path is passed to `src` property of `` element. **Required** | string | -| `package_json_dir` | Path to directory which contains package.json. If not specified, it will try to detect a path to package.json. If also failed, it gives up and show less information in 'About This App' window. **Optional** | string | -| `bug_report_url` | URL to bug report page. If not specified, 'bugs' entry in package.json is used. **Optional** | string | -| `copyright` | Copyright notice shown in window. If not specified, it is replaced with license description generated by 'license' entry of package.json. **Optional** | string | -| `homepage` | URL of application's web page. If not specified, 'homepage' entry of package.json is used instead. **Optional** | string | -| `description` | Description of the application. If not specified, 'description' entry of package.json is used instead. **Optional** | string | -| `license` | License of the application. If not specified, 'license' entry of package.json is used instead. This property is used when `copyright` is not specified. **Optional** | string | -| `win_options` | Options of 'About This App' window. It is merged into default options. **Optional** | [BrowserWindow options object](https://github.com/atom/electron/blob/master/docs/api/browser-window.md#new-browserwindowoptions) | -| `css_path` | Path to user-defined CSS file. It will be inserted to DOM of the window. **Optional** | string | -| `adjust_window_size` | Adjust the window size to its content not to show scroll bar. **Optional** | boolean | -| `open_devtools` | For debug purpose, Chrome DevTools will start when the window is opened **Optional** | boolean | -| `use_inner_html` | If `true`, set the value with `.innerHTML` on copyright, license and description Default is `false` **Optional** | boolean | - -**Note:** If you set `use_inner_html` to `true`, please ensure that contents don't contain any untrusted external input -in order to avoid XSS. Be careful. - -## Screen Shots - -### Linux - -![Linux screenshot](https://raw.githubusercontent.com/rhysd/ss/master/about-window/about-window-linux.png) - -### OS X - -![OS X screenshot](https://raw.githubusercontent.com/rhysd/ss/master/about-window/about-window-os-x.png) - -### Windows - -![Windows screenshot](https://raw.githubusercontent.com/rhysd/ss/master/about-window/about-window-windows.jpg) - -## License - -[MIT License](/LICENSE.txt). - diff --git a/app/node_modules/about-window/about.html b/app/node_modules/about-window/about.html deleted file mode 100644 index 679ec5e8..00000000 --- a/app/node_modules/about-window/about.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - About This App - - - - - -

- - -
-
- -
- - - - - - - diff --git a/app/node_modules/about-window/index.d.ts b/app/node_modules/about-window/index.d.ts deleted file mode 100644 index 4e394f95..00000000 --- a/app/node_modules/about-window/index.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/// - -export interface AboutWindowInfo { - icon_path: string; - package_json_dir?: string; - bug_report_url?: string; - copyright?: string; - homepage?: string; - description?: string; - license?: string; - win_options?: Electron.BrowserWindowConstructorOptions; - css_path?: string; - adjust_window_size?: boolean; - open_devtools?: boolean; - use_inner_html?: boolean; -} - -export default function openAboutWindow(into: AboutWindowInfo): Electron.BrowserWindow; diff --git a/app/node_modules/about-window/package.json b/app/node_modules/about-window/package.json deleted file mode 100644 index 0b9d9344..00000000 --- a/app/node_modules/about-window/package.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "about-window", - "scope": null, - "escapedName": "about-window", - "name": "about-window", - "rawSpec": "", - "spec": "latest", - "type": "tag" - }, - "C:\\Users\\ryuki\\TheDesk" - ] - ], - "_from": "about-window@latest", - "_id": "about-window@1.8.0", - "_inCache": true, - "_location": "/about-window", - "_nodeVersion": "6.10.3", - "_npmOperationalInternal": { - "host": "s3://npm-registry-packages", - "tmp": "tmp/about-window-1.8.0.tgz_1506494385445_0.4268775100354105" - }, - "_npmUser": { - "name": "rhysd", - "email": "lin90162@yahoo.co.jp" - }, - "_npmVersion": "3.10.10", - "_phantomChildren": {}, - "_requested": { - "raw": "about-window", - "scope": null, - "escapedName": "about-window", - "name": "about-window", - "rawSpec": "", - "spec": "latest", - "type": "tag" - }, - "_requiredBy": [ - "#USER" - ], - "_resolved": "https://registry.npmjs.org/about-window/-/about-window-1.8.0.tgz", - "_shasum": "3e183cfaef4342e1fea6c442f4e43f682e9da580", - "_shrinkwrap": null, - "_spec": "about-window", - "_where": "C:\\Users\\ryuki\\TheDesk", - "author": { - "name": "rhysd", - "email": "lin90162@yahoo.co.jp" - }, - "bugs": { - "url": "https://github.com/rhysd/electron-about-window/issues" - }, - "dependencies": {}, - "description": "'About App' window for Electron application", - "devDependencies": { - "@types/node": "^8.0.24", - "electron": "^1.7.5", - "stylelint": "^8.0.0", - "stylelint-config-standard": "^17.0.0", - "tslint": "^5.6.0", - "typescript": "^2.4.2" - }, - "directories": {}, - "dist": { - "shasum": "3e183cfaef4342e1fea6c442f4e43f682e9da580", - "tarball": "https://registry.npmjs.org/about-window/-/about-window-1.8.0.tgz" - }, - "gitHead": "c2dac96372fcde38f2f842c00a34f024d0bdf4c1", - "homepage": "https://github.com/rhysd/electron-about-window#readme", - "keywords": [ - "Electron", - "electron-component", - "about", - "window" - ], - "license": "MIT", - "main": "src/index.js", - "maintainers": [ - { - "name": "rhysd", - "email": "lin90162@yahoo.co.jp" - } - ], - "name": "about-window", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/rhysd/electron-about-window.git" - }, - "scripts": { - "build": "tsc -p src/", - "debug": "electron ./example", - "dep": "npm install", - "example": "NODE_ENV=production electron ./example", - "lint": "npm run tslint && npm run stylelint", - "preversion": "npm run lint && npm run build", - "start": "npm run dep && npm run build && npm run example", - "stylelint": "stylelint styles/*.css", - "tslint": "tslint -p ./src --type-check" - }, - "version": "1.8.0" -} diff --git a/app/node_modules/about-window/src/index.js b/app/node_modules/about-window/src/index.js deleted file mode 100644 index 86ef6d7b..00000000 --- a/app/node_modules/about-window/src/index.js +++ /dev/null @@ -1,115 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const electron_1 = require("electron"); -const fs_1 = require("fs"); -const path = require("path"); -let window = null; -function loadPackageJson(pkg_path) { - try { - return require(pkg_path); - } - catch (e) { - return null; - } -} -function detectPackageJson(specified_dir) { - if (specified_dir) { - const pkg = loadPackageJson(path.join(specified_dir, 'package.json')); - if (pkg !== null) { - return pkg; - } - else { - console.warn('about-window: package.json is not found in specified directory path: ' + specified_dir); - } - } - const app_name = electron_1.app.getName(); - for (const mod_path of module.paths) { - if (!path.isAbsolute(mod_path)) { - continue; - } - const p = path.join(mod_path, '..', 'package.json'); - try { - const stats = fs_1.statSync(p); - if (stats.isFile()) { - const pkg = loadPackageJson(p); - if (pkg !== null && pkg.productName === app_name) { - return pkg; - } - } - } - catch (e) { - } - } - return null; -} -function injectInfoFromPackageJson(info) { - const pkg = detectPackageJson(info.package_json_dir); - if (pkg === null) { - return info; - } - if (!info.description) { - info.description = pkg.description; - } - if (!info.license && pkg.license) { - const l = pkg.license; - info.license = typeof l === 'string' ? l : l.type; - } - if (!info.homepage) { - info.homepage = pkg.homepage; - } - if (!info.bug_report_url && typeof (pkg.bugs) === 'object') { - info.bug_report_url = pkg.bugs.url; - } - if (info.use_inner_html === undefined) { - info.use_inner_html = false; - } - return info; -} -function openAboutWindow(info) { - if (window !== null) { - window.focus(); - return window; - } - const index_html = 'file://' + path.join(__dirname, '..', 'about.html'); - const options = Object.assign({ - width: 400, - height: 400, - useContentSize: true, - titleBarStyle: 'hidden-inset', - show: !info.adjust_window_size, - icon: info.icon_path, - }, info.win_options || {}); - window = new (electron_1.BrowserWindow || electron_1.remote.BrowserWindow)(options); - window.once('closed', () => { - window = null; - }); - window.loadURL(index_html); - window.webContents.on('will-navigate', (e, url) => { - e.preventDefault(); - electron_1.shell.openExternal(url); - }); - window.webContents.on('new-window', (e, url) => { - e.preventDefault(); - electron_1.shell.openExternal(url); - }); - window.webContents.once('dom-ready', () => { - delete info.win_options; - window.webContents.send('about-window:info', info); - if (info.open_devtools) { - if (process.versions.electron >= '1.4') { - window.webContents.openDevTools({ mode: 'detach' }); - } - else { - window.webContents.openDevTools(); - } - } - }); - window.once('ready-to-show', () => { - window.show(); - }); - window.setMenu(null); - info = injectInfoFromPackageJson(info); - return window; -} -exports.default = openAboutWindow; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/app/node_modules/about-window/src/index.js.map b/app/node_modules/about-window/src/index.js.map deleted file mode 100644 index 52385ef5..00000000 --- a/app/node_modules/about-window/src/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;AAAA,uCAA2D;AAC3D,2BAA4B;AAC5B,6BAA6B;AAE7B,IAAI,MAAM,GAA2B,IAAI,CAAC;AAE1C,yBAAyB,QAAgB;IACrC,IAAI,CAAC;QACD,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC7B,CAAC;IAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACT,MAAM,CAAC,IAAI,CAAC;IAChB,CAAC;AACL,CAAC;AAED,2BAA2B,aAAqB;IAC5C,EAAE,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC;QAChB,MAAM,GAAG,GAAG,eAAe,CAAC,IAAI,CAAC,IAAI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AC,WAAW,CAAC,YAAY,CAAC,EAAC,IAAI,EAAE,QAAQ,EAAC,CAAC,CAAC;YACtD,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,MAAM,CAAC,WAAW,CAAC,YAAY,EAAE,CAAC;YACtC,CAAC;QACL,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,IAAI,CAAC,eAAe,EAAE,GAAG,EAAE;QAC9B,MAAM,CAAC,IAAI,EAAE,CAAC;IAClB,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAErB,IAAI,GAAG,yBAAyB,CAAC,IAAI,CAAC,CAAC;IAEvC,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC;AAzDD,kCAyDC"} \ No newline at end of file diff --git a/app/node_modules/about-window/src/index.ts b/app/node_modules/about-window/src/index.ts deleted file mode 100644 index 71e148d2..00000000 --- a/app/node_modules/about-window/src/index.ts +++ /dev/null @@ -1,134 +0,0 @@ -import {app, BrowserWindow, remote, shell} from 'electron'; -import {statSync} from 'fs'; -import * as path from 'path'; - -let window: Electron.BrowserWindow = null; - -function loadPackageJson(pkg_path: string): PackageJson { - try { - return require(pkg_path); - } catch (e) { - return null; - } -} - -function detectPackageJson(specified_dir: string) { - if (specified_dir) { - const pkg = loadPackageJson(path.join(specified_dir, 'package.json')); - if (pkg !== null) { - return pkg; - } else { - console.warn('about-window: package.json is not found in specified directory path: ' + specified_dir); - } - } - - const app_name = app.getName(); - - for (const mod_path of (module as any).paths) { - if (!path.isAbsolute(mod_path)) { - continue; - } - - const p = path.join(mod_path, '..', 'package.json'); - try { - const stats = statSync(p); - if (stats.isFile()) { - const pkg = loadPackageJson(p); - if (pkg !== null && pkg.productName === app_name) { - return pkg; - } - } - } catch (e) { - // File not found. Ignored. - } - } - - // Note: Not found. - return null; -} - -function injectInfoFromPackageJson(info: AboutWindowInfo) { - const pkg = detectPackageJson(info.package_json_dir); - if (pkg === null) { - // Note: Give up. - return info; - } - - if (!info.description) { - info.description = pkg.description; - } - if (!info.license && pkg.license) { - const l = pkg.license; - info.license = typeof l === 'string' ? l : l.type; - } - if (!info.homepage) { - info.homepage = pkg.homepage; - } - if (!info.bug_report_url && typeof (pkg.bugs) === 'object') { - info.bug_report_url = pkg.bugs.url; - } - if (info.use_inner_html === undefined) { - info.use_inner_html = false; - } - - return info; -} - -export default function openAboutWindow(info: AboutWindowInfo) { - if (window !== null) { - window.focus(); - return window; - } - - const index_html = 'file://' + path.join(__dirname, '..', 'about.html'); - - const options = Object.assign( - { - width: 400, - height: 400, - useContentSize: true, - titleBarStyle: 'hidden-inset', - show: !info.adjust_window_size, - icon: info.icon_path, - }, - info.win_options || {}, - ); - - window = new (BrowserWindow || remote.BrowserWindow)(options); - - window.once('closed', () => { - window = null; - }); - window.loadURL(index_html); - - window.webContents.on('will-navigate', (e, url) => { - e.preventDefault(); - shell.openExternal(url); - }); - window.webContents.on('new-window', (e, url) => { - e.preventDefault(); - shell.openExternal(url); - }); - - window.webContents.once('dom-ready', () => { - delete info.win_options; - window.webContents.send('about-window:info', info); - if (info.open_devtools) { - if (process.versions.electron >= '1.4') { - window.webContents.openDevTools({mode: 'detach'}); - } else { - window.webContents.openDevTools(); - } - } - }); - - window.once('ready-to-show', () => { - window.show(); - }); - - window.setMenu(null); - - info = injectInfoFromPackageJson(info); - - return window; -} diff --git a/app/node_modules/about-window/src/lib.d.ts b/app/node_modules/about-window/src/lib.d.ts deleted file mode 100644 index e05bf27d..00000000 --- a/app/node_modules/about-window/src/lib.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -/// - -interface LicenseEntry { - type: string; - url: string; -} - -interface PackageJson { - productName?: string; - description?: string; - homepage?: string; - license?: string | LicenseEntry; - bugs?: { - url: string; - }; -} - -interface AboutWindowInfo { - icon_path: string; - copyright?: string; - homepage?: string; - description?: string; - package_json_dir?: string; - license?: string; - bug_report_url?: string; - css_path?: string; - adjust_window_size?: boolean; - win_options?: Electron.BrowserWindowConstructorOptions; - open_devtools?: boolean; - use_inner_html?: boolean; -} - -declare namespace NodeJS { - interface ProcessVersions { - [name: string]: string; - } -} diff --git a/app/node_modules/about-window/src/renderer.js b/app/node_modules/about-window/src/renderer.js deleted file mode 100644 index f15c74d3..00000000 --- a/app/node_modules/about-window/src/renderer.js +++ /dev/null @@ -1,65 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const electron_1 = require("electron"); -electron_1.ipcRenderer.on('about-window:info', (_, info) => { - const app_name = electron_1.remote.app.getName(); - const open_home = () => electron_1.shell.openExternal(info.homepage); - const content = info.use_inner_html ? 'innerHTML' : 'innerText'; - document.title = `About ${app_name}`; - const title_elem = document.querySelector('.title'); - title_elem.innerText = `${app_name} ${electron_1.remote.app.getVersion()}`; - title_elem.addEventListener('click', open_home); - if (info.homepage) { - document - .querySelector('.logo') - .addEventListener('click', open_home); - } - const copyright_elem = document.querySelector('.copyright'); - if (info.copyright) { - copyright_elem[content] = info.copyright; - } - else if (info.license) { - copyright_elem[content] = `Distributed under ${info.license} license.`; - } - const icon_elem = document.getElementById('app-icon'); - icon_elem.src = info.icon_path; - if (info.description) { - const desc_elem = document.querySelector('.description'); - desc_elem[content] = info.description; - } - if (info.bug_report_url) { - const bug_report = document.querySelector('.bug-report-link'); - bug_report.innerText = 'found bug?'; - bug_report.addEventListener('click', e => { - e.preventDefault(); - electron_1.shell.openExternal(info.bug_report_url); - }); - } - if (info.css_path) { - const link = document.createElement('link'); - link.rel = 'stylesheet'; - link.href = info.css_path; - document.head.appendChild(link); - } - if (info.adjust_window_size) { - const height = document.body.scrollHeight; - const width = document.body.scrollWidth; - const win = electron_1.remote.getCurrentWindow(); - if (height > 0 && width > 0) { - win.setContentSize(width, height + 40); - } - } -}); -const versions = document.querySelector('.versions'); -const vs = process.versions; -for (const name of ['electron', 'chrome', 'node', 'v8']) { - const tr = document.createElement('tr'); - const name_td = document.createElement('td'); - name_td.innerText = name; - tr.appendChild(name_td); - const version_td = document.createElement('td'); - version_td.innerText = ' : ' + vs[name]; - tr.appendChild(version_td); - versions.appendChild(tr); -} -//# sourceMappingURL=renderer.js.map \ No newline at end of file diff --git a/app/node_modules/about-window/src/renderer.js.map b/app/node_modules/about-window/src/renderer.js.map deleted file mode 100644 index d70d866f..00000000 --- a/app/node_modules/about-window/src/renderer.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"renderer.js","sourceRoot":"","sources":["renderer.ts"],"names":[],"mappings":";;AAAA,uCAAoD;AAEpD,sBAAW,CAAC,EAAE,CAAC,mBAAmB,EAAE,CAAC,CAAM,EAAE,IAAqB,EAAE,EAAE;IAClE,MAAM,QAAQ,GAAG,iBAAM,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;IACtC,MAAM,SAAS,GAAG,GAAG,EAAE,CAAC,gBAAK,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC1D,MAAM,OAAO,GAAG,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC;IAChE,QAAQ,CAAC,KAAK,GAAG,SAAS,QAAQ,EAAE,CAAC;IAErC,MAAM,UAAU,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAuB,CAAC;IAC1E,UAAU,CAAC,SAAS,GAAG,GAAG,QAAQ,IAAI,iBAAM,CAAC,GAAG,CAAC,UAAU,EAAE,EAAE,CAAC;IAChE,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAEhD,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;QAChB,QAAQ;aACH,aAAa,CAAC,OAAO,CAAC;aACtB,gBAAgB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAC9C,CAAC;IAED,MAAM,cAAc,GAAG,QAAQ,CAAC,aAAa,CAAC,YAAY,CAAQ,CAAC;IACnE,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,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er.ts deleted file mode 100644 index 6c5293cd..00000000 --- a/app/node_modules/about-window/src/renderer.ts +++ /dev/null @@ -1,73 +0,0 @@ -import {ipcRenderer, remote, shell} from 'electron'; - -ipcRenderer.on('about-window:info', (_: any, info: AboutWindowInfo) => { - const app_name = remote.app.getName(); - const open_home = () => shell.openExternal(info.homepage); - const content = info.use_inner_html ? 'innerHTML' : 'innerText'; - document.title = `About ${app_name}`; - - const title_elem = document.querySelector('.title') as HTMLHeadingElement; - title_elem.innerText = `${app_name} ${remote.app.getVersion()}`; - title_elem.addEventListener('click', open_home); - - if (info.homepage) { - document - .querySelector('.logo') - .addEventListener('click', open_home); - } - - const copyright_elem = document.querySelector('.copyright') as any; - if (info.copyright) { - copyright_elem[content] = info.copyright; - } else if (info.license) { - copyright_elem[content] = `Distributed under ${info.license} license.`; - } - - const icon_elem = document.getElementById('app-icon') as HTMLImageElement; - icon_elem.src = info.icon_path; - - if (info.description) { - const desc_elem = document.querySelector('.description') as any; - desc_elem[content] = info.description; - } - - if (info.bug_report_url) { - const bug_report = document.querySelector('.bug-report-link') as HTMLDivElement; - bug_report.innerText = 'found bug?'; - bug_report.addEventListener('click', e => { - e.preventDefault(); - shell.openExternal(info.bug_report_url); - }); - } - - if (info.css_path) { - const link = document.createElement('link'); - link.rel = 'stylesheet'; - link.href = info.css_path; - document.head.appendChild(link); - } - - if (info.adjust_window_size) { - const height = document.body.scrollHeight; - const width = document.body.scrollWidth; - const win = remote.getCurrentWindow(); - if (height > 0 && width > 0) { - // Note: - // Add 30px(= about 2em) to add padding in window - win.setContentSize(width, height + 40); - } - } -}); - -const versions = document.querySelector('.versions'); -const vs = process.versions; -for (const name of ['electron', 'chrome', 'node', 'v8']) { - const tr = document.createElement('tr'); - const name_td = document.createElement('td'); - name_td.innerText = name; - tr.appendChild(name_td); - const version_td = document.createElement('td'); - version_td.innerText = ' : ' + vs[name]; - tr.appendChild(version_td); - versions.appendChild(tr); -} diff --git a/app/node_modules/about-window/src/tsconfig.json b/app/node_modules/about-window/src/tsconfig.json deleted file mode 100644 index 31fb13e1..00000000 --- a/app/node_modules/about-window/src/tsconfig.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", - "removeComments": true, - "preserveConstEnums": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "noEmitOnError": true, - "strictNullChecks": false, - "target": "es2015", - "sourceMap": true - }, - "include": [ - "**/*.ts" - ] -} diff --git a/app/node_modules/about-window/styles/ui.css b/app/node_modules/about-window/styles/ui.css deleted file mode 100644 index d28e0f78..00000000 --- a/app/node_modules/about-window/styles/ui.css +++ /dev/null @@ -1,64 +0,0 @@ -body, -html { - width: 100%; - height: 100%; - -webkit-user-select: none; - user-select: none; - -webkit-app-region: drag; -} - -body { - margin: 0; - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - color: #333; - background-color: #eee; - font-size: 12px; - font-family: 'Helvetica', 'Arial', 'ヒラギノ角ゴ Pro W3', 'Hiragino Kaku Gothic Pro', 'メイリオ', Meiryo, 'MS Pゴシック', 'MS PGothic', sans-serif; -} - -.logo { - width: 200px; - cursor: pointer; - -webkit-user-select: none; - user-select: none; -} - -.title, -.copyright, -.description { - margin: 0.2em; -} - -.title { - cursor: pointer; -} - -.description { - margin-bottom: 1em; - text-align: center; -} - -.versions { - border-collapse: collapse; - margin-top: 1em; -} - -.copyright, -.versions { - color: #999; -} - -.link { - cursor: pointer; - color: #80a0c2; -} - -.bug-report-link { - -webkit-app-region: no-drag; - position: absolute; - right: 0.5em; - bottom: 0.5em; -} diff --git a/app/node_modules/about-window/tslint.json b/app/node_modules/about-window/tslint.json deleted file mode 100644 index ab04abdc..00000000 --- a/app/node_modules/about-window/tslint.json +++ /dev/null @@ -1,127 +0,0 @@ -{ - "extends": ["tslint:recommended"], - "rules": { - "align": [ - true, - "parameters", - "statements" - ], - "ban": false, - "class-name": true, - "comment-format": [ - true, - "check-space" - ], - "curly": true, - "eofline": true, - "forin": false, - "indent": [ - true, - "spaces" - ], - "interface-name": false, - "jsdoc-format": true, - "label-position": true, - "max-line-length": false, - "member-access": false, - "member-ordering": [ - true, - "public-before-private", - "static-before-instance", - "variables-before-functions" - ], - "no-any": false, - "no-arg": true, - "no-bitwise": false, - "no-conditional-assignment": true, - "no-consecutive-blank-lines": false, - "no-console": [ - true, - "debug", - "info", - "time", - "timeEnd", - "trace" - ], - "no-construct": true, - "no-constructor-vars": false, - "no-debugger": true, - "no-duplicate-variable": true, - "no-empty": true, - "no-eval": true, - "no-inferrable-types": false, - "no-internal-module": true, - "no-require-imports": false, - "no-shadowed-variable": true, - "no-string-literal": true, - "no-switch-case-fall-through": false, - "no-trailing-whitespace": true, - "no-unused-expression": true, - "no-unsafe-finally": true, - "no-use-before-declare": true, - "no-var-keyword": true, - "no-var-requires": true, - "object-literal-sort-keys": false, - "object-literal-key-quotes": [ - true, - "as-needed" - ], - "one-line": [ - true, - "check-open-brace", - "check-catch", - "check-else", - "check-whitespace" - ], - "quotemark": [ - true, - "single", - "avoid-escape", - "jsx-double" - ], - "radix": true, - "semicolon": true, - "switch-default": true, - "trailing-comma": [ - true, - { - "multiline": "always", - "singleline": "never" - } - ], - "triple-equals": [ - true, - "allow-null-check" - ], - "typedef": [ - false - ], - "typedef-whitespace": [ - true, - { - "call-signature": "nospace", - "index-signature": "nospace", - "parameter": "nospace", - "property-declaration": "nospace", - "variable-declaration": "nospace" - } - ], - "use-strict": false, - "variable-name": [ - false, - "check-format", - "allow-leading-underscore", - "ban-keywords" - ], - "whitespace": [ - true, - "check-branch", - "check-decl", - "check-operator", - "check-separator", - "check-type" - ], - "no-namespace": false, - "arrow-parens": false - } -} diff --git a/app/node_modules/electron-dl/index.js b/app/node_modules/electron-dl/index.js index c18ff624..5d14abdd 100644 --- a/app/node_modules/electron-dl/index.js +++ b/app/node_modules/electron-dl/index.js @@ -18,7 +18,7 @@ function getFilenameFromMime(name, mime) { return `${name}.${exts[0].ext}`; } -function registerListener(session, opts = {}, cb = () => {}) { +function registerListener(session, options, cb = () => {}) { const downloadItems = new Set(); let receivedBytes = 0; let completedBytes = 0; @@ -26,6 +26,10 @@ function registerListener(session, opts = {}, cb = () => {}) { const activeDownloadItems = () => downloadItems.size; const progressDownloadItems = () => receivedBytes / totalBytes; + options = Object.assign({ + showBadge: true + }, options); + const listener = (e, item, webContents) => { downloadItems.add(item); totalBytes += item.getTotalBytes(); @@ -36,10 +40,10 @@ function registerListener(session, opts = {}, cb = () => {}) { } const win = electron.BrowserWindow.fromWebContents(hostWebContents); - const dir = opts.directory || app.getPath('downloads'); + const dir = options.directory || app.getPath('downloads'); let filePath; - if (opts.filename) { - filePath = path.join(dir, opts.filename); + if (options.filename) { + filePath = path.join(dir, options.filename); } else { const filename = item.getFilename(); const name = path.extname(filename) ? filename : getFilenameFromMime(filename, item.getMimeType()); @@ -47,10 +51,10 @@ function registerListener(session, opts = {}, cb = () => {}) { filePath = unusedFilename.sync(path.join(dir, name)); } - const errorMessage = opts.errorMessage || 'The download of {filename} was interrupted'; - const errorTitle = opts.errorTitle || 'Download Error'; + const errorMessage = options.errorMessage || 'The download of {filename} was interrupted'; + const errorTitle = options.errorTitle || 'Download Error'; - if (!opts.saveAs) { + if (!options.saveAs) { item.setSavePath(filePath); } @@ -60,7 +64,7 @@ function registerListener(session, opts = {}, cb = () => {}) { return receivedBytes; }, completedBytes); - if (['darwin', 'linux'].includes(process.platform)) { + if (options.showBadge && ['darwin', 'linux'].includes(process.platform)) { app.setBadgeCount(activeDownloadItems()); } @@ -68,8 +72,8 @@ function registerListener(session, opts = {}, cb = () => {}) { win.setProgressBar(progressDownloadItems()); } - if (typeof opts.onProgress === 'function') { - opts.onProgress(progressDownloadItems()); + if (typeof options.onProgress === 'function') { + options.onProgress(progressDownloadItems()); } }); @@ -77,7 +81,7 @@ function registerListener(session, opts = {}, cb = () => {}) { completedBytes += item.getTotalBytes(); downloadItems.delete(item); - if (['darwin', 'linux'].includes(process.platform)) { + if (options.showBadge && ['darwin', 'linux'].includes(process.platform)) { app.setBadgeCount(activeDownloadItems()); } @@ -97,11 +101,11 @@ function registerListener(session, opts = {}, cb = () => {}) { app.dock.downloadFinished(filePath); } - if (opts.openFolderWhenDone) { - shell.showItemInFolder(filePath); + if (options.openFolderWhenDone) { + shell.showItemInFolder(path.join(dir, item.getFilename())); } - if (opts.unregisterWhenDone) { + if (options.unregisterWhenDone) { session.removeListener('will-download', listener); } @@ -113,16 +117,16 @@ function registerListener(session, opts = {}, cb = () => {}) { session.on('will-download', listener); } -module.exports = (opts = {}) => { +module.exports = (options = {}) => { app.on('session-created', session => { - registerListener(session, opts); + registerListener(session, options); }); }; -module.exports.download = (win, url, opts) => new Promise((resolve, reject) => { - opts = Object.assign({}, opts, {unregisterWhenDone: true}); +module.exports.download = (win, url, options) => new Promise((resolve, reject) => { + options = Object.assign({}, options, {unregisterWhenDone: true}); - registerListener(win.webContents.session, opts, (err, item) => { + registerListener(win.webContents.session, options, (err, item) => { if (err) { reject(err); } else { diff --git a/app/node_modules/electron-dl/package.json b/app/node_modules/electron-dl/package.json index dca83903..5a50b305 100644 --- a/app/node_modules/electron-dl/package.json +++ b/app/node_modules/electron-dl/package.json @@ -1,50 +1,28 @@ { - "_args": [ - [ - { - "raw": "electron-dl", - "scope": null, - "escapedName": "electron-dl", - "name": "electron-dl", - "rawSpec": "", - "spec": "latest", - "type": "tag" - }, - "C:\\Users\\ryuki\\TheDesk" - ] - ], - "_from": "electron-dl@latest", - "_id": "electron-dl@1.10.0", - "_inCache": true, + "_from": "electron-dl@1.11.0", + "_id": "electron-dl@1.11.0", + "_inBundle": false, + "_integrity": "sha512-iL9qHzzWOuL9bus+UT+P72SwrDQcFTV6QHqcbhwgqjCC9/K5jhdRzG0dIMB3TzYlk6rmApanPqh9DvWykwIH1Q==", "_location": "/electron-dl", - "_nodeVersion": "4.8.3", - "_npmOperationalInternal": { - "host": "s3://npm-registry-packages", - "tmp": "tmp/electron-dl-1.10.0.tgz_1502139802256_0.5021310658194125" - }, - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "_npmVersion": "2.15.11", "_phantomChildren": {}, "_requested": { - "raw": "electron-dl", - "scope": null, - "escapedName": "electron-dl", + "type": "version", + "registry": true, + "raw": "electron-dl@1.11.0", "name": "electron-dl", - "rawSpec": "", - "spec": "latest", - "type": "tag" + "escapedName": "electron-dl", + "rawSpec": "1.11.0", + "saveSpec": null, + "fetchSpec": "1.11.0" }, "_requiredBy": [ - "#USER" + "#USER", + "/" ], - "_resolved": "https://registry.npmjs.org/electron-dl/-/electron-dl-1.10.0.tgz", - "_shasum": "f94416064056fc6f2a86ae498614c93526890af9", - "_shrinkwrap": null, - "_spec": "electron-dl", - "_where": "C:\\Users\\ryuki\\TheDesk", + "_resolved": "https://registry.npmjs.org/electron-dl/-/electron-dl-1.11.0.tgz", + "_shasum": "112851f3857bb1a556b5c736af06040bd40df850", + "_spec": "electron-dl@1.11.0", + "_where": "C:\\Users\\ryuki\\TheDesk\\app", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", @@ -53,15 +31,17 @@ "bugs": { "url": "https://github.com/sindresorhus/electron-dl/issues" }, + "bundleDependencies": false, "dependencies": { "ext-name": "^5.0.0", "pupa": "^1.0.0", "unused-filename": "^1.0.0" }, + "deprecated": false, "description": "Simplified file downloads for your Electron app", "devDependencies": { - "ava": "^0.21.0", - "cp-file": "^4.2.0", + "ava": "^0.25.0", + "cp-file": "^5.0.0", "electron": "^1.3.3", "minimist": "^1.2.0", "node-static": "^0.7.9", @@ -70,15 +50,9 @@ "uuid": "^3.1.0", "xo": "*" }, - "directories": {}, - "dist": { - "shasum": "f94416064056fc6f2a86ae498614c93526890af9", - "tarball": "https://registry.npmjs.org/electron-dl/-/electron-dl-1.10.0.tgz" - }, "files": [ "index.js" ], - "gitHead": "b47d7e9ee5e8c89b08ed86e9e395aa052e39f4bf", "homepage": "https://github.com/sindresorhus/electron-dl#readme", "keywords": [ "electron", @@ -89,15 +63,7 @@ "progress" ], "license": "MIT", - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - } - ], "name": "electron-dl", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", "repository": { "type": "git", "url": "git+https://github.com/sindresorhus/electron-dl.git" @@ -106,7 +72,7 @@ "start": "electron run.js", "test": "xo && ava" }, - "version": "1.10.0", + "version": "1.11.0", "xo": { "envs": [ "node", diff --git a/app/node_modules/electron-dl/readme.md b/app/node_modules/electron-dl/readme.md index 6a8f3360..0bda7d3a 100644 --- a/app/node_modules/electron-dl/readme.md +++ b/app/node_modules/electron-dl/readme.md @@ -1,6 +1,6 @@ # electron-dl [![Build Status](https://travis-ci.org/sindresorhus/electron-dl.svg?branch=master)](https://travis-ci.org/sindresorhus/electron-dl) -> Simplified file downloads for your [Electron](http://electron.atom.io) app +> Simplified file downloads for your [Electron](https://electronjs.org) app ## Why? @@ -56,9 +56,11 @@ ipcMain.on('download-btn', (e, args) => { ## API +It can only be used in the [main](https://electronjs.org/docs/glossary/#main-process) process. + ### electronDl([options]) -### electronDl.download(window, url, [options]): Promise<[DownloadItem](https://github.com/electron/electron/blob/master/docs/api/download-item.md)> +### electronDl.download(window, url, [options]): Promise<[DownloadItem](https://electronjs.org/docs/api/download-item)> ### window @@ -86,14 +88,14 @@ Note: Only use this option when strictly necessary. Downloading directly without #### directory Type: `string`
-Default: [User's downloads directory](http://electron.atom.io/docs/api/app/#appgetpathname) +Default: [User's downloads directory](https://electronjs.org/docs/api/app/#appgetpathname) Directory to save the file in. #### filename Type: `string`
-Default: [`downloadItem.getFilename()`](https://electron.atom.io/docs/api/download-item/#downloaditemgetfilename) +Default: [`downloadItem.getFilename()`](https://electronjs.org/docs/api/download-item/#downloaditemgetfilename) Name of the saved file. @@ -126,6 +128,12 @@ Default: `false` Reveal the downloaded file in the system file manager, and if possible, select the file. +#### showBadge + +Type: `boolean`
+Default: `true` + +Shows the file count badge on macOS/Linux dock icons when download is in progress. ## Development diff --git a/app/node_modules/mime-db/HISTORY.md b/app/node_modules/mime-db/HISTORY.md index 7e60975e..29a8c4ff 100644 --- a/app/node_modules/mime-db/HISTORY.md +++ b/app/node_modules/mime-db/HISTORY.md @@ -1,3 +1,11 @@ +1.33.0 / 2018-02-15 +=================== + + * Add extensions from IANA for `message/*` types + * Add new upstream MIME types + * Fix some incorrect OOXML types + * Remove `application/font-woff2` + 1.32.0 / 2017-11-29 =================== diff --git a/app/node_modules/mime-db/db.json b/app/node_modules/mime-db/db.json index e3143c04..a8db93b8 100644 --- a/app/node_modules/mime-db/db.json +++ b/app/node_modules/mime-db/db.json @@ -369,6 +369,9 @@ "application/fdt+xml": { "source": "iana" }, + "application/fhir+xml": { + "source": "iana" + }, "application/fido.trusted-apps+json": { "compressible": true }, @@ -387,10 +390,6 @@ "compressible": false, "extensions": ["woff"] }, - "application/font-woff2": { - "compressible": false, - "extensions": ["woff2"] - }, "application/framework-attributes+xml": { "source": "iana" }, @@ -779,6 +778,9 @@ "application/nlsml+xml": { "source": "iana" }, + "application/node": { + "source": "iana" + }, "application/nss": { "source": "iana" }, @@ -883,6 +885,9 @@ "source": "iana", "extensions": ["p8"] }, + "application/pkcs8-encrypted": { + "source": "iana" + }, "application/pkix-attr-cert": { "source": "iana", "extensions": ["ac"] @@ -1247,6 +1252,9 @@ "source": "iana", "extensions": ["tsd"] }, + "application/tnauthlist": { + "source": "iana" + }, "application/trig": { "source": "iana" }, @@ -1433,6 +1441,10 @@ "source": "iana", "extensions": ["azs"] }, + "application/vnd.amadeus+json": { + "source": "iana", + "compressible": true + }, "application/vnd.amazon.ebook": { "source": "apache", "extensions": ["azw"] @@ -1537,6 +1549,10 @@ "application/vnd.bbf.usp.msg": { "source": "iana" }, + "application/vnd.bbf.usp.msg+json": { + "source": "iana", + "compressible": true + }, "application/vnd.bekitzur-stech+json": { "source": "iana", "compressible": true @@ -1640,9 +1656,15 @@ "application/vnd.collabio.xodocuments.presentation": { "source": "iana" }, + "application/vnd.collabio.xodocuments.presentation-template": { + "source": "iana" + }, "application/vnd.collabio.xodocuments.spreadsheet": { "source": "iana" }, + "application/vnd.collabio.xodocuments.spreadsheet-template": { + "source": "iana" + }, "application/vnd.collection+json": { "source": "iana", "compressible": true @@ -1658,6 +1680,9 @@ "application/vnd.comicbook+zip": { "source": "iana" }, + "application/vnd.comicbook-rar": { + "source": "iana" + }, "application/vnd.commerce-battelle": { "source": "iana" }, @@ -3452,9 +3477,6 @@ "application/vnd.openxmlformats-officedocument.extended-properties+xml": { "source": "iana" }, - "application/vnd.openxmlformats-officedocument.presentationml-template": { - "source": "iana" - }, "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": { "source": "iana" }, @@ -3511,7 +3533,7 @@ "source": "iana" }, "application/vnd.openxmlformats-officedocument.presentationml.template": { - "source": "apache", + "source": "iana", "extensions": ["potx"] }, "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": { @@ -3520,9 +3542,6 @@ "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": { "source": "iana" }, - "application/vnd.openxmlformats-officedocument.spreadsheetml-template": { - "source": "iana" - }, "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": { "source": "iana" }, @@ -3583,7 +3602,7 @@ "source": "iana" }, "application/vnd.openxmlformats-officedocument.spreadsheetml.template": { - "source": "apache", + "source": "iana", "extensions": ["xltx"] }, "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": { @@ -3607,9 +3626,6 @@ "application/vnd.openxmlformats-officedocument.vmldrawing": { "source": "iana" }, - "application/vnd.openxmlformats-officedocument.wordprocessingml-template": { - "source": "iana" - }, "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": { "source": "iana" }, @@ -3646,7 +3662,7 @@ "source": "iana" }, "application/vnd.openxmlformats-officedocument.wordprocessingml.template": { - "source": "apache", + "source": "iana", "extensions": ["dotx"] }, "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": { @@ -3874,6 +3890,10 @@ "application/vnd.renlearn.rlprint": { "source": "iana" }, + "application/vnd.restful+json": { + "source": "iana", + "compressible": true + }, "application/vnd.rig.cryptonote": { "source": "iana", "extensions": ["cryptonote"] @@ -4021,6 +4041,9 @@ "source": "iana", "extensions": ["sfs"] }, + "application/vnd.sqlite3": { + "source": "iana" + }, "application/vnd.sss-cod": { "source": "iana" }, @@ -4446,6 +4469,9 @@ "source": "iana", "extensions": ["cmp"] }, + "application/vnd.youtube.yt": { + "source": "iana" + }, "application/vnd.zul": { "source": "iana", "extensions": ["zir","zirz"] @@ -4458,6 +4484,10 @@ "source": "iana", "extensions": ["vxml"] }, + "application/voucher-cms+json": { + "source": "iana", + "compressible": true + }, "application/vq-rtcpxr": { "source": "iana" }, @@ -5784,6 +5814,9 @@ "source": "iana", "extensions": ["woff2"] }, + "image/aces": { + "source": "iana" + }, "image/apng": { "compressible": false, "extensions": ["apng"] @@ -6089,7 +6122,10 @@ "source": "iana" }, "message/disposition-notification": { - "source": "iana" + "source": "iana", + "extensions": [ + "disposition-notification" + ] }, "message/external-body": { "source": "iana" @@ -6098,16 +6134,20 @@ "source": "iana" }, "message/global": { - "source": "iana" + "source": "iana", + "extensions": ["u8msg"] }, "message/global-delivery-status": { - "source": "iana" + "source": "iana", + "extensions": ["u8dsn"] }, "message/global-disposition-notification": { - "source": "iana" + "source": "iana", + "extensions": ["u8mdn"] }, "message/global-headers": { - "source": "iana" + "source": "iana", + "extensions": ["u8hdr"] }, "message/http": { "source": "iana", @@ -6145,7 +6185,8 @@ "source": "iana" }, "message/vnd.wfa.wsc": { - "source": "iana" + "source": "iana", + "extensions": ["wsc"] }, "model/3mf": { "source": "iana" diff --git a/app/node_modules/mime-db/package.json b/app/node_modules/mime-db/package.json index 8389c479..84353f3a 100644 --- a/app/node_modules/mime-db/package.json +++ b/app/node_modules/mime-db/package.json @@ -1,53 +1,31 @@ { - "_args": [ - [ - { - "raw": "mime-db@^1.28.0", - "scope": null, - "escapedName": "mime-db", - "name": "mime-db", - "rawSpec": "^1.28.0", - "spec": ">=1.28.0 <2.0.0", - "type": "range" - }, - "C:\\Users\\ryuki\\TheDesk\\node_modules\\ext-list" - ] - ], - "_from": "mime-db@>=1.28.0 <2.0.0", - "_id": "mime-db@1.32.0", - "_inCache": true, + "_from": "mime-db@^1.28.0", + "_id": "mime-db@1.33.0", + "_inBundle": false, + "_integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==", "_location": "/mime-db", - "_nodeVersion": "6.12.0", - "_npmOperationalInternal": { - "host": "s3://npm-registry-packages", - "tmp": "tmp/mime-db-1.32.0.tgz_1511989647467_0.298956407699734" - }, - "_npmUser": { - "name": "dougwilson", - "email": "doug@somethingdoug.com" - }, - "_npmVersion": "5.5.1", "_phantomChildren": {}, "_requested": { + "type": "range", + "registry": true, "raw": "mime-db@^1.28.0", - "scope": null, - "escapedName": "mime-db", "name": "mime-db", + "escapedName": "mime-db", "rawSpec": "^1.28.0", - "spec": ">=1.28.0 <2.0.0", - "type": "range" + "saveSpec": null, + "fetchSpec": "^1.28.0" }, "_requiredBy": [ "/ext-list" ], - "_resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.32.0.tgz", - "_shasum": "485b3848b01a3cda5f968b4882c0771e58e09414", - "_shrinkwrap": null, + "_resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz", + "_shasum": "a3492050a5cb9b63450541e39d9788d2272783db", "_spec": "mime-db@^1.28.0", - "_where": "C:\\Users\\ryuki\\TheDesk\\node_modules\\ext-list", + "_where": "C:\\Users\\ryuki\\TheDesk\\app\\node_modules\\ext-list", "bugs": { "url": "https://github.com/jshttp/mime-db/issues" }, + "bundleDependencies": false, "contributors": [ { "name": "Douglas Christopher Wilson", @@ -64,7 +42,7 @@ "url": "http://github.com/broofa" } ], - "dependencies": {}, + "deprecated": false, "description": "Media Type Database", "devDependencies": { "bluebird": "3.5.1", @@ -79,16 +57,10 @@ "eslint-plugin-standard": "3.0.1", "gnode": "0.1.2", "mocha": "1.21.5", - "nyc": "11.3.0", + "nyc": "11.4.1", "raw-body": "2.3.2", "stream-to-array": "2.3.0" }, - "directories": {}, - "dist": { - "integrity": "sha512-+ZWo/xZN40Tt6S+HyakUxnSOgff+JEdaneLWIm0Z6LmpCn5DMcZntLyUY5c/rTDog28LhXLKOUZKoTxTCAdBVw==", - "shasum": "485b3848b01a3cda5f968b4882c0771e58e09414", - "tarball": "https://registry.npmjs.org/mime-db/-/mime-db-1.32.0.tgz" - }, "engines": { "node": ">= 0.6" }, @@ -99,7 +71,6 @@ "db.json", "index.js" ], - "gitHead": "555f55537d688a6ba935253d8d36bf270a4a0ffa", "homepage": "https://github.com/jshttp/mime-db#readme", "keywords": [ "mime", @@ -111,19 +82,7 @@ "charsets" ], "license": "MIT", - "maintainers": [ - { - "name": "dougwilson", - "email": "doug@somethingdoug.com" - }, - { - "name": "jongleberry", - "email": "jonathanrichardong@gmail.com" - } - ], "name": "mime-db", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", "repository": { "type": "git", "url": "git+https://github.com/jshttp/mime-db.git" @@ -137,5 +96,5 @@ "test-travis": "nyc --reporter=text npm test", "update": "npm run fetch && npm run build" }, - "version": "1.32.0" + "version": "1.33.0" } diff --git a/app/package-lock.json b/app/package-lock.json index cf69961a..1ec4b7cd 100644 --- a/app/package-lock.json +++ b/app/package-lock.json @@ -1,14 +1,9 @@ { "name": "TheDesk", - "version": "14.5.0", + "version": "14.7.0", "lockfileVersion": 1, "requires": true, "dependencies": { - "about-window": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/about-window/-/about-window-1.8.0.tgz", - "integrity": "sha1-Phg8+u9DQuH+psRC9OQ/aC6dpYA=" - }, "ajv": { "version": "5.5.2", "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", @@ -146,9 +141,9 @@ } }, "electron-dl": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/electron-dl/-/electron-dl-1.10.0.tgz", - "integrity": "sha1-+UQWBkBW/G8qhq5JhhTJNSaJCvk=", + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/electron-dl/-/electron-dl-1.11.0.tgz", + "integrity": "sha512-iL9qHzzWOuL9bus+UT+P72SwrDQcFTV6QHqcbhwgqjCC9/K5jhdRzG0dIMB3TzYlk6rmApanPqh9DvWykwIH1Q==", "requires": { "ext-name": "5.0.0", "pupa": "1.0.0", @@ -170,7 +165,7 @@ "resolved": "https://registry.npmjs.org/ext-list/-/ext-list-2.2.2.tgz", "integrity": "sha1-C5jmTtgvWs8PKTG6v2khLvUt3Tc=", "requires": { - "mime-db": "1.32.0" + "mime-db": "1.33.0" } }, "ext-name": { @@ -402,9 +397,9 @@ "integrity": "sha1-Ms2eXGRVO9WNGaVor0Uqz/BJgbE=" }, "mime-db": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.32.0.tgz", - "integrity": "sha1-SFs4SLAaPNpflotIgsB3HljglBQ=" + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz", + "integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==" }, "mime-types": { "version": "2.1.18", diff --git a/app/package.json b/app/package.json index dec3a269..65df3819 100644 --- a/app/package.json +++ b/app/package.json @@ -1,6 +1,6 @@ { "name": "TheDesk", - "version": "14.7.0", + "version": "15.0.0", "description": "TheDesk on Mastodonはシンプルと多機能を両立したデスクトップ向けクライアントです", "main": "main.js", "scripts": { @@ -10,8 +10,7 @@ "author": "Cutls P", "license": "TheDesk LICENSE", "dependencies": { - "about-window": "1.8.0", - "electron-dl": "1.10.0", + "electron-dl": "^1.11.0", "jimp": "^0.2.28", "node-notifier": "5.2.1" } diff --git a/app/setting.html b/app/setting.html index 3480d91b..9f93dd7d 100644 --- a/app/setting.html +++ b/app/setting.html @@ -103,6 +103,19 @@
+
viaを表示する
+ + + + +
+
マウスオーバーするまでアクションメニューを非表示
+ 1画面で得られる情報量が格段にアップしますが、すこし鬱陶しいと思うかもしれません。
+ + + + +
指定行数以上を折りたたむ
5文字以下のトゥートは折りたたみません。また、折りたたみ時は改行が描画されません。
行以上または @@ -194,7 +207,7 @@ SpotifyとNowPlayingの設定
- play_circle_outlineボタンで表示されるメニューから簡単にNowPlayingができます。
+ ボタンから簡単にNowPlayingができます。
アカウントの連携
APIの性質上,thedesk.topへアクセスします。