Local NowPlaying for Windows

This commit is contained in:
cutls
2019-01-26 23:27:35 +09:00
parent 77ad2bd200
commit 7921633efd
17 changed files with 228 additions and 141 deletions

View File

@@ -116,11 +116,13 @@ var lang={
"lang_layout_nodata":"[No data]<br>F5/⌘+R to reload",
"lang_layout_dm":"Direct Message",
"lang_layout_webviewmode":"Prefer WebView",
"lang_excluded":"Excluded type of notification",
//ui/spotify.js
"lang_spotify_img":"Attach an album artwork",
"lang_spotify_imgno":"Not attach an album artwork",
"lang_spotify_acct":"Connect TheDesk to Spotify",
"lang_spotify_np":"Done:templete of NowPlaying",
"lang_setting_npprovide":"NowPlaying provider:{{set}}",
//userdata/his-data.js
"lang_hisdata_frcreq":"Required Mastodon 2.4.3 and above",
"lang_hisdata_frcwarn":"Unfollow accounts will be shown.",

View File

@@ -117,11 +117,13 @@ var lang={
"lang_layout_nodata":"[ここにトゥートはありません。]<br>F5/⌘+Rで再読込できます。",
"lang_layout_dm":"ダイレクトメッセージ",
"lang_layout_webviewmode":"WebView優先",
"lang_excluded":"除外する通知",
//ui/spotify.js
"lang_spotify_img":"アルバムアートワークを添付します。",
"lang_spotify_imgno":"アルバムアートワークを添付しません。",
"lang_spotify_acct":"アカウント連携をしてください。",
"lang_spotify_np":"NowPlaying文書を更新しました。",
"lang_setting_npprovide":"NowPlayingのソースを{{set}}に設定しました。",
//userdata/his-data.js
"lang_hisdata_frcreq":"Mastodon 2.4.3~が必要です",
"lang_hisdata_frcwarn":"非フォローだけど絡みがある時に表示されます。",

View File

@@ -120,7 +120,7 @@ function parseColumn() {
$("#timeline-container").append(html);
}else{
if(acct.type=="notf"){
var exclude=':<br><input type="checkbox" class="filled-in" id="exc-reply-'+key+'" '+excludeCk(key,"mention")+' /><label for="exc-reply-'+key+'" class="exc-chb"><i class="fa fa-share exc-icons"></i></label> '+
var exclude=lang.lang_excluded+':<br><input type="checkbox" class="filled-in" id="exc-reply-'+key+'" '+excludeCk(key,"mention")+' /><label for="exc-reply-'+key+'" class="exc-chb"><i class="fa fa-share exc-icons"></i></label> '+
'<input type="checkbox" class="filled-in" id="exc-fav-'+key+'" '+excludeCk(key,"favourite")+' /><label for="exc-fav-'+key+'" class="exc-chb"><i class="fa fa-star exc-icons"></i></label> '+
'<input type="checkbox" class="filled-in" id="exc-bt-'+key+'" '+excludeCk(key,"reblog")+' /><label for="exc-bt-'+key+'" class="exc-chb" ><i class="fa fa-retweet exc-icons"></i></label> '+
'<input type="checkbox" class="filled-in" id="exc-follow-'+key+'" '+excludeCk(key,"follow")+' /><label for="exc-follow-'+key+'" class="exc-chb" ><i class="fa fa-users exc-icons"></i></label> '+

View File

@@ -419,6 +419,7 @@ wordemp();
checkSpotify();
voiceSettingLoad();
oksload();
npprovider();
function climute(){
//クライアントミュート
var cli = localStorage.getItem("client_mute");

View File

@@ -130,6 +130,10 @@ function nowplaying(mode){
if(!content || content=="" || content=="null"){
var content="#NowPlaying {song} / {album} / {artist}\n{url}";
}
var flag=localStorage.getItem("artwork");
if(flag && arg.path){
media(arg.path,"image/png","new");
}
var regExp = new RegExp("{song}", "g");
content = content.replace(regExp, arg.name);
var regExp = new RegExp("{album}", "g");
@@ -160,6 +164,25 @@ function spotifySave(){
localStorage.setItem("np-temp", temp);
Materialize.toast(lang.lang_spotify_np, 3000);
}
function npprovider(){
var provd = $("[name=npp]:checked").val();
if(!provd){
if (localStorage.getItem("np_provider")) {
$("[value="+localStorage.getItem("np_provider")+"]").prop("checked", true);
}else{
$("[value=AIMP]").prop("checked", true);
localStorage.setItem("np_provider", "AIMP");
}
}else{
if (provd != localStorage.getItem("np_provider")) {
Materialize.toast(lang.lang_setting_npprovide.replace("{{set}}" ,provd), 3000);
}
localStorage.setItem("np_provider", provd);
var electron = require("electron");
var ipc = electron.ipcRenderer;
ipc.send('itunes', ["set",provd]);
}
}
if(location.search){
var m = location.search.match(/\?mode=([a-zA-Z-0-9]+)\&code=(.+)/);
var mode=m[1];