TheDesk Riina (ver.4)
This commit is contained in:
parent
7a1c6ea17c
commit
502a364142
23
LATEST.md
23
LATEST.md
|
@ -1,5 +1,18 @@
|
|||
[TheDesk](https://thedesk.top) :thedesk: Riina (ver.3)
|
||||
・バグ修正(通知,レイアウトなど)
|
||||
・画像の添付の順番を正規化(ドラッグ・アンド・ドロップで複数入れた場合,意図しない順番になることがあります)
|
||||
・bmpイメージの自動変換(JimpをNode.jsで使用)
|
||||
:github: [cutls/TheDesk](https://github.com/cutls/TheDesk) #Desk #DeskUpdate
|
||||
## For Markdown-supporting Instances
|
||||
|
||||
[TheDesk](https://thedesk.top) :thedesk: Riina (ver.4)
|
||||
・返信時,画像添付時の挙動修正。
|
||||
・トゥートUI変更。
|
||||
・自動折りたたみ機能の発生条件を追加。文字数でも制限をかけられます。
|
||||
・設定画面UI変更。
|
||||
・トゥートボックスをデフォルトで最小化する設定。
|
||||
:github: [cutls/TheDesk](https://github.com/cutls/TheDesk) #Desk #DeskUpdate
|
||||
|
||||
## For Vanilla Instances
|
||||
|
||||
TheDesk Riina (ver.4)リリース!
|
||||
・返信時,画像添付時の挙動修正。
|
||||
・トゥートUI変更。
|
||||
・自動折りたたみ機能の発生条件を追加。文字数でも制限をかけられます。
|
||||
・設定画面UI変更。
|
||||
・トゥートボックスをデフォルトで最小化する設定。
|
||||
|
|
|
@ -46,7 +46,7 @@ iframe {
|
|||
height: 100%;
|
||||
display: grid;
|
||||
grid-template-columns: 43px 2fr 1fr;
|
||||
grid-template-areas: 'notice notice notice' 'icon display_name acct' 'icon toot toot' 'icon date_via date_via' 'actions actions actions';
|
||||
grid-template-areas: 'notice notice notice' 'icon display_name acct' 'icon toot toot' 'icon additional additional' 'actions actions date_via';
|
||||
}
|
||||
|
||||
.area-notice {
|
||||
|
@ -61,7 +61,7 @@ grid-area: icon;
|
|||
}
|
||||
|
||||
.area-display_name {
|
||||
height:1.4em;
|
||||
height:1.5em;
|
||||
margin:2px;
|
||||
overflow:hidden;
|
||||
grid-area: display_name;
|
||||
|
@ -84,9 +84,14 @@ grid-area: toot;
|
|||
}
|
||||
|
||||
.area-date_via {
|
||||
grid-area: date_via;
|
||||
text-align:right;
|
||||
grid-area: date_via;
|
||||
}
|
||||
|
||||
.area-additional {
|
||||
grid-area: additional;
|
||||
}
|
||||
|
||||
.area-actions {
|
||||
margin:2px;
|
||||
grid-area: actions;
|
||||
|
@ -126,7 +131,6 @@ font-size:1rem;
|
|||
vertical-align: middle;
|
||||
background-color: #777;
|
||||
border-radius: 10px;
|
||||
width:70px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
<script type="text/javascript" src="./js/common/keyshortcut.js"></script>
|
||||
<script type="text/javascript" src="./js/common/modal.js"></script>
|
||||
<script>
|
||||
var ver="Riina (ver.3)";
|
||||
var ver="Riina (ver.4)";
|
||||
//betaを入れるとバージョンチェックしない
|
||||
//var ver="beta";
|
||||
var acct_id=0;
|
||||
|
|
|
@ -39,7 +39,8 @@ $("#drag").on('dragleave', function(e) {
|
|||
function pimg(files) {
|
||||
console.log(files);
|
||||
for (i = 0; i < files.length; i++) {
|
||||
if(files[i].path.match(/(.+)\\(.+)\.(.+)$/)[3]=="bmp"){
|
||||
var dot=files[i].path.match(/(.+)\\(.+)\.(.+)$/)[3];
|
||||
if(dot=="bmp" || dot=="BMP"){
|
||||
var electron = require("electron");
|
||||
var ipc = electron.ipcRenderer;
|
||||
ipc.send('bmp-image', files[i].path);
|
||||
|
@ -140,6 +141,7 @@ function media(b64, type) {
|
|||
todc();
|
||||
$("#toot-post-btn").prop("disabled", false);
|
||||
$("#post-acct-sel").prop("disabled", true);
|
||||
$('select').material_select();
|
||||
Materialize.toast("ファイルアップロード後はアカウントを切り替えられません。", 1000);
|
||||
localStorage.removeItem("image");
|
||||
});
|
||||
|
|
|
@ -45,6 +45,8 @@ function post() {
|
|||
var box = localStorage.getItem("box");
|
||||
if (box == "yes") {
|
||||
hide();
|
||||
}else if (box == "hide"){
|
||||
mini();
|
||||
}
|
||||
todc();
|
||||
clear();
|
||||
|
@ -54,7 +56,7 @@ function post() {
|
|||
//クリア(Shift+C)
|
||||
function clear() {
|
||||
$("#textarea").val("");
|
||||
$("#textarea").attr("placeholder", "象");
|
||||
$("#textarea").attr("placeholder", "");
|
||||
$("#reply").val("");
|
||||
$("#media").val("");
|
||||
var cwt = localStorage.getItem("cw-text");
|
||||
|
@ -68,7 +70,6 @@ function clear() {
|
|||
$("#cw").removeClass("cw-avail");
|
||||
$("#rec").text("いいえ");
|
||||
$("#mec").text("なし");
|
||||
$("#post-acct-sel").prop("disabled", false);
|
||||
var vis = localStorage.getItem("vis");
|
||||
if (!vis) {
|
||||
$("#vis").text("public");
|
||||
|
@ -87,6 +88,8 @@ function clear() {
|
|||
$("#drag").css("background-color", "#e0e0e0");
|
||||
$("#preview").html("");
|
||||
$("#toot-post-btn").prop("disabled", false);
|
||||
$("#post-acct-sel").prop("disabled", false);
|
||||
$('select').material_select();
|
||||
localStorage.removeItem("image");
|
||||
if ($("#post-box").hasClass("post-more")) {
|
||||
$("#file-wrap").html(
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
/*リプライ*/
|
||||
function re(id,at){
|
||||
function re(id,at,acct_id){
|
||||
show();
|
||||
$("#reply").val(id);
|
||||
var te=$("#textarea").val();
|
||||
$("#textarea").val("@"+at+" "+te);
|
||||
$("#rec").text("はい");
|
||||
$("#post-acct-sel").val(acct_id);
|
||||
$('select').material_select();
|
||||
$("#textarea").attr("placeholder","返信モードです。クリアするときはShift+Cを押してください。");
|
||||
}
|
|
@ -82,6 +82,10 @@ function parseNotf(obj, popup, tlid, acct_id) {
|
|||
var templete = '';
|
||||
var datetype = localStorage.getItem("datetype");
|
||||
var nsfwtype = localStorage.getItem("nsfw");
|
||||
var gif = localStorage.getItem("gif");
|
||||
if (!gif) {
|
||||
var gif = "yes";
|
||||
}
|
||||
if (!nsfwtype || nsfwtype == "yes") {
|
||||
var nsfw = "ok";
|
||||
} else {
|
||||
|
@ -100,6 +104,7 @@ function parseNotf(obj, popup, tlid, acct_id) {
|
|||
var eachobj = obj[key];
|
||||
var toot = eachobj.status;
|
||||
//トゥートである
|
||||
var type = eachobj.type;
|
||||
if (toot) {
|
||||
if (!toot.application) {
|
||||
var via = '<span style="font-style: italic;">Unknown</span>';
|
||||
|
@ -107,9 +112,9 @@ function parseNotf(obj, popup, tlid, acct_id) {
|
|||
var via = toot.application.name;
|
||||
}
|
||||
var sent = localStorage.getItem("sentence");
|
||||
if (!sent) {
|
||||
var sent = 500;
|
||||
}
|
||||
if (!sent) {
|
||||
var sent = 500;
|
||||
}
|
||||
if (toot.spoiler_text && cw) {
|
||||
var content = toot.content;
|
||||
var spoil = toot.spoiler_text;
|
||||
|
@ -118,11 +123,13 @@ function parseNotf(obj, popup, tlid, acct_id) {
|
|||
var spoiler_show = '<a href="#" onclick="cw_show(\'' + toot.id +
|
||||
'\')" class="nex parsed">見る</a>';
|
||||
} else {
|
||||
var ct = toot.content.split('</p>').length + toot.content.split('<br />').length -
|
||||
var ct = toot.content.split('</p>').length + toot.content.split('<br />')
|
||||
.length -
|
||||
2;
|
||||
if (sent < ct && $.mb_strlen(toot.content) > 5) {
|
||||
var content = '<span class="gray">以下全文</span><br>' + toot.content
|
||||
var spoil = '<span class="cw-long-'+toot.id+'">'+$.strip_tags($.mb_substr(toot.content, 0, 100)) +
|
||||
var spoil = '<span class="cw-long-' + toot.id + '">' + $.strip_tags($.mb_substr(
|
||||
toot.content, 0, 100)) +
|
||||
'</span><span class="gray">自動折りたたみ</span>';
|
||||
var spoiler = "cw cw_hide_" + toot.id;
|
||||
var spoiler_show = '<a href="#" onclick="cw_show(\'' + toot.id +
|
||||
|
@ -145,17 +152,18 @@ function parseNotf(obj, popup, tlid, acct_id) {
|
|||
} else if (eachobj.type == "reblog") {
|
||||
var what = "ブーストしました";
|
||||
} else if (eachobj.type == "favourite") {
|
||||
var what = "ふぁぼしました";
|
||||
var what = "お気に入り登録しました";
|
||||
}
|
||||
var noticetext = '<a onclick="udg(\'' + eachobj.account.id +
|
||||
'\',\'' + acct_id + '\')" class="pointer">'+eachobj.account.display_name + "(" + eachobj.account.acct +
|
||||
'\',\'' + acct_id + '\')" class="pointer">' + eachobj.account.display_name +
|
||||
"(" + eachobj.account.acct +
|
||||
")</a>が" + what;
|
||||
var memory = localStorage.getItem("notice-mem");
|
||||
if (popup >= 0 && obj.length < 5 && noticetext != memory) {
|
||||
Materialize.toast(noticetext, popup * 1000);
|
||||
$(".notf-icon_" + tlid).addClass("red-text");
|
||||
localStorage.setItem("notice-mem",noticetext);
|
||||
notftext="";
|
||||
localStorage.setItem("notice-mem", noticetext);
|
||||
notftext = "";
|
||||
}
|
||||
if (toot.spoiler_text && cw) {
|
||||
var spoiler = "cw cw_hide_" + toot.id;
|
||||
|
@ -167,58 +175,65 @@ function parseNotf(obj, popup, tlid, acct_id) {
|
|||
var urls = content.match(
|
||||
/https?:\/\/([-a-zA-Z0-9@.]+)\/?([-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)?/
|
||||
);
|
||||
if(urls){
|
||||
var analyze='<a onclick="additionalIndv(\'' + tlid + '\',' + acct_id +
|
||||
',\''+id+'\')" class="add-show pointer">URL解析</a>';
|
||||
}else{
|
||||
var analyze='';
|
||||
if (urls) {
|
||||
var analyze = '<a onclick="additionalIndv(\'' + tlid + '\',' + acct_id +
|
||||
',\'' + id + '\')" class="add-show pointer">URL解析</a>';
|
||||
} else {
|
||||
var analyze = '';
|
||||
}
|
||||
var viewer = "";
|
||||
var youtube = "";
|
||||
var emojick = toot.emojis[0];
|
||||
//絵文字があれば
|
||||
var content=toot.content
|
||||
if (emojick) {
|
||||
Object.keys(toot.emojis).forEach(function(key5) {
|
||||
var emoji = toot.emojis[key5];
|
||||
var shortcode = emoji.shortcode;
|
||||
var emoji_url = '<img src="' + emoji.url +
|
||||
'" style="width:1em" class="emoji-img">';
|
||||
var regExp = new RegExp(":" + shortcode + ":", "g");
|
||||
content = content.replace(regExp, emoji_url);
|
||||
});
|
||||
}
|
||||
//絵文字があれば
|
||||
var content = toot.content
|
||||
if (emojick) {
|
||||
Object.keys(toot.emojis).forEach(function(key5) {
|
||||
var emoji = toot.emojis[key5];
|
||||
var shortcode = emoji.shortcode;
|
||||
var emoji_url = '<img src="' + emoji.url +
|
||||
'" style="width:1em" class="emoji-img">';
|
||||
var regExp = new RegExp(":" + shortcode + ":", "g");
|
||||
content = content.replace(regExp, emoji_url);
|
||||
});
|
||||
}
|
||||
var mediack = toot.media_attachments[0];
|
||||
//メディアがあれば
|
||||
if (mediack) {
|
||||
var cwdt=100/toot.media_attachments.length
|
||||
Object.keys(toot.media_attachments).forEach(function(key2) {
|
||||
var media = toot.media_attachments[key2];
|
||||
var purl = media.preview_url;
|
||||
var url = media.url;
|
||||
if (toot.sensitive && nsfw) {
|
||||
var sense = "sensitive"
|
||||
} else {
|
||||
var sense = ""
|
||||
}
|
||||
viewer = viewer + '<a onclick="imgv(\''+id+'\',\''+key2+'\','+acct_id+')" id="'+id+'-image-'+key2+'" data-url="'+url+'" data-type="'+media.type+'" class="img-parsed"><img src="' + purl + '" class="' + sense +
|
||||
' toot-img pointer" style="width:'+cwdt+'%"></a></span>';
|
||||
});
|
||||
} else {
|
||||
viewer = "";
|
||||
}
|
||||
//公開範囲を取得
|
||||
var vis="";
|
||||
var visen=toot.visibility;
|
||||
if(visen=="public"){
|
||||
var vis = '<i class="text-darken-3 material-icons gray sml pointer" title="公開(クリックでトゥートURLをコピー)" onclick="tootUriCopy(\''+toot.url+'\');">public</i>';
|
||||
}else if(visen=="unlisted"){
|
||||
var vis = '<i class="text-darken-3 material-icons blue-text pointer" title="未収載(クリックでトゥートURLをコピー)" onclick="tootUriCopy(\''+toot.url+'\');">lock_open</i>';
|
||||
}else if(visen=="plivate"){
|
||||
var vis = '<i class="text-darken-3 material-icons orange-text pointer" title="非公開(クリックでトゥートURLをコピー)" onclick="tootUriCopy(\''+toot.url+'\');">lock</i>';
|
||||
}else if(visen=="direct"){
|
||||
var vis = '<i class="text-darken-3 material-icons red-text pointer" title="ダイレクト(クリックでトゥートURLをコピー)" onclick="tootUriCopy(\''+toot.url+'\');">mail</i>';
|
||||
}
|
||||
if (mediack) {
|
||||
var cwdt = 100 / toot.media_attachments.length
|
||||
Object.keys(toot.media_attachments).forEach(function(key2) {
|
||||
var media = toot.media_attachments[key2];
|
||||
var purl = media.preview_url;
|
||||
var url = media.url;
|
||||
if (toot.sensitive && nsfw) {
|
||||
var sense = "sensitive"
|
||||
} else {
|
||||
var sense = ""
|
||||
}
|
||||
viewer = viewer + '<a onclick="imgv(\'' + id + '\',\'' + key2 + '\',' +
|
||||
acct_id + ')" id="' + id + '-image-' + key2 + '" data-url="' + url +
|
||||
'" data-type="' + media.type + '" class="img-parsed"><img src="' +
|
||||
purl + '" class="' + sense +
|
||||
' toot-img pointer" style="width:' + cwdt + '%"></a></span>';
|
||||
});
|
||||
} else {
|
||||
viewer = "";
|
||||
}
|
||||
//公開範囲を取得
|
||||
var vis = "";
|
||||
var visen = toot.visibility;
|
||||
if (visen == "public") {
|
||||
var vis =
|
||||
'<i class="text-darken-3 material-icons gray sml" title="公開">public</i>';
|
||||
} else if (visen == "unlisted") {
|
||||
var vis =
|
||||
'<i class="text-darken-3 material-icons blue-text" title="未収載">lock_open</i>';
|
||||
} else if (visen == "plivate") {
|
||||
var vis =
|
||||
'<i class="text-darken-3 material-icons orange-text" title="非公開">lock</i>';
|
||||
} else if (visen == "direct") {
|
||||
var vis =
|
||||
'<i class="text-darken-3 material-icons red-text" title="ダイレクト">mail</i>';
|
||||
}
|
||||
var menck = toot.mentions[0];
|
||||
var mentions = "";
|
||||
if (menck) {
|
||||
|
@ -274,63 +289,86 @@ function parseNotf(obj, popup, tlid, acct_id) {
|
|||
var if_rt = "";
|
||||
var rt_app = "";
|
||||
}
|
||||
var boostback="";
|
||||
var hasmedia="";
|
||||
var home=""
|
||||
var boostback = "";
|
||||
var hasmedia = "";
|
||||
var home = "";
|
||||
//アニメ再生
|
||||
if (gif == "yes") {
|
||||
var avatar = toot.account.avatar;
|
||||
} else {
|
||||
var avatar = toot.account.avatar_static;
|
||||
}
|
||||
var divider = '<div class="divider"></div>';
|
||||
var notice = noticetext;
|
||||
templete = templete + '<div id="pub_' + toot.id + '" class="cvo ' +
|
||||
templete = templete + '<div id="pub_' + toot.id + '" class="cvo ' +
|
||||
boostback + ' ' + fav_app + ' ' + rt_app +
|
||||
' '+ hasmedia + '" toot-id="' + id + '" unixtime="' + date(obj[
|
||||
key].created_at, 'unix') + '">'+
|
||||
'<div class="area-notice"><span class="gray sharesta">' + noticetext + home + '</span></div>'+
|
||||
' ' + hasmedia + '" toot-id="' + id + '" unixtime="' + date(obj[
|
||||
key].created_at, 'unix') + '">' +
|
||||
'<div class="area-notice"><span class="gray sharesta"><span class="cbadge"title="' + date(eachobj.created_at,
|
||||
'absolute') + '(通知された時間)"><i class="fa fa-clock-o"></i>' + date(eachobj.created_at,
|
||||
datetype) +
|
||||
'</span>' + notice + home +
|
||||
'</span></div>' +
|
||||
'<div class="area-icon"><a onclick="udg(\'' + toot.account.id +
|
||||
'\',' + acct_id + ');" user="' + toot.account.acct + '" class="udg">' +
|
||||
'<img src="' + toot.account.avatar +
|
||||
'<img src="' + avatar +
|
||||
'" width="40" class="prof-img" user="' + toot.account.acct +
|
||||
'"></a></div>'+
|
||||
'"></a></div>' +
|
||||
'<div class="area-display_name"><span class="user">' +
|
||||
toot.account.display_name + '</span></div>'+
|
||||
'<div class="area-acct"><span class="sml gray" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;"> @' +
|
||||
toot.account.acct + locked + '</span><span class="cbadge right"><i class="fa fa-clock-o"></i>' + date(eachobj.created_at,
|
||||
datetype) + '</span></div>'+
|
||||
'<div class="area-toot"><span class="toot ' + spoiler + '">' + content + '</span><span class="' +
|
||||
toot.account.display_name +
|
||||
'</span><span class="sml gray" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;"> @' +
|
||||
toot.account.acct + locked + '</span></div>' +
|
||||
'<div class="area-acct"><div><span class="cbadge pointer" onclick="tootUriCopy(\'' + toot.url +
|
||||
'\');" title="' + date(toot.created_at, 'absolute') +
|
||||
'(クリックでトゥートURLをコピー)"><i class="fa fa-clock-o"></i>' +
|
||||
date(toot.created_at, datetype) + '</span></div></div>' +
|
||||
'<div class="area-toot"><span class="toot ' + spoiler + '">' + content +
|
||||
'</span><span class="' +
|
||||
api_spoil + ' cw_text_' + toot.id + '">' + spoil + spoiler_show +
|
||||
'</span>' +
|
||||
'' + viewer + '' +
|
||||
'<span class="additional">' + analyze + '</span></div>'+
|
||||
'<div class="area-date_via">'+ mentions + tags +'</div>'+
|
||||
'</div><div class="area-additional"><span class="additional">' + analyze +
|
||||
'</span>' +
|
||||
'' + mentions + tags + '</div>' +
|
||||
'<div class="area-actions" style="padding:0; margin:0; top:-20px; display:flex; justify-content:space-around; max-width:100%; ">' +
|
||||
'<div class="action">'+ vis +'</div><div class="action"><a onclick="re(\'' + toot.id + '\',\'' + toot.account.acct + '\',' +
|
||||
'<div class="action"><span class="waves-effect waves-dark btn-flat" style="padding:0">' +
|
||||
vis + '</span></div><div class="action"><a onclick="re(\'' + toot.id +
|
||||
'\',\'' + toot.account.acct + '\',' +
|
||||
acct_id +
|
||||
')" class="waves-effect waves-dark btn-flat" style="padding:0"><i class="fa fa-share"></i></a></div>' +
|
||||
'<div class="action"><a onclick="rt(\'' + toot.id + '\',' + acct_id +
|
||||
',\''+tlid+'\')" class="waves-effect waves-dark btn-flat" style="padding:0"><i class="text-darken-3 fa fa-retweet ' +
|
||||
',\'' + tlid +
|
||||
'\')" class="waves-effect waves-dark btn-flat" style="padding:0"><i class="text-darken-3 fa fa-retweet ' +
|
||||
if_rt + ' rt_' + toot.id + '"></i><span class="rt_ct">' + toot.reblogs_count +
|
||||
'</span></a></div>' +
|
||||
'<div class="action"><a onclick="fav(\'' + toot.id + '\',' + acct_id +
|
||||
',\''+tlid+'\')" class="waves-effect waves-dark btn-flat" style="padding:0"><i class="fa text-darken-3 fa-star' +
|
||||
',\'' + tlid +
|
||||
'\')" class="waves-effect waves-dark btn-flat" style="padding:0"><i class="fa text-darken-3 fa-star' +
|
||||
if_fav + ' fav_' + toot.id + '"></i><span class="fav_ct">' + toot.favourites_count +
|
||||
'</a></span></div>' +
|
||||
'<div class="' + if_mine + ' action"><a onclick="del(\'' + toot.id + '\',' +
|
||||
'<div class="' + if_mine + ' action"><a onclick="del(\'' + toot.id +
|
||||
'\',' +
|
||||
acct_id +
|
||||
')" class="waves-effect waves-dark btn-flat" style="padding:0"><i class="fa fa-trash-o"></i></a></div>' +
|
||||
'<div class="action"><a onclick="details(\'' + toot.id + '\',' + acct_id +
|
||||
')" class="waves-effect waves-dark btn-flat details" style="padding:0"><i class="text-darken-3 material-icons">more_vert</i></a></div>' +
|
||||
'<div><span class="cbadge"><i class="fa fa-clock-o"></i>' +
|
||||
date(toot.created_at, datetype) + '</span></div>' +
|
||||
'<div><span class="cbadge" title="via ' + $.strip_tags(via) + '">via ' + via +
|
||||
'</span></div></div></div>'+
|
||||
'</div><div class="divider"></div>';
|
||||
}else{
|
||||
'</div><div class="area-date_via">' +
|
||||
'<div><span class="cbadge" title="via ' + $.strip_tags(via) + '">via ' +
|
||||
via +
|
||||
'</span></div></div></div>' +
|
||||
'</div>' + divider;
|
||||
|
||||
} else {
|
||||
templete = templete + userparse([eachobj.account],"","true");
|
||||
var noticetext = eachobj.account.display_name + "(" + eachobj.account.acct +
|
||||
")がフォローしました";
|
||||
var memory = localStorage.getItem("notice-mem");
|
||||
if (popup >= 0 && obj.length < 5 && noticetext != memory) {
|
||||
Materialize.toast(noticetext, popup * 1000);
|
||||
$(".notf-icon_" + tlid).addClass("red-text");
|
||||
localStorage.setItem("notice-mem",noticetext);
|
||||
notftext="";
|
||||
}
|
||||
var memory = localStorage.getItem("notice-mem");
|
||||
if (popup >= 0 && obj.length < 5 && noticetext != memory) {
|
||||
Materialize.toast(noticetext, popup * 1000);
|
||||
$(".notf-icon_" + tlid).addClass("red-text");
|
||||
localStorage.setItem("notice-mem", noticetext);
|
||||
notftext = "";
|
||||
}
|
||||
}
|
||||
});
|
||||
if (!noticetext) {
|
||||
|
|
|
@ -4,6 +4,7 @@ function parse(obj, mix, acct_id) {
|
|||
var datetype = localStorage.getItem("datetype");
|
||||
var nsfwtype = localStorage.getItem("nsfw");
|
||||
var sent = localStorage.getItem("sentence");
|
||||
var ltr = localStorage.getItem("letters");
|
||||
var gif = localStorage.getItem("gif");
|
||||
if (!sent) {
|
||||
var sent = 500;
|
||||
|
@ -22,8 +23,8 @@ function parse(obj, mix, acct_id) {
|
|||
if (!datetype) {
|
||||
datetype = "absolute";
|
||||
}
|
||||
if(!gif){
|
||||
var gif="yes";
|
||||
if (!gif) {
|
||||
var gif = "yes";
|
||||
}
|
||||
var local = [];
|
||||
Object.keys(obj).forEach(function(key) {
|
||||
|
@ -32,14 +33,14 @@ function parse(obj, mix, acct_id) {
|
|||
//Integratedである場合はUnix時間をキーに配列を生成しておく
|
||||
if (mix == "mix") {
|
||||
local[date(obj[key].created_at, 'unix')] = toot.id;
|
||||
var divider='<div class="divider"></div>';
|
||||
var divider = '<div class="divider"></div>';
|
||||
}
|
||||
if (mix == "home") {
|
||||
var home = "Home TLより"
|
||||
var divider="";
|
||||
var divider = "";
|
||||
} else {
|
||||
var home = "";
|
||||
var divider='<div class="divider"></div>';
|
||||
var divider = '<div class="divider"></div>';
|
||||
}
|
||||
if (toot.reblog) {
|
||||
var notice = toot.account.display_name + "(" + toot.account.acct +
|
||||
|
@ -70,13 +71,14 @@ function parse(obj, mix, acct_id) {
|
|||
} else {
|
||||
var ct = toot.content.split('</p>').length + toot.content.split('<br />').length -
|
||||
2;
|
||||
if (sent < ct && $.mb_strlen(toot.content) > 5) {
|
||||
if ((sent < ct && $.mb_strlen($.strip_tags(toot.content)) > 5) || ($.strip_tags(toot.content).length > ltr && $.mb_strlen($.strip_tags(toot.content)) > 5)) {
|
||||
var content = '<span class="gray">以下全文</span><br>' + toot.content
|
||||
var spoil = '<span class="cw-long-'+toot.id+'">'+$.strip_tags($.mb_substr(toot.content, 0, 100)) +
|
||||
var spoil = '<span class="cw-long-' + toot.id + '">' + $.mb_substr($.strip_tags(
|
||||
toot.content), 0, 100) +
|
||||
'</span><span class="gray">自動折りたたみ</span>';
|
||||
var spoiler = "cw cw_hide_" + toot.id;
|
||||
var spoiler_show = '<a href="#" onclick="cw_show(\'' + toot.id +
|
||||
'\')" class="nex parsed">続き…</a>';
|
||||
'\')" class="nex parsed">続き…</a><br>';
|
||||
} else {
|
||||
var content = toot.content;
|
||||
var spoil = toot.spoiler_text;
|
||||
|
@ -85,16 +87,16 @@ function parse(obj, mix, acct_id) {
|
|||
}
|
||||
}
|
||||
var urls = content.match(
|
||||
/https?:\/\/([-a-zA-Z0-9@.]+)\/?([-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)?/
|
||||
/https?:\/\/([-a-zA-Z0-9@.]+)\/?(?!.*((media|tags)|mentions)).*([-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)?/
|
||||
);
|
||||
if(urls){
|
||||
var analyze='<a onclick="additionalIndv(\'' + tlid + '\',' + acct_id +
|
||||
',\''+id+'\')" class="add-show pointer">URL解析</a>';
|
||||
}else{
|
||||
var analyze='';
|
||||
if (urls) {
|
||||
var analyze = '<a onclick="additionalIndv(\'' + tlid + '\',' + acct_id +
|
||||
',\'' + id + '\')" class="add-show pointer">URL解析</a><br>';
|
||||
} else {
|
||||
var analyze = '';
|
||||
}
|
||||
var viewer = "";
|
||||
var hasmedia="";
|
||||
var hasmedia = "";
|
||||
var youtube = "";
|
||||
var emojick = toot.emojis[0];
|
||||
//絵文字があれば
|
||||
|
@ -112,7 +114,7 @@ function parse(obj, mix, acct_id) {
|
|||
//メディアがあれば
|
||||
if (mediack) {
|
||||
hasmedia = "hasmedia";
|
||||
var cwdt=100/toot.media_attachments.length
|
||||
var cwdt = 100 / toot.media_attachments.length
|
||||
Object.keys(toot.media_attachments).forEach(function(key2) {
|
||||
var media = toot.media_attachments[key2];
|
||||
var purl = media.preview_url;
|
||||
|
@ -122,8 +124,11 @@ function parse(obj, mix, acct_id) {
|
|||
} else {
|
||||
var sense = ""
|
||||
}
|
||||
viewer = viewer + '<a onclick="imgv(\''+id+'\',\''+key2+'\','+acct_id+')" id="'+id+'-image-'+key2+'" data-url="'+url+'" data-type="'+media.type+'" class="img-parsed"><img src="' + purl + '" class="' + sense +
|
||||
' toot-img pointer" style="width:'+cwdt+'%"></a></span>';
|
||||
viewer = viewer + '<a onclick="imgv(\'' + id + '\',\'' + key2 + '\',' +
|
||||
acct_id + ')" id="' + id + '-image-' + key2 + '" data-url="' + url +
|
||||
'" data-type="' + media.type + '" class="img-parsed"><img src="' +
|
||||
purl + '" class="' + sense +
|
||||
' toot-img pointer" style="width:' + cwdt + '%"></a></span>';
|
||||
});
|
||||
} else {
|
||||
viewer = "";
|
||||
|
@ -139,6 +144,7 @@ function parse(obj, mix, acct_id) {
|
|||
mentions = mentions + '<a onclick="udg(\'' + mention.id + '\',' +
|
||||
acct_id + ')" class="pointer">@' + mention.acct + '</a> ';
|
||||
});
|
||||
mentions = '<div style="float:right">' + mentions + '</div>';
|
||||
}
|
||||
var tagck = toot.tags[0];
|
||||
var tags = "";
|
||||
|
@ -152,18 +158,23 @@ function parse(obj, mix, acct_id) {
|
|||
tags = tags + '<a onclick="tl(\'tag\',\'' + tag.name + '\',' + acct_id +
|
||||
',\'add\')" class="pointer">#' + tag.name + '</a> ';
|
||||
});
|
||||
tags = '<div style="float:right">' + tags + '</div>';
|
||||
}
|
||||
//公開範囲を取得
|
||||
var vis="";
|
||||
var visen=toot.visibility;
|
||||
if(visen=="public"){
|
||||
var vis = '<i class="text-darken-3 material-icons gray sml" title="公開">public</i>';
|
||||
}else if(visen=="unlisted"){
|
||||
var vis = '<i class="text-darken-3 material-icons blue-text" title="未収載">lock_open</i>';
|
||||
}else if(visen=="plivate"){
|
||||
var vis = '<i class="text-darken-3 material-icons orange-text" title="非公開">lock</i>';
|
||||
}else if(visen=="direct"){
|
||||
var vis = '<i class="text-darken-3 material-icons red-text" title="ダイレクト">mail</i>';
|
||||
var vis = "";
|
||||
var visen = toot.visibility;
|
||||
if (visen == "public") {
|
||||
var vis =
|
||||
'<i class="text-darken-3 material-icons gray sml" title="公開">public</i>';
|
||||
} else if (visen == "unlisted") {
|
||||
var vis =
|
||||
'<i class="text-darken-3 material-icons blue-text" title="未収載">lock_open</i>';
|
||||
} else if (visen == "plivate") {
|
||||
var vis =
|
||||
'<i class="text-darken-3 material-icons orange-text" title="非公開">lock</i>';
|
||||
} else if (visen == "direct") {
|
||||
var vis =
|
||||
'<i class="text-darken-3 material-icons red-text" title="ダイレクト">mail</i>';
|
||||
}
|
||||
if (toot.account.acct == localStorage.getItem("user_" + acct_id)) {
|
||||
var if_mine = "";
|
||||
|
@ -185,53 +196,64 @@ function parse(obj, mix, acct_id) {
|
|||
var rt_app = "";
|
||||
}
|
||||
//アニメ再生
|
||||
if(gif=="yes"){
|
||||
var avatar=toot.account.avatar;
|
||||
}else{
|
||||
var avatar=toot.account.avatar_static;
|
||||
if (gif == "yes") {
|
||||
var avatar = toot.account.avatar;
|
||||
} else {
|
||||
var avatar = toot.account.avatar_static;
|
||||
}
|
||||
templete = templete + '<div id="pub_' + toot.id + '" class="cvo ' +
|
||||
boostback + ' ' + fav_app + ' ' + rt_app +
|
||||
' '+ hasmedia + '" toot-id="' + id + '" unixtime="' + date(obj[
|
||||
key].created_at, 'unix') + '">'+
|
||||
'<div class="area-notice"><span class="gray sharesta">' + notice + home + '</span></div>'+
|
||||
'<div class="area-icon"><a onclick="udg(\'' + toot.account.id +
|
||||
'\',' + acct_id + ');" user="' + toot.account.acct + '" class="udg">' +
|
||||
'<img src="' + avatar +
|
||||
'" width="40" class="prof-img" user="' + toot.account.acct +
|
||||
'"></a></div>'+
|
||||
'<div class="area-display_name"><span class="user">' +
|
||||
toot.account.display_name + '</span></div>'+
|
||||
'<div class="area-acct"><span class="sml gray" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;"> @' +
|
||||
toot.account.acct + locked + '</span></div>'+
|
||||
'<div class="area-toot"><span class="toot ' + spoiler + '">' + content + '</span><span class="' +
|
||||
api_spoil + ' cw_text_' + toot.id + '">' + spoil + spoiler_show +
|
||||
'</span>' +
|
||||
'' + viewer + '' +
|
||||
'<span class="additional">' + analyze + '</span></div>'+
|
||||
'<div class="area-date_via">'+ mentions + tags +'</div>'+
|
||||
'<div class="area-actions" style="padding:0; margin:0; top:-20px; display:flex; justify-content:space-around; max-width:100%; ">' +
|
||||
'<div class="action">'+ vis +'</div><div class="action"><a onclick="re(\'' + toot.id + '\',\'' + toot.account.acct + '\',' +
|
||||
acct_id +
|
||||
')" class="waves-effect waves-dark btn-flat" style="padding:0"><i class="fa fa-share"></i></a></div>' +
|
||||
'<div class="action"><a onclick="rt(\'' + toot.id + '\',' + acct_id +
|
||||
',\''+tlid+'\')" class="waves-effect waves-dark btn-flat" style="padding:0"><i class="text-darken-3 fa fa-retweet ' +
|
||||
if_rt + ' rt_' + toot.id + '"></i><span class="rt_ct">' + toot.reblogs_count +
|
||||
'</span></a></div>' +
|
||||
'<div class="action"><a onclick="fav(\'' + toot.id + '\',' + acct_id +
|
||||
',\''+tlid+'\')" class="waves-effect waves-dark btn-flat" style="padding:0"><i class="fa text-darken-3 fa-star' +
|
||||
if_fav + ' fav_' + toot.id + '"></i><span class="fav_ct">' + toot.favourites_count +
|
||||
'</a></span></div>' +
|
||||
'<div class="' + if_mine + ' action"><a onclick="del(\'' + toot.id + '\',' +
|
||||
acct_id +
|
||||
')" class="waves-effect waves-dark btn-flat" style="padding:0"><i class="fa fa-trash-o"></i></a></div>' +
|
||||
'<div class="action"><a onclick="details(\'' + toot.id + '\',' + acct_id +
|
||||
')" class="waves-effect waves-dark btn-flat details" style="padding:0"><i class="text-darken-3 material-icons">more_vert</i></a></div>' +
|
||||
'<div><span class="cbadge pointer" onclick="tootUriCopy(\''+toot.url+'\');" title="クリックでトゥートURLをコピー"><i class="fa fa-clock-o"></i>' +
|
||||
date(toot.created_at, datetype) + '</span></div>' +
|
||||
'<div><span class="cbadge" title="via ' + $.strip_tags(via) + '">via ' + via +
|
||||
'</span></div></div></div>'+
|
||||
'</div>'+divider;
|
||||
boostback + ' ' + fav_app + ' ' + rt_app +
|
||||
' ' + hasmedia + '" toot-id="' + id + '" unixtime="' + date(obj[
|
||||
key].created_at, 'unix') + '">' +
|
||||
'<div class="area-notice"><span class="gray sharesta">' + notice + home +
|
||||
'</span></div>' +
|
||||
'<div class="area-icon"><a onclick="udg(\'' + toot.account.id +
|
||||
'\',' + acct_id + ');" user="' + toot.account.acct + '" class="udg">' +
|
||||
'<img src="' + avatar +
|
||||
'" width="40" class="prof-img" user="' + toot.account.acct +
|
||||
'"></a></div>' +
|
||||
'<div class="area-display_name"><span class="user">' +
|
||||
toot.account.display_name +
|
||||
'</span><span class="sml gray" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;"> @' +
|
||||
toot.account.acct + locked + '</span></div>' +
|
||||
'<div class="area-acct"><div><span class="cbadge pointer" onclick="tootUriCopy(\'' +
|
||||
toot.url + '\');" title="' + date(toot.created_at, 'absolute') +
|
||||
'(クリックでトゥートURLをコピー)"><i class="fa fa-clock-o"></i>' +
|
||||
date(toot.created_at, datetype) + '</span></div></div>' +
|
||||
'<div class="area-toot"><span class="toot ' + spoiler + '">' + content +
|
||||
'</span><span class="' +
|
||||
api_spoil + ' cw_text_' + toot.id + '">' + spoil + spoiler_show +
|
||||
'</span>' +
|
||||
'' + viewer + '' +
|
||||
'</div><div class="area-additional"><span class="additional">' + analyze +
|
||||
'</span>' +
|
||||
'' + mentions + tags + '</div>' +
|
||||
'<div class="area-actions" style="padding:0; margin:0; top:-20px; display:flex; justify-content:space-around; max-width:100%; ">' +
|
||||
'<div class="action"><span class="waves-effect waves-dark btn-flat" style="padding:0">' +
|
||||
vis + '</span></div><div class="action"><a onclick="re(\'' + toot.id +
|
||||
'\',\'' + toot.account.acct + '\',' +
|
||||
acct_id +
|
||||
')" class="waves-effect waves-dark btn-flat" style="padding:0"><i class="fa fa-share"></i></a></div>' +
|
||||
'<div class="action"><a onclick="rt(\'' + toot.id + '\',' + acct_id +
|
||||
',\'' + tlid +
|
||||
'\')" class="waves-effect waves-dark btn-flat" style="padding:0"><i class="text-darken-3 fa fa-retweet ' +
|
||||
if_rt + ' rt_' + toot.id + '"></i><span class="rt_ct">' + toot.reblogs_count +
|
||||
'</span></a></div>' +
|
||||
'<div class="action"><a onclick="fav(\'' + toot.id + '\',' + acct_id +
|
||||
',\'' + tlid +
|
||||
'\')" class="waves-effect waves-dark btn-flat" style="padding:0"><i class="fa text-darken-3 fa-star' +
|
||||
if_fav + ' fav_' + toot.id + '"></i><span class="fav_ct">' + toot.favourites_count +
|
||||
'</a></span></div>' +
|
||||
'<div class="' + if_mine + ' action"><a onclick="del(\'' + toot.id + '\',' +
|
||||
acct_id +
|
||||
')" class="waves-effect waves-dark btn-flat" style="padding:0"><i class="fa fa-trash-o"></i></a></div>' +
|
||||
'<div class="action"><a onclick="details(\'' + toot.id + '\',' + acct_id +
|
||||
')" class="waves-effect waves-dark btn-flat details" style="padding:0"><i class="text-darken-3 material-icons">more_vert</i></a></div>' +
|
||||
'</div><div class="area-date_via">' +
|
||||
'<div><span class="cbadge" title="via ' + $.strip_tags(via) + '">via ' +
|
||||
via +
|
||||
'</span></div></div></div>' +
|
||||
'</div>' + divider;
|
||||
});
|
||||
if (mix == "mix") {
|
||||
return [templete, local]
|
||||
|
@ -241,8 +263,9 @@ function parse(obj, mix, acct_id) {
|
|||
}
|
||||
|
||||
//オブジェクトパーサー(ユーザーデータ)
|
||||
function userparse(obj, auth) {
|
||||
function userparse(obj, auth, notf) {
|
||||
var templete = '';
|
||||
var datetype = localStorage.getItem("datetype");
|
||||
Object.keys(obj).forEach(function(key) {
|
||||
var toot = obj[key];
|
||||
if (toot.locked) {
|
||||
|
@ -256,8 +279,17 @@ function userparse(obj, auth) {
|
|||
} else {
|
||||
var auth = "";
|
||||
}
|
||||
if(notf){
|
||||
var notftext='<span class="cbadge"title="' + date(toot.created_at,
|
||||
'absolute') + '(通知された時間)"><i class="fa fa-clock-o"></i>' + date(toot.created_at,
|
||||
datetype) +
|
||||
'</span>フォローされました。<br>';
|
||||
}else{
|
||||
var notftext="";
|
||||
}
|
||||
templete = templete +
|
||||
'<div class="cvo " style="padding-top:5px;" user-id="' + toot.id + '">' +
|
||||
'<div class="" style="padding-top:5px;" user-id="' + toot.id + '">' +
|
||||
notftext +
|
||||
'<div style="padding:0; margin:0; width:400px; max-width:100%; display:flex; align-items:flex-end;">' +
|
||||
'<div style="flex-basis:40px;"><a onclick="udg(\'' + toot.id + '\',' +
|
||||
acct_id + ');" user="' + toot.acct + '" class="udg">' +
|
||||
|
@ -268,8 +300,9 @@ function userparse(obj, auth) {
|
|||
'<div class="sml gray" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;"> @' +
|
||||
toot.acct + locked + '</div>' +
|
||||
'</div>' + auth +
|
||||
'<div style="justify-content:space-around"> <div class="cbadge">Follows:' +
|
||||
toot.following_count + '</div><div class="cbadge">Followers:' + toot.followers_count +
|
||||
'<div style="justify-content:space-around"> <div class="cbadge" style="width:100px;">Follows:' +
|
||||
toot.following_count +
|
||||
'</div><div class="cbadge" style="width:100px;">Followers:' + toot.followers_count +
|
||||
'</div>' +
|
||||
'<div class="divider"></div>' +
|
||||
'</div>' +
|
||||
|
|
|
@ -95,6 +95,9 @@
|
|||
$("#post-box").addClass("hidenbox");
|
||||
$("#post-box").fadeOut();
|
||||
$("#menu-btn").fadeIn();
|
||||
}else if (box == "hide"){
|
||||
$("body").addClass("mini-post");
|
||||
$(".mini-btn").text("expand_less");
|
||||
}
|
||||
var vis = localStorage.getItem("vis");
|
||||
if (!vis) {
|
||||
|
|
|
@ -2,37 +2,48 @@
|
|||
//設定ボタン押した。
|
||||
function settings() {
|
||||
var dd = $("[name=time]:checked").val();
|
||||
if (dd != localStorage.getItem("datetype")) {
|
||||
Materialize.toast("時間設定を" + dd + "に設定しました。", 3000);
|
||||
var dt = $("[for="+dd+"]").text();
|
||||
if (dd != localStorage.getItem("datetype")) {
|
||||
Materialize.toast("時間設定を" + dt + "に設定しました。", 3000);
|
||||
}
|
||||
localStorage.setItem("datetype", dd);
|
||||
|
||||
var cd = $("[name=theme]:checked").val();
|
||||
var ct = $("[for="+cd+"]").text();
|
||||
if (cd != localStorage.getItem("theme")) {
|
||||
Materialize.toast("テーマ設定を" + cd + "に設定しました。", 3000);
|
||||
Materialize.toast("テーマ設定を" + ct + "に設定しました。", 3000);
|
||||
}
|
||||
//テーマはこの場で設定
|
||||
themes(cd);
|
||||
localStorage.setItem("theme", cd);
|
||||
|
||||
var nd = $("[name=nsfw]:checked").val();
|
||||
var nt = $("[for=n_"+nd+"]").text();
|
||||
if (nd != localStorage.getItem("nsfw")) {
|
||||
Materialize.toast("画像表示設定を" + nd + "に設定しました。", 3000);
|
||||
Materialize.toast("画像表示設定を" + nt + "に設定しました。", 3000);
|
||||
}
|
||||
localStorage.setItem("nsfw", nd);
|
||||
|
||||
var cwd = $("[name=cw]:checked").val();
|
||||
var cwt = $("[for=c_"+cwd+"]").text();
|
||||
if (cwd != localStorage.getItem("cw")) {
|
||||
Materialize.toast("テキスト表示設定を" + cwd + "に設定しました。", 3000);
|
||||
Materialize.toast("テキスト表示設定を" + cwt + "に設定しました。", 3000);
|
||||
}
|
||||
localStorage.setItem("cw", cwd);
|
||||
|
||||
var cwtd = $("#cw-text").val();
|
||||
if (cwtd != localStorage.getItem("cw-text")) {
|
||||
Materialize.toast("デフォルトの警告文を「" + cwtd + "」に設定しました。", 3000);
|
||||
}
|
||||
localStorage.setItem("cw-text", cwtd);
|
||||
|
||||
var visd = $("[name=vis]:checked").val();
|
||||
var vist = $("[for="+visd+"]").text();
|
||||
if (visd != localStorage.getItem("vis")) {
|
||||
Materialize.toast("デフォルトの公開設定を" + visd + "に設定しました。", 3000);
|
||||
Materialize.toast("デフォルトの公開設定を" + vist + "に設定しました。", 3000);
|
||||
}
|
||||
localStorage.setItem("vis", visd);
|
||||
|
||||
var popd = $("#popup").val();
|
||||
if (popd > 0 && popd != localStorage.getItem("popup")) {
|
||||
Materialize.toast("ポップアップお知らせを" + popd + "秒に設定しました。", 3000);
|
||||
|
@ -40,29 +51,39 @@ function settings() {
|
|||
Materialize.toast("ポップアップお知らせをオフに設定しました。", 3000);
|
||||
}
|
||||
localStorage.setItem("popup", popd);
|
||||
|
||||
var boxd = $("[name=box]:checked").val();
|
||||
var boxt = $("[for=b_"+boxd+"]").text();
|
||||
if (boxd != localStorage.getItem("box")) {
|
||||
Materialize.toast("デフォルトでボックスを隠すかを" + boxd + "に設定しました。", 3000);
|
||||
Materialize.toast("デフォルトでのボックスの挙動を" + boxt + "に設定しました。", 3000);
|
||||
}
|
||||
localStorage.setItem("box", boxd);
|
||||
|
||||
var gifd = $("[name=gif]:checked").val();
|
||||
var gift = $("[for=g_"+gifd+"]").text();
|
||||
if (gifd != localStorage.getItem("gif")) {
|
||||
Materialize.toast("アイコンアニメーション再生を" + gifd + "に設定しました。", 3000);
|
||||
Materialize.toast("アイコンアニメーション再生を" + gift + "に設定しました。", 3000);
|
||||
}
|
||||
localStorage.setItem("gif", gifd);
|
||||
|
||||
var sentd = $("#sentence").val();
|
||||
if (sentd != localStorage.getItem("sentence")) {
|
||||
Materialize.toast("指定行超過折りたたみを" + sentd + "行に設定しました。", 3000);
|
||||
var ltrd = $("#letters").val();
|
||||
if (sentd != localStorage.getItem("sentence") || ltrd != localStorage.getItem("letters")) {
|
||||
Materialize.toast(sentd + "行以上または"+ltrd+"文字以上でテキストを隠します。", 3000);
|
||||
}
|
||||
localStorage.setItem("sentence", sentd);
|
||||
localStorage.setItem("letters", ltrd);
|
||||
|
||||
var widthd = $("#width").val();
|
||||
if (widthd != localStorage.getItem("width")) {
|
||||
Materialize.toast("横幅最低を" + widthd + "pxに設定しました。", 3000);
|
||||
}
|
||||
localStorage.setItem("width", widthd);
|
||||
|
||||
var imgd = $("[name=img]:checked").val();
|
||||
var imgt = $("[for=i_"+imgd+"]").text();
|
||||
if (imgd != localStorage.getItem("img")) {
|
||||
Materialize.toast("画像投稿後の設定を" + imgd + "に設定しました。", 3000);
|
||||
Materialize.toast("画像投稿後の設定を「" + imgt + "」に設定しました。", 3000);
|
||||
}
|
||||
var sized = $("#size").val();
|
||||
if (sized != localStorage.getItem("size")) {
|
||||
|
@ -123,6 +144,11 @@ function load() {
|
|||
var sent = "500";
|
||||
}
|
||||
$("#sentence").val(sent);
|
||||
var ltrs = localStorage.getItem("letters");
|
||||
if (!ltrs) {
|
||||
var ltrs = "500";
|
||||
}
|
||||
$("#letters").val(ltrs);
|
||||
|
||||
var width = localStorage.getItem("width");
|
||||
if (!width) {
|
||||
|
|
|
@ -30,6 +30,8 @@ function cap(type, data) {
|
|||
return "List(id:" + data + ")"
|
||||
} else if (type == "notf") {
|
||||
return "Notification"
|
||||
} else if (type == "mix") {
|
||||
return "Integrated"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
18
app/main.js
18
app/main.js
|
@ -100,16 +100,14 @@ ipc.on('download-btn', (e, args) => {
|
|||
properties: ['openFile', 'createDirectory'],
|
||||
defaultPath: 'TheDesk-win32-x64.zip'
|
||||
}, (savedFiles) => {
|
||||
console.log();
|
||||
|
||||
console.log(savedFiles);
|
||||
|
||||
var m = savedFiles.match(/(.+)\\(.+)$/);
|
||||
try {
|
||||
if(isExistFile(savedFiles)){
|
||||
fs.statSync(savedFiles);
|
||||
fs.unlink(savedFiles);
|
||||
return true
|
||||
} catch(err) {
|
||||
if(err.code === 'ENOENT') return false
|
||||
}
|
||||
console.log(m[1]+":"+savedFiles)
|
||||
dl(m[1],savedFiles);
|
||||
});
|
||||
}else{
|
||||
|
@ -117,6 +115,14 @@ ipc.on('download-btn', (e, args) => {
|
|||
}
|
||||
|
||||
});
|
||||
function isExistFile(file) {
|
||||
try {
|
||||
fs.statSync(file);
|
||||
return true
|
||||
} catch(err) {
|
||||
if(err.code === 'ENOENT') return false
|
||||
}
|
||||
}
|
||||
function dl(files,fullname){
|
||||
console.log(files);
|
||||
mainWindow.webContents.send('comp', "ダウンロードを開始します。");
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "TheDesk",
|
||||
"version": "12.3.0",
|
||||
"version": "12.3.1",
|
||||
"description": "TheDesk on Mastodonはシンプルと多機能を両立したデスクトップ向けクライアントです",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
|
|
254
app/setting.html
254
app/setting.html
|
@ -1,17 +1,17 @@
|
|||
<!doctype html>
|
||||
<html lang="ja">
|
||||
<head>
|
||||
<title>Settings - TheDesk</title>
|
||||
<meta content="width=device-width,initial-scale=1.0" name="viewport">
|
||||
<link href="./css/materialize.css" type="text/css" rel="stylesheet">
|
||||
<link href="./css/master.css" type="text/css" rel="stylesheet">
|
||||
<link href="./css/auth.css" type="text/css" rel="stylesheet">
|
||||
<link href='./css/font-awesome.css' rel='stylesheet' type='text/css'>
|
||||
<link href='./css/tl.css' rel='stylesheet' type='text/css'>
|
||||
<link href='./css/userdata.css' rel='stylesheet' type='text/css'>
|
||||
<link href='./css/sort.css' rel='stylesheet' type='text/css'>
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons|Open+Sans:300" rel="stylesheet">
|
||||
<meta charset="utf-8">
|
||||
<title>Settings - TheDesk</title>
|
||||
<meta content="width=device-width,initial-scale=1.0" name="viewport">
|
||||
<link href="./css/materialize.css" type="text/css" rel="stylesheet">
|
||||
<link href="./css/master.css" type="text/css" rel="stylesheet">
|
||||
<link href="./css/auth.css" type="text/css" rel="stylesheet">
|
||||
<link href='./css/font-awesome.css' rel='stylesheet' type='text/css'>
|
||||
<link href='./css/tl.css' rel='stylesheet' type='text/css'>
|
||||
<link href='./css/userdata.css' rel='stylesheet' type='text/css'>
|
||||
<link href='./css/sort.css' rel='stylesheet' type='text/css'>
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons|Open+Sans:300" rel="stylesheet">
|
||||
<meta charset="utf-8">
|
||||
</head>
|
||||
<body id="mainView" style="overflow-y:scroll">
|
||||
<script type="text/javascript" src="./js/common/jquery.js"></script>
|
||||
|
@ -21,132 +21,166 @@
|
|||
<script type="text/javascript" src="./js/common/time.js"></script>
|
||||
<script type="text/javascript" src="./js/common/modal.js"></script>
|
||||
<script type="text/javascript" src="./js/ui/jquery-ui.min.js"></script>
|
||||
<div id="notf-box" class="hide"><div id="notifications">Notifications will be showed here...</div><button class="btn waves-effect orange more-hide" style="width:calc( 100% - 10px); padding:0;" onclick="notfToggle()">閉じる</button></div>
|
||||
<a href="acct.html" class="btn waves-effect blue nex" style="width:100%; max-width:400px;">アカウントマネージャー</a><br>
|
||||
<h5>カラム並べ替え</H5>
|
||||
<div id="notf-box" class="hide">
|
||||
<div id="notifications">Notifications will be showed here...</div>
|
||||
<button class="btn waves-effect orange more-hide" style="width:calc( 100% - 10px); padding:0;" onclick="notfToggle()">閉じる</button>
|
||||
</div>
|
||||
<a href="acct.html" class="btn waves-effect blue nex" style="width:100%; max-width:400px;">アカウントマネージャー</a>
|
||||
<br>
|
||||
<h5>カラム並べ替え
|
||||
</H5>
|
||||
<ul id="sort"></ul>
|
||||
<button onclick="sort()" class="btn waves-effect light-blue nex" style="width:100%; max-width:200px;">並べ替え設定</button><br><br><br>
|
||||
<h5>時間表記設定</h5>
|
||||
相対時間の例:"1分前","3日前"<br>
|
||||
絶対時間の例"23:25:21","2017年12月30日 23:59:00"<br>
|
||||
混合表示は、当日のトゥートのみ相対、それ以外は絶対で表示<br>
|
||||
<button onclick="sort()" class="btn waves-effect light-blue nex" style="width:100%; max-width:200px;">並べ替え設定</button>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<h5>時間表記設定</h5>相対時間の例:"1分前","3日前"
|
||||
<br>絶対時間の例"23:25:21","2017年12月30日 23:59:00"
|
||||
<br>混合表示は、当日のトゥートのみ相対、それ以外は絶対で表示
|
||||
<br>
|
||||
<input class="with-gap" name="time" type="radio" id="relative" value="relative" />
|
||||
<label for="relative">相対時間</label>
|
||||
<label for="relative">相対時間</label>
|
||||
<input class="with-gap" name="time" type="radio" id="absolute" value="absolute" />
|
||||
<label for="absolute">絶対時間</label>
|
||||
<label for="absolute">絶対時間</label>
|
||||
<input class="with-gap" name="time" type="radio" id="double" value="double" />
|
||||
<label for="double">両方表示</label>
|
||||
<label for="double">両方表示</label>
|
||||
<input class="with-gap" name="time" type="radio" id="medium" value="medium" />
|
||||
<label for="medium">混合表示</label>
|
||||
<br>
|
||||
|
||||
<h5>テーマの設定</h5>
|
||||
<label for="medium">混合表示</label>
|
||||
<br>
|
||||
<h5>テーマの設定</h5>
|
||||
<input class="with-gap" name="theme" type="radio" id="white" value="white" />
|
||||
<label for="white">白</label>
|
||||
<label for="white">白</label>
|
||||
<input class="with-gap" name="theme" type="radio" id="black" value="black" />
|
||||
<label for="black">黒</label><br>
|
||||
|
||||
<h5>非表示設定の画像を隠す</h5>
|
||||
きつめのぼかしがかかります。<br>
|
||||
<label for="black">黒</label>
|
||||
<br>
|
||||
<h5>非表示設定の画像を隠す</h5>きつめのぼかしがかかります。
|
||||
<br>
|
||||
<input class="with-gap" name="nsfw" type="radio" id="n_yes" value="yes" />
|
||||
<label for="n_yes">はい</label>
|
||||
<label for="n_yes">はい</label>
|
||||
<input class="with-gap" name="nsfw" type="radio" id="n_no" value="no" />
|
||||
<label for="n_no">いいえ</label><br>
|
||||
|
||||
<h5>非表示設定のテキストを隠す</h5>
|
||||
<label for="n_no">いいえ</label>
|
||||
<br>
|
||||
<h5>非表示設定のテキストを隠す</h5>
|
||||
<input class="with-gap" name="cw" type="radio" id="c_yes" value="yes" />
|
||||
<label for="c_yes">はい</label>
|
||||
<label for="c_yes">はい</label>
|
||||
<input class="with-gap" name="cw" type="radio" id="c_no" value="no" />
|
||||
<label for="c_no">いいえ</label><br>
|
||||
|
||||
<h5>デフォルトの警告文</h5>
|
||||
<input type="text" style="width:150px" id="cw-text"><br>
|
||||
|
||||
<h5>デフォルトの公開設定</h5>
|
||||
<label for="c_no">いいえ</label>
|
||||
<br>
|
||||
<h5>デフォルトの警告文</h5>
|
||||
<input type="text" style="width:150px" id="cw-text">
|
||||
<br>
|
||||
<h5>デフォルトの公開設定</h5>
|
||||
<input class="with-gap" name="vis" type="radio" id="public" value="public" />
|
||||
<label for="public">公開(Public)</label>
|
||||
<label for="public">公開(Public)</label>
|
||||
<input class="with-gap" name="vis" type="radio" id="unlisted" value="unlisted" />
|
||||
<label for="unlisted">未収載(Unlisted)</label>
|
||||
<label for="unlisted">未収載(Unlisted)</label>
|
||||
<input class="with-gap" name="vis" type="radio" id="private" value="private" />
|
||||
<label for="private">非公開(Private)</label>
|
||||
<label for="private">非公開(Private)</label>
|
||||
<input class="with-gap" name="vis" type="radio" id="direct" value="direct" />
|
||||
<label for="direct">ダイレクト(Direct)</label>
|
||||
<label for="direct">ダイレクト(Direct)</label>
|
||||
<input class="with-gap" name="vis" type="radio" id="memory" value="memory" />
|
||||
<label for="memory">前回の投稿設定を記憶する</label><br>
|
||||
|
||||
<h5>デフォルトでボックスを隠す(起動時・トゥート後)</h5>
|
||||
<label for="memory">前回の投稿設定を記憶する</label>
|
||||
<br>
|
||||
<h5>デフォルトでのボックスの挙動(起動時・トゥート後)</h5>
|
||||
<input class="with-gap" name="box" type="radio" id="b_yes" value="yes" />
|
||||
<label for="b_yes">はい</label>
|
||||
<label for="b_yes">隠す</label>
|
||||
<input class="with-gap" name="box" type="radio" id="b_hide" value="hide" />
|
||||
<label for="b_hide">最小化</label>
|
||||
<input class="with-gap" name="box" type="radio" id="b_no" value="no" />
|
||||
<label for="b_no">いいえ</label><br>
|
||||
|
||||
<h5>アイコンのアニメーションを再生する</h5>
|
||||
<label for="b_no">何もしない</label>
|
||||
<br>
|
||||
<h5>アイコンのアニメーションを再生する</h5>
|
||||
<input class="with-gap" name="gif" type="radio" id="g_yes" value="yes" />
|
||||
<label for="g_yes">はい</label>
|
||||
<label for="g_yes">はい</label>
|
||||
<input class="with-gap" name="gif" type="radio" id="g_no" value="no" />
|
||||
<label for="g_no">いいえ</label><br>
|
||||
|
||||
<h5>新規通知のポップアップお知らせの表示秒数</h5>
|
||||
0に設定すると表示されません<br>
|
||||
<input type="text" style="width:50px" id="popup">秒<br>
|
||||
|
||||
<h5>指定行数以上を折りたたむ</h5>
|
||||
5文字以下のトゥートは折りたたみません。また、折りたたみ時は改行が描画されません。<br>
|
||||
<input type="text" style="width:50px" id="sentence">行以上<br>
|
||||
|
||||
<h5>マルチカラムの最低横幅</h5>
|
||||
画面全体の横幅÷コラム数がこの値を超えた時、横スクロールとなります。<br>
|
||||
<input type="text" style="width:50px" id="width">px以上<br>
|
||||
|
||||
<label for="g_no">いいえ</label>
|
||||
<br>
|
||||
<h5>新規通知のポップアップお知らせの表示秒数</h5>0に設定すると表示されません
|
||||
<br>
|
||||
<input type="text" style="width:50px" id="popup">秒
|
||||
<br>
|
||||
<h5>指定行数以上を折りたたむ</h5>5文字以下のトゥートは折りたたみません。また、折りたたみ時は改行が描画されません。
|
||||
<br>
|
||||
<input type="text" style="width:50px" id="sentence">行以上または
|
||||
<input type="text" style="width:50px" id="letters">文字以上
|
||||
<br>
|
||||
<h5>マルチカラムの最低横幅</h5>画面全体の横幅÷コラム数がこの値を超えた時、横スクロールとなります。
|
||||
<br>
|
||||
<input type="text" style="width:50px" id="width">px以上
|
||||
<br>
|
||||
<h5>フォントサイズ</h5>
|
||||
<span style="font-size:15px">15px(絶対指定)</span><br>
|
||||
<input type="text" style="width:50px" id="size">px<br>
|
||||
|
||||
<span style="font-size:15px">15px(絶対指定)</span>
|
||||
<br>
|
||||
<input type="text" style="width:50px" id="size">px
|
||||
<br>
|
||||
<h5>画像投稿設定</h5>
|
||||
<input class="with-gap" name="img" type="radio" id="i_url" value="url" />
|
||||
<label for="i_url">画像を投稿し、画像のURLを最後に表示</label>
|
||||
<label for="i_url">画像を投稿し、画像のURLを最後に表示</label>
|
||||
<input class="with-gap" name="img" type="radio" id="i_no-act" value="no-act" />
|
||||
<label for="i_no-act">画像を投稿するがURLは表示しない</label><br>
|
||||
<label for="i_no-act">画像を投稿するがURLは表示しない</label>
|
||||
<br>
|
||||
<input class="with-gap" name="img" type="radio" id="i_inline" value="inline" disabled />
|
||||
<label for="i_inline">現在利用できません。<!--画像を投稿し、インラインで表示(Markdownに対応したインスタンスのみ。マルチアカウント環境では非推奨。)--></label>
|
||||
<label for="i_inline">現在利用できません。
|
||||
<!--画像を投稿し、インラインで表示(Markdownに対応したインスタンスのみ。マルチアカウント環境では非推奨。)-->
|
||||
</label>
|
||||
<br>
|
||||
<button class="btn waves-effect" style="width:100%; max-width:200px;" onclick="settings()">設定</button>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<a href="index.html" class="btn waves-effect orange nex" style="width:100%; max-width:200px;">戻る</a>
|
||||
<br>
|
||||
<br>キーボードショートカット一覧
|
||||
</li>
|
||||
<li>N:投稿パネルを開く
|
||||
</li>
|
||||
<li>X:投稿パネルを開閉
|
||||
</li>
|
||||
<li>Ctrl+Enter:投稿
|
||||
</li>
|
||||
<li>Esc:投稿パネルを消す
|
||||
</li>
|
||||
<li>F5:スーパーリロード
|
||||
</li>
|
||||
<li>E:投稿パネルの幅を切り替え
|
||||
</li>
|
||||
<li>Shift+C:入力内容を消す
|
||||
</li>
|
||||
<li>←/→:イメージビューワー起動時に画像切り替え
|
||||
</li>
|
||||
<li>マウスホイール:イメージビューワー時に拡大縮小
|
||||
</li>以下Markdownに対応したインスタンスのみ。
|
||||
<br>
|
||||
<li>Ctrl+B/I/S/U:太字/斜字/取り消し/下線
|
||||
</li>
|
||||
<li>Shift+Enter:全角スペースを入れて改行
|
||||
</li>
|
||||
<li>Shift+Space:ゼロ幅スペース
|
||||
</li>以下アスタルテにログインしている場合のみ
|
||||
<br>
|
||||
<li>Ctrl+R:
|
||||
<a href="https://astarte.thedesk.top">アスタルテ暇人ランキング</a>を開く
|
||||
</li>
|
||||
<br>
|
||||
<button class="btn waves-effect red" style="width:100%; max-width:500px;" onclick="if(confirm('初期化します')){ localStorage.clear(); location.href='index.html'; }">初期化</button>
|
||||
<br>
|
||||
<button class="btn waves-effect indigo" onclick="about()" style="width:100%; max-width:500px;">このソフトについて</button>
|
||||
<br>
|
||||
<a href="https://thedesk.top" class="btn waves-effect deep-purple lighten-2" style="width:100%; max-width:500px;">公式HP</a>
|
||||
<br>
|
||||
<a href="https://enty.jp/Cutls" class="btn waves-effect purple lighten-2" style="width:100%; max-width:500px;">寄付(Enty)</a>
|
||||
<br>
|
||||
<a href="https://github.com/cutls/TheDesk" class="btn waves-effect black lighten-2" style="width:100%; max-width:500px;">GitHub</a>
|
||||
<br>
|
||||
<a href="index.html?mode=open&code=12336" class="btn waves-effect blue lighten-2" style="width:100%; max-width:500px;">Developer: Cutls@kirishima.cloud</a>
|
||||
<br>
|
||||
<span style="font-family:Open Sans;">Copyright © TheDesk on Mastodon 2018 & Cutls.com 2015 All Rights Reserved.
|
||||
<a href="https://github.com/cutls/TheDesk/blob/master/LICENSE.md">TheDesk LICENSE (Latest Ver.)</a>
|
||||
<br>Developer: Cutls P(
|
||||
<a href="index.html?mode=open&code=12336">@Cutls@kirishima.cloud</a>)
|
||||
<br>
|
||||
|
||||
|
||||
<button class="btn waves-effect" style="width:100%; max-width:200px;" onclick="settings()">設定</button><br>
|
||||
<br>
|
||||
<br><br>
|
||||
<a href="index.html" class="btn waves-effect orange nex" style="width:100%; max-width:200px;">戻る</a><br>
|
||||
<br>
|
||||
キーボードショートカット一覧</li>
|
||||
<li>N:投稿パネルを開く</li>
|
||||
<li>X:投稿パネルを開閉</li>
|
||||
<li>Ctrl+Enter:投稿</li>
|
||||
<li>Esc:投稿パネルを消す</li>
|
||||
<li>F5:スーパーリロード</li>
|
||||
<li>E:投稿パネルの幅を切り替え</li>
|
||||
<li>Shift+C:入力内容を消す</li>
|
||||
<li>←/→:イメージビューワー起動時に画像切り替え</li>
|
||||
<li>マウスホイール:イメージビューワー時に拡大縮小</li>
|
||||
以下Markdownに対応したインスタンスのみ。<br>
|
||||
<li>Ctrl+B/I/S/U:太字/斜字/取り消し/下線</li>
|
||||
<li>Shift+Enter:全角スペースを入れて改行</li>
|
||||
<li>Shift+Space:ゼロ幅スペース</li>
|
||||
以下アスタルテにログインしている場合のみ<br>
|
||||
<li>Ctrl+R:<a href="https://astarte.thedesk.top">アスタルテ暇人ランキング</a>を開く</li>
|
||||
<br>
|
||||
<button class="btn waves-effect red" style="width:100%; max-width:500px;" onclick="if(confirm('初期化します')){ localStorage.clear(); location.href='index.html'; }">初期化</button><br>
|
||||
<button class="btn waves-effect indigo" onclick="about()" style="width:100%; max-width:500px;">このソフトについて</button><br>
|
||||
<a href="https://thedesk.top" class="btn waves-effect deep-purple lighten-2" style="width:100%; max-width:500px;">公式HP</a><br>
|
||||
<a href="https://enty.jp/Cutls" class="btn waves-effect purple lighten-2" style="width:100%; max-width:500px;">寄付(Enty)</a><br>
|
||||
<a href="https://github.com/cutls/TheDesk" class="btn waves-effect black lighten-2" style="width:100%; max-width:500px;">GitHub</a><br>
|
||||
<a href="index.html?mode=open&code=12336" class="btn waves-effect blue lighten-2" style="width:100%; max-width:500px;">Developer: Cutls@kirishima.cloud</a>
|
||||
<br>
|
||||
|
||||
<span style="font-family:Open Sans;">
|
||||
Copyright © TheDesk on Mastodon 2018 & Cutls.com 2015 All Rights Reserved. <a href="https://github.com/cutls/TheDesk/blob/master/LICENSE.md">TheDesk LICENSE (Latest Ver.)</a><br>
|
||||
Developer: Cutls P(<a href="index.html?mode=open&code=12336">@Cutls@kirishima.cloud</a>)<br>
|
||||
</span>
|
||||
|
||||
<script type="text/javascript" src="./js/common/about.js"></script>
|
||||
<script type="text/javascript" src="./js/platform/end.js"></script>
|
||||
<script type="text/javascript" src="./js/login/logout.js"></script>
|
||||
|
|
Loading…
Reference in New Issue
Block a user