TheDesk Riina (ver.4)
This commit is contained in:
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user