TheDesk Akane (16.0.11)

This commit is contained in:
cutls 2018-08-29 19:17:34 +09:00
parent 8439aa3e05
commit cf587c76e6
11 changed files with 48 additions and 23 deletions

View File

@ -26,7 +26,7 @@
<script type="text/javascript" src="./js/common/modal.js"></script> <script type="text/javascript" src="./js/common/modal.js"></script>
<script type="text/javascript" src="./js/ui/jquery-ui.min.js"></script> <script type="text/javascript" src="./js/ui/jquery-ui.min.js"></script>
<script> <script>
var ver="Akane (16.0.10)"; var ver="Akane (16.0.11)";
//betaを入れるとバージョンチェックしない //betaを入れるとバージョンチェックしない
//GitHubに上げるときはindex.htmlをちゃんとする。(index.start.html) //GitHubに上げるときはindex.htmlをちゃんとする。(index.start.html)
//var ver="beta"; //var ver="beta";
@ -522,12 +522,16 @@ var lang="{{lang}}";
<a href="https://thedesk.top" target="_blank">HP</a><br> <a href="https://thedesk.top" target="_blank">HP</a><br>
<a href="https://github.com/cutls/TheDesk" target="_blank">GitHub</a><br> <a href="https://github.com/cutls/TheDesk" target="_blank">GitHub</a><br>
<br> <br>
<div id="release-Akane_16-0-10" style="display:none"> <div id="release-Akane_16-0-11" style="display:none">
<a href="https://code.cutls.com/thedesk-log/" target="_blank">開発の経緯</a><br> <a href="https://code.cutls.com/thedesk-log/" target="_blank">開発の経緯</a><br>
<a href="https://ja.mstdn.wiki/TheDesk" target="_blank">機能一覧</a><br> <a href="https://ja.mstdn.wiki/TheDesk" target="_blank">機能一覧</a><br>
Entyでは支援者様限定で様々なTheDeskに関する記事をご覧いただけます。 Entyでは支援者様限定で様々なTheDeskに関する記事をご覧いただけます。
<h5>Release Note Akane (16.0.10)</h5> <h5>Release Note Akane (16.0.11)</h5>
16.0.9<br> 16.0.11<br>
<ul>
<li>様々なバグを修正</li>
</ul>
16.0.10<br>
<ul> <ul>
<li>自動CWに関する不具合</li> <li>自動CWに関する不具合</li>
<li>アップデートに関する不具合</li> <li>アップデートに関する不具合</li>

View File

