diff --git a/.gitignore b/.gitignore index 515c07ff..37583d0a 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ TheDesk-* app/build build make.js +make_js.js app/.DS_Store .DS_Store .vs/* diff --git a/app/css/master.css b/app/css/master.css index 66977556..9b193194 100644 --- a/app/css/master.css +++ b/app/css/master.css @@ -52,6 +52,7 @@ option { } #imagemodal .modal-content { overflow: hidden; + padding:0; } #imagemodal .modal-footer{ overflow-x:scroll; @@ -309,7 +310,7 @@ blockquote:before, .quote:before { position:fixed; z-index:9999; background-color: var(--box); - width:520px; + width:540px; top:calc(50% - 150px); left:calc(50% - 250px); padding: 5px; @@ -341,12 +342,41 @@ blockquote:before, .quote:before { background-color: var(--emphasized); } #right-menu{ - width:350px; - max-height:325px; + width:380px; + max-height:375px; overflow-y:scroll; overflow-x:hidden; padding:5px; } +#tltype{ + display:flex; + flex-wrap: wrap; + +} +#tltype .type{ + display:flex; + flex-wrap: wrap; + align-items:center; + width:170px; + height:40px; + cursor:pointer; +} +#tltype .type:hover { + background-color: var(--beforehover); +} +#tltype .active{ + background-color: var(--emphasized); +} +#tltype i{ + font-size:30px; +} +#tltype i.sub-icon{ + font-size: 20px; + position: relative; + color: var(--beforehover); + left: -15px; + +} .drag-bar{ cursor:move; text-align:center; diff --git a/app/css/tl.css b/app/css/tl.css index aa536ece..891fe985 100644 --- a/app/css/tl.css +++ b/app/css/tl.css @@ -488,6 +488,7 @@ p:not(:last-child){ .votebtn:hover{ background-color:var(--color); } + @keyframes fadeInDown { from { opacity: 0; @@ -523,3 +524,4 @@ p:not(:last-child){ animation-duration: 0.1s; animation-name: fadeInDown; } + diff --git a/app/js/common/version.js b/app/js/common/version.js index 4a7dccc2..409a4411 100644 --- a/app/js/common/version.js +++ b/app/js/common/version.js @@ -1,5 +1,6 @@ //バージョンチェッカー -function verck(ver,winstore) { +function verck(ver) { + console.log("Welcome") if(localStorage.getItem("ver")!=ver){ localStorage.setItem("ver", ver); console.log("Thank you for your update"); @@ -27,7 +28,6 @@ function verck(ver,winstore) { message: lang.lang_version_platform, buttons: [lang.lang_no,lang.lang_yesno] } - console.log(localStorage.getItem("winstore")) if(!localStorage.getItem("winstore")){ dialog.showMessageBox(options, function(arg) { @@ -42,7 +42,6 @@ function verck(ver,winstore) { if(localStorage.getItem("winstore")=="unix"){ localStorage.removeItem("winstore") } - console.log(localStorage.getItem("winstore")) if(!localStorage.getItem("winstore")){ const options = { type: 'info', @@ -61,6 +60,11 @@ function verck(ver,winstore) { }else{ localStorage.setItem("winstore","unix") } + if(localStorage.getItem("winstore")=="snapcraft" || localStorage.getItem("winstore")=="winstore"){ + var winstore=true; + }else{ + var winstore=false; + } var l = 5; // 生成する文字列に含める文字セット var c = "abcdefghijklmnopqrstuvwxyz0123456789"; @@ -90,7 +94,7 @@ function verck(ver,winstore) { } if (newest == ver) { todo(lang.lang_version_usever.replace("{{ver}}" ,mess.desk)); - //betaかWInstoreならアプデチェックしない + //betaかWinstoreならアプデチェックしない } else if (ver.indexOf("beta")!=-1 || winstore) { }else{ @@ -100,6 +104,7 @@ function verck(ver,winstore) { var ipc = electron.ipcRenderer; ipc.send('update', "true"); }else{ + console.log(lang.lang_version_skipver); todo(lang.lang_version_skipver); } }else{ diff --git a/app/js/lang/lang.js b/app/js/lang/lang.js deleted file mode 100644 index e69de29b..00000000 diff --git a/app/js/lang/parse.lang.js b/app/js/lang/parse.lang.js deleted file mode 100644 index f59613a3..00000000 --- a/app/js/lang/parse.lang.js +++ /dev/null @@ -1,189 +0,0 @@ -var lang_parse_mentioned={ - "ja":"が返信しました", - "en":" replied to you" -} -var lang_parse_faved={ - "ja":"がお気に入り登録しました", - "en":" favourited your toot" -} -var lang_parse_bted={ - "ja":"がブーストしました", - "en":" boosted your toot" -} -var lang_parse_btedsimple={ - "ja":"がブースト", - "en":" boosted" -} -var lang_parse_notftime={ - "ja":"通知された時間", - "en":"Actioned at" -} -var lang_parse_cwshow={ - "ja":"見る", - "en":"Show" -} -var lang_parse_fulltext={ - "ja":"以下全文", - "en":"Full size text:" -} -var lang_parse_autofold={ - "ja":"自動折り畳み", - "en":"Auto folded" -} -var lang_parse_more={ - "ja":"続き...", - "en":"More" -} -var lang_parse_url={ - "ja":"URL解析", - "en":"URL Analyzer" -} -var lang_parse_tagTL={ - "ja":"{{tag}}のタイムライン", - "en":"Timeline of {{tag}}" -} -var lang_parse_tagtoot={ - "ja":"{{tag}}でトゥート", - "en":"Toot with {{tag}}" -} -var lang_parse_tagpin={ - "ja":"{{tag}}をよく使うタグへ", - "en":"Pin {{tag}}" -} -var lang_parse_public={ - "ja":"公開", - "en":"Public" -} -var lang_parse_unlisted={ - "ja":"未収載", - "en":"Unlisted" -} -var lang_parse_private={ - "ja":"非公開", - "en":"Private" -} -var lang_parse_direct={ - "ja":"ダイレクト", - "en":"Direct" -} -var lang_parse_clickcopy={ - "ja":"クリックして本文をコピー", - "en":"Click to copy text of this toot" -} -var lang_parse_clickcopyurl={ - "ja":"クリックしてトゥートURLをコピー", - "en":"Click to copy URL of this toot" -} -var lang_parse_trans={ - "ja":"このトゥートを日本語に翻訳", - "en":"Translate to Japanese" -} -var lang_parse_replyto={ - "ja":"このトゥートに返信", - "en":"Reply to this toot" -} -var lang_parse_bt={ - "ja":"このトゥートをブースト", - "en":"Boost this toot" -} -var lang_parse_fav={ - "ja":"このトゥートをお気に入り登録", - "en":"Favourite this toot" -} -var lang_parse_quote={ - "ja":"このトゥートを引用", - "en":"Quote this toot" -} -var lang_parse_del={ - "ja":"このトゥートを削除", - "en":"Delete this toot" -} -var lang_parse_pin={ - "ja":"このトゥートをピン留め", - "en":"Pin this toot" -} -var lang_parse_det={ - "ja":"詳細(メインアカウント経由)", - "en":"Details via your main account." -} -var lang_parse_redraft={ - "ja":"このトゥートを削除して再編集", - "en":"Delete & re-draft" -} -var lang_parse_followed={ - "ja":"フォローされました。", - "en":"Followed you" -} -var lang_parse_clientop={ - "ja":"クライアント処理", - "en":"Operation of this client" -} -var lang_parse_clienttxt={ - "ja":"に対する処理を選択してください。", - "en":" will be" -} -var lang_parse_clientno={ - "ja":"何もしない", - "en":"done nothing" -} -var lang_parse_clientemp={ - "ja":"強調表示/解除", - "en":"emphasized(/not emphasized)" -} -var lang_parse_clientmute={ - "ja":"ミュート", - "en":"muted" -} -var lang_parse_mute={ - "ja":"ミュートします。設定から解除できます。", - "en":" will be muted. You can remove on preferences." -} -//misskey -var lang_misskeyparse_renote={ - "ja":"再投稿", - "en":"Repost" -} -var lang_misskeyparse_renoteqt={ - "ja":"引用", - "en":"Renote" -} -var lang_misskeyparse_reaction={ - "ja":"リアクション", - "en":"Reaction" -} -var lang_misskeyparse_tagnostr={ - "ja":"タグTLはストリーミング非対応です。", - "en":"No streaming API on Tag TLs" -} -var lang_misskeyparse_listnostr={ - "ja":"リストTLはストリーミング非対応です。", - "en":"No streaming API on List TLs" -} -var lang_misskeyparse_home={ - "ja":"ホーム", - "en":"Home" -} -var lang_misskeyparse_followers={ - "ja":"フォロワー", - "en":"Follower" -} -var lang_misskeyparse_specified={ - "ja":"ユーザー指定", - "en":"Specified User" -} -var lang_misskeyparse_qt={ - "ja":"MisskeyのRenote(引用モード)中:Ctrl+Shift+Cでクリア", - "en":"Misskey renote(quote) mode:Ctrl+Shift+Enter to clear" -} -var lang_misskeyparse_renoted={ - "ja":"がRepost", - "en":" renoted your following post." -} -var lang_misskeyparse_quoted={ - "ja":"が引用", - "en":" quoted your following post." -} -var lang_misskeyparse_reaction={ - "ja":"がリアクション", - "en":" reacted your following post." -} \ No newline at end of file diff --git a/app/js/lang/setting.lang.js b/app/js/lang/setting.lang.js deleted file mode 100644 index 5f000d03..00000000 --- a/app/js/lang/setting.lang.js +++ /dev/null @@ -1,152 +0,0 @@ -var lang_setting_time={ - "ja":"時間設定を{{set}}に設定しました。", - "en":"Time format:{{set}}" -} -var lang_setting_theme={ - "ja":"テーマ設定を{{set}}に設定しました。", - "en":"Theme:{{set}}" -} -var lang_setting_nsfw={ - "ja":"画像表示設定を{{set}}に設定しました。", - "en":"NSFW:{{set}}" -} -var lang_setting_cw={ - "ja":"テキスト表示設定を{{set}}に設定しました。", - "en":"CW:{{set}}" -} -var lang_setting_cwtext={ - "ja":"デフォルトの警告文を「{{set}}」に設定しました。", - "en":"Default CW text:{{set}}" -} -var lang_setting_cws={ - "ja":"標準でCW:{{set}}", - "en":"Always CW on:{{set}}" -} -var lang_setting_rp={ - "ja":"リプライ数表示:{{set}}", - "en":"Reply counter:{{set}}" -} -var lang_setting_vis={ - "ja":"デフォルトの公開設定を{{set}}に設定しました。", - "en":"Default visibility:{{set}}" -} -var lang_setting_popup={ - "ja":"ポップアップお知らせを{{set}}に設定しました。", - "en":"Popup notification:{{set}}" -} -var lang_setting_off={ - "ja":"オフ", - "en":"Off" -} -var lang_setting_s={ - "ja":"秒", - "en":"s" -} -var lang_setting_box={ - "ja":"デフォルトでのボックスの挙動を{{set}}に設定しました。", - "en":"Default toot box action:{{set}}" -} -var lang_setting_gif={ - "ja":"アイコンアニメーション再生を{{set}}に設定しました。", - "en":"GIF:{{set}}" -} -var lang_setting_selt={ - "ja":"{{set1}}行以上または{{set2}}文字以上でテキストを隠します。", - "en":"Auto fold:{{set1}} lines and above, {{set2}} letters and above" -} -var lang_setting_autocw={ - "ja":"{{set1}}行以上または{{set2}}文字以上で警告を表示します。", - "en":"Auto CW:{{set1}} lines and above, {{set2}} letters and above" -} -var lang_setting_width={ - "ja":"横幅最低を{{set}}pxに設定しました。", - "en":"Minimam width:{{set}}" -} -var lang_setting_img={ - "ja":"画像投稿後の設定を「{{set}}」に設定しました。", - "en":"After posting an image:{{set}}" -} -var lang_setting_font={ - "ja":"フォントを{{set}}に設定しました。", - "en":"Fonts:{{set}}" -} -var lang_setting_default={ - "ja":"デフォルト", - "en":"default font" -} -var lang_setting_size={ - "ja":"フォントサイズを{{set}}pxに設定しました。", - "en":"Font size:{{set}}px" -} -var lang_setting_imgheight={ - "ja":"画像高さを{{set}}pxに設定しました。", - "en":"Image height:{{set}}px" -} -var lang_setting_ticker={ - "ja":"#InstanceTicker使用を{{set}}に設定しました。", - "en":"#InstanceTicker:{{set}}px" -} -var lang_setting_tag={ - "ja":"タグの取得範囲を「{{set}}」に設定しました。", - "en":"Tag TL:{{set}}" -} -var lang_setting_box={ - "ja":"投稿ボックスを{{set}}", - "en":"Post box:{{set}}" -} -var lang_setting_ul={ - "ja":"独自ロケール設定を{{set}}に設定しました。", - "en":"Native locale:{{set}}" -} -var lang_setting_notf={ - "ja":"ネイティブ通知を{{set}}に設定しました。", - "en":"Native notification:{{set}}" -} -var lang_setting_quote={ - "ja":"引用形式を{{set}}に設定しました。", - "en":"Quote format:{{set}}" -} -var lang_setting_via={ - "ja":"via表示を{{set}}に設定しました。", - "en":"Via:{{set}}" -} -var lang_setting_mov={ - "ja":"アクションボタン非表示を{{set}}に設定しました。", - "en":"Action buttons hiding:{{set}}" -} -var lang_setting_setasread={ - "ja":"通知カラム存在時新着非表示を{{set}}に設定しました。", - "en":"Notification markers:{{set}}" -} -var lang_setting_main={ - "ja":"起動時・投稿時のアカウントを{{set}}に設定しました。", - "en":"Default account:{{set}}" -} -var lang_setting_sec={ - "ja":"セカンダリートゥートボタン:{{set}}", - "en":"Secondary toot button:{{set}}" -} -var lang_setting_ksref={ - "ja":"キーボードショートカットが更新されました。", - "en":"Keyboard shortcuts are refreshed." -} -var lang_setting_nomuting={ - "ja":"ミュートしているクライアントはありません。", - "en":"No client is muted." -} -var lang_setting_notftest={ - "ja":"通知テスト", - "en":" Notification test " -} -var lang_setting_notftestprof={ - "ja":"アイコンはあなたのアカウントのものです。", - "en":"Your icon is shown." -} -var lang_setting_exportwarn={ - "ja":"重要なデータのみエクスポートされます。エクスポートされたデータは外部に公開しないでください。全ての認証データが含まれています。", - "en":"Only important data will be exported. You must keep this data secure." -} -var lang_setting_importwarn={ - "ja":"全てのデータがリセットされます。", - "en":"All data will be deleted." -} \ No newline at end of file diff --git a/app/js/tl/parse.js b/app/js/tl/parse.js index 077e1aeb..baab4ed7 100644 --- a/app/js/tl/parse.js +++ b/app/js/tl/parse.js @@ -22,7 +22,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter) { } } var qt = localStorage.getItem("quote"); - if(qt=="nothing"){ + if(qt=="nothing" || !qt){ var qtClass="hide"; }else{ var qtClass=""; diff --git a/app/js/ui/img.js b/app/js/ui/img.js index 50f90f37..88d0e8f2 100644 --- a/app/js/ui/img.js +++ b/app/js/ui/img.js @@ -10,6 +10,7 @@ function imgv(id, key, acct_id) { $("#imagemodal").attr("data-acct",acct_id); $(document).ready(function() { if (type == "image") { + $('#imagemodal').modal('open'); xhr = new XMLHttpRequest; xhr.open('GET', murl, true); xhr.addEventListener('progress', function (event) { @@ -29,7 +30,6 @@ function imgv(id, key, acct_id) { xhr.send(); $('#imgmodal').attr('src', murl); $('#imagewrap').dragScroll(); // ドラッグスクロール設定 - $('#imagemodal').modal('open'); $('#imgmodal').show(); $('#imagemodal').attr('data-key', key); $('#imagemodal').attr('data-id', id); @@ -45,61 +45,31 @@ function imgv(id, key, acct_id) { var height = element.naturalHeight; var windowH = $(window).height(); var windowW = $(window).width(); - //小さい画像 - if(width<(windowW - 50) && height<(windowH-1000)){ - $("#imgmodal").css('height',height+"px"); - $("#imgmodal").css('width',width+"px"); - $("#imagewrap").css('height',height+"px"); - $("#imagemodal").css('height',height+100+"px"); - $("#imagewrap").css('width',width+"px"); - $("#imagemodal").css('width',width+"px"); - $("#imagemodal").css('margin-top',(windowH /2) - (height / 2) +"px"); - }else{ - $("#imagemodal").css('margin-top',0); - var aspect = width/height; - if (aspect < 2.8 && aspect > 0.3){ - //moderate - if(windowW > windowH){ - //画面が横長(縦幅基準) - $("#imgmodal").css('height',windowH/1.2-70+"px"); - var imgW = (windowH/1.2-70)/height*width; - $("#imgmodal").css('width',imgW+"px"); - $("#imagewrap").css('height',windowH/1.2-60+"px"); - $("#imagemodal").css('height',windowH/1.2+"px"); - $("#imagewrap").css('width',imgW+50+"px"); - $("#imagemodal").css('width',imgW+50+"px"); - }else{ - //画面が縦長・正方形(横幅基準) - $("#imgmodal").css('width',windowW/1.2-30+"px"); - var imgH = (windowW/1.2-30)/width*height; - $("#imgmodal").css('height',imgH+"px"); - $("#imagewrap").css('width',windowW/1.2+"px"); - $("#imagemodal").css('width',windowW/1.2+"px"); - $("#imagewrap").css('height',imgH+60+"px"); - $("#imagemodal").css('height',imgH+120+"px"); - } + $("#imagemodal").css("bottom","0") + $("#imagemodal img").css("width","auto") + if(heightwindowW*0.8){ + $("#imagemodal").css("width","80vw") + $("#imagemodal img").css("width","100%") + var heightS=windowW*0.8/width*height; + $("#imagemodal").css("height",heightS+60+"px") }else{ - //極端な画像 - if(height > width){ - //縦長 - $("#imgmodal").css('height',windowH-60+"px"); - var imgW = (windowH-50)/height*width; - $("#imgmodal").css('width',imgW+"px"); - $("#imagewrap").css('height',windowH-50+"px"); - $("#imagemodal").css('height',windowH+"px"); - $("#imagewrap").css('width',imgW+50+"px"); - $("#imagemodal").css('width',imgW+50+"px"); - }else{ - //横長・正方形 - $("#imgmodal").css('width',windowW-30+"px"); - var imgH = (windowW-50)/width*height; - $("#imgmodal").css('height',imgH+"px"); - $("#imagewrap").css('width',windowW+"px"); - $("#imagemodal").css('width',windowW+"px"); - $("#imagewrap").css('height',imgH+60+"px"); - $("#imagemodal").css('height',imgH+120+"px"); - } + $("#imagemodal").css("width",width+"px") } + }else{ + console.log("long") + $("#imagemodal img").css("width","auto") + var widthS=windowH/height*width; + if(widthS 0 && popd != localStorage.getItem("popup")) { - Materialize.toast(lang.lang_setting_popup.replace("{{set}}" ,popd+lang.lang_setting_s), 3000); - } else if (popd != localStorage.getItem("popup")) { - Materialize.toast(lang.lang_setting_popup.replace("{{set}}" ,lang.lang_setting_off), 3000); - } - localStorage.setItem("popup", popd); - - var gifd = $("[name=gif]:checked").val(); - var gift = $("[for=g_"+gifd+"]").text(); - if (gifd != localStorage.getItem("gif")) { - Materialize.toast(lang.lang_setting_gif.replace("{{set}}" ,gift), 3000); - } - localStorage.setItem("gif", gifd); - - var sentd = $("#sentence").val(); - var ltrd = $("#letters").val(); - if (sentd != localStorage.getItem("sentence") || ltrd != localStorage.getItem("letters")) { - Materialize.toast(lang.lang_setting_selt.replace("{{set1}}" ,sentd).replace("{{set2}}" ,ltrd), 3000); - } - localStorage.setItem("sentence", sentd); - localStorage.setItem("letters", ltrd); - - var csentd = $("#cw_sentence").val(); - var cltrd = $("#cw_letters").val(); - if (csentd != localStorage.getItem("cw_sentence") || cltrd != localStorage.getItem("cw_letters")) { - Materialize.toast(lang.lang_setting_autocw.replace("{{set1}}" ,csentd).replace("{{set2}}" ,cltrd), 3000); - } - localStorage.setItem("cw_sentence", csentd); - localStorage.setItem("cw_letters", cltrd); - - var widthd = $("#width").val(); - if (widthd != localStorage.getItem("width")) { - Materialize.toast(lang.lang_setting_width.replace("{{set}}" ,widthd), 3000); - } - localStorage.setItem("width", widthd); - - var fwidthd = $("#fixwidth").val(); - if (fwidthd != localStorage.getItem("fixwidth")) { - Materialize.toast(lang.lang_setting_fixwidth.replace("{{set}}" ,fwidthd), 3000); - } - localStorage.setItem("fixwidth", fwidthd); - - var imgd = $("[name=img]:checked").val(); - var imgt = $("[for=i_"+imgd+"]").text(); - if (imgd != localStorage.getItem("img")) { - Materialize.toast(lang.lang_setting_img.replace("{{set}}" ,imgt), 3000); - } - localStorage.setItem("img", imgd); - var fontd = $("#font").val(); if(fontd){ if (fontd != localStorage.getItem("font")) { @@ -130,326 +70,41 @@ function settings() { themes(); } } - - - var sized = $("#size").val(); - if (sized != localStorage.getItem("size")) { - Materialize.toast(lang.lang_setting_size.replace("{{set}}" ,sized), 3000); - } - localStorage.setItem("size", sized); - - var heid = $("#img-height").val(); - if (heid != localStorage.getItem("img-height")) { - Materialize.toast(lang.lang_setting_imgheight.replace("{{set}}" ,heid), 3000); - } - localStorage.setItem("img-height", heid); - - var tckrd = $("[name=ticker]:checked").val(); - var tckrt = $("[for=ticker_"+tckrd+"]").text(); - if (tckrd != localStorage.getItem("ticker_ok")) { - Materialize.toast(lang.lang_setting_ticker.replace("{{set}}" ,tckrt), 3000); - } - localStorage.setItem("ticker_ok", tckrd); - - var animed = $("[name=anime]:checked").val(); - var animet = $("[for=anime_"+animed+"]").text(); - if (animed != localStorage.getItem("animation")) { - Materialize.toast(lang.lang_setting_animation.replace("{{set}}" ,animet), 3000); - } - localStorage.setItem("animation", animed); - - var boxd = $("[name=box]:checked").val(); - var boxt = $("[for=bx_"+boxd+"]").text(); - if (boxd != localStorage.getItem("box")) { - Materialize.toast(lang.lang_setting_boxConfirm.replace("{{set}}" ,boxt), 3000); - } - localStorage.setItem("box", boxd); - - var tagd = $("[name=tag]:checked").val(); - var tagt = $("[for=t_"+tagd+"]").text(); - if (tagd != localStorage.getItem("tag-range")) { - Materialize.toast(lang.lang_setting_tag.replace("{{set}}" ,tagt), 3000); - } - localStorage.setItem("tag-range", tagd); - - var uld = $("[name=ul]:checked").val(); - var ult = $("[for=ul_"+uld+"]").text(); - if (uld != localStorage.getItem("locale")) { - Materialize.toast(lang.lang_setting_ul.replace("{{set}}" ,ult), 3000); - } - localStorage.setItem("locale", uld); - - var ntd = $("[name=notf]:checked").val(); - var ntt = $("[for=ntf_"+ntd+"]").text(); - if (ntd != localStorage.getItem("nativenotf")) { - Materialize.toast(lang.lang_setting_notf.replace("{{set}}" ,ntt), 3000); - } - localStorage.setItem("nativenotf", ntd); - - var qtd = $("[name=quote]:checked").val(); - var qtt = $("[for=q_"+qtd+"]").text(); - if (qtd != localStorage.getItem("quote")) { - Materialize.toast(lang.lang_setting_quote.replace("{{set}}" ,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(lang.lang_setting_via.replace("{{set}}" ,viat), 3000); - } - localStorage.setItem("viashow", viad); - - var notfmd = $("[name=notfm]:checked").val(); - var notfmt = $("[for=notfm_"+notfmd+"]").text(); - if (notfmd != localStorage.getItem("setasread")) { - Materialize.toast(lang.lang_setting_setasread.replace("{{set}}" ,notfmt), 3000); - } - localStorage.setItem("setasread", notfmd); - - var movd = $("[name=mov]:checked").val(); - var movt = $("[for=mov_"+movd+"]").text(); - if (movd != localStorage.getItem("mouseover")) { - Materialize.toast(lang.lang_setting_mov.replace("{{set}}" ,movt), 3000); - } - localStorage.setItem("mouseover", movd); - - var maind = $("[name=main]:checked").val(); - var maint = $("[for=mn_"+maind+"]").text(); - if (maind != localStorage.getItem("mainuse")) { - Materialize.toast(lang.lang_setting_main.replace("{{set}}" ,maint), 3000); - } - localStorage.setItem("mainuse", maind); - - var secd = $("[name=sec]:checked").val(); - var sect = $("[for=sec-"+secd+"]").text(); - if (secd != localStorage.getItem("sec")) { - Materialize.toast(lang.lang_setting_sec.replace("{{set}}" ,sect), 3000); - } - localStorage.setItem("sec", secd); } //読み込み時の設定ロード function load() { + var max=envView.config.length; + for(var i=0;i { console.log(savedFiles); if(!savedFiles){ @@ -569,20 +224,27 @@ function exportSettings(){ var column = JSON.parse(multi); exp.columns=column; //Themes - exp.theme=localStorage.getItem("theme"); - //Min width - exp.minwidth=localStorage.getItem("width"); + var config={}; + config.theme=localStorage.getItem("theme"); + //Other configs + var max=envView.config.length; + for(var i=0;i { console.log(fileNames); @@ -651,26 +313,53 @@ function importSettings(){ localStorage.setItem("acct_"+ key + "_at", acct.at); } localStorage.setItem("column",JSON.stringify(obj.columns)); - localStorage.setItem("theme",obj.theme); - if(obj.width){ - console.log(obj.width) - localStorage.setItem("width",obj.width); + if(obj.config){ + //Version 2 + var max=envView.config.length; + for(var i=0;i 0 && popd != localStorage.getItem("popup")) { + Materialize.toast(lang.lang_setting_popup.replace("{{set}}" ,popd+lang.lang_setting_s), 3000); + } else if (popd != localStorage.getItem("popup")) { + Materialize.toast(lang.lang_setting_popup.replace("{{set}}" ,lang.lang_setting_off), 3000); + } + localStorage.setItem("popup", popd); + + var gifd = $("[name=gif]:checked").val(); + var gift = $("[for=g_"+gifd+"]").text(); + if (gifd != localStorage.getItem("gif")) { + Materialize.toast(lang.lang_setting_gif.replace("{{set}}" ,gift), 3000); + } + localStorage.setItem("gif", gifd); + + var sentd = $("#sentence").val(); + var ltrd = $("#letters").val(); + if (sentd != localStorage.getItem("sentence") || ltrd != localStorage.getItem("letters")) { + Materialize.toast(lang.lang_setting_selt.replace("{{set1}}" ,sentd).replace("{{set2}}" ,ltrd), 3000); + } + localStorage.setItem("sentence", sentd); + localStorage.setItem("letters", ltrd); + + var csentd = $("#cw_sentence").val(); + var cltrd = $("#cw_letters").val(); + if (csentd != localStorage.getItem("cw_sentence") || cltrd != localStorage.getItem("cw_letters")) { + Materialize.toast(lang.lang_setting_autocw.replace("{{set1}}" ,csentd).replace("{{set2}}" ,cltrd), 3000); + } + localStorage.setItem("cw_sentence", csentd); + localStorage.setItem("cw_letters", cltrd); + + var widthd = $("#width").val(); + if (widthd != localStorage.getItem("width")) { + Materialize.toast(lang.lang_setting_width.replace("{{set}}" ,widthd), 3000); + } + localStorage.setItem("width", widthd); + + var fwidthd = $("#fixwidth").val(); + if (fwidthd != localStorage.getItem("fixwidth")) { + Materialize.toast(lang.lang_setting_fixwidth.replace("{{set}}" ,fwidthd), 3000); + } + localStorage.setItem("fixwidth", fwidthd); + + var imgd = $("[name=img]:checked").val(); + var imgt = $("[for=i_"+imgd+"]").text(); + if (imgd != localStorage.getItem("img")) { + Materialize.toast(lang.lang_setting_img.replace("{{set}}" ,imgt), 3000); + } + localStorage.setItem("img", imgd); + + var fontd = $("#font").val(); + if(fontd){ + if (fontd != localStorage.getItem("font")) { + Materialize.toast(lang.lang_setting_font.replace("{{set}}" ,fontd), 3000); + } + localStorage.setItem("font", fontd); + themes(); + }else{ + if(localStorage.getItem("font")){ + localStorage.removeItem("font"); + Materialize.toast(lang.lang_setting_font.replace("{{set}}" ,lang.lang_setting_default), 3000); + themes(); + } + } + + + var sized = $("#size").val(); + if (sized != localStorage.getItem("size")) { + Materialize.toast(lang.lang_setting_size.replace("{{set}}" ,sized), 3000); + } + localStorage.setItem("size", sized); + + var heid = $("#img-height").val(); + if (heid != localStorage.getItem("img-height")) { + Materialize.toast(lang.lang_setting_imgheight.replace("{{set}}" ,heid), 3000); + } + localStorage.setItem("img-height", heid); + + var tckrd = $("[name=ticker]:checked").val(); + var tckrt = $("[for=ticker_"+tckrd+"]").text(); + if (tckrd != localStorage.getItem("ticker_ok")) { + Materialize.toast(lang.lang_setting_ticker.replace("{{set}}" ,tckrt), 3000); + } + localStorage.setItem("ticker_ok", tckrd); + + var animed = $("[name=anime]:checked").val(); + var animet = $("[for=anime_"+animed+"]").text(); + if (animed != localStorage.getItem("animation")) { + Materialize.toast(lang.lang_setting_animation.replace("{{set}}" ,animet), 3000); + } + localStorage.setItem("animation", animed); + + var boxd = $("[name=box]:checked").val(); + var boxt = $("[for=bx_"+boxd+"]").text(); + if (boxd != localStorage.getItem("box")) { + Materialize.toast(lang.lang_setting_boxConfirm.replace("{{set}}" ,boxt), 3000); + } + localStorage.setItem("box", boxd); + + var tagd = $("[name=tag]:checked").val(); + var tagt = $("[for=t_"+tagd+"]").text(); + if (tagd != localStorage.getItem("tag-range")) { + Materialize.toast(lang.lang_setting_tag.replace("{{set}}" ,tagt), 3000); + } + localStorage.setItem("tag-range", tagd); + + var uld = $("[name=ul]:checked").val(); + var ult = $("[for=ul_"+uld+"]").text(); + if (uld != localStorage.getItem("locale")) { + Materialize.toast(lang.lang_setting_ul.replace("{{set}}" ,ult), 3000); + } + localStorage.setItem("locale", uld); + + var ntd = $("[name=notf]:checked").val(); + var ntt = $("[for=ntf_"+ntd+"]").text(); + if (ntd != localStorage.getItem("nativenotf")) { + Materialize.toast(lang.lang_setting_notf.replace("{{set}}" ,ntt), 3000); + } + localStorage.setItem("nativenotf", ntd); + + var qtd = $("[name=quote]:checked").val(); + var qtt = $("[for=q_"+qtd+"]").text(); + if (qtd != localStorage.getItem("quote")) { + Materialize.toast(lang.lang_setting_quote.replace("{{set}}" ,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(lang.lang_setting_via.replace("{{set}}" ,viat), 3000); + } + localStorage.setItem("viashow", viad); + + var notfmd = $("[name=notfm]:checked").val(); + var notfmt = $("[for=notfm_"+notfmd+"]").text(); + if (notfmd != localStorage.getItem("setasread")) { + Materialize.toast(lang.lang_setting_setasread.replace("{{set}}" ,notfmt), 3000); + } + localStorage.setItem("setasread", notfmd); + + var movd = $("[name=mov]:checked").val(); + var movt = $("[for=mov_"+movd+"]").text(); + if (movd != localStorage.getItem("mouseover")) { + Materialize.toast(lang.lang_setting_mov.replace("{{set}}" ,movt), 3000); + } + localStorage.setItem("mouseover", movd); + + var maind = $("[name=main]:checked").val(); + var maint = $("[for=mn_"+maind+"]").text(); + if (maind != localStorage.getItem("mainuse")) { + Materialize.toast(lang.lang_setting_main.replace("{{set}}" ,maint), 3000); + } + localStorage.setItem("mainuse", maind); + + var secd = $("[name=sec]:checked").val(); + var sect = $("[for=sec-"+secd+"]").text(); + if (secd != localStorage.getItem("sec")) { + Materialize.toast(lang.lang_setting_sec.replace("{{set}}" ,sect), 3000); + } + localStorage.setItem("sec", secd); +} + +//読み込み時の設定ロード +function load() { + if(localStorage.getItem("imas")){ + $(".imas").removeClass("hide"); + } + if(localStorage.getItem("kirishima")){ + $(".kirishima").removeClass("hide"); + } + var prof = localStorage.getItem("prof"); + $("#my-prof").attr("src", prof); + var datetype = localStorage.getItem("datetype"); + if (!datetype) { + var datetype = "absolute"; + } + $("#" + datetype).prop("checked", true); + + var theme = localStorage.getItem("theme"); + if (!theme) { + var theme = "white"; + } + $("#" + theme).prop("checked", true); + + var ha = localStorage.getItem("ha"); + if (!ha) { + var ha = "false"; + } + $("#ha_" + ha).prop("checked", true); + + var nsfw = localStorage.getItem("nsfw"); + if (!nsfw) { + var nsfw = "yes"; + } + $("#n_" + nsfw).prop("checked", true); + + var cw = localStorage.getItem("cw"); + if (!cw) { + var cw = "yes"; + } + $("#c_" + cw).prop("checked", true); + + var cws = localStorage.getItem("always-cw"); + if (!cws) { + var cws = "no"; + } + $("#cws_" + cws).prop("checked", true); + + var popup = localStorage.getItem("popup"); + if (!popup) { + var popup = "0"; + } + $("#popup").val(popup); + + var box = localStorage.getItem("box"); + if (!box) { + var box = "no"; + } + if(box=="absolute"){ + var box = "abs"; + } + $("#bx_" + box).prop("checked", true); + + var gif = localStorage.getItem("gif"); + if (!gif) { + var gif = "yes"; + } + $("#g_" + gif).prop("checked", true); + + var sent = localStorage.getItem("sentence"); + if (!sent) { + var sent = "500"; + } + $("#sentence").val(sent); + var ltrs = localStorage.getItem("letters"); + if (!ltrs) { + var ltrs = "500"; + } + $("#letters").val(ltrs); + + var csent = localStorage.getItem("cw_sentence"); + if (!csent) { + var csent = "500"; + } + $("#cw_sentence").val(csent); + var cltrs = localStorage.getItem("cw_letters"); + if (!cltrs) { + var cltrs = "500"; + } + $("#cw_letters").val(cltrs); + + var width = localStorage.getItem("width"); + if (!width) { + var width = "300"; + } + $("#width").val(width); + + var fwidth = localStorage.getItem("fixwidth"); + if (!fwidth) { + var fwidth = "300"; + } + $("#fixwidth").val(fwidth); + + var cwt = localStorage.getItem("cw-text"); + if (!cwt) { + var cwt = ""; + } + $("#cw-text").val(cwt); + + var cws = localStorage.getItem("always-cw"); + if (!cws) { + var cws = "no"; + } + $("#cws_" + cws).prop("checked", true); + + var rps = localStorage.getItem("replyct"); + if (!rps) { + var rps = "hidden"; + } + $("#rp_" + rps).prop("checked", true); + + var vis = localStorage.getItem("vis"); + if (!vis) { + var vis = "public"; + } + $("#" + vis).prop("checked", true); + + var img = localStorage.getItem("img"); + if (!img) { + var img = "no-act"; + } + $("#i_" + img).prop("checked", true); + + var font = localStorage.getItem("font"); + if (!font) { + var font = ""; + } + $("#font").val(font); + + var size = localStorage.getItem("size"); + if (!size) { + var size = "13"; + } + $("#size").val(size); + + var imh = localStorage.getItem("img-height"); + if (!imh) { + var imh = "200"; + } + $("#img-height").val(imh); + + var ticker = localStorage.getItem("ticker_ok"); + if (!ticker) { + var ticker = "no"; + } + $("#ticker_" + ticker).prop("checked", true); + + var animation = localStorage.getItem("animation"); + if (!animation) { + var animation = "yes"; + } + $("#anime_" + animation).prop("checked", true); + + var tag = localStorage.getItem("tag-range"); + if (!tag) { + var tag = "all"; + } + $("#t_" + tag).prop("checked", true); + + var box = localStorage.getItem("box"); + if (!box) { + var box = "yes"; + } + $("#bx_" + box).prop("checked", true); + + var uld = localStorage.getItem("locale"); + if (!uld) { + var uld = "yes"; + } + $("#ul_" + uld).prop("checked", true); + + var nnd = localStorage.getItem("nativenotf"); + if (!nnd) { + var nnd = "yes"; + } + $("#ntf_" + nnd).prop("checked", true); + + var qt = localStorage.getItem("quote"); + if (!qt) { + 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); + + var notfmt = localStorage.getItem("setasread"); + if (!notfmt) { + var notfmt = "yes"; + } + $("#notfm_" + notfmt).prop("checked", true); + + var maint = localStorage.getItem("mainuse"); + if (!maint) { + var maint = "remain"; + } + $("#mn_" + maint).prop("checked", true); + + var sect = localStorage.getItem("sec"); + if (!sect) { + var sect = "nothing"; + } + $("#sec-" + sect).prop("checked", true); + +} + +function climute(){ + //クライアントミュート + var cli = localStorage.getItem("client_mute"); + var obj = JSON.parse(cli); + if(!obj){ + $("#mute-cli").html(lang.lang_setting_nomuting); + }else{ + if(!obj[0]){ + $("#mute-cli").html(lang.lang_setting_nomuting); + return; + } + var templete; + Object.keys(obj).forEach(function(key) { + var cli = obj[key]; + var list = key * 1 + 1; + templete = '
' + list + + '.' + + cli + '
'; + $("#mute-cli").append(templete); + }); +} +} +function cliMuteDel(key){ + var cli = localStorage.getItem("client_mute"); + var obj = JSON.parse(cli); + obj.splice(key, 1); + var json = JSON.stringify(obj); + localStorage.setItem("client_mute", json); + mute(); +} + +function wordmute(){ + var word = localStorage.getItem("word_mute"); + var obj = JSON.parse(word); + $('#wordmute').material_chip({ + data: obj, + }); +} +function wordmuteSave(){ + var word=$('#wordmute').material_chip('data'); + var json = JSON.stringify(word); + localStorage.setItem("word_mute", json); +} + +function wordemp(){ + var word = localStorage.getItem("word_emp"); + var obj = JSON.parse(word); + $('#wordemp').material_chip({ + data: obj, + }); +} +function wordempSave(){ + var word=$('#wordemp').material_chip('data'); + var json = JSON.stringify(word); + localStorage.setItem("word_emp", json); +} +function notftest(){ + var electron = require("electron"); + var ipc = electron.ipcRenderer; + var os = electron.remote.process.platform; + var options = { + body: lang.lang_setting_notftest+'('+lang.lang_setting_notftestprof+')', + icon: localStorage.getItem("prof_0") + }; + if(os=="darwin"){ + var n = new Notification('TheDesk'+lang.lang_setting_notftest, options); + }else{ + ipc.send('native-notf', ['TheDesk'+lang.lang_setting_notftest,lang.lang_setting_notftest+'('+lang.lang_setting_notftestprof+')',localStorage.getItem('prof_0'),"",""]); + } + +} +function oks(no){ + var txt=$("#oks-"+no).val(); + localStorage.setItem("oks-"+no, txt); + Materialize.toast(lang.lang_setting_ksref, 3000); +} +function oksload(){ + if(localStorage.getItem("oks-1")){$("#oks-1").val(localStorage.getItem("oks-1"))} + if(localStorage.getItem("oks-2")){$("#oks-2").val(localStorage.getItem("oks-2"))} + if(localStorage.getItem("oks-3")){$("#oks-3").val(localStorage.getItem("oks-3"))} +} +function changelang(lang){ + var electron = require("electron"); + var ipc = electron.ipcRenderer; + ipc.send('lang',lang); + ipc.on('langres', function (event, arg) { + location.href="../"+lang+"/setting.html" + }); +} +function exportSettings(){ + if(!confirm(lang.lang_setting_exportwarn)){ + return false; + } + var electron = require("electron"); + var remote=electron.remote; + var dialog=remote.dialog; + var ipc = electron.ipcRenderer; + dialog.showSaveDialog(null, { + title: 'Export', + properties: ['openFile', 'createDirectory'], + defaultPath: "export.thedeskconfig" + }, (savedFiles) => { + console.log(savedFiles); + if(!savedFiles){ + return false; + } + var exp={}; + //Accounts + var multi = localStorage.getItem("multi"); + var acct = JSON.parse(multi); + exp.accts=acct; + //Columns + var multi = localStorage.getItem("column"); + var column = JSON.parse(multi); + exp.columns=column; + //Themes + exp.theme=localStorage.getItem("theme"); + //Min width + exp.minwidth=localStorage.getItem("width"); + //Font + exp.font=localStorage.getItem("font"); + exp.size=localStorage.getItem("size"); + //Img height + exp.imgheight=localStorage.getItem("img-height"); + //Main + exp.mainuse=localStorage.getItem("mainuse"); + //CW text + exp.cw=localStorage.getItem("cw-text"); + //vis + exp.vis=localStorage.getItem("vis"); + //keysc + exp.ksc=[ + localStorage.getItem("oks-1"), + localStorage.getItem("oks-2"), + localStorage.getItem("oks-3") + ]; + //climu + var cli = localStorage.getItem("client_mute"); + var climu = JSON.parse(cli); + exp.clientMute=climu; + //wordmu + var wdm = localStorage.getItem("word_mute"); + var wordmu = JSON.parse(wdm); + exp.wordMute=wordmu; + //spotify + exp.spotifyArtwork=localStorage.getItem("artwork") + var content=localStorage.getItem("np-temp"); + if(content || content=="" || content=="null"){ + exp.spotifyTemplete=content; + }else{ + exp.spotifyTemplete=null; + } + //tags + var tagarr = localStorage.getItem("tag"); + var favtag = JSON.parse(tagarr); + exp.favoriteTags=favtag; + console.log(exp); + ipc.send('export', [savedFiles,JSON.stringify(exp)]); + alert("Done.") + //cards + //lang + }); +} +function importSettings(){ + if(!confirm(lang.lang_setting_importwarn)){ + return false; + } + var electron = require("electron"); + var remote=electron.remote; + var dialog=remote.dialog; + var ipc = electron.ipcRenderer; + dialog.showOpenDialog(null, { + title: 'Import', + properties: ['openFile'], + filters: [ + {name: 'TheDesk Config', extensions: ['thedeskconfig']}, + ] + }, (fileNames) => { + console.log(fileNames); + if(!fileNames){ + return false; + } + ipc.send('import', fileNames[0]); + ipc.on('config', function (event, arg) { + var obj = JSON.parse(arg); + if(obj){ + localStorage.clear(); + localStorage.setItem("multi",JSON.stringify(obj.accts)); + for(var key=0;key { + localStorage.setItem("savefolder",fileNames[0]); + }); +} + +function font(){ + var electron = require("electron"); + var ipc = electron.ipcRenderer; + ipc.send('fonts', []); + ipc.on('font-list', function (event, arg) { + $("#fonts").removeClass("hide"); + for( var i=0; i'+font.family+"") + } + }); +} +function insertFont(name){ + $("#font").val(name); +} +$(".color-picker").each(function(i, elem) { + pickerDefine(i,"fff"); +}); +function pickerDefine(i,color){ + var pickr = new Pickr({ + el: '#color-picker'+i, + default: color, + showAlways: true, + appendToBody: true, + closeWithKey: 'Escape', + comparison: false, + components: { + preview: true, // Left side color comparison + opacity: false, // Opacity slider + hue: true, // Hue slider + interaction: { + rgba: false, // rgba option (red green blue and alpha) + input: true, // input / output element + } + }, + strings: { + save: 'Save', // Default for save button + clear: 'Clear' // Default for clear button + } + }); + pickr.on('change', (...args) => { + var rgb='rgb('+args[0].toRGBA()[0]+','+args[0].toRGBA()[1]+','+args[0].toRGBA()[2]+')'; + $("#color-picker"+i+"_value").val(rgb) + }); +} +function customComp(){ + var nameC=$("#custom_name").val(); + if(!nameC){return false;} + var descC=$("#custom_desc").val(); + var primaryC=$("#color-picker0_value").val(); + if(!primaryC){primaryC="rgb(255,255,255)"} + var secondaryC=$("#color-picker1_value").val(); + if(!secondaryC){secondaryC="rgb(255,255,255)"} + var textC=$("#color-picker2_value").val(); + if(!textC){textC="rgb(255,255,255)"} + var accentC=$("#color-picker3_value").val(); + if(!accentC){accentC="rgb(255,255,255)"} + var multi = localStorage.getItem("multi"); + var my=JSON.parse(multi)[0].name; + var id=$("#custom-edit-sel").val(); + if(id=="add_new"){ + id=makeCID(); + } + var json={ + "name": nameC, + "author": my, + "desc": descC, + "base": $("[name=direction]:checked").val(), + "vars": { + "primary": primaryC, + "secondary": secondaryC, + "text": textC + }, + "props": { + "TheDeskAccent": accentC + }, + "id": id + } + $("#custom_json").val(JSON.stringify(json)); + themes(); + $("#custom_name").val(""); + $("#custom_desc").val(""); + $("#dark").prop("checked", true); + $("#custom_json").val(""); + $("#color-picker0-wrap").html('
') + $("#color-picker1-wrap").html('
') + $("#color-picker2-wrap").html('
') + $("#color-picker3-wrap").html('
') + $("#color-picker0_value").val(""); + $("#color-picker1_value").val(""); + $("#color-picker2_value").val(""); + $("#color-picker3_value").val(""); + pickerDefine(0,"fff"); + pickerDefine(1,"fff"); + pickerDefine(2,"fff"); + pickerDefine(3,"fff"); + ipc.send('theme-json-create', JSON.stringify(json)); +} +function deleteIt(){ + var id=$("#custom-sel-sel").val(); + $("#custom_name").val(""); + $("#custom_desc").val(""); + $("#dark").prop("checked", true); + $("#custom_json").val(""); + $("#color-picker0-wrap").html('
') + $("#color-picker1-wrap").html('
') + $("#color-picker2-wrap").html('
') + $("#color-picker3-wrap").html('
') + $("#color-picker0_value").val(""); + $("#color-picker1_value").val(""); + $("#color-picker2_value").val(""); + $("#color-picker3_value").val(""); + pickerDefine(0,"fff"); + pickerDefine(1,"fff"); + pickerDefine(2,"fff"); + pickerDefine(3,"fff"); + ipc.on('theme-json-delete-complete', function (event, args) { + ctLoad() + }); + ipc.send('theme-json-delete', id); +} +function ctLoad(){ + ipc.send('theme-json-list', ""); + ipc.on('theme-json-list-response', function (event, args) { + console.log(args); + var templete=""; + Object.keys(args).forEach(function(key) { + var theme = args[key]; + var themeid=theme.id + templete = templete+''; + }); + if(args[0]){ + localStorage.setItem("customtheme-id",args[0].id) + } + $("#custom-sel-sel").html(templete); + templete=''+templete; + $("#custom-edit-sel").html(templete); + $('select').material_select('update'); + }); +} +function customSel(){ + var id=$("#custom-sel-sel").val(); + localStorage.setItem("customtheme-id",id) +} +function custom(){ + var id=$("#custom-edit-sel").val(); + if(id=="add_new"){ + $("#custom_name").val(""); + $("#custom_desc").val(""); + $("#dark").prop("checked", true); + $("#custom_json").val(""); + $("#color-picker0-wrap").html('
') + $("#color-picker1-wrap").html('
') + $("#color-picker2-wrap").html('
') + $("#color-picker3-wrap").html('
') + $("#color-picker0_value").val(""); + $("#color-picker1_value").val(""); + $("#color-picker2_value").val(""); + $("#color-picker3_value").val(""); + pickerDefine(0,"fff"); + pickerDefine(1,"fff"); + pickerDefine(2,"fff"); + pickerDefine(3,"fff"); + $("#delTheme").addClass("disabled") + }else{ + $("#delTheme").removeClass("disabled") + ipc.send('theme-json-request', id); + ipc.on('theme-json-response', function (event, args) { + console.log(args); + $("#custom_name").val(args.name); + $("#custom_desc").val(args.desc); + $("#"+args.base).prop("checked", true); + $("#color-picker0-wrap").html('
') + pickerDefine(0,rgbToHex(args.vars.primary)) + $("#color-picker0_value").val(args.vars.primary); + $("#color-picker1-wrap").html('
') + pickerDefine(1,rgbToHex(args.vars.secondary)) + $("#color-picker1_value").val(args.vars.secondary); + $("#color-picker2-wrap").html('
') + $("#color-picker2_value").val(args.vars.text); + pickerDefine(2,rgbToHex(args.vars.text)) + if(args.props){ + if(args.props.TheDeskAccent){ + var accent=args.props.TheDeskAccent; + }else{ + var accent=args.vars.secondary; + } + }else{ + var accent=args.vars.secondary; + } + $("#color-picker3-wrap").html('
') + pickerDefine(3,rgbToHex(accent)) + $("#custom_json").val(JSON.stringify(args)); + }); + } +} +function customImp(){ + var json=$("#custom_import").val(); + if(JSON5.parse(json)){ + ipc.send('theme-json-create', json); + }else{ + alert("Error") + } +} +function hardwareAcceleration(){ + var had = $("[name=ha]:checked").val(); + localStorage.setItem("ha", had); + console.log("ha"); + ipc.send('ha', had); +} + +ipc.on('theme-json-create-complete', function (event, args) { + $("#custom_import").val(""); + ctLoad() +}); +//最初に読む +load(); +climute(); +wordmute(); +wordemp(); +checkSpotify(); +voiceSettingLoad(); +oksload(); +npprovider(); +ctLoad() \ No newline at end of file diff --git a/app/main.js b/app/main.js index 38ab0479..fa9d3a5d 100644 --- a/app/main.js +++ b/app/main.js @@ -247,7 +247,7 @@ ipc.on('theme-css-request', function(e, arg) { var css=".customtheme {--bg:"+secondary+";--drag:"+drag+";"+ "--color:"+text+";--beforehover:"+beforehover+";--modal:"+secondary+";--subcolor:"+primary+";--box:"+primary+";--sidebar:"+primary+";--shared:"+emphasized+";"+ "--notfbox:"+secondary+";--emphasized:"+primary+";--his-data:"+secondary+ - +"--active:"+primary+";--postbox:"+primary+";--modalfooter:"+primary+";}.blacktheme #imagemodal{background: url(\"../img/pixel.svg\");}"; + "--active:"+primary+";--postbox:"+primary+";--modalfooter:"+primary+";}.blacktheme #imagemodal{background: url(\"../img/pixel.svg\");}"; mainWindow.webContents.send('theme-css-response', css); } catch (e) { var css=""; diff --git a/app/package-lock.json b/app/package-lock.json index 14cfd0d0..ab63ffc0 100644 --- a/app/package-lock.json +++ b/app/package-lock.json @@ -1,6 +1,6 @@ { "name": "thedesk", - "version": "17.2.0", + "version": "17.3.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -3160,6 +3160,11 @@ "extsprintf": "^1.2.0" } }, + "vue": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/vue/-/vue-2.6.9.tgz", + "integrity": "sha512-t1+tvH8hybPM86oNne3ZozCD02zj/VoZIiojOBPJLjwBn7hxYU5e1gBObFpq8ts1NEn1VhPf/hVXBDAJ3X5ljg==" + }, "wcwidth": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", diff --git a/app/package.json b/app/package.json index e78889cb..29ab2c31 100644 --- a/app/package.json +++ b/app/package.json @@ -1,6 +1,6 @@ { "name": "thedesk", - "version": "17.3.0", + "version": "18.0.0", "description": "TheDesk is a Mastodon client for PC.", "main": "main.js", "scripts": { @@ -39,7 +39,8 @@ "jimp": "^0.2.28", "json5": "^2.1.0", "node-notifier": "^5.2.1", - "sumchecker": "^2.0.2" + "sumchecker": "^2.0.2", + "vue": "^2.6.9" }, "optionalDependencies": { "itunes-nowplaying-mac": "^0.2.3", diff --git a/app/view/en/index.html b/app/view/en/index.html index d82534fe..620c2971 100644 --- a/app/view/en/index.html +++ b/app/view/en/index.html @@ -32,15 +32,14 @@
@@ -582,19 +581,22 @@ var tlid=0; HP
GitHub

-
-
crwdns551:0crwdne551:0
crwdns552:0crwdne552:0 -
crwdns553:0crwdne553:0 -
crwdns554:0crwdne554:0 -
- - - - - - - - -
crwdns1904:0crwdne1904:0
crwdns1906:0crwdne1906:0 -
- - - - -
-
crwdns561:0crwdne561:0
crwdns562:0crwdne562:0 -
- - - - -
-
crwdns563:0crwdne563:0
- - - - -
-
crwdns564:0crwdne564:0
- - - - -
-
crwdns567:0crwdne567:0
- - - - -
-
crwdns572:0crwdne572:0
- - - - -
-
crwdns575:0crwdne575:0
- - - - -
-
crwdns576:0crwdne576:0
- crwdns577:0crwdne577:0
- - - - - - -
-
crwdns580:0crwdne580:0
- - - - -
-
crwdns581:0crwdne581:0
- crwdns582:0crwdne582:0 -
- crwdns583:0crwdne583:0 crwdns543:0crwdne543:0 crwdns585:0crwdne585:0 - crwdns584:0crwdne584:0 crwdns543:0crwdne543:0 - -
-
crwdns586:0crwdne586:0 -
- px - -
-
crwdns1908:0crwdne1908:0
- crwdns1910:0crwdne1910:0
- - - - -
-
crwdns2446:0crwdne2446:0
- - - - +
+ +
  • @@ -262,90 +180,32 @@ sendcrwdns587:0crwdne587:0
  • -
    crwdns590:0crwdne590:0
    - - -
    -
    crwdns588:0crwdne588:0
    - crwdns589:0crwdne589:0 -
    - crwdns583:0crwdne583:0 crwdns543:0crwdne543:0 crwdns585:0crwdne585:0 - crwdns584:0crwdne584:0 crwdns543:0crwdne543:0 - -
    -
    crwdns591:0crwdne591:0
    - - - - -
    -
    crwdns592:0crwdne592:0
    - - - - - - - - - - - - -
    -
    crwdns599:0crwdne599:0
    - - - - -
    - - -
    -
    crwdns568:0crwdne568:0
    - - - - - - -
    -
    crwdns603:0crwdne603:0
    - - - - - - - - -
    -
    crwdns607:0crwdne607:0
    - crwdns608:0crwdne608:0
    - - - - - -
    crwdns1916:0crwdne1916:0
    - crwdns1918:0crwdne1918:0
    - - - - - - - - - - - - 非対応インスタンスでは「未収載」になります。 -
    +
    + +
  • @@ -510,7 +370,6 @@ TheDeskおよびCutls Pは被災地支援のため - diff --git a/app/view/ps/setting.vue.js b/app/view/ps/setting.vue.js new file mode 100644 index 00000000..613484cc --- /dev/null +++ b/app/view/ps/setting.vue.js @@ -0,0 +1,480 @@ +var yesno=[ + { + text:"crwdns526:0crwdne526:0", + value:"yes" + },{ + text:"crwdns527:0crwdne527:0", + value:"no" + } +]; +var envConstruction=[ + { + id:"popup", + storage:"popup", + checkbox:false, + doubleText:false, + setValue:0, + width:50, + text:{ + head:"crwdns1898:0crwdne1898:0", + desc:"crwdns536:0crwdne536:0", + after:"crwdns537:0crwdne537:0" + } + },{ + id:"notf", + storage:"nativenotf", + checkbox:true, + setValue:"yes", + text:{ + head:"crwdns538:0crwdne538:0", + desc:"crwdns539:0crwdne539:0", + checkbox:yesno + } + },{ + id:"width", + storage:"width", + checkbox:false, + doubleText:false, + width:50, + setValue:300, + text:{ + head:"crwdns2376:0crwdne2376:0", + desc:"crwdns542:0crwdne542:0", + after:"px crwdns543:0crwdne543:0" + } + },{ + id:"fixwidth", + storage:"fixwidth", + checkbox:false, + doubleText:false, + setValue:300, + width:50, + text:{ + head:"crwdns2378:0crwdne2378:0", + desc:"crwdns2380:0crwdne2380:0", + after:"px crwdns543:0crwdne543:0" + } + },{ + id:"size", + storage:"size", + checkbox:false, + doubleText:false, + width:50, + setValue:13, + text:{ + head:"crwdns546:0crwdne546:0", + desc:'15px(crwdns549:0crwdne549:0)', + after:"px" + } + },{ + id:"ha", + storage:"ha", + checkbox:true, + setValue:false, + text:{ + head:"@@hardwareAcceleration@@", + desc:"@@hardwareAccelerationWarn@@", + checkbox:[ + { + text:"crwdns526:0crwdne526:0", + value:"true" + },{ + text:"crwdns527:0crwdne527:0", + value:"false" + } + ] + } + } +]; +var tlConstruction=[ + { + id:"time", + storage:"datetype", + checkbox:true, + setValue:"absolute", + text:{ + head:"crwdns551:0crwdne551:0", + desc:'crwdns552:0crwdne552:0
    crwdns553:0crwdne553:0
    crwdns554:0crwdne554:0', + checkbox:[ + { + text:"crwdns555:0crwdne555:0", + value:"relative" + },{ + text:"crwdns1902:0crwdne1902:0", + value:"absolute" + },{ + text:"crwdns557:0crwdne557:0", + value:"double" + },{ + text:"crwdns558:0crwdne558:0", + value:"medium" + } + + ] + } + },{ + id:"ul", + storage:"locale", + checkbox:true, + setValue:"yes", + text:{ + head:"crwdns1904:0crwdne1904:0", + desc:"crwdns1906:0crwdne1906:0", + checkbox:yesno + } + },{ + id:"nsfw", + storage:"nsfw", + checkbox:true, + setValue:"yes", + text:{ + head:"crwdns561:0crwdne561:0", + desc:"crwdns562:0crwdne562:0", + checkbox:yesno + } + },{ + id:"cw", + storage:"cw", + checkbox:true, + setValue:"yes", + text:{ + head:"crwdns563:0crwdne563:0", + desc:"", + checkbox:yesno + } + },{ + id:"rp", + storage:"replyct", + checkbox:true, + setValue:"hidden", + text:{ + head:"crwdns564:0crwdne564:0", + desc:"", + checkbox:[ + { + text:"crwdns565:0crwdne565:0", + value:"hidden" + },{ + text:"crwdns565:0crwdne565:0", + value:"all" + } + + ] + } + },{ + id:"gif", + storage:"gif", + checkbox:true, + setValue:"yes", + text:{ + head:"crwdns567:0crwdne567:0", + desc:"", + checkbox:yesno + } + },{ + id:"tag", + storage:"tag-range", + checkbox:true, + setValue:"local", + text:{ + head:"crwdns572:0crwdne572:0", + desc:"", + checkbox:[ + { + text:"crwdns573:0crwdne573:0", + value:"all" + },{ + text:"crwdns574:0crwdne574:0", + value:"local" + } + + ] + } + },{ + id:"via", + storage:"viashow", + checkbox:true, + setValue:"no", + text:{ + head:"crwdns575:0crwdne575:0", + desc:"", + checkbox:yesno + } + },{ + id:"mov", + storage:"mouseover", + checkbox:true, + setValue:"no", + text:{ + head:"crwdns576:0crwdne576:0", + desc:"crwdns577:0crwdne577:0", + checkbox:[ + { + text:"crwdns578:0crwdne578:0", + value:"yes" + },{ + text:"crwdns579:0crwdne579:0", + value:"click" + },{ + text:"crwdns527:0crwdne527:0", + value:"no" + } + + ] + } + },{ + id:"notfm", + storage:"setasread", + checkbox:true, + setValue:"yes", + text:{ + head:"crwdns580:0crwdne580:0", + desc:"", + checkbox:yesno + } + },{ + checkbox:false, + doubleText:true, + data:[ + { + id:"sentence", + storage:"sentence", + width:50, + setValue:500, + text:{after:"crwdns583:0crwdne583:0 crwdns543:0crwdne543:0 crwdns585:0crwdne585:0"} + },{ + id:"letters", + storage:"letters", + width:50, + setValue:7000, + text:{after:"crwdns584:0crwdne584:0 crwdns543:0crwdne543:0"} + } + ], + text:{ + head:"crwdns581:0crwdne581:0", + desc:"crwdns582:0crwdne582:0", + } + },{ + id:"img-height", + storage:"img-height", + checkbox:false, + doubleText:false, + width:80, + setValue:200, + text:{ + head:"crwdns586:0crwdne586:0", + desc:"", + after:"px" + } + },{ + id:"ticker", + storage:"ticker_ok", + checkbox:true, + setValue:"no", + text:{ + head:"crwdns1908:0crwdne1908:0", + desc:'crwdns1910:0crwdne1910:0', + checkbox:yesno + } + },{ + id:"anime", + storage:"animation", + checkbox:true, + setValue:"yes", + text:{ + head:"crwdns2446:0crwdne2446:0", + desc:"", + checkbox:yesno + } + } +]; +var postConstruction=[ + { + id:"cw-text", + storage:"cw-text", + checkbox:false, + doubleText:false, + width:150, + setValue:"", + text:{ + head:"crwdns590:0crwdne590:0", + desc:"", + after:"" + } + },{ + checkbox:false, + doubleText:true, + data:[ + { + id:"cw_sentence", + storage:"cw_sentence", + width:50, + setValue:500, + text:{after:"crwdns583:0crwdne583:0 crwdns543:0crwdne543:0 crwdns585:0crwdne585:0"} + },{ + id:"cw_letters", + storage:"cw_letters", + width:50, + setValue:7000, + text:{after:"crwdns584:0crwdne584:0 crwdns543:0crwdne543:0"} + } + ], + text:{ + head:"crwdns588:0crwdne588:0", + desc:"crwdns589:0crwdne589:0", + } + },{ + id:"cws", + storage:"always-cw", + checkbox:true, + setValue:"no", + text:{ + head:"crwdns591:0crwdne591:0", + desc:"", + checkbox:yesno + } + },{ + id:"vis", + storage:"vis", + checkbox:true, + setValue:"public", + text:{ + head:"crwdns592:0crwdne592:0", + desc:"", + checkbox:[ + { + text:"crwdns593:0crwdne593:0", + value:"public" + },{ + text:"crwdns594:0crwdne594:0", + value:"unlisted" + },{ + text:"crwdns595:0crwdne595:0", + value:"private" + },{ + text:"crwdns596:0crwdne596:0", + value:"direct" + },{ + text:"crwdns1912:0crwdne1912:0", + value:"memory" + },{ + text:"crwdns1914:0crwdne1914:0", + value:"useapi" + } + ] + } + },{ + id:"img", + storage:"img", + checkbox:true, + setValue:"no-act", + text:{ + head:"crwdns599:0crwdne599:0", + desc:"", + checkbox:[ + { + text:"crwdns600:0crwdne600:0", + value:"url" + },{ + text:"crwdns601:0crwdne601:0", + value:"no-act" + } + ] + } + },{ + id:"box", + storage:"box", + checkbox:true, + setValue:"yes", + text:{ + head:"crwdns568:0crwdne568:0", + desc:"", + checkbox:[ + { + text:"crwdns569:0crwdne569:0", + value:"yes" + },{ + text:"crwdns571:0crwdne571:0", + value:"no" + },{ + text:"crwdns570:0crwdne570:0", + value:"absolute" + } + ] + } + },{ + id:"quote", + storage:"quote", + checkbox:true, + setValue:"nothing", + text:{ + head:"crwdns603:0crwdne603:0", + desc:"", + checkbox:[ + { + text:"crwdns604:0crwdne604:0", + value:"simple" + },{ + text:"crwdns605:0crwdne605:0", + value:"mention" + },{ + text:"crwdns606:0crwdne606:0", + value:"full" + },{ + text:"@@notqt@@", + value:"nothing" + } + ] + } + },{ + id:"main", + storage:"mainuse", + checkbox:true, + setValue:"remain", + text:{ + head:"crwdns607:0crwdne607:0", + desc:"crwdns608:0crwdne608:0", + checkbox:[ + { + text:"crwdns609:0crwdne609:0", + value:"remain" + },{ + text:"crwdns610:0crwdne610:0", + value:"main" + } + ] + } + },{ + id:"sec", + storage:"sec", + checkbox:true, + setValue:"public", + text:{ + head:"crwdns1916:0crwdne1916:0", + desc:"", + checkbox:[ + { + text:"crwdns1920:0crwdne1920:0", + value:"nothing" + },{ + text:"crwdns593:0crwdne593:0", + value:"public" + },{ + text:"crwdns594:0crwdne594:0", + value:"unlisted" + },{ + text:"crwdns595:0crwdne595:0", + value:"private" + },{ + text:"crwdns596:0crwdne596:0", + value:"direct" + },{ + text:"crwdns1922:0crwdne1922:0", + value:"local", + kirishima:true, + kirishimaText:"非対応インスタンスでは「未収載」になります。" + } + ] + } + } +] \ No newline at end of file