@ -168,6 +168,8 @@ function verck(ver) {
Materialize.toast(obj.text+toot+'<span class="sml grey-text">(スライドして消去)</span>', 86400); Materialize.toast(obj.text+toot+'<span class="sml grey-text">(スライドして消去)</span>', 86400);
} }
} }
}else{
$("#persons").text(obj.text);
} }
} }
infows.onerror = function(error) { infows.onerror = function(error) {

View File

@ -382,7 +382,7 @@ function ckdb(acct_id) {
localStorage.setItem("follow_" + acct_id, json[domain + "_follow"]); localStorage.setItem("follow_" + acct_id, json[domain + "_follow"]);
} }
} }
if(localStorage.getItem("mode_" + domain)=="misskey"){ if(localStorage.getItem("mode_" + domain)!="misskey"){
var start = "https://" + domain + "/api/v1/instance/activity"; var start = "https://" + domain + "/api/v1/instance/activity";
fetch(start, { fetch(start, {
method: 'GET', method: 'GET',

View File

@ -95,12 +95,12 @@ function additional(acct_id, tlid) {
var twiImg=''; var twiImg='';
} }
$("[toot-id=" + id + "] .additional").html( $("[toot-id=" + id + "] .additional").html(
'<blockquote class="twitter-tweet"><b>'+json.author_name+'</b><br>'+json.description+twiImg+'</blockquote>'); '<blockquote class="twitter-tweet"><b>'+escapeHTML(json.author_name)+'</b><br>'+escapeHTML(json.description)+twiImg+'</blockquote>');
} }
if (json.title) { if (json.title) {
$("[toot-id=" + id + "] .additional").html( $("[toot-id=" + id + "] .additional").html(
"<span class=\"gray\">URL"+lang_cards_check[lang]+":<br>Title:" + json.title + "<br>" + "<span class=\"gray\">URL"+lang_cards_check[lang]+":<br>Title:" + escapeHTML(json.title) + "<br>" +
json.description + "</span>"); escapeHTML(json.description) + "</span>");
} }
if (json.html) { if (json.html) {
$("[toot-id=" + id + "] .additional").html(json.html+'<i class="material-icons" onclick="pip('+id+')" title="'+lang_cards_pip[lang]+'">picture_in_picture_alt</i>'); $("[toot-id=" + id + "] .additional").html(json.html+'<i class="material-icons" onclick="pip('+id+')" title="'+lang_cards_pip[lang]+'">picture_in_picture_alt</i>');
@ -221,7 +221,7 @@ function additionalIndv(tlid, acct_id, id) {
var twiImg=''; var twiImg='';
} }
$("[toot-id=" + id + "] .additional").html( $("[toot-id=" + id + "] .additional").html(
'<div class="twitter-tweet"><b>'+json.author_name+'</b><br>'+json.description+twiImg+'</div>'); '<div class="twitter-tweet"><b>'+escapeHTML(json.author_name)+'</b><br>'+escapeHTML(json.description)+twiImg+'</div>');
}else if (json.provider_name=="pixiv"){ }else if (json.provider_name=="pixiv"){
if(json.image){ if(json.image){
var pxvImg='<br><img src="'+json.image+'" style="max-width:100%" onclick="imgv(\'pixiv_'+id+'\', 0, \'pixiv\');" id="pixiv_'+id+'-image-0" data-url="'+json.embed_url+'" data-type="image">'; var pxvImg='<br><img src="'+json.image+'" style="max-width:100%" onclick="imgv(\'pixiv_'+id+'\', 0, \'pixiv\');" id="pixiv_'+id+'-image-0" data-url="'+json.embed_url+'" data-type="image">';
@ -229,12 +229,12 @@ function additionalIndv(tlid, acct_id, id) {
var pxvImg=''; var pxvImg='';
} }
$("[toot-id=" + id + "] .additional").html( $("[toot-id=" + id + "] .additional").html(
'<div class="pixiv-post"><b><a href="'+json.author_url+'" target="_blank">'+json.author_name+'</a></b><br>'+json.title+pxvImg+'</div>'); '<div class="pixiv-post"><b><a href="'+json.author_url+'" target="_blank">'+escapeHTML(json.author_name)+'</a></b><br>'+escapeHTML(json.title)+pxvImg+'</div>');
}else{ }else{
if (json.title) { if (json.title) {
$("[toot-id=" + id + "] .additional").html( $("[toot-id=" + id + "] .additional").html(
"<span class=\"gray\">URL"+lang_cards_check[lang]+":<br>Title:" + json.title + "<br>" + "<span class=\"gray\">URL"+lang_cards_check[lang]+":<br>Title:" + escapeHTML(json.title) + "<br>" +
json.description + "</span>"); escapeHTML(json.description) + "</span>");
} }
if (json.html) { if (json.html) {
$("[toot-id=" + id + "] .additional").html(json.html+'<i class="material-icons sml pointer" onclick="pip(\''+id+'\')" title="'+lang_cards_pip[lang]+'">picture_in_picture_alt</i>'); $("[toot-id=" + id + "] .additional").html(json.html+'<i class="material-icons sml pointer" onclick="pip(\''+id+'\')" title="'+lang_cards_pip[lang]+'">picture_in_picture_alt</i>');

View File

@ -96,7 +96,7 @@ function filter(){
Object.keys(json).forEach(function(key) { Object.keys(json).forEach(function(key) {
var filterword = json[key]; var filterword = json[key];
var context = filterword.context.join(','); var context = filterword.context.join(',');
filters = filters + filterword.phrase+'<span class="sml">(for '+context+')</span>:<a onclick="filterEdit(\'' + filterword.id + '\',\'' + acct_id + filters = filters + escapeHTML(filterword.phrase)+'<span class="sml">(for '+context+')</span>:<a onclick="filterEdit(\'' + filterword.id + '\',\'' + acct_id +
'\')" class="pointer">'+lang_edit[lang]+'</a>/<a onclick="filterDel(' + filterword.id + ',' + acct_id + '\')" class="pointer">'+lang_edit[lang]+'</a>/<a onclick="filterDel(' + filterword.id + ',' + acct_id +
')" class="pointer">'+lang_del[lang]+'</a><br> '; ')" class="pointer">'+lang_del[lang]+'</a><br> ';
}); });
@ -131,6 +131,9 @@ function makeNewFilter(){
} }
var exc=$("#except_filter:checked").val(); var exc=$("#except_filter:checked").val();
var who=$("#wholeword_filter:checked").val(); var who=$("#wholeword_filter:checked").val();
if(!who){
who=false;
}
var time=$("#days_filter").val()*24*60*60+$("#hours_filter").val()*60*60+$("#mins_filter").val()*60; var time=$("#days_filter").val()*24*60*60+$("#hours_filter").val()*60*60+$("#mins_filter").val()*60;
var domain = localStorage.getItem("domain_" + acct_id); var domain = localStorage.getItem("domain_" + acct_id);
var at = localStorage.getItem("acct_"+ acct_id + "_at"); var at = localStorage.getItem("acct_"+ acct_id + "_at");
@ -249,7 +252,8 @@ function filterDel(id,acct_id){
} }
function getFilter(acct_id){ function getFilter(acct_id){
var domain = localStorage.getItem("domain_" + acct_id); var domain = localStorage.getItem("domain_" + acct_id);
var at = localStorage.getItem("acct_"+ acct_id + "_at"); var at = localStorage.getItem("acct_"+ acct_id + "_at");
if(localStorage.getItem("mode_" + domain)!="misskey"){
var start = "https://" + domain + "/api/v1/filters" var start = "https://" + domain + "/api/v1/filters"
console.log(start) console.log(start)
fetch(start, { fetch(start, {
@ -266,6 +270,9 @@ function getFilter(acct_id){
}).then(function(json) { }).then(function(json) {
localStorage.setItem("filter_"+ acct_id ,JSON.stringify(json)); localStorage.setItem("filter_"+ acct_id ,JSON.stringify(json));
}); });
}else{
localStorage.setItem("filter_"+ acct_id ,JSON.stringify({}));
}
} }
function getFilterType(json,type){ function getFilterType(json,type){
if(!json){ if(!json){

View File

@ -123,7 +123,7 @@ function hisList(user,acct_id){
Object.keys(json).forEach(function(key) { Object.keys(json).forEach(function(key) {
var list = json[key]; var list = json[key];
lists = lists + '<a onclick="listAdd(' + list.id + ',\'' + user + '\',\'' + acct_id + lists = lists + '<a onclick="listAdd(' + list.id + ',\'' + user + '\',\'' + acct_id +
'\')" class="pointer">'+list.title+'</a><br> '; '\')" class="pointer">'+escapeHTML(list.title)+'</a><br> ';
}); });
$("#his-lists-a").html(lists); $("#his-lists-a").html(lists);
}else{ }else{

View File

@ -128,7 +128,9 @@ function misskeyParse(obj, mix, acct_id, tlid, popup, mutefilter) {
var dis_name=toot.user.name; var dis_name=toot.user.name;
if(dis_name){ if(dis_name){
dis_name=escapeHTML(dis_name); dis_name=escapeHTML(dis_name);
} }else{
disname="";
}
if (mix == "notf") { if (mix == "notf") {
if (gif == "yes") { if (gif == "yes") {
noticeavatar = toot.user.avatarUrl; noticeavatar = toot.user.avatarUrl;

View File

@ -519,7 +519,12 @@ function exportSettings(){
exp.wordMute=wordmu; exp.wordMute=wordmu;
//spotify //spotify
exp.spotifyArtwork=localStorage.getItem("artwork") exp.spotifyArtwork=localStorage.getItem("artwork")
exp.spotifyTemplete=localStorage.getItem("np-temp") var content=localStorage.getItem("np-temp");
if(content || content=="" || content=="null"){
exp.spotifyTemplete=content;
}else{
exp.spotifyTemplete=null;
}
//tags //tags
var tagarr = localStorage.getItem("tag"); var tagarr = localStorage.getItem("tag");
var favtag = JSON.parse(tagarr); var favtag = JSON.parse(tagarr);
@ -604,6 +609,7 @@ function importSettings(){
if(obj.favoriteTags){ if(obj.favoriteTags){
localStorage.setItem("tag",JSON.stringify(obj.favoriteTags)); localStorage.setItem("tag",JSON.stringify(obj.favoriteTags));
} }
localStorage.setItem("np-temp",obj.spotifyTemplete); localStorage.setItem("np-temp",obj.spotifyTemplete);
for(var i=0;i<obj.columns.length;i++){ for(var i=0;i<obj.columns.length;i++){
localStorage.setItem("card_" + i,"true"); localStorage.setItem("card_" + i,"true");

View File

@ -42,7 +42,7 @@ function checkSpotify(){
$("#spotify-disable").addClass("disabled"); $("#spotify-disable").addClass("disabled");
} }
var content=localStorage.getItem("np-temp"); var content=localStorage.getItem("np-temp");
if(!content || content==""){ if(!content || content=="" || content=="null"){
var content="#NowPlaying {song} / {album} / {artist}\n{url} #SpotifyWithTheDesk"; var content="#NowPlaying {song} / {album} / {artist}\n{url} #SpotifyWithTheDesk";
} }
$("#np-temp").val(content); $("#np-temp").val(content);
@ -80,6 +80,9 @@ function nowplaying(mode){
console.error(error); console.error(error);
}).then(function(json) { }).then(function(json) {
console.log(json); console.log(json);
if(json.length<1){
return false;
}
var item=json.item; var item=json.item;
var img=item.album.images[0].url; var img=item.album.images[0].url;
var electron = require("electron"); var electron = require("electron");
@ -89,7 +92,7 @@ function nowplaying(mode){
ipc.send('bmp-image', [img,0]); ipc.send('bmp-image', [img,0]);
} }
var content=localStorage.getItem("np-temp"); var content=localStorage.getItem("np-temp");
if(!content || content==""){ if(!content || content=="" || content=="null"){
var content="#NowPlaying {song} / {album} / {artist}\n{url}"; var content="#NowPlaying {song} / {album} / {artist}\n{url}";
} }
var regExp = new RegExp("{song}", "g"); var regExp = new RegExp("{song}", "g");
@ -124,7 +127,7 @@ function nowplaying(mode){
ipc.on('itunes-np', function (event, arg) { ipc.on('itunes-np', function (event, arg) {
console.log(arg); console.log(arg);
var content=localStorage.getItem("np-temp"); var content=localStorage.getItem("np-temp");
if(!content || content==""){ if(!content || content=="" || content=="null"){
var content="#NowPlaying {song} / {album} / {artist}\n{url}"; var content="#NowPlaying {song} / {album} / {artist}\n{url}";
} }
var regExp = new RegExp("{song}", "g"); var regExp = new RegExp("{song}", "g");

View File

@ -14,7 +14,7 @@ function tips(mode){
clearInterval(spotStart); clearInterval(spotStart);
if(mode=="ver"){ if(mode=="ver"){
tipsToggle() tipsToggle()
$("#tips-text").html('<img src="./img/desk.png" width="20"><span style="font-size:20px">TheDesk</span> '+localStorage.getItem("ver")) $("#tips-text").html('<img src="./img/desk.png" width="20"><span style="font-size:20px">TheDesk</span> '+localStorage.getItem("ver")+'[<i class="material-icons" style="font-size:1.2rem;top: 3px;position: relative;">supervisor_account</i><span id="persons"></span>]')
localStorage.setItem("tips","ver") localStorage.setItem("tips","ver")
}else if(mode=="clock"){ }else if(mode=="clock"){
tipsToggle() tipsToggle()
@ -109,6 +109,7 @@ function spotifytips(){
artisttxt=item.artists[0].name; artisttxt=item.artists[0].name;
} }
} }
artisttxt=escapeHTML(artisttxt);
sleep(last); sleep(last);
var tms=item.duration_ms; var tms=item.duration_ms;
var per=ms/item.duration_ms*100; var per=ms/item.duration_ms*100;
@ -124,7 +125,7 @@ function spotifytips(){
ts="0"+ts; ts="0"+ts;
} }
var tm=(Math.round(tms)-Math.round(tms)%60)/60; var tm=(Math.round(tms)-Math.round(tms)%60)/60;
$("#tips-text").html('<div id="spot-box"><i class="material-icons pointer" onclick="spotifytips()" style="font-size:12px">refresh</i><img src="'+img+'" width="20" id="spot-img">'+item.name+'<span class="gray sml" id="spot-art">'+artisttxt+'</span><span id="spot-m">'+m+'</span>:<span id="spot-s">'+s+'</span>/'+tm+":"+ts+'</span></div><div class="progress grey"><div class="determinate spotify-prog grey lighten-2" style="width: '+per+'%" data-s="'+Math.round(ms)+'" data-total="'+item.duration_ms+'"></div></div>'); $("#tips-text").html('<div id="spot-box"><i class="material-icons pointer" onclick="spotifytips()" style="font-size:12px">refresh</i><img src="'+img+'" width="20" id="spot-img">'+escapeHTML(item.name)+'<span class="gray sml" id="spot-art">'+artisttxt+'</span><span id="spot-m">'+m+'</span>:<span id="spot-s">'+s+'</span>/'+tm+":"+ts+'</span></div><div class="progress grey"><div class="determinate spotify-prog grey lighten-2" style="width: '+per+'%" data-s="'+Math.round(ms)+'" data-total="'+item.duration_ms+'"></div></div>');
spotint=setInterval(spotStart, 1000); spotint=setInterval(spotStart, 1000);
}); });
}else{ }else{

View File

@ -1,6 +1,6 @@
{ {
"name": "thedesk", "name": "thedesk",
"version": "16.0.10", "version": "16.0.11",
"description": "TheDesk is a Mastodon client for PC.", "description": "TheDesk is a Mastodon client for PC.",
"main": "main.js", "main": "main.js",
"scripts": { "scripts": {