More prettier

This commit is contained in:
Cutls 2019-05-19 16:39:30 +09:00
parent de6e9c6f11
commit 06eb347cf8
101 changed files with 20094 additions and 16766 deletions

View File

@ -1,17 +1,18 @@
# TheDesk # TheDesk
TheDesk Minami (19)はVueで書き直します(rewrite-vueブランチ参照)。18までのバージョンはTheDesk Kawaii (20)以降で継続します。 TheDesk Minami (19)はVueで書き直します(rewrite-vueブランチ参照)。18までのバージョンはTheDesk Kawaii (20)(仮称)以降で継続します。
[![Build Status](https://travis-ci.org/cutls/TheDesk.svg?branch=master)](https://travis-ci.org/cutls/TheDesk) [![Build Status](https://travis-ci.org/cutls/TheDesk.svg?branch=master)](https://travis-ci.org/cutls/TheDesk)
[![Crowdin](https://d322cqt584bo4o.cloudfront.net/thedesk/localized.svg)](https://translate.thedesk.top/project/thedesk) [![Crowdin](https://d322cqt584bo4o.cloudfront.net/thedesk/localized.svg)](https://translate.thedesk.top/project/thedesk)
[![code style: prettier](https://flat.badgen.net/badge/code%20style/prettier/pink)](https://github.com/prettier/prettier)
[![PRs Welcome](https://flat.badgen.net/badge/PRs/welcome/green)](https://github.com/cutls/TheDesk/pulls)
[![Version](https://flat.badgen.net/github/release/cutls/TheDesk)](https://github.com/cutls/TheDesk/releases)
[![Download](https://flat.badgen.net/github/assets-dl/cutls/TheDesk)](https://github.com/cutls/TheDesk/releases)
![Contributors](https://flat.badgen.net/github/contributors/cutls/TheDesk)
Mastodon/Misskey client for PC(Windows/Linux/macOS) Mastodon/Misskey client for PC(Windows/Linux/macOS)
オープンソースSNSマストドン/MisskeyのWindows/Linuxクライアント オープンソースSNSマストドン/MisskeyのWindows/Linuxクライアント
Download:[TheDesk](https://thedesk.top) Download:[TheDesk](https://thedesk.top)
Contact me(bug report...):GitHub Issues, mention to [Cutls@kirishima.cloud](https://kirishima.cloud/@Cutls) or toot with #Desk
バグレポートなど:GitHub Issuesや[Cutls@kirishima.cloud](https://kirishima.cloud/@Cutls)へのリプ,または#Deskでトゥートして下さい.
### Contribute/コントリビュート ### Contribute/コントリビュート
Please make a pull request to ***WIP(before CI)*** brunch Please make a pull request to ***WIP(before CI)*** brunch

View File

@ -1,115 +1,124 @@
<!doctype html> <!doctype html>
<html lang="ja"> <html lang="ja">
<head> <head>
<title>TheDesk</title> <title>TheDesk</title>
<meta content="width=device-width,initial-scale=1.0" name="viewport"> <meta content="width=device-width,initial-scale=1.0" name="viewport">
<link href="./css/materialize.css" type="text/css" rel="stylesheet"> <link href="./css/materialize.css" type="text/css" rel="stylesheet">
<link href='./css/font-awesome.css' rel='stylesheet' type='text/css'> <link href='./css/font-awesome.css' rel='stylesheet' type='text/css'>
<link href="./css/themes.css" type="text/css" rel="stylesheet"> <link href="./css/themes.css" type="text/css" rel="stylesheet">
<link href="./css/master.css" type="text/css" rel="stylesheet"> <link href="./css/master.css" type="text/css" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons|Open+Sans:300|Baloo+Bhai" rel="stylesheet"> <link href="https://fonts.googleapis.com/icon?family=Material+Icons|Open+Sans:300|Baloo+Bhai" rel="stylesheet">
<meta charset="utf-8"> <meta charset="utf-8">
<style> <style>
body{ body {
font-family:'Open Sans'; font-family: 'Open Sans';
-webkit-app-region: drag; -webkit-app-region: drag;
cursor: move; cursor: move;
} }
a,button{
-webkit-app-region: no-drag;
}
.container {
width: 100%;
display: grid;
grid-template-columns: 1fr 1fr;
grid-template-rows: 1fr 1fr 1fr 1fr 1fr;
grid-template-areas: 'name1 data1' 'name2 data2' 'name3 data3' 'name4 data4' 'name5 data5';
text-align:left;
margin:5px;
}
.area-name1 { a,
grid-area: name1; button {
} -webkit-app-region: no-drag;
}
.area-data1 { .container {
grid-area: data1; width: 100%;
} display: grid;
grid-template-columns: 1fr 1fr;
grid-template-rows: 1fr 1fr 1fr 1fr 1fr;
grid-template-areas: 'name1 data1''name2 data2''name3 data3''name4 data4''name5 data5';
text-align: left;
margin: 5px;
}
.area-name2 { .area-name1 {
grid-area: name2; grid-area: name1;
} }
.area-data2 { .area-data1 {
grid-area: data2; grid-area: data1;
} }
.area-name3 { .area-name2 {
grid-area: name3; grid-area: name2;
} }
.area-data3 { .area-data2 {
grid-area: data3; grid-area: data2;
} }
.area-name4 { .area-name3 {
grid-area: name4; grid-area: name3;
} }
.area-data4 { .area-data3 {
grid-area: data4; grid-area: data3;
} }
.area-name5 { .area-name4 {
grid-area: name5; grid-area: name4;
} }
.area-data5 { .area-data4 {
grid-area: data5; grid-area: data4;
} }
</style>
.area-name5 {
grid-area: name5;
}
.area-data5 {
grid-area: data5;
}
</style>
</head> </head>
<body class="center " style="overflow:hidden"> <body class="center " style="overflow:hidden">
<script type="text/javascript" src="./js/common/jquery.js"></script> <script type="text/javascript" src="./js/common/jquery.js"></script>
<script type="text/javascript" src="./js/platform/first-not-view.js"></script> <script type="text/javascript" src="./js/platform/first-not-view.js"></script>
<script type="text/javascript" src="./js/common/materialize.js"></script> <script type="text/javascript" src="./js/common/materialize.js"></script>
<img src="./img/desk.png" style="max-width:70%;"> <img src="./img/desk.png" style="max-width:70%;">
<h5>TheDesk</h5> <h5>TheDesk</h5>
<div class='container'> <div class='container'>
<div class='area-name1'>Display version</div> <div class='area-name1'>Display version</div>
<div class='area-data1' id="now"></div> <div class='area-data1' id="now"></div>
<div class='area-name2'>Internal version</div> <div class='area-name2'>Internal version</div>
<div class='area-data2' id="ver"></div> <div class='area-data2' id="ver"></div>
<div class='area-name3'>Chromium</div> <div class='area-name3'>Chromium</div>
<div class='area-data3' id="chrome"></div> <div class='area-data3' id="chrome"></div>
<div class='area-name4'>Electron</div> <div class='area-name4'>Electron</div>
<div class='area-data4' id="electron"></div> <div class='area-data4' id="electron"></div>
<div class='area-name5'>Node.js</div> <div class='area-name5'>Node.js</div>
<div class='area-data5' id="node"></div> <div class='area-data5' id="node"></div>
</div> </div>
<div class="cp">Copyright &copy; TheDesk 2018<br> <div class="cp">Copyright &copy; TheDesk 2018<br>
Main developer(author): <a href="https://cutls.com/@Cutls" target="_blank">Cutls P</a><br> Main developer(author): <a href="https://cutls.com/@Cutls" target="_blank">Cutls P</a><br>
Thanks:<a href="https://minohdon.jp/@toneji" target="_blank">toneji</a>/<a href="https://popon.pptdn.jp/@popn_ja" target="_blank">popn_ja</a>/<a href="https://pawoo.net/@kPherox" target="_blank">kPherox</a> and all users Thanks:<a href="https://minohdon.jp/@toneji" target="_blank">toneji</a>/<a
<img draggable="false" style="width:0.8rem;top: 1px;margin-left: 1px;position: relative;" alt="❤️" title=":heart:" src="https://twemoji.maxcdn.com/2/72x72/2764.png"> href="https://popon.pptdn.jp/@popn_ja" target="_blank">popn_ja</a>/<a href="https://pawoo.net/@kPherox"
<br><a href="https://thedesk.top" target="_blank">Web site</a></div> target="_blank">kPherox</a> and all users
<button onclick="window.close()" class="btn waves-effect indigo" style="width:calc(100% - 10px);"><i class="material-icons left">close</i>Close</button> <img draggable="false" style="width:0.8rem;top: 1px;margin-left: 1px;position: relative;" alt="❤️"
<script type="text/javascript" src="./js/ui/theme.js"></script> title=":heart:" src="https://twemoji.maxcdn.com/2/72x72/2764.png">
<script> <br><a href="https://thedesk.top" target="_blank">Web site</a></div>
$("#now").text(localStorage.getItem("ver")); <button onclick="window.close()" class="btn waves-effect indigo" style="width:calc(100% - 10px);"><i
var electron = require("electron"); class="material-icons left">close</i>Close</button>
var remote=electron.remote; <script type="text/javascript" src="./js/ui/theme.js"></script>
const shell=electron.shell; <script>
$("#node").text(process.version); $("#now").text(localStorage.getItem("ver"));
$("#chrome").text(process.versions.chrome); var electron = require("electron");
$("#electron").text(process.versions.electron); var remote = electron.remote;
if(location.search){ const shell = electron.shell;
var m = location.search.match(/\?ver=([a-zA-Z-0-9.]+)/); $("#node").text(process.version);
var ver=m[1]; $("#chrome").text(process.versions.chrome);
$("#ver").text(ver); $("#electron").text(process.versions.electron);
} if (location.search) {
$(document).on('click', 'a', e => { var m = location.search.match(/\?ver=([a-zA-Z-0-9.]+)/);
var url = $(e.target).attr('href'); var ver = m[1];
shell.openExternal(url); $("#ver").text(ver);
return false; }
}); $(document).on('click', 'a', e => {
</script> var url = $(e.target).attr('href');
shell.openExternal(url);
return false;
});
</script>

View File

@ -1,259 +1,267 @@
<!doctype html> <!doctype html>
<html lang="ja"> <html lang="ja">
<head> <head>
<title>Adobe Photo Editor - TheDesk</title> <title>Adobe Photo Editor - TheDesk</title>
<meta content="width=device-width,initial-scale=1.0" name="viewport"> <meta content="width=device-width,initial-scale=1.0" name="viewport">
<link href="./css/materialize.css" type="text/css" rel="stylesheet"> <link href="./css/materialize.css" type="text/css" rel="stylesheet">
<link href="./css/themes.css" type="text/css" rel="stylesheet"> <link href="./css/themes.css" type="text/css" rel="stylesheet">
<link href="./css/master.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/auth.css" type="text/css" rel="stylesheet">
<link href='./css/font-awesome.css' rel='stylesheet' type='text/css'> <link href='./css/font-awesome.css' rel='stylesheet' type='text/css'>
<link href='./css/tl.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/userdata.css' rel='stylesheet' type='text/css'>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons|Open+Sans:300" rel="stylesheet"> <link href="https://fonts.googleapis.com/icon?family=Material+Icons|Open+Sans:300" rel="stylesheet">
<style> <style>
#cb-drag { #cb-drag {
margin-bottom: 8px; margin-bottom: 8px;
padding: 24px 0; padding: 24px 0;
text-align: center; text-align: center;
}
#cb-drag p {
font-weight: bold;
text-align: center;
}
#cb-file {
cursor: pointer;
}
#cb-display {
margin-bottom: 0;
}
#cb-display p {
margin-top: 8px;
margin-bottom: 0;
line-height: 1.4;
}
.cb-div {
padding: 16px;
margin-bottom: 8px;
}
.cb-image {
cursor: pointer;
}
</style>
<meta charset="utf-8">
</head>
<body id="mainView">
<script type="text/javascript" src="./js/common/jquery.js"></script>
<script type="text/javascript" src="./js/platform/first-not-view.js"></script>
<script type="text/javascript" src="./js/common/materialize.js"></script>
<script type="text/javascript" src="./js/ui/tips.js"></script>
<script type="text/javascript" src="./js/common/time.js"></script>
<script type="text/javascript" src="./js/common/modal.js"></script>
<div>
<div id="cb-drag">
<p>ここに画像ファイルをドラッグし、画像をクリックしてください。</p>
<input type="file" id="cb-file">
</div>
<div id="cb-display"></div>
</div>
<script type="text/javascript" src="https://dme0ih8comzn4.cloudfront.net/imaging/v2/editor.js"></script>
<script type="text/javascript">
var dragAndDrop = (function (window, document) {
"use strict";
var drag = document.getElementById("mainView");
var disp = document.getElementById("cb-display");
var file = document.getElementById("cb-file");
function makeView(data) {
var div, img, customEvent;
var metaData = "<p>■ファイル名: <b>" + data.name + "</b><br>■容量: <b>" + data.size + "</b>バイト</p>";
div = document.createElement("div");
div.setAttribute("class", "cb-div");
img = document.createElement("img");
img.src = data.url;
img.setAttribute("class", "cb-image");
img.style.maxWidth = "100%";
img.style.height = "auto";
div.appendChild(img);
img.insertAdjacentHTML("afterend", metaData);
disp.appendChild(div);
customEvent = document.createEvent("HTMLEvents");
customEvent.initEvent("makeView", true, false);
div.dispatchEvent(customEvent);
}
function readImage(e) {
var f = (e.dataTransfer) ? e.dataTransfer.files : e.target.files;
for (var i = 0, l = f.length; i < l; i++) {
var reader = new FileReader();
reader.onload = (function (f) {
var imageData = {};
return function (evt) {
if (f.type === "image/gif" || f.type === "image/png" || f.type === "image/jpeg") {
imageData.type = f.type;
imageData.name = f.name;
imageData.size = f.size;
imageData.date = f.lastModifiedDate.toLocaleDateString();
imageData.url = evt.target.result;
makeView(imageData);
} else {
return;
}
};
})(f[i]);
reader.readAsDataURL(f[i]);
}
}
function dragFiles() {
drag.addEventListener("drop", function (e) {
e.stopPropagation();
e.preventDefault();
readImage(e);
}, false);
drag.addEventListener("dragover", function (e) {
e.stopPropagation();
e.preventDefault();
}, false);
}
function uploadFiles() {
file.addEventListener("change", function(e) {
readImage(e);
}, false);
}
return {
init: function () {
dragFiles();
uploadFiles();
}
};
})(this, this.document);
var photoEditor = (function (window, document) {
"use strict";
var featherEditor = new Aviary.Feather({
apiKey: "ffee425017ab44b18ce95dab98a5cdc1",
onSave: function(imageID, newURL) {
var img1 = document.getElementById(imageID);
img1.src = newURL;
var electron = require("electron");
var ipc = electron.ipcRenderer;
ipc.send('bmp-image', [newURL,0]);
window.close();
}
});
function clearImage() {
this.parentNode.style.display = "none";
}
function launchEditor(id, src) {
featherEditor.launch({
image: id,
url: src
});
return false;
}
function editPhoto() {
var id = this.getAttribute("id");
var src = this.getAttribute("src");
launchEditor(id, src);
}
function makeButton() {
var button = document.createElement("button");
button.setAttribute("style",
"width: 64px;"
+ " line-height: 24px;"
+ " background-color: #37474F;"
+ " color: #fff;"
+ " border: none;"
+ " cursor: pointer;"
+ " border-radius: 2px;"
+ " font-size: 14px;"
+ " position: absolute;"
+ " text-align: center;"
+ " top: 16px;"
+ " right: 8px;"
+ " padding: 0;"
+ " z-index: 1000;"
);
button.innerHTML = "削除";
return button;
}
function listener() {
var disp = document.getElementById("cb-display");
disp.addEventListener("makeView", function () {
var image = document.querySelectorAll(".cb-image");
var button = [];
for (var i = 0, l = image.length; i < l; i++) {
button[i] = makeButton();
image[i].setAttribute("id", "cb-image_" + i);
image[i].parentNode.style.position = "relative";
image[i].parentNode.appendChild(button[i]);
button[i].addEventListener("click", clearImage, false);
image[i].addEventListener("click", editPhoto, false);
} }
}, false); #cb-drag p {
font-weight: bold;
text-align: center;
}
} #cb-file {
cursor: pointer;
}
return { #cb-display {
init: function () { margin-bottom: 0;
listener(); }
}
};
})(this, this.document); #cb-display p {
margin-top: 8px;
margin-bottom: 0;
line-height: 1.4;
}
dragAndDrop.init(); .cb-div {
photoEditor.init(); padding: 16px;
</script> margin-bottom: 8px;
}
<script type="text/javascript" src="./js/ui/theme.js"></script> .cb-image {
<script type="text/javascript" src="./js/platform/end.js"></script> cursor: pointer;
}
</style>
<meta charset="utf-8">
</head>
<body id="mainView">
<script type="text/javascript" src="./js/common/jquery.js"></script>
<script type="text/javascript" src="./js/platform/first-not-view.js"></script>
<script type="text/javascript" src="./js/common/materialize.js"></script>
<script type="text/javascript" src="./js/ui/tips.js"></script>
<script type="text/javascript" src="./js/common/time.js"></script>
<script type="text/javascript" src="./js/common/modal.js"></script>
<div>
<div id="cb-drag">
<p>ここに画像ファイルをドラッグし、画像をクリックしてください。</p>
<input type="file" id="cb-file">
</div>
<div id="cb-display"></div>
</div>
<script type="text/javascript" src="https://dme0ih8comzn4.cloudfront.net/imaging/v2/editor.js"></script>
<script type="text/javascript">
var dragAndDrop = (function (window, document) {
"use strict";
var drag = document.getElementById("mainView");
var disp = document.getElementById("cb-display");
var file = document.getElementById("cb-file");
function makeView(data) {
var div, img, customEvent;
var metaData = "<p>■ファイル名: <b>" + data.name + "</b><br>■容量: <b>" + data.size + "</b>バイト</p>";
div = document.createElement("div");
div.setAttribute("class", "cb-div");
img = document.createElement("img");
img.src = data.url;
img.setAttribute("class", "cb-image");
img.style.maxWidth = "100%";
img.style.height = "auto";
div.appendChild(img);
img.insertAdjacentHTML("afterend", metaData);
disp.appendChild(div);
customEvent = document.createEvent("HTMLEvents");
customEvent.initEvent("makeView", true, false);
div.dispatchEvent(customEvent);
}
function readImage(e) {
var f = (e.dataTransfer) ? e.dataTransfer.files : e.target.files;
for (var i = 0, l = f.length; i < l; i++) {
var reader = new FileReader();
reader.onload = (function (f) {
var imageData = {};
return function (evt) {
if (f.type === "image/gif" || f.type === "image/png" || f.type === "image/jpeg") {
imageData.type = f.type;
imageData.name = f.name;
imageData.size = f.size;
imageData.date = f.lastModifiedDate.toLocaleDateString();
imageData.url = evt.target.result;
makeView(imageData);
} else {
return;
}
};
})(f[i]);
reader.readAsDataURL(f[i]);
}
}
function dragFiles() {
drag.addEventListener("drop", function (e) {
e.stopPropagation();
e.preventDefault();
readImage(e);
}, false);
drag.addEventListener("dragover", function (e) {
e.stopPropagation();
e.preventDefault();
}, false);
}
function uploadFiles() {
file.addEventListener("change", function (e) {
readImage(e);
}, false);
}
return {
init: function () {
dragFiles();
uploadFiles();
}
};
})(this, this.document);
var photoEditor = (function (window, document) {
"use strict";
var featherEditor = new Aviary.Feather({
apiKey: "ffee425017ab44b18ce95dab98a5cdc1",
onSave: function (imageID, newURL) {
var img1 = document.getElementById(imageID);
img1.src = newURL;
var electron = require("electron");
var ipc = electron.ipcRenderer;
ipc.send('bmp-image', [newURL, 0]);
window.close();
}
});
function clearImage() {
this.parentNode.style.display = "none";
}
function launchEditor(id, src) {
featherEditor.launch({
image: id,
url: src
});
return false;
}
function editPhoto() {
var id = this.getAttribute("id");
var src = this.getAttribute("src");
launchEditor(id, src);
}
function makeButton() {
var button = document.createElement("button");
button.setAttribute("style",
"width: 64px;"
+ " line-height: 24px;"
+ " background-color: #37474F;"
+ " color: #fff;"
+ " border: none;"
+ " cursor: pointer;"
+ " border-radius: 2px;"
+ " font-size: 14px;"
+ " position: absolute;"
+ " text-align: center;"
+ " top: 16px;"
+ " right: 8px;"
+ " padding: 0;"
+ " z-index: 1000;"
);
button.innerHTML = "削除";
return button;
}
function listener() {
var disp = document.getElementById("cb-display");
disp.addEventListener("makeView", function () {
var image = document.querySelectorAll(".cb-image");
var button = [];
for (var i = 0, l = image.length; i < l; i++) {
button[i] = makeButton();
image[i].setAttribute("id", "cb-image_" + i);
image[i].parentNode.style.position = "relative";
image[i].parentNode.appendChild(button[i]);
button[i].addEventListener("click", clearImage, false);
image[i].addEventListener("click", editPhoto, false);
}
}, false);
}
return {
init: function () {
listener();
}
};
})(this, this.document);
dragAndDrop.init();
photoEditor.init();
</script>
<script type="text/javascript" src="./js/ui/theme.js"></script>
<script type="text/javascript" src="./js/platform/end.js"></script>
</body> </body>
</html> </html>

View File

@ -1,2 +1,4 @@
/*このソフトについてを押した時に読み込まれます*/ /*このソフトについてを押した時に読み込まれます*/
body{font-family:Open Sans;} body {
font-family: Open Sans;
}

View File

@ -5,9 +5,15 @@
/* FONT PATH /* FONT PATH
* -------------------------- */ * -------------------------- */
@font-face { @font-face {
font-family: 'FontAwesome'; font-family: "FontAwesome";
src: url('../fonts/fontawesome-webfont.eot?v=4.7.0'); src: url("../fonts/fontawesome-webfont.eot?v=4.7.0");
src: url('../fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'), url('../fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'), url('../fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'), url('../fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'), url('../fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg'); src: url("../fonts/fontawesome-webfont.eot?#iefix&v=4.7.0")
format("embedded-opentype"),
url("../fonts/fontawesome-webfont.woff2?v=4.7.0") format("woff2"),
url("../fonts/fontawesome-webfont.woff?v=4.7.0") format("woff"),
url("../fonts/fontawesome-webfont.ttf?v=4.7.0") format("truetype"),
url("../fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular")
format("svg");
font-weight: normal; font-weight: normal;
font-style: normal; font-style: normal;
} }
@ -60,9 +66,9 @@
left: -1.85714286em; left: -1.85714286em;
} }
.fa-border { .fa-border {
padding: .2em .25em .15em; padding: 0.2em 0.25em 0.15em;
border: solid 0.08em #eeeeee; border: solid 0.08em #eeeeee;
border-radius: .1em; border-radius: 0.1em;
} }
.fa-pull-left { .fa-pull-left {
float: left; float: left;
@ -71,10 +77,10 @@
float: right; float: right;
} }
.fa.fa-pull-left { .fa.fa-pull-left {
margin-right: .3em; margin-right: 0.3em;
} }
.fa.fa-pull-right { .fa.fa-pull-right {
margin-left: .3em; margin-left: 0.3em;
} }
/* Deprecated as of 4.4.0 */ /* Deprecated as of 4.4.0 */
.pull-right { .pull-right {
@ -84,10 +90,10 @@
float: left; float: left;
} }
.fa.pull-left { .fa.pull-left {
margin-right: .3em; margin-right: 0.3em;
} }
.fa.pull-right { .fa.pull-right {
margin-left: .3em; margin-left: 0.3em;
} }
.fa-spin { .fa-spin {
-webkit-animation: fa-spin 2s infinite linear; -webkit-animation: fa-spin 2s infinite linear;

View File

@ -1,15 +1,16 @@
/*共通CSS*/ /*共通CSS*/
html,body{ html,
body {
/*transform: translate3d(0,0,0);*/ /*transform: translate3d(0,0,0);*/
overflow:hidden; overflow: hidden;
user-select: none; user-select: none;
cursor:default; cursor: default;
font-size:13px; font-size: 13px;
height: 100vh; height: 100vh;
background-color: var(--bg); background-color: var(--bg);
color: var(--color); color: var(--color);
} }
body{ body {
border: thin solid gray; border: thin solid gray;
} }
.btn { .btn {
@ -30,7 +31,7 @@ option {
} }
#mainView { #mainView {
padding: 10px; padding: 10px;
overflow:scroll; overflow: scroll;
height: auto; height: auto;
} }
#message { #message {
@ -42,23 +43,25 @@ option {
color: white; color: white;
z-index: 9999; z-index: 9999;
} }
#imagemodal, #videomodal { #imagemodal,
#videomodal {
display: none; display: none;
max-width: 100vw; max-width: 100vw;
max-height: 100vh; max-height: 100vh;
position: fixed; position: fixed;
z-index: 9; z-index: 9;
} }
#videomodal, #tootmodal { #videomodal,
#tootmodal {
background-color: var(--modal); background-color: var(--modal);
} }
#imagemodal .modal-content { #imagemodal .modal-content {
overflow: hidden; overflow: hidden;
padding:0; padding: 0;
} }
#imagemodal .modal-footer{ #imagemodal .modal-footer {
overflow-x:scroll; overflow-x: scroll;
overflow-y:hidden; overflow-y: hidden;
} }
#imagewrap { #imagewrap {
@ -68,11 +71,13 @@ option {
.pointer { .pointer {
cursor: pointer; cursor: pointer;
} }
.badge{ .badge {
min-width: 0 !important; min-width: 0 !important;
margin-left: 5px !important; margin-left: 5px !important;
} }
.bbcode-pulse-loadings, .bbcode-pulse-loading, .fa-pulse { .bbcode-pulse-loadings,
.bbcode-pulse-loading,
.fa-pulse {
display: inline-block; display: inline-block;
animation-duration: 3s; animation-duration: 3s;
animation-fill-mode: both; animation-fill-mode: both;
@ -80,10 +85,13 @@ option {
animation-name: pulse; animation-name: pulse;
} }
@keyframes pulse { @keyframes pulse {
from, 50%, to { from,
50%,
to {
opacity: 1; opacity: 1;
} }
25%, 75% { 25%,
75% {
opacity: 0; opacity: 0;
} }
} }
@ -119,7 +127,8 @@ option {
animation-iteration-count: infinite; animation-iteration-count: infinite;
animation-name: shake; animation-name: shake;
} }
code:before, .pre:before { code:before,
.pre:before {
content: "Code"; content: "Code";
font-size: 1.8rem; font-size: 1.8rem;
line-height: 1em; line-height: 1em;
@ -129,7 +138,8 @@ code:before, .pre:before {
right: 0; right: 0;
top: 0; top: 0;
} }
code, pre { code,
pre {
color: white; color: white;
display: block; display: block;
border-left: 5px solid; border-left: 5px solid;
@ -145,10 +155,12 @@ code, pre {
border-bottom-right-radius: 10px; border-bottom-right-radius: 10px;
border-bottom-left-radius: 10px; border-bottom-left-radius: 10px;
} }
blockquote, .quote p { blockquote,
.quote p {
margin: 0; margin: 0;
} }
blockquote, .quote { blockquote,
.quote {
color: black; color: black;
background-color: #ddd; background-color: #ddd;
padding: 1em 1em 1em; padding: 1em 1em 1em;
@ -157,7 +169,8 @@ blockquote, .quote {
border-bottom-right-radius: 10px; border-bottom-right-radius: 10px;
border-bottom-left-radius: 10px; border-bottom-left-radius: 10px;
} }
blockquote:before, .quote:before { blockquote:before,
.quote:before {
content: "Quote"; content: "Quote";
font-size: 1.8rem; font-size: 1.8rem;
line-height: 1em; line-height: 1em;
@ -221,184 +234,183 @@ blockquote:before, .quote:before {
#drag-content { #drag-content {
font-size: 2rem; font-size: 2rem;
} }
.radio{ .radio {
font-family:'Baloo Bhai' font-family: "Baloo Bhai";
} }
#pip{ #pip {
z-index:504; z-index: 504;
width:418px; width: 418px;
background-color: var(--subcolor); background-color: var(--subcolor);
position:absolute; position: absolute;
} }
.pip-bottom{ .pip-bottom {
bottom:10px; bottom: 10px;
} }
.pip-left{ .pip-left {
left:10px; left: 10px;
} }
.pip-top{ .pip-top {
top:10px; top: 10px;
} }
.pip-right{ .pip-right {
right:10px; right: 10px;
} }
#pip-content .material-icons{ #pip-content .material-icons {
display:none; display: none;
} }
.big-text{ .big-text {
font-size:1.2rem; font-size: 1.2rem;
} }
#releasenote { #releasenote {
background-color: var(--modal); background-color: var(--modal);
} }
#releasenote li{ #releasenote li {
list-style-type: disc list-style-type: disc;
} }
@media only screen and (min-width: 993px){ @media only screen and (min-width: 993px) {
#toast-container { #toast-container {
top:auto; top: auto;
right:auto; right: auto;
bottom: 5%; bottom: 5%;
left: 4%; left: 4%;
max-width: 86%; max-width: 86%;
}
} }
} .show {
.show{
animation: show 0.2s linear 0s; animation: show 0.2s linear 0s;
} }
@keyframes show{ @keyframes show {
from{ from {
opacity: 0; opacity: 0;
} }
to{ to {
opacity: 1; opacity: 1;
} }
} }
.hide-anime{ .hide-anime {
animation: hide 0.2s linear 0s; animation: hide 0.2s linear 0s;
display:none; display: none;
} }
@keyframes hide{ @keyframes hide {
from{ from {
opacity: 1; opacity: 1;
} }
to{ to {
opacity: 0; opacity: 0;
} }
} }
.collapsible-header,.tabs{ .collapsible-header,
.tabs {
background-color: var(--subcolor); background-color: var(--subcolor);
} }
.modal-footer{ .modal-footer {
background-color: var(--modalfooter) !important; background-color: var(--modalfooter) !important;
} }
.font{ .font {
font-size:1.5rem; font-size: 1.5rem;
margin-bottom:5px; margin-bottom: 5px;
} }
.font:hover{ .font:hover {
background-color: #999; background-color: #999;
} }
.release-do{ .release-do {
border: solid 2px; border: solid 2px;
border-color:var(--color); border-color: var(--color);
padding:5px; padding: 5px;
} }
#pickers{ #pickers {
display:flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
} }
#menu{ #menu {
position:fixed; position: fixed;
z-index:9999; z-index: 9999;
background-color: var(--box); background-color: var(--box);
width:540px; width: 540px;
top:calc(50% - 150px); top: calc(50% - 150px);
left:calc(50% - 250px); left: calc(50% - 250px);
padding: 5px; padding: 5px;
border: thin solid gray; border: thin solid gray;
border-radius:5px; border-radius: 5px;
} }
#menu-wrapper{ #menu-wrapper {
margin-left:-5px; margin-left: -5px;
display:flex; display: flex;
} }
#left-menu{ #left-menu {
width:170px; width: 170px;
} }
#left-menu div{ #left-menu div {
padding-left:5px; padding-left: 5px;
width:100%; width: 100%;
height:50px; height: 50px;
display:flex; display: flex;
align-items:center; align-items: center;
cursor:pointer; cursor: pointer;
} }
#left-menu div:hover { #left-menu div:hover {
background-color: var(--beforehover); background-color: var(--beforehover);
} }
#left-menu span{ #left-menu span {
margin-left:5px; margin-left: 5px;
} }
#left-menu div.active{ #left-menu div.active {
background-color: var(--emphasized); background-color: var(--emphasized);
} }
#right-menu{ #right-menu {
width:380px; width: 380px;
max-height:375px; max-height: 375px;
overflow-y:scroll; overflow-y: scroll;
overflow-x:hidden; overflow-x: hidden;
padding:5px; padding: 5px;
} }
#tltype{ #tltype {
display:flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
} }
#tltype .type{ #tltype .type {
display:flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
align-items:center; align-items: center;
width:170px; width: 170px;
height:40px; height: 40px;
cursor:pointer; cursor: pointer;
} }
#tltype .type:hover { #tltype .type:hover {
background-color: var(--beforehover); background-color: var(--beforehover);
} }
#tltype .active{ #tltype .active {
background-color: var(--emphasized); background-color: var(--emphasized);
} }
#tltype i{ #tltype i {
font-size:30px; font-size: 30px;
} }
#tltype i.sub-icon{ #tltype i.sub-icon {
font-size: 20px; font-size: 20px;
position: relative; position: relative;
color: var(--beforehover); color: var(--beforehover);
left: -15px; left: -15px;
} }
.drag-bar{ .drag-bar {
cursor:move; cursor: move;
text-align:center; text-align: center;
width:calc(100% + 10px); width: calc(100% + 10px);
border-radius: 5px; border-radius: 5px;
background-color: var(--bg); background-color: var(--bg);
margin-left:-5px; margin-left: -5px;
margin-right:-5px; margin-right: -5px;
margin-top:-5px; margin-top: -5px;
font-size:16px; font-size: 16px;
padding:4px; padding: 4px;
} }
#something-wrong{ #something-wrong {
flex-direction: column; flex-direction: column;
width:100%; width: 100%;
height:100%; height: 100%;
position:absolute; position: absolute;
display:flex; display: flex;
justify-content: center; justify-content: center;
align-items:center; align-items: center;
} }
/*スクロールバー*/ /*スクロールバー*/
@ -417,4 +429,4 @@ blockquote:before, .quote:before {
border-radius: 5px; border-radius: 5px;
background: #607d8b; background: #607d8b;
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.5); -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.5);
} }

1818
app/css/materialize.css vendored

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1,16 +1,16 @@
/*トゥートボックス向けCSS*/ /*トゥートボックス向けCSS*/
#post-box { #post-box {
display:none; display: none;
position: fixed; position: fixed;
left: calc(50vw - 150px); left: calc(50vw - 150px);
top: 50vh; top: 50vh;
background-color: var(--postbox); background-color: var(--postbox);
border: thin solid gray; border: thin solid gray;
z-index: 501; z-index: 501;
min-width:300px; min-width: 300px;
max-width:100%; max-width: 100%;
padding: 5px; padding: 5px;
border-radius:5px; border-radius: 5px;
} }
.cancel { .cancel {
@ -19,8 +19,7 @@
cursor: pointer; cursor: pointer;
position: absolute; position: absolute;
right: 2px; right: 2px;
top:4px; top: 4px;
} }
.more-show { .more-show {
display: none; display: none;
@ -42,10 +41,12 @@
display: none; display: none;
} }
#sch-box input { #sch-box input {
width:auto; width: auto;
} }
.picker__close, .picker__today, .picker__clear { .picker__close,
color: #26a69a !important; .picker__today,
.picker__clear {
color: #26a69a !important;
} }
.cw { .cw {
display: none; display: none;
@ -54,10 +55,9 @@
filter: blur(50px); filter: blur(50px);
} }
#emoji { #emoji {
} }
#suggest{ #suggest {
max-height:300px; max-height: 300px;
overflow-y: scroll; overflow-y: scroll;
} }
#emoji-list { #emoji-list {
@ -68,50 +68,53 @@
#preview-field { #preview-field {
display: none; display: none;
} }
.preview-img{ .preview-img {
width:50px; width: 50px;
max-height:100px; max-height: 100px;
} }
.pi-wrap{ .pi-wrap {
display:inline-block; display: inline-block;
width:50px; width: 50px;
max-height:100px; max-height: 100px;
} }
#default-emoji a{ #default-emoji a {
color:white; color: white;
margin-right:2px; margin-right: 2px;
} }
.character-counter{ .character-counter {
position: relative; position: relative;
top: -25px; top: -25px;
} }
.trendtag{ .trendtag {
overflow-y:scroll; overflow-y: scroll;
max-height:100px; max-height: 100px;
} }
#toot-btn-field{ #toot-btn-field {
display:flex; display: flex;
} }
#toot-post-btn{ #toot-post-btn {
width:calc(100% - 10px); padding:0; margin-top:10px; width: calc(100% - 10px);
padding: 0;
margin-top: 10px;
} }
#toot-sec-btn{ #toot-sec-btn {
width:30px; padding:0; margin-top:10px; width: 30px;
padding: 0;
margin-top: 10px;
} }
#left-side{ #left-side {
float:left; float: left;
width:300px; width: 300px;
} }
#right-side{ #right-side {
display:none; display: none;
float:left; float: left;
width:300px; width: 300px;
padding:5px; padding: 5px;
} }
#poll{ #poll {
} }
.poll-provider{ .poll-provider {
position: absolute; position: absolute;
height: calc(100% - 90px); height: calc(100% - 90px);
overflow-y: scroll; overflow-y: scroll;
@ -119,19 +122,19 @@
} }
/*mini*/ /*mini*/
.mini-post .mize{ .mini-post .mize {
display:none !important; display: none !important;
} }
.mini-post #textarea{ .mini-post #textarea {
padding:0; padding: 0;
} }
.mini-post #post-box{ .mini-post #post-box {
width:200px; width: 200px;
min-width:100px; min-width: 100px;
} }
.mini-post #toot-field{ .mini-post #toot-field {
padding:0; padding: 0;
}
.mini-post #toot-btn-field {
padding: 0;
} }
.mini-post #toot-btn-field{
padding:0;
}

View File

@ -1,32 +1,31 @@
.drag-content {
.drag-content{ text-overflow: ellipsis;
text-overflow: ellipsis; cursor: move;
cursor:move; user-select: none;
user-select: none; background-color: var(--modalfooter);
background-color:var(--modalfooter); margin: 5px;
margin:5px; border-radius: 5px;
border-radius:5px; color: var(--color);
color:var(--color); padding: 3px;
padding:3px; display: grid;
display:grid; grid-template-columns: 43px 1fr 60px;
grid-template-columns: 43px 1fr 60px; grid-template-areas: "sorticon sorttitle sorttitle" "sorticon sortacct sortaction";
grid-template-areas: 'sorticon sorttitle sorttitle' 'sorticon sortacct sortaction';
} }
.sorticon { .sorticon {
grid-area:sorticon; grid-area: sorticon;
} }
.sorticon i{ .sorticon i {
font-size:43px; font-size: 43px;
} }
.sorttitle { .sorttitle {
margin-left:5px; margin-left: 5px;
grid-area:sorttitle; grid-area: sorttitle;
} }
.sortacct { .sortacct {
margin-left:5px; margin-left: 5px;
grid-area:sortacct; grid-area: sortacct;
} }
.sortaction { .sortaction {
margin-left:5px; margin-left: 5px;
grid-area:sortaction; grid-area: sortaction;
} }

View File

@ -1,100 +1,100 @@
:root{ :root {
--bg:white; --bg: white;
--drag:rgba(255, 255, 255, 0.8); --drag: rgba(255, 255, 255, 0.8);
--color:black; --color: black;
--beforehover:#757575; --beforehover: #757575;
--modal:white; --modal: white;
--subcolor:#e0e0e0; --subcolor: #e0e0e0;
--box:white; --box: white;
--sidebar:#eeeeee; --sidebar: #eeeeee;
--shared:#cfd8dc; --shared: #cfd8dc;
--notfbox:white; --notfbox: white;
--emphasized:#81c784; --emphasized: #81c784;
--his-data:rgba(255, 255, 255, 0.9); --his-data: rgba(255, 255, 255, 0.9);
--active:#e6ee9c; --active: #e6ee9c;
--postbox:white; --postbox: white;
--modalfooter:#fafafa; --modalfooter: #fafafa;
} }
#imagemodal{ #imagemodal {
background: url("../img/pixel.white.svg"); background: url("../img/pixel.white.svg");
} }
.blacktheme { .blacktheme {
--bg:#212121; --bg: #212121;
--drag:rgba(0, 0, 0, 0.8); --drag: rgba(0, 0, 0, 0.8);
--color:white; --color: white;
--beforehover:#9e9e9e; --beforehover: #9e9e9e;
--modal:black; --modal: black;
--subcolor:#212121; --subcolor: #212121;
--box:#424242; --box: #424242;
--sidebar:#424242; --sidebar: #424242;
--shared:#004d40; --shared: #004d40;
--notfbox:#333333; --notfbox: #333333;
--emphasized:#4e342e; --emphasized: #4e342e;
--his-data:rgba(0, 0, 0, 0.8); --his-data: rgba(0, 0, 0, 0.8);
--active:#757575; --active: #757575;
--postbox:#424242; --postbox: #424242;
--modalfooter:#212121; --modalfooter: #212121;
} }
.blacktheme #imagemodal{ .blacktheme #imagemodal {
background: url("../img/pixel.svg"); background: url("../img/pixel.svg");
} }
.indigotheme { .indigotheme {
--bg:#031833; --bg: #031833;
--drag:rgba(0, 0, 0, 0.8); --drag: rgba(0, 0, 0, 0.8);
--color:white; --color: white;
--beforehover:#9e9e9e; --beforehover: #9e9e9e;
--modal:#0d1351; --modal: #0d1351;
--subcolor:#0d1351; --subcolor: #0d1351;
--shared:#004d40; --shared: #004d40;
--box:#0d1351; --box: #0d1351;
--sidebar:#0d1351; --sidebar: #0d1351;
--notfbox:#0d47a1; --notfbox: #0d47a1;
--emphasized:#4e342e; --emphasized: #4e342e;
--his-data:rgba(13, 19, 81,0.8); --his-data: rgba(13, 19, 81, 0.8);
--active:#757575; --active: #757575;
--postbox:#1a237e; --postbox: #1a237e;
--modalfooter:#031833; --modalfooter: #031833;
} }
.indigotheme #imagemodal{ .indigotheme #imagemodal {
background: url("../img/pixel.svg"); background: url("../img/pixel.svg");
} }
.browntheme { .browntheme {
--bg:#261411; --bg: #261411;
--drag:rgba(0, 0, 0, 0.8); --drag: rgba(0, 0, 0, 0.8);
--color:white; --color: white;
--beforehover:#9e9e9e; --beforehover: #9e9e9e;
--modal:#261411; --modal: #261411;
--subcolor:#4e342e; --subcolor: #4e342e;
--shared:#004d40; --shared: #004d40;
--box:#4e342e; --box: #4e342e;
--sidebar:#4e342e; --sidebar: #4e342e;
--notfbox:#4e342e; --notfbox: #4e342e;
--emphasized:#0d47a1; --emphasized: #0d47a1;
--his-data:rgba(62, 39, 35,0.8); --his-data: rgba(62, 39, 35, 0.8);
--active:#757575; --active: #757575;
--postbox:#4e342e; --postbox: #4e342e;
--modalfooter:#261411; --modalfooter: #261411;
} }
.browntheme #imagemodal{ .browntheme #imagemodal {
background: url("../img/pixel.svg"); background: url("../img/pixel.svg");
} }
.greentheme{ .greentheme {
--bg:#c8e6c9; --bg: #c8e6c9;
--drag:rgba(255, 255, 255, 0.8); --drag: rgba(255, 255, 255, 0.8);
--color:black; --color: black;
--beforehover:#757575; --beforehover: #757575;
--modal:#81c784; --modal: #81c784;
--subcolor:#a5d6a7; --subcolor: #a5d6a7;
--box:#81c784; --box: #81c784;
--sidebar:#81c784; --sidebar: #81c784;
--shared:#ffcc80; --shared: #ffcc80;
--notfbox:#a5d6a7; --notfbox: #a5d6a7;
--emphasized:#9e9d24; --emphasized: #9e9d24;
--his-data:rgba(255, 255, 255, 0.9); --his-data: rgba(255, 255, 255, 0.9);
--active:#e6ee9c; --active: #e6ee9c;
--postbox:#a5d6a7; --postbox: #a5d6a7;
--modalfooter:#81c784; --modalfooter: #81c784;
}
.greentheme #imagemodal {
background: url("../img/pixel.white.svg");
} }
.greentheme #imagemodal{
background: url("../img/pixel.white.svg");
}

View File

@ -1,97 +1,102 @@
/*TL CSS(ただしBBCode pulse:master.css/spin:font-awesome*/ /*TL CSS(ただしBBCode pulse:master.css/spin:font-awesome*/
#main{ #main {
display:flex; display: flex;
width:100vw; width: 100vw;
} }
#timeline-container { #timeline-container {
overflow-x: scroll; overflow-x: scroll;
overflow-y: hidden; overflow-y: hidden;
display: flex; display: flex;
height: calc(100vh - 40px); height: calc(100vh - 40px);
flex-grow:4; flex-grow: 4;
} }
#bottom{ #bottom {
position:absolute; position: absolute;
bottom:0; bottom: 0;
width:100vw; width: 100vw;
height:40px; height: 40px;
padding:3px; padding: 3px;
padding-right:0; padding-right: 0;
padding-left:40px; padding-left: 40px;
background-color:var(--sidebar); background-color: var(--sidebar);
display:flex; display: flex;
justify-content: space-between; justify-content: space-between;
flex-wrap:wrap; flex-wrap: wrap;
z-index:500; z-index: 500;
box-shadow: 10px 0 10px 10px rgba(0, 0, 0, 0.2); box-shadow: 10px 0 10px 10px rgba(0, 0, 0, 0.2);
} }
#bottom.reverse{ #bottom.reverse {
padding-left:0; padding-left: 0;
padding-right:40px; padding-right: 40px;
} }
.reverse{ .reverse {
flex-direction: row-reverse; flex-direction: row-reverse;
} }
#bottom #dambox{ #bottom #dambox {
width:300px; width: 300px;
margin-right:10px; margin-right: 10px;
} }
#bottom.reverse #dambox{ #bottom.reverse #dambox {
margin-right:0; margin-right: 0;
} }
#bottom .trendtag{ #bottom .trendtag {
height:40px; height: 40px;
} }
#bottom #group{ #bottom #group {
margin-right:40px; margin-right: 40px;
} }
#bottom .leftside{ #bottom .leftside {
display:flex; display: flex;
} }
#bottom #tips img{ #bottom #tips img {
vertical-align: -3px; vertical-align: -3px;
} }
#bottom a{ #bottom a {
color:var(--color); color: var(--color);
} }
#bottom i{ #bottom i {
font-size:30px; font-size: 30px;
} }
.exc-icons{ .exc-icons {
font-size:20px; font-size: 20px;
} }
.exc-chb{ .exc-chb {
padding-left:24px !important; padding-left: 24px !important;
} }
#bottom .btnsgroup{ #bottom .btnsgroup {
border:1px solid; border: 1px solid;
padding:1px; padding: 1px;
padding-left:5px; padding-left: 5px;
padding-right:5px; padding-right: 5px;
margin-right:15px; margin-right: 15px;
border-radius:5px; border-radius: 5px;
} }
#spot-box{ #spot-box {
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
#spot-img{ #spot-img {
margin-right:2px; margin-right: 2px;
} }
#spot-art{ #spot-art {
margin-right:2px; margin-right: 2px;
margin-left:2px; margin-left: 2px;
} }
.btnsgroup .grouptitle{ .btnsgroup .grouptitle {
font-family:Open Sans; font-family: Open Sans;
font-size:15px; font-size: 15px;
} }
@media screen and (max-width: 890px) { @media screen and (max-width: 890px) {
.btnsgroup .grouptitle{ display: none; } .btnsgroup .grouptitle {
#tips,#tips-menu{ display: none; } display: none;
}
#tips,
#tips-menu {
display: none;
}
} }
iframe { iframe {
max-width:100%; max-width: 100%;
} }
@media screen and (max-width: 600px) { @media screen and (max-width: 600px) {
.mobile #timeline-container { .mobile #timeline-container {
@ -109,119 +114,128 @@ iframe {
overflow: hidden; overflow: hidden;
min-width: 300px; min-width: 300px;
flex: 1; flex: 1;
border-top:none; border-top: none;
display:flex; display: flex;
flex-direction: column; flex-direction: column;
margin-bottom: -10px; margin-bottom: -10px;
} }
.img_FTL{ .img_FTL {
display:none; display: none;
} }
.bbcode_FTL{ .bbcode_FTL {
display:none; display: none;
} }
.boxIn{ .boxIn {
height:100%; height: 100%;
border: thin solid gray; border: thin solid gray;
overflow: hidden; overflow: hidden;
} }
.box .pin,#his-data .pin{ .box .pin,
display:none; #his-data .pin {
display: none;
} }
.user{ .user {
cursor:text; cursor: text;
font-size:1.1rem; font-size: 1.1rem;
} }
.emoji,.emoji-img{ .emoji,
.emoji-img {
width: 15px; width: 15px;
} }
.area-toot .emoji,.area-toot .emoji-img{ .area-toot .emoji,
.area-toot .emoji-img {
width: 20px; width: 20px;
vertical-align: middle; vertical-align: middle;
margin:-1px 0; margin: -1px 0;
} }
.faicon_FTL{ .faicon_FTL {
display:none; display: none;
}
.tl-box {
position: relative;
height: calc(100% - 40px);
overflow-y: scroll;
overflow-x: hidden;
} }
.tl-box{
position:relative;
height:calc(100% - 40px);
overflow-y:scroll;
overflow-x:hidden }
.additional { .additional {
overflow-x: scroll; overflow-x: scroll;
width: 100%; width: 100%;
} }
.media-filter .nomedia{ .media-filter .nomedia {
display:none; display: none;
} }
.bt-filter .shared{ .bt-filter .shared {
display:none; display: none;
} }
.except-bt-filter .unshared{ .except-bt-filter .unshared {
display:none; display: none;
} }
.cvo { .cvo {
user-select: text; user-select: text;
padding-left: 5px; padding-left: 5px;
border-bottom:0.5px solid; border-bottom: 0.5px solid;
padding-right: 2px; padding-right: 2px;
word-break: break-word; word-break: break-word;
width: 100%; width: 100%;
display: grid; display: grid;
grid-template-columns: 43px 2fr 1fr; grid-template-columns: 43px 2fr 1fr;
grid-template-areas: 'notice notice notice' 'icon display_name display_name' 'icon toot toot' 'vis additional additional' 'actions actions side'; grid-template-areas: "notice notice notice" "icon display_name display_name" "icon toot toot" "vis additional additional" "actions actions side";
} }
.cvo h1,.cvo h2,.cvo h3,.cvo h4,.cvo h5,.cvo h6{ .cvo h1,
margin:0; .cvo h2,
.cvo h3,
.cvo h4,
.cvo h5,
.cvo h6 {
margin: 0;
} }
.area-notice { .area-notice {
margin:2px; margin: 2px;
grid-area: notice; grid-area: notice;
} }
.area-icon { .area-icon {
width:40px; width: 40px;
margin:2px; margin: 2px;
grid-area: icon; grid-area: icon;
} }
.area-display_name { .area-display_name {
user-select: text; user-select: text;
height:1.5em; height: 1.5em;
margin:2px; margin: 2px;
margin-left:5px; margin-left: 5px;
overflow:hidden; overflow: hidden;
grid-area: display_name; grid-area: display_name;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
display:flex; display: flex;
justify-content:space-between; justify-content: space-between;
width:100%; width: 100%;
flex-wrap:nowrap flex-wrap: nowrap;
} }
.flex-name{ .flex-name {
max-width:calc(100% - 60px); max-width: calc(100% - 60px);
overflow:hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.area-toot { .area-toot {
cursor:text; cursor: text;
user-select: auto; user-select: auto;
margin:2px; margin: 2px;
margin-left:5px; margin-left: 5px;
grid-area: toot; grid-area: toot;
} }
.area-date_via { .area-date_via {
text-align:right; text-align: right;
grid-area: date_via; grid-area: date_via;
} }
.area-additional { .area-additional {
cursor:text; cursor: text;
user-select: auto; user-select: auto;
grid-area: additional; grid-area: additional;
overflow: hidden; overflow: hidden;
@ -230,69 +244,69 @@ grid-area: toot;
} }
.area-actions { .area-actions {
padding:0; padding: 0;
margin:0; margin: 0;
top:-20px; top: -20px;
display:flex; display: flex;
justify-content:space-around; justify-content: space-around;
width:250px; width: 250px;
max-width:100%; max-width: 100%;
grid-area: actions; grid-area: actions;
} }
.area-vis { .area-vis {
margin:2px; margin: 2px;
grid-area: vis; grid-area: vis;
} }
.area-side { .area-side {
display:flex; display: flex;
justify-content:flex-end; justify-content: flex-end;
margin:2px; margin: 2px;
grid-area: side; grid-area: side;
} }
.quote-renote{ .quote-renote {
display: grid; display: grid;
grid-template-columns: 43px 2fr 1fr; grid-template-columns: 43px 2fr 1fr;
grid-template-areas: 'ricon ruser' 'ricon rtext'; grid-template-areas: "ricon ruser" "ricon rtext";
border: 1px solid; border: 1px solid;
margin-top: 3px; margin-top: 3px;
padding: 1px; padding: 1px;
border-radius: 3px; border-radius: 3px;
} }
.renote-icon{ .renote-icon {
grid-area: ricon; grid-area: ricon;
} }
.renote-icon img{ .renote-icon img {
width:43px; width: 43px;
} }
.renote-user{ .renote-user {
grid-area: ruser; grid-area: ruser;
} }
.renote-text{ .renote-text {
grid-area: rtext; grid-area: rtext;
} }
.btn-flat{ .btn-flat {
color:var(--color); color: var(--color);
} }
.area-side i{ .area-side i {
margin-left:10px; margin-left: 10px;
} }
.viabadge{ .viabadge {
margin-top:10px; margin-top: 10px;
} }
.action i{ .action i {
font-size:1.2rem; font-size: 1.2rem;
margin-right:2px; margin-right: 2px;
} }
.action .fa-quote-right{ .action .fa-quote-right {
margin-top: 2px; margin-top: 2px;
} }
.actct{ .actct {
color:var(--beforehover); color: var(--beforehover);
} }
.actct:hover{ .actct:hover {
color:var(--color); color: var(--color);
transition: 0.5s; transition: 0.5s;
} }
@ -316,7 +330,7 @@ grid-area: toot;
.cbadge { .cbadge {
display: inline-block; display: inline-block;
min-width: 10px; min-width: 10px;
max-width:100px; max-width: 100px;
padding: 3px 7px; padding: 3px 7px;
font-size: 0.8em; font-size: 0.8em;
margin-right: 5px; margin-right: 5px;
@ -330,7 +344,7 @@ grid-area: toot;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
height:calc(0.8em + 8px); height: calc(0.8em + 8px);
} }
.cbadge-hover { .cbadge-hover {
color: var(--color); color: var(--color);
@ -343,9 +357,9 @@ grid-area: toot;
p { p {
margin: 0; margin: 0;
margin-bottom: 0px; margin-bottom: 0px;
line-height:20px; line-height: 20px;
} }
p:not(:last-child){ p:not(:last-child) {
margin-bottom: 10px; margin-bottom: 10px;
} }
.shared { .shared {
@ -359,20 +373,20 @@ p:not(:last-child){
} }
.notice-box { .notice-box {
top: 0; top: 0;
background-color:var(--notfbox); background-color: var(--notfbox);
filter: brightness(110%); filter: brightness(110%);
position: relative; position: relative;
margin-right: 10px; margin-right: 10px;
width:100%; width: 100%;
min-height:60px; min-height: 60px;
z-index:500; z-index: 500;
padding:5px; padding: 5px;
display: grid; display: grid;
grid-template-columns: 40px 48px 1fr 24px; grid-template-columns: 40px 48px 1fr 24px;
grid-template-rows: 30px 30px; grid-template-rows: 30px 30px;
grid-template-areas: 'notice notice_name notice_name a2' 'notice a1 sta a3' 'notf-box notf-box notf-box notf-box'; grid-template-areas: "notice notice_name notice_name a2" "notice a1 sta a3" "notf-box notf-box notf-box notf-box";
} }
.emp{ .emp {
font-weight: bold; font-weight: bold;
text-decoration: underline; text-decoration: underline;
} }
@ -434,89 +448,91 @@ p:not(:last-child){
min-height: 100px; min-height: 100px;
max-height: 500px; max-height: 500px;
} }
.column-hide{ .column-hide {
display:none; display: none;
overflow:hidden; overflow: hidden;
height:0; height: 0;
} }
.prof-img{ .prof-img {
border-radius: 3px; border-radius: 3px;
} }
.notf-icon{ .notf-icon {
position: relative; position: relative;
top: -20px; top: -20px;
width: 20px; width: 20px;
left: 20px; left: 20px;
} }
.notf-indv-box { .notf-indv-box {
width:100%; width: 100%;
max-height: 400px; max-height: 400px;
overflow-y: scroll; overflow-y: scroll;
overflow-x: hidden; overflow-x: hidden;
border: thin solid gray; border: thin solid gray;
border-bottom: 2px solid white; border-bottom: 2px solid white;
grid-area: notf-box; grid-area: notf-box;
box-shadow:0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.3), 0px -10px 10px 0px rgba(0,0,0,0.3) inset; box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14),
0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.3),
0px -10px 10px 0px rgba(0, 0, 0, 0.3) inset;
} }
#src-contents { #src-contents {
min-height: 100px; min-height: 100px;
max-height: 190px; max-height: 190px;
overflow-y: scroll; overflow-y: scroll;
} }
.type-b{ .type-b {
display:none; display: none;
} }
.modal-footer{ .modal-footer {
background-color:var(--box);
}
.ballons{
background-color: var(--box); background-color: var(--box);
position:absolute;
bottom:0px;
right:0px;
} }
.toot a span.ellipsis:after{ .ballons {
content:"..."; background-color: var(--box);
position: absolute;
bottom: 0px;
right: 0px;
} }
.toot a:not(.mention) span:last-of-type{ .toot a span.ellipsis:after {
display:none; content: "...";
} }
.tl-box .via-hide{ .toot a:not(.mention) span:last-of-type {
display:none; display: none;
} }
.vote{ .tl-box .via-hide {
display: none;
}
.vote {
width: 100%; width: 100%;
border: 1px solid; border: 1px solid;
margin-top: 3px; margin-top: 3px;
padding: 1px; padding: 1px;
border-radius: 3px; border-radius: 3px;
} }
.fa-2x>.emoji-img { .fa-2x > .emoji-img {
width: 36px!important; width: 36px !important;
height: 36px!important height: 36px !important;
} }
.fa-3x>.emoji-img { .fa-3x > .emoji-img {
width: 54px!important; width: 54px !important;
height: 54px!important height: 54px !important;
} }
.fa-4x>.emoji-img { .fa-4x > .emoji-img {
width: 72px!important; width: 72px !important;
height: 72px!important height: 72px !important;
} }
.fa-5x>.emoji-img { .fa-5x > .emoji-img {
width: 90px!important; width: 90px !important;
height: 90px!important height: 90px !important;
} }
#lists-user{ #lists-user {
overflow-y: scroll; overflow-y: scroll;
overflow-x: hidden; overflow-x: hidden;
max-height: 200px; max-height: 200px;
} }
.votebtn{ .votebtn {
border: 1px solid; border: 1px solid;
color: var(--bg); color: var(--bg);
background-color: var(--beforehover); background-color: var(--beforehover);
cursor:pointer; cursor: pointer;
width: 50px; width: 50px;
padding: 2px; padding: 2px;
display: inline-block; display: inline-block;
@ -525,46 +541,47 @@ p:not(:last-child){
border-radius: 10px; border-radius: 10px;
transition-duration: 0.5s; transition-duration: 0.5s;
} }
.votebtn:hover{ .votebtn:hover {
background-color:var(--color); background-color: var(--color);
} }
.jump{ .jump {
display: inline-block; animation: jump 0.75s linear infinite; display: inline-block;
animation: jump 0.75s linear infinite;
} }
.img-link{ .img-link {
position:relative; position: relative;
display:block; display: block;
margin-right:1px; margin-right: 1px;
float: left; float: left;
} }
.nsfw-media{ .nsfw-media {
position:absolute; position: absolute;
top:0; top: 0;
right:0; right: 0;
background-color: black; background-color: black;
color:white; color: white;
} }
.img-link img{ .img-link img {
display:block; display: block;
width:100%; width: 100%;
height:100%; height: 100%;
} }
@keyframes jump { @keyframes jump {
0% { 0% {
transform: translateY(0); transform: translateY(0);
} }
25% { 25% {
transform: translateY(-16px); transform: translateY(-16px);
} }
50% { 50% {
transform: translateY(0); transform: translateY(0);
} }
75% { 75% {
transform: translateY(-8px); transform: translateY(-8px);
} }
100% { 100% {
transform: translateY(0); transform: translateY(0);
} }
} }
@keyframes fadeInDown { @keyframes fadeInDown {
from { from {
@ -601,4 +618,3 @@ p:not(:last-child){
animation-duration: 0.1s; animation-duration: 0.1s;
animation-name: fadeInDown; animation-name: fadeInDown;
} }

File diff suppressed because it is too large Load Diff

View File

@ -1,64 +1,69 @@
/*アイコンをクリックした時とかにでてくるユーザーデータ*/ /*アイコンをクリックした時とかにでてくるユーザーデータ*/
#his-data { #his-data {
background-repeat: no-repeat; background-repeat: no-repeat;
background-image: url('../../loading.svg'); background-image: url("../../loading.svg");
overflow-y: hidden; overflow-y: hidden;
} }
#his-name{ #his-name {
font-size:1.5rem; font-size: 1.5rem;
} }
#his-prof { #his-prof {
float: left; float: left;
width: 100px; width: 100px;
margin-right:5px; margin-right: 5px;
} }
.his-float { .his-float {
float: left; float: left;
overflow-y: scroll; overflow-y: scroll;
padding: 5px; padding: 5px;
} }
#his-float-data{ #his-float-data {
width: 400px; width: 400px;
height: 100%; height: 100%;
} }
#his-float-timeline{ #his-float-timeline {
width: calc(100% - 400px); width: calc(100% - 400px);
height:100%; height: 100%;
overflow-y:hidden; overflow-y: hidden;
} }
#his-basic-prof{ #his-basic-prof {
min-height:130px; min-height: 130px;
} }
#his-matching-list{ #his-matching-list {
overflow-y: scroll; overflow-y: scroll;
overflow-x: hidden; overflow-x: hidden;
} }
#his-field{ #his-field {
vertical-align: baseline; vertical-align: baseline;
text-align:center; text-align: center;
padding:0; padding: 0;
} }
#his-field tr{ #his-field tr {
height:1.5rem; height: 1.5rem;
} }
.his-field-title{ .his-field-title {
height:1.5rem; padding:0; background-color:#757575; text-align:center; height: 1.5rem;
padding:5px; padding: 0;
margin-bottom:1px; background-color: #757575;
width:30%; text-align: center;
padding: 5px;
margin-bottom: 1px;
width: 30%;
} }
.his-field-content{ .his-field-content {
height:1.5rem; padding:0; padding-left:5px; height: 1.5rem;
padding: 0;
padding-left: 5px;
} }
#his-data a span.ellipsis:after{ #his-data a span.ellipsis:after {
content:"..."; content: "...";
} }
#his-data a:not(.mention) span:last-of-type{ #his-data a:not(.mention) span:last-of-type {
display:none; display: none;
} }
#his-data-show { #his-data-show {
margin: 20px; margin: 20px;
background-color:var(--his-data); background-color: var(--his-data);
width: calc(100% - 20px); width: calc(100% - 20px);
height: calc(100% - 20px); height: calc(100% - 20px);
margin-bottom: 0; margin-bottom: 0;
@ -67,34 +72,37 @@
.tab-content { .tab-content {
overflow-y: scroll; overflow-y: scroll;
overflow-x: hidden; overflow-x: hidden;
height: calc(100% - 240px) height: calc(100% - 240px);
} }
.my-data-width { .my-data-width {
width: 10%; width: 10%;
} }
.active-back{ .active-back {
background-color: var(--active); background-color: var(--active);
} }
#his-name .emojione,#his-name .emoji-img{ #his-name .emojione,
#his-name .emoji-img {
width: 20px; width: 20px;
} }
#his-plus-action .btn{ #his-plus-action .btn {
width:170px width: 170px;
} }
.custom-tabs{ .custom-tabs {
display:flex; display: flex;
} }
.custom-tabs .custom-tab a{ .custom-tabs .custom-tab a {
padding: 8px 12px; padding: 8px 12px;
} }
#his-des .mention{ #his-des .mention {
color: #039be5; color: #039be5;
cursor: pointer; cursor: pointer;
} }
#his-float-blocked{ #his-float-blocked {
display:flex; justify-content: center; align-items:center; display: flex;
font-size:2rem; justify-content: center;
align-items: center;
font-size: 2rem;
width: 90%; width: 90%;
height: 100%; height: 100%;
position: absolute; position: absolute;
} }

View File

@ -1,6 +1,6 @@
//このソフトについて //このソフトについて
function about() { function about() {
var electron = require("electron"); var electron = require("electron");
var ipc = electron.ipcRenderer; var ipc = electron.ipcRenderer;
ipc.send('about', 'go'); ipc.send('about', 'go');
} }

View File

@ -1,16 +1,16 @@
$(function($) { $(function ($) {
//キーボードショートカット //キーボードショートカット
$(window).keydown(function(e) { $(window).keydown(function (e) {
var hasFocus = $('input').is(':focus'); var hasFocus = $('input').is(':focus');
var hasFocus2 = $('textarea').is(':focus'); var hasFocus2 = $('textarea').is(':focus');
if(document.getElementById("webview")){ if (document.getElementById("webview")) {
if($("#webviewsel:checked").val()){ if ($("#webviewsel:checked").val()) {
var wv=false; var wv = false;
}else{ } else {
var wv=true; var wv = true;
} }
}else{ } else {
var wv=true; var wv = true;
} }
//Ctrl+Shift+Enter:Lgen //Ctrl+Shift+Enter:Lgen
if (event.metaKey || event.ctrlKey && wv) { if (event.metaKey || event.ctrlKey && wv) {
@ -20,7 +20,7 @@ $(function($) {
return false; return false;
} }
} }
} }
//Ctrl+Enter:投稿 //Ctrl+Enter:投稿
if (event.metaKey || event.ctrlKey && wv) { if (event.metaKey || event.ctrlKey && wv) {
@ -36,7 +36,7 @@ $(function($) {
return false; return false;
} }
} }
//Shift+Space:Markdownゼロ幅スペース //Shift+Space:Markdownゼロ幅スペース
if (event.shiftKey) { if (event.shiftKey) {
if (e.keyCode === 32) { if (e.keyCode === 32) {
@ -57,13 +57,13 @@ $(function($) {
//Ctrl+R:ランキング //Ctrl+R:ランキング
if ((event.metaKey || event.ctrlKey) && wv) { if ((event.metaKey || event.ctrlKey) && wv) {
if (e.keyCode === 82) { if (e.keyCode === 82) {
if(localStorage.getItem("kirishima")){ if (localStorage.getItem("kirishima")) {
window.open("https://astarte.thedesk.top"); window.open("https://astarte.thedesk.top");
} }
} }
} }
//Ctrl+Sift+C:全消し //Ctrl+Sift+C:全消し
if (((event.metaKey || event.ctrlKey) && event.shiftKey )&& wv) { if (((event.metaKey || event.ctrlKey) && event.shiftKey) && wv) {
if (e.keyCode === 67) { if (e.keyCode === 67) {
clear(); clear();
return false; return false;
@ -78,8 +78,8 @@ $(function($) {
} }
} }
//input/textareaにフォーカスなし時 //input/textareaにフォーカスなし時
if ((!hasFocus && !hasFocus2 ) && wv) { if ((!hasFocus && !hasFocus2) && wv) {
if(!wv){ if (!wv) {
return true; return true;
} }
//Ctrl+V:いつもの //Ctrl+V:いつもの
@ -143,11 +143,11 @@ $(function($) {
} }
//数字:TL //数字:TL
if (event.metaKey || event.ctrlKey) { if (event.metaKey || event.ctrlKey) {
if (e.keyCode >= 49 && e.keyCode <= 57) { if (e.keyCode >= 49 && e.keyCode <= 57) {
var kz=e.keyCode-49; var kz = e.keyCode - 49;
goColumn(kz); goColumn(kz);
return false; return false;
} }
} }
} }
//textareaフォーカス時 //textareaフォーカス時
@ -176,15 +176,15 @@ $(function($) {
//C+S+(No):ワンクリ //C+S+(No):ワンクリ
if ((event.metaKey || event.ctrlKey) && event.shiftKey) { if ((event.metaKey || event.ctrlKey) && event.shiftKey) {
if (e.keyCode >= 49 && e.keyCode <= 51) { if (e.keyCode >= 49 && e.keyCode <= 51) {
var no=e.keyCode-48; var no = e.keyCode - 48;
if(localStorage.getItem("oks-"+no)){$("#textarea").val($("#textarea").val()+localStorage.getItem("oks-"+no))} if (localStorage.getItem("oks-" + no)) { $("#textarea").val($("#textarea").val() + localStorage.getItem("oks-" + no)) }
return false; return false;
} }
} }
} }
} }
//イメージビューワー切り替え //イメージビューワー切り替え
if (e.keyCode === 37 &&wv) { if (e.keyCode === 37 && wv) {
if ($("#imagemodal").hasClass("open")) { if ($("#imagemodal").hasClass("open")) {
imgCont('prev'); imgCont('prev');
return false; return false;
@ -198,7 +198,7 @@ $(function($) {
} }
}); });
//クリアボタン //クリアボタン
$("#clear").click(function() { $("#clear").click(function () {
clear(); clear();
}); });
}); });

File diff suppressed because it is too large Load Diff

View File

@ -1,17 +1,17 @@
//モーダル・ドロップダウンの各種設定 //モーダル・ドロップダウンの各種設定
$(document).ready(function(){ $(document).ready(function () {
// the "href" attribute of the modal trigger must specify the modal ID that wants to be triggered // the "href" attribute of the modal trigger must specify the modal ID that wants to be triggered
$('.modal').modal(); $('.modal').modal();
$('.dropdown-button').dropdown({ $('.dropdown-button').dropdown({
inDuration: 300, inDuration: 300,
outDuration: 225, outDuration: 225,
constrainWidth: false, // Does not change width of dropdown to that of the activator constrainWidth: false, // Does not change width of dropdown to that of the activator
hover: false, // Activate on hover hover: false, // Activate on hover
gutter: 0, // Spacing from edge gutter: 0, // Spacing from edge
belowOrigin: false, // Displays dropdown below the button belowOrigin: false, // Displays dropdown below the button
alignment: 'left', // Displays dropdown with edge aligned to the left of button alignment: 'left', // Displays dropdown with edge aligned to the left of button
stopPropagation: false // Stops event propagation stopPropagation: false // Stops event propagation
} }
); );
}); });

View File

@ -1,8 +1,8 @@
var sha256 = function sha256(ascii) { var sha256 = function sha256(ascii) {
function rightRotate(value, amount) { function rightRotate(value, amount) {
return (value>>>amount) | (value<<(32 - amount)); return (value >>> amount) | (value << (32 - amount));
}; };
var mathPow = Math.pow; var mathPow = Math.pow;
var maxWord = mathPow(2, 32); var maxWord = mathPow(2, 32);
var lengthProperty = 'length' var lengthProperty = 'length'
@ -10,8 +10,8 @@ var sha256 = function sha256(ascii) {
var result = '' var result = ''
var words = []; var words = [];
var asciiBitLength = ascii[lengthProperty]*8; var asciiBitLength = ascii[lengthProperty] * 8;
//* caching results is optional - remove/add slash from front of this line to toggle //* caching results is optional - remove/add slash from front of this line to toggle
// Initial hash value: first 32 bits of the fractional parts of the square roots of the first 8 primes // Initial hash value: first 32 bits of the fractional parts of the square roots of the first 8 primes
// (we actually calculate the first 64, but extra values are just ignored) // (we actually calculate the first 64, but extra values are just ignored)
@ -30,21 +30,21 @@ var sha256 = function sha256(ascii) {
for (i = 0; i < 313; i += candidate) { for (i = 0; i < 313; i += candidate) {
isComposite[i] = candidate; isComposite[i] = candidate;
} }
hash[primeCounter] = (mathPow(candidate, .5)*maxWord)|0; hash[primeCounter] = (mathPow(candidate, .5) * maxWord) | 0;
k[primeCounter++] = (mathPow(candidate, 1/3)*maxWord)|0; k[primeCounter++] = (mathPow(candidate, 1 / 3) * maxWord) | 0;
} }
} }
ascii += '\x80' // Append Ƈ' bit (plus zero padding) ascii += '\x80' // Append Ƈ' bit (plus zero padding)
while (ascii[lengthProperty]%64 - 56) ascii += '\x00' // More zero padding while (ascii[lengthProperty] % 64 - 56) ascii += '\x00' // More zero padding
for (i = 0; i < ascii[lengthProperty]; i++) { for (i = 0; i < ascii[lengthProperty]; i++) {
j = ascii.charCodeAt(i); j = ascii.charCodeAt(i);
if (j>>8) return; // ASCII check: only accept characters in range 0-255 if (j >> 8) return; // ASCII check: only accept characters in range 0-255
words[i>>2] |= j << ((3 - i)%4)*8; words[i >> 2] |= j << ((3 - i) % 4) * 8;
} }
words[words[lengthProperty]] = ((asciiBitLength/maxWord)|0); words[words[lengthProperty]] = ((asciiBitLength / maxWord) | 0);
words[words[lengthProperty]] = (asciiBitLength) words[words[lengthProperty]] = (asciiBitLength)
// process each chunk // process each chunk
for (j = 0; j < words[lengthProperty];) { for (j = 0; j < words[lengthProperty];) {
var w = words.slice(j, j += 16); // The message is expanded into 64 words as part of the iteration var w = words.slice(j, j += 16); // The message is expanded into 64 words as part of the iteration
@ -52,7 +52,7 @@ var sha256 = function sha256(ascii) {
// This is now the undefinedworking hash", often labelled as variables a...g // This is now the undefinedworking hash", often labelled as variables a...g
// (we have to truncate as well, otherwise extra entries at the end accumulate // (we have to truncate as well, otherwise extra entries at the end accumulate
hash = hash.slice(0, 8); hash = hash.slice(0, 8);
for (i = 0; i < 64; i++) { for (i = 0; i < 64; i++) {
var i2 = i + j; var i2 = i + j;
// Expand the message into 64 words // Expand the message into 64 words
@ -63,32 +63,32 @@ var sha256 = function sha256(ascii) {
var a = hash[0], e = hash[4]; var a = hash[0], e = hash[4];
var temp1 = hash[7] var temp1 = hash[7]
+ (rightRotate(e, 6) ^ rightRotate(e, 11) ^ rightRotate(e, 25)) // S1 + (rightRotate(e, 6) ^ rightRotate(e, 11) ^ rightRotate(e, 25)) // S1
+ ((e&hash[5])^((~e)&hash[6])) // ch + ((e & hash[5]) ^ ((~e) & hash[6])) // ch
+ k[i] + k[i]
// Expand the message schedule if needed // Expand the message schedule if needed
+ (w[i] = (i < 16) ? w[i] : ( + (w[i] = (i < 16) ? w[i] : (
w[i - 16] w[i - 16]
+ (rightRotate(w15, 7) ^ rightRotate(w15, 18) ^ (w15>>>3)) // s0 + (rightRotate(w15, 7) ^ rightRotate(w15, 18) ^ (w15 >>> 3)) // s0
+ w[i - 7] + w[i - 7]
+ (rightRotate(w2, 17) ^ rightRotate(w2, 19) ^ (w2>>>10)) // s1 + (rightRotate(w2, 17) ^ rightRotate(w2, 19) ^ (w2 >>> 10)) // s1
)|0 ) | 0
); );
// This is only used once, so *could* be moved below, but it only saves 4 bytes and makes things unreadble // This is only used once, so *could* be moved below, but it only saves 4 bytes and makes things unreadble
var temp2 = (rightRotate(a, 2) ^ rightRotate(a, 13) ^ rightRotate(a, 22)) // S0 var temp2 = (rightRotate(a, 2) ^ rightRotate(a, 13) ^ rightRotate(a, 22)) // S0
+ ((a&hash[1])^(a&hash[2])^(hash[1]&hash[2])); // maj + ((a & hash[1]) ^ (a & hash[2]) ^ (hash[1] & hash[2])); // maj
hash = [(temp1 + temp2)|0].concat(hash); // We don't bother trimming off the extra ones, they're harmless as long as we're truncating when we do the slice() hash = [(temp1 + temp2) | 0].concat(hash); // We don't bother trimming off the extra ones, they're harmless as long as we're truncating when we do the slice()
hash[4] = (hash[4] + temp1)|0; hash[4] = (hash[4] + temp1) | 0;
} }
for (i = 0; i < 8; i++) { for (i = 0; i < 8; i++) {
hash[i] = (hash[i] + oldHash[i])|0; hash[i] = (hash[i] + oldHash[i]) | 0;
} }
} }
for (i = 0; i < 8; i++) { for (i = 0; i < 8; i++) {
for (j = 3; j + 1; j--) { for (j = 3; j + 1; j--) {
var b = (hash[i]>>(j*8))&255; var b = (hash[i] >> (j * 8)) & 255;
result += ((b < 16) ? 0 : '') + b.toString(16); result += ((b < 16) ? 0 : '') + b.toString(16);
} }
} }

View File

@ -25,7 +25,7 @@
factory(jQuery); factory(jQuery);
} }
}(function ($) { }(function ($) {
$.timeago = function(timestamp) { $.timeago = function (timestamp) {
if (timestamp instanceof Date) { if (timestamp instanceof Date) {
return inWords(timestamp); return inWords(timestamp);
} else if (typeof timestamp === "string") { } else if (typeof timestamp === "string") {
@ -68,9 +68,9 @@
} }
}, },
inWords: function(distanceMillis) { inWords: function (distanceMillis) {
if (!this.settings.allowPast && ! this.settings.allowFuture) { if (!this.settings.allowPast && !this.settings.allowFuture) {
throw 'timeago allowPast and allowFuture settings can not both be set to false.'; throw 'timeago allowPast and allowFuture settings can not both be set to false.';
} }
var $l = this.settings.strings; var $l = this.settings.strings;
@ -116,20 +116,20 @@
return $.trim([prefix, words, suffix].join(separator)); return $.trim([prefix, words, suffix].join(separator));
}, },
parse: function(iso8601) { parse: function (iso8601) {
var s = $.trim(iso8601); var s = $.trim(iso8601);
s = s.replace(/\.\d+/,""); // remove milliseconds s = s.replace(/\.\d+/, ""); // remove milliseconds
s = s.replace(/-/,"/").replace(/-/,"/"); s = s.replace(/-/, "/").replace(/-/, "/");
s = s.replace(/T/," ").replace(/Z/," UTC"); s = s.replace(/T/, " ").replace(/Z/, " UTC");
s = s.replace(/([\+\-]\d\d)\:?(\d\d)/," $1$2"); // -04:00 -> -0400 s = s.replace(/([\+\-]\d\d)\:?(\d\d)/, " $1$2"); // -04:00 -> -0400
s = s.replace(/([\+\-]\d\d)$/," $100"); // +09 -> +0900 s = s.replace(/([\+\-]\d\d)$/, " $100"); // +09 -> +0900
return new Date(s); return new Date(s);
}, },
datetime: function(elem) { datetime: function (elem) {
var iso8601 = $t.isTime(elem) ? $(elem).attr("datetime") : $(elem).attr("title"); var iso8601 = $t.isTime(elem) ? $(elem).attr("datetime") : $(elem).attr("title");
return $t.parse(iso8601); return $t.parse(iso8601);
}, },
isTime: function(elem) { isTime: function (elem) {
// jQuery's `is()` doesn't play well with HTML5 in IE // jQuery's `is()` doesn't play well with HTML5 in IE
return $(elem).get(0).tagName.toLowerCase() === "time"; // $(elem).is("time"); return $(elem).get(0).tagName.toLowerCase() === "time"; // $(elem).is("time");
} }
@ -139,7 +139,7 @@
// init is default when no action is given // init is default when no action is given
// functions are called with context of a single element // functions are called with context of a single element
var functions = { var functions = {
init: function() { init: function () {
functions.dispose.call(this); functions.dispose.call(this);
var refresh_el = $.proxy(refresh, this); var refresh_el = $.proxy(refresh, this);
refresh_el(); refresh_el();
@ -148,7 +148,7 @@
this._timeagoInterval = setInterval(refresh_el, $s.refreshMillis); this._timeagoInterval = setInterval(refresh_el, $s.refreshMillis);
} }
}, },
update: function(timestamp) { update: function (timestamp) {
var date = (timestamp instanceof Date) ? timestamp : $t.parse(timestamp); var date = (timestamp instanceof Date) ? timestamp : $t.parse(timestamp);
$(this).data('timeago', { datetime: date }); $(this).data('timeago', { datetime: date });
if ($t.settings.localeTitle) { if ($t.settings.localeTitle) {
@ -156,8 +156,8 @@
} }
refresh.apply(this); refresh.apply(this);
}, },
updateFromDOM: function() { updateFromDOM: function () {
$(this).data('timeago', { datetime: $t.parse( $t.isTime(this) ? $(this).attr("datetime") : $(this).attr("title") ) }); $(this).data('timeago', { datetime: $t.parse($t.isTime(this) ? $(this).attr("datetime") : $(this).attr("title")) });
refresh.apply(this); refresh.apply(this);
}, },
dispose: function () { dispose: function () {
@ -168,13 +168,13 @@
} }
}; };
$.fn.timeago = function(action, options) { $.fn.timeago = function (action, options) {
var fn = action ? functions[action] : functions.init; var fn = action ? functions[action] : functions.init;
if (!fn) { if (!fn) {
throw new Error("Unknown function name '"+ action +"' for timeago"); throw new Error("Unknown function name '" + action + "' for timeago");
} }
// each over objects here and call the requested function // each over objects here and call the requested function
this.each(function() { this.each(function () {
fn.call(this, options); fn.call(this, options);
}); });
return this; return this;
@ -184,7 +184,7 @@
var $s = $t.settings; var $s = $t.settings;
//check if it's still visible //check if it's still visible
if ($s.autoDispose && !$.contains(document.documentElement,this)) { if ($s.autoDispose && !$.contains(document.documentElement, this)) {
//stop if it has been removed //stop if it has been removed
$(this).timeago("dispose"); $(this).timeago("dispose");
return this; return this;
@ -193,11 +193,11 @@
var data = prepareData(this); var data = prepareData(this);
if (!isNaN(data.datetime)) { if (!isNaN(data.datetime)) {
if ( $s.cutoff === 0 || Math.abs(distance(data.datetime)) < $s.cutoff) { if ($s.cutoff === 0 || Math.abs(distance(data.datetime)) < $s.cutoff) {
$(this).text(inWords(data.datetime)); $(this).text(inWords(data.datetime));
} else { } else {
if ($(this).attr('title').length > 0) { if ($(this).attr('title').length > 0) {
$(this).text($(this).attr('title')); $(this).text($(this).attr('title'));
} }
} }
} }

View File

@ -1,274 +1,274 @@
//バージョンチェッカー //バージョンチェッカー
function verck(ver) { function verck(ver) {
console.log("%c Welcome😊", "color: red;font-size:200%;") console.log("%c Welcome😊", "color: red;font-size:200%;")
if(localStorage.getItem("ver")!=ver){ if (localStorage.getItem("ver") != ver) {
localStorage.setItem("ver", ver); localStorage.setItem("ver", ver);
console.log("%c Thank you for your update🎉", "color: red;font-size:200%;"); console.log("%c Thank you for your update🎉", "color: red;font-size:200%;");
$(document).ready(function(){ $(document).ready(function () {
$('#releasenote').modal('open'); $('#releasenote').modal('open');
verp=ver.replace( '(', ''); verp = ver.replace('(', '');
verp=verp.replace( '.', '-'); verp = verp.replace('.', '-');
verp=verp.replace( '.', '-'); verp = verp.replace('.', '-');
verp=verp.replace( '[', '-'); verp = verp.replace('[', '-');
verp=verp.replace( ']', ''); verp = verp.replace(']', '');
verp=verp.replace( ')', ''); verp = verp.replace(')', '');
verp=verp.replace( ' ', '_'); verp = verp.replace(' ', '_');
console.log("%c "+verp, "color: red;font-size:200%;"); console.log("%c " + verp, "color: red;font-size:200%;");
if(lang.language=="ja"){ if (lang.language == "ja") {
$("#release-"+verp).show(); $("#release-" + verp).show();
}else{ } else {
$("#release-en").show(); $("#release-en").show();
} }
}); });
} }
var electron = require("electron"); var electron = require("electron");
var remote=electron.remote; var remote = electron.remote;
var dialog=remote.dialog; var dialog = remote.dialog;
var platform=remote.process.platform; var platform = remote.process.platform;
if(platform=="win32"){ if (platform == "win32") {
const options = { const options = {
type: 'info', type: 'info',
title: "Select your platform", title: "Select your platform",
message: lang.lang_version_platform, message: lang.lang_version_platform,
buttons: [lang.lang_no,lang.lang_yesno] buttons: [lang.lang_no, lang.lang_yesno]
} }
if(!localStorage.getItem("winstore")){ if (!localStorage.getItem("winstore")) {
dialog.showMessageBox(options, function(arg) { dialog.showMessageBox(options, function (arg) {
if(arg==1){ if (arg == 1) {
localStorage.setItem("winstore","winstore") localStorage.setItem("winstore", "winstore")
}else{ } else {
localStorage.setItem("winstore","localinstall") localStorage.setItem("winstore", "localinstall")
} }
}); });
} }
}else if(platform=="linux"){ } else if (platform == "linux") {
if(localStorage.getItem("winstore")=="unix"){ if (localStorage.getItem("winstore") == "unix") {
localStorage.removeItem("winstore") localStorage.removeItem("winstore")
} }
if(!localStorage.getItem("winstore")){ if (!localStorage.getItem("winstore")) {
const options = { const options = {
type: 'info', type: 'info',
title: "Select your platform", title: "Select your platform",
message: lang.lang_version_platform_linux, message: lang.lang_version_platform_linux,
buttons: [lang.lang_no,lang.lang_yesno] buttons: [lang.lang_no, lang.lang_yesno]
} }
dialog.showMessageBox(options, function(arg) { dialog.showMessageBox(options, function (arg) {
if(arg==1){ if (arg == 1) {
localStorage.setItem("winstore","snapcraft") localStorage.setItem("winstore", "snapcraft")
}else{ } else {
localStorage.setItem("winstore","localinstall") localStorage.setItem("winstore", "localinstall")
} }
}); });
} }
}else if(platform=="darwin"){ } else if (platform == "darwin") {
if(localStorage.getItem("winstore")=="unix"){ if (localStorage.getItem("winstore") == "unix") {
localStorage.removeItem("winstore") localStorage.removeItem("winstore")
} }
if(!localStorage.getItem("winstore")){ if (!localStorage.getItem("winstore")) {
const options = { const options = {
type: 'info', type: 'info',
title: "Select your platform", title: "Select your platform",
message: lang.lang_version_platform_mac, message: lang.lang_version_platform_mac,
buttons: [lang.lang_no,lang.lang_yesno] buttons: [lang.lang_no, lang.lang_yesno]
} }
dialog.showMessageBox(options, function(arg) { dialog.showMessageBox(options, function (arg) {
if(arg==1){ if (arg == 1) {
localStorage.setItem("winstore","brewcask") localStorage.setItem("winstore", "brewcask")
}else{ } else {
localStorage.setItem("winstore","localinstall") localStorage.setItem("winstore", "localinstall")
} }
}); });
} }
}else{ } else {
localStorage.setItem("winstore","unix") localStorage.setItem("winstore", "unix")
} }
if(localStorage.getItem("winstore")=="brewcask" || localStorage.getItem("winstore")=="snapcraft" || localStorage.getItem("winstore")=="winstore"){ if (localStorage.getItem("winstore") == "brewcask" || localStorage.getItem("winstore") == "snapcraft" || localStorage.getItem("winstore") == "winstore") {
var winstore=true; var winstore = true;
}else{ } else {
var winstore=false; var winstore = false;
} }
var l = 5; var l = 5;
// 生成する文字列に含める文字セット // 生成する文字列に含める文字セット
var c = "abcdefghijklmnopqrstuvwxyz0123456789"; var c = "abcdefghijklmnopqrstuvwxyz0123456789";
var cl = c.length; var cl = c.length;
var r = ""; var r = "";
for(var i=0; i<l; i++){ for (var i = 0; i < l; i++) {
r += c[Math.floor(Math.random()*cl)]; r += c[Math.floor(Math.random() * cl)];
} }
var start = "https://thedesk.top/ver.json"; var start = "https://thedesk.top/ver.json";
fetch(start, { fetch(start, {
method: 'GET' method: 'GET'
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(mess) { }).then(function (mess) {
console.table(mess); console.table(mess);
if (mess) { if (mess) {
var electron = require("electron"); var electron = require("electron");
var remote=electron.remote; var remote = electron.remote;
var platform=remote.process.platform; var platform = remote.process.platform;
if(platform=="darwin"){ if (platform == "darwin") {
var newest=mess.desk_mac; var newest = mess.desk_mac;
}else{ } else {
var newest=mess.desk; var newest = mess.desk;
} }
if (newest == ver) { if (newest == ver) {
todo(lang.lang_version_usever.replace("{{ver}}" ,mess.desk)); todo(lang.lang_version_usever.replace("{{ver}}", mess.desk));
//betaかWinstoreならアプデチェックしない //betaかWinstoreならアプデチェックしない
} else if (ver.indexOf("beta")!=-1 || winstore) { } else if (ver.indexOf("beta") != -1 || winstore) {
}else{ } else {
localStorage.removeItem("instance") localStorage.removeItem("instance")
if(localStorage.getItem("new-ver-skip")){ if (localStorage.getItem("new-ver-skip")) {
if(localStorage.getItem("next-ver")!=newest){ if (localStorage.getItem("next-ver") != newest) {
var ipc = electron.ipcRenderer; var ipc = electron.ipcRenderer;
ipc.send('update', "true"); ipc.send('update', "true");
}else{ } else {
console.warn(lang.lang_version_skipver); console.warn(lang.lang_version_skipver);
todo(lang.lang_version_skipver); todo(lang.lang_version_skipver);
} }
}else{ } else {
var ipc = electron.ipcRenderer; var ipc = electron.ipcRenderer;
ipc.send('update', "true"); ipc.send('update', "true");
} }
} }
} }
}); });
if(!localStorage.getItem("last-notice-id")){ if (!localStorage.getItem("last-notice-id")) {
localStorage.setItem("last-notice-id",0) localStorage.setItem("last-notice-id", 0)
} }
var start = "https://thedesk.top/notice?since_id="+localStorage.getItem("last-notice-id"); var start = "https://thedesk.top/notice?since_id=" + localStorage.getItem("last-notice-id");
fetch(start, { fetch(start, {
method: 'GET' method: 'GET'
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(mess) { }).then(function (mess) {
if(mess.length<1){ if (mess.length < 1) {
return false; return false;
}else{ } else {
var last=localStorage.getItem("last-notice-id") var last = localStorage.getItem("last-notice-id")
localStorage.setItem("last-notice-id",mess[0].ID) localStorage.setItem("last-notice-id", mess[0].ID)
for(i=0;i<mess.length;i++){ for (i = 0; i < mess.length; i++) {
var obj=mess[i]; var obj = mess[i];
if(obj.ID*1<=last){ if (obj.ID * 1 <= last) {
break; break;
}else{ } else {
var show=true; var show = true;
if(obj.Toot!=""){ if (obj.Toot != "") {
var toot='<button class="btn-flat toast-action" onclick="detEx(\''+obj.Toot+'\',\'main\')">Show</button>'; var toot = '<button class="btn-flat toast-action" onclick="detEx(\'' + obj.Toot + '\',\'main\')">Show</button>';
}else{ } else {
var toot=""; var toot = "";
} }
if(obj.Ver!=""){ if (obj.Ver != "") {
if(obj.Ver==ver){ if (obj.Ver == ver) {
show=true; show = true;
}else{ } else {
show=false; show = false;
}
}
if (obj.Domain != "") {
var multi = localStorage.getItem("multi");
if (multi) {
show = false;
var accts = JSON.parse(multi);
Object.keys(accts).forEach(function (key) {
var acct = accts[key];
if (acct.domain == obj.Domain) {
show = true;
}
});
}
}
if (show) {
Materialize.toast(escapeHTML(obj.Text) + toot + '<span class="sml grey-text">(スライドして消去)</span>', 86400);
} }
} }
if(obj.Domain!=""){
var multi = localStorage.getItem("multi");
if (multi) {
show=false;
var accts = JSON.parse(multi);
Object.keys(accts).forEach(function(key) {
var acct = accts[key];
if(acct.domain==obj.Domain){
show=true;
}
});
}
}
if(show){
Materialize.toast(escapeHTML(obj.Text)+toot+'<span class="sml grey-text">(スライドして消去)</span>', 86400);
}
} }
} }
}
}); });
} }
var infostreaming=false; var infostreaming = false;
function infowebsocket(){ function infowebsocket() {
infows = new WebSocket("wss://thedesk.top/ws/"); infows = new WebSocket("wss://thedesk.top/ws/");
infows.onopen = function(mess) { infows.onopen = function (mess) {
console.log([tlid,":Connect Streaming Info:",mess]); console.log([tlid, ":Connect Streaming Info:", mess]);
infostreaming=true; infostreaming = true;
} }
infows.onmessage = function(mess) { infows.onmessage = function (mess) {
console.log([tlid,":Receive Streaming:",JSON.parse(mess.data)]); console.log([tlid, ":Receive Streaming:", JSON.parse(mess.data)]);
var obj=JSON.parse(mess.data); var obj = JSON.parse(mess.data);
if(obj.type!="counter"){ if (obj.type != "counter") {
localStorage.setItem("last-notice-id",obj.id) localStorage.setItem("last-notice-id", obj.id)
var show=true; var show = true;
if(obj.toot!=""){ if (obj.toot != "") {
var toot='<button class="btn-flat toast-action" onclick="detEx(\''+obj.toot+'\',\'main\')">Show</button>'; var toot = '<button class="btn-flat toast-action" onclick="detEx(\'' + obj.toot + '\',\'main\')">Show</button>';
}else{ } else {
var toot=""; var toot = "";
} }
if(obj.ver!=""){ if (obj.ver != "") {
if(obj.ver==ver){ if (obj.ver == ver) {
show=true; show = true;
}else{ } else {
show=false; show = false;
} }
} }
if(obj.domain!=""){ if (obj.domain != "") {
var multi = localStorage.getItem("multi"); var multi = localStorage.getItem("multi");
if (multi) { if (multi) {
show=false; show = false;
var accts = JSON.parse(multi); var accts = JSON.parse(multi);
Object.keys(accts).forEach(function(key) { Object.keys(accts).forEach(function (key) {
var acct = accts[key]; var acct = accts[key];
if(acct.domain==obj.domain){ if (acct.domain == obj.domain) {
show=true; show = true;
} }
}); });
} }
} }
if(show){ if (show) {
Materialize.toast(escapeHTML(obj.text)+toot+'<span class="sml grey-text">(スライドして消去)</span>', 86400); Materialize.toast(escapeHTML(obj.text) + toot + '<span class="sml grey-text">(スライドして消去)</span>', 86400);
} }
}else{ } else {
$("#persons").text(obj.text); $("#persons").text(obj.text);
}
} }
} infows.onerror = function (error) {
infows.onerror = function(error) { infostreaming = false;
infostreaming=false;
console.error("Error closing:info"); console.error("Error closing:info");
console.error(error); console.error(error);
return false; return false;
}; };
infows.onclose = function() { infows.onclose = function () {
infostreaming=false; infostreaming = false;
console.error("Closing:info"); console.error("Closing:info");
}; };
} }
setInterval(function(){ setInterval(function () {
if(!infostreaming){ if (!infostreaming) {
console.log("try to connect to base-streaming") console.log("try to connect to base-streaming")
infowebsocket(); infowebsocket();
} }
}, 10000); }, 10000);
function openRN(){ function openRN() {
$('#releasenote').modal('open'); $('#releasenote').modal('open');
if(lang.language=="ja"){ if (lang.language == "ja") {
verp=ver.replace( '(', ''); verp = ver.replace('(', '');
verp=verp.replace( '.', '-'); verp = verp.replace('.', '-');
verp=verp.replace( '.', '-'); verp = verp.replace('.', '-');
verp=verp.replace( '[', '-'); verp = verp.replace('[', '-');
verp=verp.replace( ']', ''); verp = verp.replace(']', '');
verp=verp.replace( ')', ''); verp = verp.replace(')', '');
verp=verp.replace( ' ', '_'); verp = verp.replace(' ', '_');
$("#release-"+verp).show(); $("#release-" + verp).show();
}else{ } else {
$("#release-en").show(); $("#release-en").show();
} }
} }

View File

@ -1,89 +1,89 @@
var defaultemojiList=["activity","flag","food","nature","object","people","place","symbol"]; var defaultemojiList = ["activity", "flag", "food", "nature", "object", "people", "place", "symbol"];
var defaultemoji={ var defaultemoji = {
activity:activity, activity: activity,
flag:flag, flag: flag,
food:food, food: food,
nature:nature, nature: nature,
object:object, object: object,
people:people, people: people,
place:place, place: place,
symbol:symbol symbol: symbol
}; };
if(lang=="ja"){ if (lang == "ja") {
var defaultemojiname={ var defaultemojiname = {
activity:"活動", activity: "活動",
flag:"国旗", flag: "国旗",
food:"食べ物", food: "食べ物",
nature:"自然", nature: "自然",
object:"もの", object: "もの",
people:"ひと", people: "ひと",
place:"場所", place: "場所",
symbol:"記号" symbol: "記号"
}; };
}else{ } else {
var defaultemojiname={ var defaultemojiname = {
activity:"Activities", activity: "Activities",
flag:"Flags", flag: "Flags",
food:"Foods", food: "Foods",
nature:"Nature", nature: "Nature",
object:"Tools", object: "Tools",
people:"People", people: "People",
place:"Places", place: "Places",
symbol:"Symbols" symbol: "Symbols"
}; };
} }
function defaultEmoji(target){ function defaultEmoji(target) {
var json=defaultemoji[target]; var json = defaultemoji[target];
var emojis=""; var emojis = "";
Object.keys(json).forEach(function(key) { Object.keys(json).forEach(function (key) {
var emoji = json[key]; var emoji = json[key];
emojis = emojis + '<a onclick="defEmoji(\''+emoji["shortcode"]+'\')" class="pointer"><span style="width: 20px; height: 20px; display: inline-block; background-image: url(\'../../img/sheet.png\'); background-size: 4900%; background-position: '+emoji["css"]+';"></span></a>'; emojis = emojis + '<a onclick="defEmoji(\'' + emoji["shortcode"] + '\')" class="pointer"><span style="width: 20px; height: 20px; display: inline-block; background-image: url(\'../../img/sheet.png\'); background-size: 4900%; background-position: ' + emoji["css"] + ';"></span></a>';
}); });
$("#emoji-list").html(emojis); $("#emoji-list").html(emojis);
$("#now-emoji").text(lang.lang_defaultemojis_text.replace("{{cat}}" ,defaultemojiname[target])); $("#now-emoji").text(lang.lang_defaultemojis_text.replace("{{cat}}", defaultemojiname[target]));
$(".emoji-control").addClass("hide"); $(".emoji-control").addClass("hide");
} }
function customEmoji(){ function customEmoji() {
$("#emoji-suggest").val(""); $("#emoji-suggest").val("");
$(".emoji-control").removeClass("hide"); $(".emoji-control").removeClass("hide");
emojiList('home') emojiList('home')
} }
function defEmoji(target){ function defEmoji(target) {
var emojiraw = newpack.filter(function(item, index){ var emojiraw = newpack.filter(function (item, index) {
if (item.short_name == target) return true; if (item.short_name == target) return true;
}); });
var hex=emojiraw[0].unified.split("-"); var hex = emojiraw[0].unified.split("-");
if(hex.length===2){ if (hex.length === 2) {
emoji=twemoji.convert.fromCodePoint(hex[0])+twemoji.convert.fromCodePoint(hex[1]); emoji = twemoji.convert.fromCodePoint(hex[0]) + twemoji.convert.fromCodePoint(hex[1]);
}else{ } else {
emoji=twemoji.convert.fromCodePoint(hex[0]); emoji = twemoji.convert.fromCodePoint(hex[0]);
} }
var now = $("#textarea").val(); var now = $("#textarea").val();
var selin = localStorage.getItem("cursor"); var selin = localStorage.getItem("cursor");
var now = $("#textarea").val(); var now = $("#textarea").val();
if(selin>0){ if (selin > 0) {
var before = now.substr(0, selin); var before = now.substr(0, selin);
var after = now.substr(selin, now.length); var after = now.substr(selin, now.length);
newt = before+ emoji + after; newt = before + emoji + after;
}else{ } else {
newt = emoji+now; newt = emoji + now;
} }
$("#textarea").val(newt); $("#textarea").val(newt);
$("#textarea").focus(); $("#textarea").focus();
var selin = $("#textarea").prop('selectionStart'); var selin = $("#textarea").prop('selectionStart');
if(!selin){ if (!selin) {
selin=0; selin = 0;
} }
localStorage.setItem("cursor", selin); localStorage.setItem("cursor", selin);
} }
function faicon(){ function faicon() {
var json=faicons; var json = faicons;
var emojis=""; var emojis = "";
Object.keys(json).forEach(function(key) { Object.keys(json).forEach(function (key) {
var emoji = json[key]; var emoji = json[key];
var eje = emoji.replace( /fa-/g , "" ) ; var eje = emoji.replace(/fa-/g, "");
emojis = emojis + '<a onclick="emojiInsert(\'[faicon]'+eje+'[/faicon]\')" class="pointer white-text" style="font-size:24px"><i class="fa '+emoji+'"></i></a>'; emojis = emojis + '<a onclick="emojiInsert(\'[faicon]' + eje + '[/faicon]\')" class="pointer white-text" style="font-size:24px"><i class="fa ' + emoji + '"></i></a>';
}); });
$("#emoji-list").html(emojis); $("#emoji-list").html(emojis);
$("#now-emoji").text("faicon"); $("#now-emoji").text("faicon");

View File

@ -1,252 +1,252 @@
//commonError //commonError
var lang={ var lang = {
"language":"en", "language": "en",
"lang_toot":"Toot", "lang_toot": "Toot",
"lang_there":"Yes", "lang_there": "Yes",
"lang_nothing":"None", "lang_nothing": "None",
"lang_yesno":"Yes", "lang_yesno": "Yes",
"lang_no":"No", "lang_no": "No",
"lang_progress":"Wait...", "lang_progress": "Wait...",
"lang_edit":"Edit", "lang_edit": "Edit",
"lang_del":"Delete", "lang_del": "Delete",
"lang_add":"Add", "lang_add": "Add",
"lang_fatalerroroccured":"Some errors are occured, please restart TheDesk.", "lang_fatalerroroccured": "Some errors are occured, please restart TheDesk.",
"lang_speech":"Google US English", "lang_speech": "Google US English",
//language.html //language.html
"lang_lang":"Language", "lang_lang": "Language",
"lang_langlocale":"English", "lang_langlocale": "English",
"lang_back":"Back", "lang_back": "Back",
"lang_set":"Set", "lang_set": "Set",
"lang_langadd":"Translate TheDesk to other languages or proofread TheDesk on <a href=\"https://github.com/cutls/TheDesk\" target=\"_blank\">GitHub</a>. TheDesk needs your help.", "lang_langadd": "Translate TheDesk to other languages or proofread TheDesk on <a href=\"https://github.com/cutls/TheDesk\" target=\"_blank\">GitHub</a>. TheDesk needs your help.",
//common/version.js //common/version.js
"lang_version_usever":"No update is found({{ver}})", "lang_version_usever": "No update is found({{ver}})",
"lang_version_skipver":"Update was ignored.", "lang_version_skipver": "Update was ignored.",
"lang_version_platform":"Was this software installed at Microsoft Store? When select 'yes', any update was ignored.", "lang_version_platform": "Was this software installed at Microsoft Store? When select 'yes', any update was ignored.",
"lang_version_platform_linux":"Was this software installed at Snapcraft(snapd)? When select 'yes', any update was ignored.", "lang_version_platform_linux": "Was this software installed at Snapcraft(snapd)? When select 'yes', any update was ignored.",
"lang_version_platform_mac":"Was this software installed at Homebrew Cask? When select 'yes', any update was ignored.", "lang_version_platform_mac": "Was this software installed at Homebrew Cask? When select 'yes', any update was ignored.",
//login //login
//login/login.js //login/login.js
"lang_login_noauth":"Show TL of unlogined accounts", "lang_login_noauth": "Show TL of unlogined accounts",
//login/manager.js //login/manager.js
"lang_manager_info":"About this instance", "lang_manager_info": "About this instance",
"lang_manager_refresh":"Refresh", "lang_manager_refresh": "Refresh",
"lang_manager_delete":"Logout", "lang_manager_delete": "Logout",
"lang_manager_color":"Account Color", "lang_manager_color": "Account Color",
"lang_manager_confirm":"is about to logout. Continue?", "lang_manager_confirm": "is about to logout. Continue?",
"lang_manager_mainAcct":"Done:choose main account", "lang_manager_mainAcct": "Done:choose main account",
"lang_manager_def":"Default", "lang_manager_def": "Default",
"lang_manager_none":"None", "lang_manager_none": "None",
"lang_manager_godev":"Open DevCenter of Misskey. We show also an official documents to refer.", "lang_manager_godev": "Open DevCenter of Misskey. We show also an official documents to refer.",
//post/bb-md.js //post/bb-md.js
"lang_bbmd_misskey":"TheDesk regards \"@\" as reply, but put other parameter. Unlisted on Mastodon means Home on Misskey.", "lang_bbmd_misskey": "TheDesk regards \"@\" as reply, but put other parameter. Unlisted on Mastodon means Home on Misskey.",
//post/emoji.js //post/emoji.js
"lang_emoji_get":"Get emojis", "lang_emoji_get": "Get emojis",
"lang_emoji_custom":"Custom emojis", "lang_emoji_custom": "Custom emojis",
"lang_defaultemojis_text":"Emojis about {{cat}}", "lang_defaultemojis_text": "Emojis about {{cat}}",
//post/img.js //post/img.js
"lang_postimg_previewdis":"cannot preview", "lang_postimg_previewdis": "cannot preview",
"lang_postimg_aftupload":"You cannot change accounts after uploading.", "lang_postimg_aftupload": "You cannot change accounts after uploading.",
"lang_postimg_delete":"Delete this image.", "lang_postimg_delete": "Delete this image.",
//post/post.js //post/post.js
"lang_post_tagTL":"This toot does not contain a default tag. This toot will not be shown on Local TL. Continue?", "lang_post_tagTL": "This toot does not contain a default tag. This toot will not be shown on Local TL. Continue?",
"lang_post_tagVis":"This toot(not 'public' toot) is not shown on this tag's TL.", "lang_post_tagVis": "This toot(not 'public' toot) is not shown on this tag's TL.",
"lang_post_cwtitle":"Auto CW Alert", "lang_post_cwtitle": "Auto CW Alert",
"lang_post_cwtxt":"You are about to post longer toot than you set.\nWarning text:", "lang_post_cwtxt": "You are about to post longer toot than you set.\nWarning text:",
"lang_post_btn1":"Cancel (will not post)", "lang_post_btn1": "Cancel (will not post)",
"lang_post_btn2":"Make text hidden automatically", "lang_post_btn2": "Make text hidden automatically",
"lang_post_btn3":"Continue to post", "lang_post_btn3": "Continue to post",
//post/status.js //post/status.js
"lang_status_favWarn":"It will take a miunte to favourite a remote toot.", "lang_status_favWarn": "It will take a miunte to favourite a remote toot.",
"lang_status_btWarn":"It will take a miunte to boost a remote toot.", "lang_status_btWarn": "It will take a miunte to boost a remote toot.",
"lang_status_follow":"Follow", "lang_status_follow": "Follow",
"lang_status_unfollow":"Unfollow", "lang_status_unfollow": "Unfollow",
"lang_status_block":"Block", "lang_status_block": "Block",
"lang_status_unblock":"Unblock", "lang_status_unblock": "Unblock",
"lang_status_mute":"Mute", "lang_status_mute": "Mute",
"lang_status_unmute":"Unmute", "lang_status_unmute": "Unmute",
"lang_status_redraft":"Continue to delete & redraft? You lose statuses of this toot. This fanction may contain some bugs. Images of this toot will be deleted on older than Mastodon 2.4.1.", "lang_status_redraft": "Continue to delete & redraft? You lose statuses of this toot. This fanction may contain some bugs. Images of this toot will be deleted on older than Mastodon 2.4.1.",
"lang_status_emphas":"'s toots are emphasized. Please reload after this action.", "lang_status_emphas": "'s toots are emphasized. Please reload after this action.",
"lang_status_unemphas":"'s toots are not emphasized. Please reload after this action.", "lang_status_unemphas": "'s toots are not emphasized. Please reload after this action.",
"lang_status_unendorse":"Not feature on profile", "lang_status_unendorse": "Not feature on profile",
"lang_status_endorse":"Feature on profile", "lang_status_endorse": "Feature on profile",
//post/suggest.js //post/suggest.js
"lang_suggest_nodata":"Please get emojis list in order to show suggestion.", "lang_suggest_nodata": "Please get emojis list in order to show suggestion.",
//post/use-txtbox.js //post/use-txtbox.js
"lang_usetxtbox_reply":"Reply Mode. Ctrl+Shift+C to clear.", "lang_usetxtbox_reply": "Reply Mode. Ctrl+Shift+C to clear.",
//tl/card.js //tl/card.js
"lang_cards_check":" check", "lang_cards_check": " check",
"lang_cards_pip":"PiP mode", "lang_cards_pip": "PiP mode",
//tl/details.js //tl/details.js
"lang_details_nodata":"No data", "lang_details_nodata": "No data",
"lang_details_filtered":"Filtered toot", "lang_details_filtered": "Filtered toot",
"lang_details_embed":"Embed HTML is cliped.", "lang_details_embed": "Embed HTML is cliped.",
"lang_details_url":"URL of this toot is cliped.", "lang_details_url": "URL of this toot is cliped.",
"lang_details_txt":"Content of this toot is cliped.", "lang_details_txt": "Content of this toot is cliped.",
//tl/filter.js //tl/filter.js
"lang_filter_nodata":"No data", "lang_filter_nodata": "No data",
"lang_filter_errordegree":"Please check a context", "lang_filter_errordegree": "Please check a context",
//tl/list.js //tl/list.js
"lang_list_nodata":"No data", "lang_list_nodata": "No data",
"lang_list_show":"Show", "lang_list_show": "Show",
"lang_list_users":"Users list", "lang_list_users": "Users list",
"lang_list_nouser":"No users in this list.", "lang_list_nouser": "No users in this list.",
"lang_list_add":"Add to the list", "lang_list_add": "Add to the list",
"lang_list_add_misskey":"(perhaps this user has been listed)", "lang_list_add_misskey": "(perhaps this user has been listed)",
"lang_list_remove":"Remove from the list", "lang_list_remove": "Remove from the list",
//tl/notification.js //tl/notification.js
"lang_notf_new":" new notifications", "lang_notf_new": " new notifications",
//tl/speech.js //tl/speech.js
"lang_speech_refresh":"Save value about TTS config", "lang_speech_refresh": "Save value about TTS config",
//tl/src.js //tl/src.js
"lang_src_ts":"chronological order", "lang_src_ts": "chronological order",
"lang_src_people":" people toot", "lang_src_people": " people toot",
//tl/tag.js //tl/tag.js
"lang_tags_always":"Always toots with ", "lang_tags_always": "Always toots with ",
"lang_tags_realtime":"Tag-stream toot", "lang_tags_realtime": "Tag-stream toot",
"lang_tags_tagunpin":"Unpin {{tag}}", "lang_tags_tagunpin": "Unpin {{tag}}",
"lang_tags_unrealtime":"Disable TsT", "lang_tags_unrealtime": "Disable TsT",
"lang_tags_tagwarn":"Auto complete {{tag}}, if toot without {{tag}}", "lang_tags_tagwarn": "Auto complete {{tag}}, if toot without {{tag}}",
//tl/tl.js //tl/tl.js
"lang_tl_media":"Media", "lang_tl_media": "Media",
"lang_tl_reconnect":"Reconnect to streaming API", "lang_tl_reconnect": "Reconnect to streaming API",
//ui/layout.js //ui/layout.js
"lang_layout_gotop":"Go top of this column. When icon is red, this column cannot connect straming API. Please reload.", "lang_layout_gotop": "Go top of this column. When icon is red, this column cannot connect straming API. Please reload.",
"lang_layout_thisacct":"{{notf}} of this account", "lang_layout_thisacct": "{{notf}} of this account",
"lang_layout_delthis":"Remove this column", "lang_layout_delthis": "Remove this column",
"lang_layout_setthis":"Preferences of this column", "lang_layout_setthis": "Preferences of this column",
"lang_layout_mediafil":"Media filtering", "lang_layout_mediafil": "Media filtering",
"lang_layout_linkana":"Auto Link Analyzer", "lang_layout_linkana": "Auto Link Analyzer",
"lang_layout_linkanades":"Auto link analyzer", "lang_layout_linkanades": "Auto link analyzer",
"lang_layout_tts":"Text to speech ", "lang_layout_tts": "Text to speech ",
"lang_layout_reconnect":"Reconnect to streaming API", "lang_layout_reconnect": "Reconnect to streaming API",
"lang_layout_headercolor":"Header color of this column", "lang_layout_headercolor": "Header color of this column",
"lang_layout_nodata":"[No data]<br>F5/⌘+R to reload", "lang_layout_nodata": "[No data]<br>F5/⌘+R to reload",
"lang_layout_dm":"Direct Message", "lang_layout_dm": "Direct Message",
"lang_layout_webviewmode":"Prefer WebView", "lang_layout_webviewmode": "Prefer WebView",
"lang_excluded":"Excluded type of notification", "lang_excluded": "Excluded type of notification",
"lang_layout_excludingbt":"Show BT mode(OFF/Exclude BT/Only BT)", "lang_layout_excludingbt": "Show BT mode(OFF/Exclude BT/Only BT)",
"lang_layout_leftFold":"Stack to the left", "lang_layout_leftFold": "Stack to the left",
"lang_layout_leftUnfold":"Dock on the right", "lang_layout_leftUnfold": "Dock on the right",
//ui/sort.js //ui/sort.js
"lang_sort_gothis":"Go to this column", "lang_sort_gothis": "Go to this column",
"lang_sort_remthis":"Delete this column", "lang_sort_remthis": "Delete this column",
//ui/spotify.js //ui/spotify.js
"lang_spotify_img":"Attach an album artwork", "lang_spotify_img": "Attach an album artwork",
"lang_spotify_imgno":"Not attach an album artwork", "lang_spotify_imgno": "Not attach an album artwork",
"lang_spotify_acct":"Connect TheDesk to Spotify", "lang_spotify_acct": "Connect TheDesk to Spotify",
"lang_spotify_np":"Done:templete of NowPlaying", "lang_spotify_np": "Done:templete of NowPlaying",
"lang_setting_npprovide":"NowPlaying provider:{{set}}", "lang_setting_npprovide": "NowPlaying provider:{{set}}",
//userdata/his-data.js //userdata/his-data.js
"lang_hisdata_frcreq":"Required Mastodon 2.4.3 and above", "lang_hisdata_frcreq": "Required Mastodon 2.4.3 and above",
"lang_hisdata_frcwarn":"Unfollow accounts will be shown.", "lang_hisdata_frcwarn": "Unfollow accounts will be shown.",
"lang_hisdata_taketime":"It will take 30s ~ several minutes", "lang_hisdata_taketime": "It will take 30s ~ several minutes",
"lang_hisdata_notonmisskey":"Misskey is unable to request.", "lang_hisdata_notonmisskey": "Misskey is unable to request.",
"lang_hisdata_key":"This user is proofed by {{set}}", "lang_hisdata_key": "This user is proofed by {{set}}",
//userdata/showOnTL.js //userdata/showOnTL.js
"lang_showontl_movetxt":"This account was moved", "lang_showontl_movetxt": "This account was moved",
"lang_showontl_movebtn":"Continue on the new account", "lang_showontl_movebtn": "Continue on the new account",
"lang_showontl_botacct":"[bot]", "lang_showontl_botacct": "[bot]",
"lang_showontl_followed":"Following you", "lang_showontl_followed": "Following you",
"lang_showontl_notf":"Notification ", "lang_showontl_notf": "Notification ",
"lang_showontl_domain":"Domain ", "lang_showontl_domain": "Domain ",
"lang_showontl_listwarn":"Follow to add this user to lists.", "lang_showontl_listwarn": "Follow to add this user to lists.",
"lang_showontl_verified":"This website is verified by owner at ", "lang_showontl_verified": "This website is verified by owner at ",
//parse //parse
"lang_parse_mentioned":" replied to you", "lang_parse_mentioned": " replied to you",
"lang_parse_faved":" favourited your toot", "lang_parse_faved": " favourited your toot",
"lang_parse_bted":" boosted your toot", "lang_parse_bted": " boosted your toot",
"lang_parse_btedsimple":" boosted", "lang_parse_btedsimple": " boosted",
"lang_parse_polled":"'s poll", "lang_parse_polled": "'s poll",
"lang_parse_notftime":"Actioned at", "lang_parse_notftime": "Actioned at",
"lang_parse_cwshow":"Show", "lang_parse_cwshow": "Show",
"lang_parse_fulltext":"Full size text:", "lang_parse_fulltext": "Full size text:",
"lang_parse_autofold":"Auto folded", "lang_parse_autofold": "Auto folded",
"lang_parse_more":"More", "lang_parse_more": "More",
"lang_parse_url":"URL Analyzer", "lang_parse_url": "URL Analyzer",
"lang_parse_tagTL":"Timeline of {{tag}}", "lang_parse_tagTL": "Timeline of {{tag}}",
"lang_parse_tagtoot":"Toot with {{tag}}", "lang_parse_tagtoot": "Toot with {{tag}}",
"lang_parse_tagpin":"Pin {{tag}}", "lang_parse_tagpin": "Pin {{tag}}",
"lang_parse_public":"Public", "lang_parse_public": "Public",
"lang_parse_unlisted":"Unlisted", "lang_parse_unlisted": "Unlisted",
"lang_parse_private":"Private", "lang_parse_private": "Private",
"lang_parse_direct":"Direct", "lang_parse_direct": "Direct",
"lang_parse_clickcopy":"Click to copy text of this toot", "lang_parse_clickcopy": "Click to copy text of this toot",
"lang_parse_clickcopyurl":"Click to copy URL of this toot", "lang_parse_clickcopyurl": "Click to copy URL of this toot",
"lang_parse_trans":"Translate to Japanese", "lang_parse_trans": "Translate to Japanese",
"lang_parse_replyto":"Reply to this toot", "lang_parse_replyto": "Reply to this toot",
"lang_parse_bt":"Boost this toot", "lang_parse_bt": "Boost this toot",
"lang_parse_fav":"Favourite this toot", "lang_parse_fav": "Favourite this toot",
"lang_parse_quote":"Quote this toot", "lang_parse_quote": "Quote this toot",
"lang_parse_del":"Delete this toot", "lang_parse_del": "Delete this toot",
"lang_parse_pin":"Pin this toot", "lang_parse_pin": "Pin this toot",
"lang_parse_det":"Details via your main account.", "lang_parse_det": "Details via your main account.",
"lang_parse_redraft":"Delete & re-draft", "lang_parse_redraft": "Delete & re-draft",
"lang_parse_followed":"Followed you", "lang_parse_followed": "Followed you",
"lang_parse_clientop":"Operation of this client", "lang_parse_clientop": "Operation of this client",
"lang_parse_clienttxt":" will be", "lang_parse_clienttxt": " will be",
"lang_parse_clientno":"done nothing", "lang_parse_clientno": "done nothing",
"lang_parse_clientemp":"emphasized(/not emphasized)", "lang_parse_clientemp": "emphasized(/not emphasized)",
"lang_parse_clientmute":"muted", "lang_parse_clientmute": "muted",
"lang_parse_mute":" will be muted. You can remove on preferences.", "lang_parse_mute": " will be muted. You can remove on preferences.",
"lang_parse_voted":"Voted", "lang_parse_voted": "Voted",
"lang_parse_vote":"Vote", "lang_parse_vote": "Vote",
"lang_parse_unvoted":"Show the result without voting", "lang_parse_unvoted": "Show the result without voting",
"lang_parse_endedvote":"Expired", "lang_parse_endedvote": "Expired",
"lang_parse_thread":"Show thread", "lang_parse_thread": "Show thread",
"lang_parse_unknown":"Attached file", "lang_parse_unknown": "Attached file",
"lang_parse_nsfw":"NSFW media", "lang_parse_nsfw": "NSFW media",
//misskey //misskey
"lang_misskeyparse_renote":"Repost", "lang_misskeyparse_renote": "Repost",
"lang_misskeyparse_renoteqt":"Renote", "lang_misskeyparse_renoteqt": "Renote",
"lang_misskeyparse_reaction":"Reaction", "lang_misskeyparse_reaction": "Reaction",
"lang_misskeyparse_tagnostr":"No streaming API on Tag TLs", "lang_misskeyparse_tagnostr": "No streaming API on Tag TLs",
"lang_misskeyparse_listnostr":"No streaming API on List TLs", "lang_misskeyparse_listnostr": "No streaming API on List TLs",
"lang_misskeyparse_home":"Home", "lang_misskeyparse_home": "Home",
"lang_misskeyparse_followers":"Follower", "lang_misskeyparse_followers": "Follower",
"lang_misskeyparse_specified":"Specified User", "lang_misskeyparse_specified": "Specified User",
"lang_misskeyparse_qt":"Misskey renote(quote) mode:Ctrl+Shift+Enter to clear", "lang_misskeyparse_qt": "Misskey renote(quote) mode:Ctrl+Shift+Enter to clear",
"lang_misskeyparse_renoted":" renoted your following post.", "lang_misskeyparse_renoted": " renoted your following post.",
"lang_misskeyparse_quoted":" quoted your following post.", "lang_misskeyparse_quoted": " quoted your following post.",
"lang_misskeyparse_reacted":" reacted your following post.", "lang_misskeyparse_reacted": " reacted your following post.",
//setting //setting
"lang_setting_time":"Time format:{{set}}", "lang_setting_time": "Time format:{{set}}",
"lang_setting_theme":"Theme:{{set}}", "lang_setting_theme": "Theme:{{set}}",
"lang_setting_nsfw":"NSFW:{{set}}", "lang_setting_nsfw": "NSFW:{{set}}",
"lang_setting_cw":"CW:{{set}}", "lang_setting_cw": "CW:{{set}}",
"lang_setting_cwtext":"Default CW text:{{set}}", "lang_setting_cwtext": "Default CW text:{{set}}",
"lang_setting_cws":"Always CW on:{{set}}", "lang_setting_cws": "Always CW on:{{set}}",
"lang_setting_rp":"Reply counter:{{set}}", "lang_setting_rp": "Reply counter:{{set}}",
"lang_setting_vis":"Default visibility:{{set}}", "lang_setting_vis": "Default visibility:{{set}}",
"lang_setting_popup":"Popup notification:{{set}}", "lang_setting_popup": "Popup notification:{{set}}",
"lang_setting_off":"Off", "lang_setting_off": "Off",
"lang_setting_s":"s", "lang_setting_s": "s",
"lang_setting_box":"Default toot box action:{{set}}", "lang_setting_box": "Default toot box action:{{set}}",
"lang_setting_gif":"GIF:{{set}}", "lang_setting_gif": "GIF:{{set}}",
"lang_setting_selt":"Auto fold:{{set1}} lines and above, {{set2}} letters and above", "lang_setting_selt": "Auto fold:{{set1}} lines and above, {{set2}} letters and above",
"lang_setting_autocw":"Auto CW:{{set1}} lines and above, {{set2}} letters and above", "lang_setting_autocw": "Auto CW:{{set1}} lines and above, {{set2}} letters and above",
"lang_setting_width":"Minimam width:{{set}}", "lang_setting_width": "Minimam width:{{set}}",
"lang_setting_fixwidth":"TweetDeck fixed width:{{set}}px", "lang_setting_fixwidth": "TweetDeck fixed width:{{set}}px",
"lang_setting_img":"After posting an image:{{set}}", "lang_setting_img": "After posting an image:{{set}}",
"lang_setting_font":"Fonts:{{set}}", "lang_setting_font": "Fonts:{{set}}",
"lang_setting_default":"default font", "lang_setting_default": "default font",
"lang_setting_size":"Font size:{{set}}px", "lang_setting_size": "Font size:{{set}}px",
"lang_setting_imgheight":"Image height:{{set}}px", "lang_setting_imgheight": "Image height:{{set}}px",
"lang_setting_ticker":"#InstanceTicker:{{set}}px", "lang_setting_ticker": "#InstanceTicker:{{set}}px",
"lang_setting_animation":"Animation: {{set}}", "lang_setting_animation": "Animation: {{set}}",
"lang_setting_tag":"Tag TL:{{set}}", "lang_setting_tag": "Tag TL:{{set}}",
"lang_setting_boxConfirm":"Post box:{{set}}", "lang_setting_boxConfirm": "Post box:{{set}}",
"lang_setting_ul":"Native locale:{{set}}", "lang_setting_ul": "Native locale:{{set}}",
"lang_setting_notf":"Native notification:{{set}}", "lang_setting_notf": "Native notification:{{set}}",
"lang_setting_quote":"Quote format:{{set}}", "lang_setting_quote": "Quote format:{{set}}",
"lang_setting_via":"Via:{{set}}", "lang_setting_via": "Via:{{set}}",
"lang_setting_mov":"Action buttons hiding:{{set}}", "lang_setting_mov": "Action buttons hiding:{{set}}",
"lang_setting_setasread":"Notification markers:{{set}}", "lang_setting_setasread": "Notification markers:{{set}}",
"lang_setting_main":"Default account:{{set}}", "lang_setting_main": "Default account:{{set}}",
"lang_setting_sec":"Secondary toot button:{{set}}", "lang_setting_sec": "Secondary toot button:{{set}}",
"lang_setting_ksref":"Keyboard shortcuts are refreshed.", "lang_setting_ksref": "Keyboard shortcuts are refreshed.",
"lang_setting_nomuting":"No client is muted.", "lang_setting_nomuting": "No client is muted.",
"lang_setting_notftest":" Notification test ", "lang_setting_notftest": " Notification test ",
"lang_setting_notftestprof":"Your icon is shown.", "lang_setting_notftestprof": "Your icon is shown.",
"lang_setting_exportwarn":"Only important data will be exported. You must keep this data secure.", "lang_setting_exportwarn": "Only important data will be exported. You must keep this data secure.",
"lang_setting_importwarn":"All data will be deleted.", "lang_setting_importwarn": "All data will be deleted.",
} }

View File

@ -1,254 +1,254 @@
//commonError //commonError
var lang={ var lang = {
"language":"ja", "language": "ja",
"lang_toot":"トゥート", "lang_toot": "トゥート",
"lang_there":"あり", "lang_there": "あり",
"lang_nothing":"なし", "lang_nothing": "なし",
"lang_yesno":"はい", "lang_yesno": "はい",
"lang_no":"いいえ", "lang_no": "いいえ",
"lang_progress":"処理中", "lang_progress": "処理中",
"lang_edit":"編集", "lang_edit": "編集",
"lang_del":"削除", "lang_del": "削除",
"lang_add":"追加", "lang_add": "追加",
"lang_fatalerroroccured":"エラーが発生しました。しばらく待ってから再起動してください。", "lang_fatalerroroccured": "エラーが発生しました。しばらく待ってから再起動してください。",
"lang_speech":"Google 日本語", "lang_speech": "Google 日本語",
//language.html //language.html
"lang_lang":"言語", "lang_lang": "言語",
"lang_langlocale":"日本語", "lang_langlocale": "日本語",
"lang_back":"戻る", "lang_back": "戻る",
"lang_set":"設定", "lang_set": "設定",
"lang_langadd":"<a href=\"https://github.com/cutls/TheDesk\" target=\"_blank\">GitHub</a>から翻訳に参加できます。英語の校正(緊急)や他言語に翻訳していただける方を募集しております。", "lang_langadd": "<a href=\"https://github.com/cutls/TheDesk\" target=\"_blank\">GitHub</a>から翻訳に参加できます。英語の校正(緊急)や他言語に翻訳していただける方を募集しております。",
//common/version.js //common/version.js
"lang_version_usever":"お使いのバージョン{{ver}}は最新です。", "lang_version_usever": "お使いのバージョン{{ver}}は最新です。",
"lang_version_skipver":"アップデートはスキップされました。", "lang_version_skipver": "アップデートはスキップされました。",
"lang_version_platform":"このソフトウェアはMicrosoft Storeからダウンロードされましたか(「はい」を選択すると次回からアップデート通知を無視します。)", "lang_version_platform": "このソフトウェアはMicrosoft Storeからダウンロードされましたか(「はい」を選択すると次回からアップデート通知を無視します。)",
"lang_version_platform_linux":"このソフトウェアはSnapcraft(snapd)からインストールしましたか?(「はい」を選択すると次回からアップデート通知を無視します。)", "lang_version_platform_linux": "このソフトウェアはSnapcraft(snapd)からインストールしましたか?(「はい」を選択すると次回からアップデート通知を無視します。)",
"lang_version_platform_mac":"このソフトウェアはHomebrew Caskからインストールしましたか(「はい」を選択すると次回からアップデート通知を無視します。)", "lang_version_platform_mac": "このソフトウェアはHomebrew Caskからインストールしましたか(「はい」を選択すると次回からアップデート通知を無視します。)",
//login //login
//login/login.js //login/login.js
"lang_login_noauth":"認証せずに見る", "lang_login_noauth": "認証せずに見る",
//login/manager.js //login/manager.js
"lang_manager_info":"インスタンス情報", "lang_manager_info": "インスタンス情報",
"lang_manager_refresh":"情報更新", "lang_manager_refresh": "情報更新",
"lang_manager_delete":"削除", "lang_manager_delete": "削除",
"lang_manager_color":"アカウントカラーを選択", "lang_manager_color": "アカウントカラーを選択",
"lang_manager_confirm":"を削除します。", "lang_manager_confirm": "を削除します。",
"lang_manager_mainAcct":"メインアカウントを設定しました。", "lang_manager_mainAcct": "メインアカウントを設定しました。",
"lang_manager_def":"既定", "lang_manager_def": "既定",
"lang_manager_none":"なし", "lang_manager_none": "なし",
"lang_manager_godev":"MisskeyのDevセンターに移動します。同時に開かれるドキュメントを参考にログインしてください。", "lang_manager_godev": "MisskeyのDevセンターに移動します。同時に開かれるドキュメントを参考にログインしてください。",
//post/bb-md.js //post/bb-md.js
"lang_bbmd_misskey":"TheDeskにおけるMisskeyでは、@を返信として扱いますが、全ての@は消去され別パラメータに入力されます。また、「未収載」を「ホーム」として扱います。", "lang_bbmd_misskey": "TheDeskにおけるMisskeyでは、@を返信として扱いますが、全ての@は消去され別パラメータに入力されます。また、「未収載」を「ホーム」として扱います。",
//post/emoji.js //post/emoji.js
"lang_emoji_get":"絵文字リストを取得", "lang_emoji_get": "絵文字リストを取得",
"lang_emoji_custom":"カスタム絵文字", "lang_emoji_custom": "カスタム絵文字",
"lang_defaultemojis_text":"{{cat}}の絵文字", "lang_defaultemojis_text": "{{cat}}の絵文字",
//post/img.js //post/img.js
"lang_postimg_previewdis":"プレビューできません。", "lang_postimg_previewdis": "プレビューできません。",
"lang_postimg_aftupload":"アップロード後はアカウントを切り替えられません。", "lang_postimg_aftupload": "アップロード後はアカウントを切り替えられません。",
"lang_postimg_delete":"この画像を削除します", "lang_postimg_delete": "この画像を削除します",
//post/post.js //post/post.js
"lang_post_tagTL":"デフォルトタグが挿入されていません。このまま投稿するとローカルには表示されません。", "lang_post_tagTL": "デフォルトタグが挿入されていません。このまま投稿するとローカルには表示されません。",
"lang_post_tagVis":"公開範囲が「公開」以外だと、タグTLに表示されません。(一部インスタンスを除く)", "lang_post_tagVis": "公開範囲が「公開」以外だと、タグTLに表示されません。(一部インスタンスを除く)",
"lang_post_cwtitle":"長文投稿の警告", "lang_post_cwtitle": "長文投稿の警告",
"lang_post_cwtxt":"指定文字数、行数を超えるトゥートを行おうとしています。\n自動CWのタイトル:", "lang_post_cwtxt": "指定文字数、行数を超えるトゥートを行おうとしています。\n自動CWのタイトル:",
"lang_post_btn1":"キャンセル(投稿しない)", "lang_post_btn1": "キャンセル(投稿しない)",
"lang_post_btn2":"自動でCWを付ける", "lang_post_btn2": "自動でCWを付ける",
"lang_post_btn3":"そのまま投稿", "lang_post_btn3": "そのまま投稿",
//post/status.js //post/status.js
"lang_status_favWarn":"お気に入り登録しました。インスタンスが違うときは時間がかかる場合があります。", "lang_status_favWarn": "お気に入り登録しました。インスタンスが違うときは時間がかかる場合があります。",
"lang_status_btWarn":"ブーストしました。インスタンスが違うときは時間がかかる場合があります。", "lang_status_btWarn": "ブーストしました。インスタンスが違うときは時間がかかる場合があります。",
"lang_status_follow":"フォロー", "lang_status_follow": "フォロー",
"lang_status_unfollow":"フォロー解除", "lang_status_unfollow": "フォロー解除",
"lang_status_block":"ブロック", "lang_status_block": "ブロック",
"lang_status_unblock":"ブロック解除", "lang_status_unblock": "ブロック解除",
"lang_status_mute":"ミュート", "lang_status_mute": "ミュート",
"lang_status_unmute":"ミュート解除", "lang_status_unmute": "ミュート解除",
"lang_status_redraft":"削除して再編集しますか?そのトゥートの全てのデータがリセットされます。この機能はベータ版です。画像は~v2.4.1で破棄されます。", "lang_status_redraft": "削除して再編集しますか?そのトゥートの全てのデータがリセットされます。この機能はベータ版です。画像は~v2.4.1で破棄されます。",
"lang_status_emphas":"を強調します。リロードしてください。", "lang_status_emphas": "を強調します。リロードしてください。",
"lang_status_unemphas":"を強調解除します。リロードしてください。", "lang_status_unemphas": "を強調解除します。リロードしてください。",
"lang_status_unendorse":"紹介解除", "lang_status_unendorse": "紹介解除",
"lang_status_endorse":"プロフで紹介する", "lang_status_endorse": "プロフで紹介する",
//post/suggest.js //post/suggest.js
"lang_suggest_nodata":"サジェストのために絵文字リストを取得してください。", "lang_suggest_nodata": "サジェストのために絵文字リストを取得してください。",
//post/use-txtbox.js //post/use-txtbox.js
"lang_usetxtbox_reply":"返信モードです。クリアするときはCtrl+Shift+Cを押してください。", "lang_usetxtbox_reply": "返信モードです。クリアするときはCtrl+Shift+Cを押してください。",
//tl/card.js //tl/card.js
"lang_cards_check":"チェック", "lang_cards_check": "チェック",
"lang_cards_pip":"ながら観モード", "lang_cards_pip": "ながら観モード",
//tl/details.js //tl/details.js
"lang_details_nodata":"データなし", "lang_details_nodata": "データなし",
"lang_details_filtered":"フィルターされました。", "lang_details_filtered": "フィルターされました。",
"lang_details_embed":"埋め込みHTMLがコピーされました。", "lang_details_embed": "埋め込みHTMLがコピーされました。",
"lang_details_url":"トゥートURLがコピーされました。", "lang_details_url": "トゥートURLがコピーされました。",
"lang_details_txt":"トゥート本文がコピーされました。", "lang_details_txt": "トゥート本文がコピーされました。",
//tl/filter.js //tl/filter.js
"lang_filter_nodata":"フィルターはありません", "lang_filter_nodata": "フィルターはありません",
"lang_filter_errordegree":"適応範囲を最低一つ以上チェックしてください。", "lang_filter_errordegree": "適応範囲を最低一つ以上チェックしてください。",
//tl/list.js //tl/list.js
"lang_list_nodata":"リストはありません", "lang_list_nodata": "リストはありません",
"lang_list_show":"表示", "lang_list_show": "表示",
"lang_list_users":"ユーザー一覧", "lang_list_users": "ユーザー一覧",
"lang_list_nouser":"ユーザーはいません", "lang_list_nouser": "ユーザーはいません",
"lang_list_add":"リストに追加", "lang_list_add": "リストに追加",
"lang_list_add_misskey":"(重複追加の可能性があります)", "lang_list_add_misskey": "(重複追加の可能性があります)",
"lang_list_remove":"リストから削除", "lang_list_remove": "リストから削除",
//tl/notification.js //tl/notification.js
"lang_notf_new":"件の新しい通知", "lang_notf_new": "件の新しい通知",
//tl/speech.js //tl/speech.js
"lang_speech_refresh":"音声読み上げ設定を更新しました。", "lang_speech_refresh": "音声読み上げ設定を更新しました。",
//tl/src.js //tl/src.js
"lang_src_ts":"時系列", "lang_src_ts": "時系列",
"lang_src_people":"人がトゥート", "lang_src_people": "人がトゥート",
//tl/tag.js //tl/tag.js
"lang_tags_always":"常に", "lang_tags_always": "常に",
"lang_tags_realtime":"実況", "lang_tags_realtime": "実況",
"lang_tags_tagunpin":"{{tag}}をよく使うタグから削除", "lang_tags_tagunpin": "{{tag}}をよく使うタグから削除",
"lang_tags_unrealtime":"実況解除", "lang_tags_unrealtime": "実況解除",
"lang_tags_tagwarn":"{{tag}}がない場合自動で補完されます。", "lang_tags_tagwarn": "{{tag}}がない場合自動で補完されます。",
//tl/tl.js //tl/tl.js
"lang_tl_media":"メディア", "lang_tl_media": "メディア",
"lang_tl_reconnect":"Streamingに再接続しました", "lang_tl_reconnect": "Streamingに再接続しました",
//ui/img.js //ui/img.js
"lang_img_DLDone":"ダウンロード先:", "lang_img_DLDone": "ダウンロード先:",
//ui/layout.js //ui/layout.js
"lang_layout_gotop":"一番上へ。アイコンが赤のときはストリーミングに接続できていません。F5等で再読込をお試し下さい。", "lang_layout_gotop": "一番上へ。アイコンが赤のときはストリーミングに接続できていません。F5等で再読込をお試し下さい。",
"lang_layout_thisacct":"このアカウントの{{notf}}", "lang_layout_thisacct": "このアカウントの{{notf}}",
"lang_layout_delthis":"このカラムを削除", "lang_layout_delthis": "このカラムを削除",
"lang_layout_setthis":"このカラムの設定", "lang_layout_setthis": "このカラムの設定",
"lang_layout_mediafil":"メディアフィルター", "lang_layout_mediafil": "メディアフィルター",
"lang_layout_linkana":"リンク解析", "lang_layout_linkana": "リンク解析",
"lang_layout_linkanades":"リンクの解析を切り替え", "lang_layout_linkanades": "リンクの解析を切り替え",
"lang_layout_tts":"読み上げ", "lang_layout_tts": "読み上げ",
"lang_layout_reconnect":"ストリーミング再接続", "lang_layout_reconnect": "ストリーミング再接続",
"lang_layout_headercolor":"TLヘッダーカラー", "lang_layout_headercolor": "TLヘッダーカラー",
"lang_layout_nodata":"[ここにトゥートはありません。]<br>F5/⌘+Rで再読込できます。", "lang_layout_nodata": "[ここにトゥートはありません。]<br>F5/⌘+Rで再読込できます。",
"lang_layout_dm":"ダイレクトメッセージ", "lang_layout_dm": "ダイレクトメッセージ",
"lang_layout_webviewmode":"WebView優先", "lang_layout_webviewmode": "WebView優先",
"lang_excluded":"除外する通知", "lang_excluded": "除外する通知",
"lang_layout_excludingbt":"BT表示(OFF/BT除外/BTのみ)", "lang_layout_excludingbt": "BT表示(OFF/BT除外/BTのみ)",
"lang_layout_leftFold":"左へ重ねる", "lang_layout_leftFold": "左へ重ねる",
"lang_layout_leftUnfold":"右へ出す", "lang_layout_leftUnfold": "右へ出す",
//ui/sort.js //ui/sort.js
"lang_sort_gothis":"このカラムへ", "lang_sort_gothis": "このカラムへ",
"lang_sort_remthis":"このカラムを削除", "lang_sort_remthis": "このカラムを削除",
//ui/spotify.js //ui/spotify.js
"lang_spotify_img":"アルバムアートワークを添付します。", "lang_spotify_img": "アルバムアートワークを添付します。",
"lang_spotify_imgno":"アルバムアートワークを添付しません。", "lang_spotify_imgno": "アルバムアートワークを添付しません。",
"lang_spotify_acct":"アカウント連携をしてください。", "lang_spotify_acct": "アカウント連携をしてください。",
"lang_spotify_np":"NowPlaying文書を更新しました。", "lang_spotify_np": "NowPlaying文書を更新しました。",
"lang_setting_npprovide":"NowPlayingのソースを{{set}}に設定しました。", "lang_setting_npprovide": "NowPlayingのソースを{{set}}に設定しました。",
//userdata/his-data.js //userdata/his-data.js
"lang_hisdata_frcreq":"Mastodon 2.4.3~が必要です", "lang_hisdata_frcreq": "Mastodon 2.4.3~が必要です",
"lang_hisdata_frcwarn":"非フォローだけど絡みがある時に表示されます。", "lang_hisdata_frcwarn": "非フォローだけど絡みがある時に表示されます。",
"lang_hisdata_taketime":"30秒から数分かかります", "lang_hisdata_taketime": "30秒から数分かかります",
"lang_hisdata_notonmisskey":"このシステムはMisskeyにはありません。", "lang_hisdata_notonmisskey": "このシステムはMisskeyにはありません。",
"lang_hisdata_key":"このユーザーの信頼性は{{set}}によって示されています", "lang_hisdata_key": "このユーザーの信頼性は{{set}}によって示されています",
//userdata/showOnTL.js //userdata/showOnTL.js
"lang_showontl_movetxt":"このアカウントは移行しています", "lang_showontl_movetxt": "このアカウントは移行しています",
"lang_showontl_movebtn":"移行先を見る", "lang_showontl_movebtn": "移行先を見る",
"lang_showontl_botacct":"botアカウント", "lang_showontl_botacct": "botアカウント",
"lang_showontl_followed":"フォローされています", "lang_showontl_followed": "フォローされています",
"lang_showontl_notf":"通知", "lang_showontl_notf": "通知",
"lang_showontl_domain":"ドメイン", "lang_showontl_domain": "ドメイン",
"lang_showontl_listwarn":"リストに追加するためにはフォローが必要です。", "lang_showontl_listwarn": "リストに追加するためにはフォローが必要です。",
"lang_showontl_verified":"このユーザーの所持するWebサイトであると証明されています。", "lang_showontl_verified": "このユーザーの所持するWebサイトであると証明されています。",
//parse //parse
"lang_parse_mentioned":"が返信しました", "lang_parse_mentioned": "が返信しました",
"lang_parse_faved":"がお気に入り登録しました", "lang_parse_faved": "がお気に入り登録しました",
"lang_parse_bted":"がブーストしました", "lang_parse_bted": "がブーストしました",
"lang_parse_btedsimple":"がブースト", "lang_parse_btedsimple": "がブースト",
"lang_parse_polled":"のアンケート", "lang_parse_polled": "のアンケート",
"lang_parse_notftime":"通知された時間", "lang_parse_notftime": "通知された時間",
"lang_parse_cwshow":"見る", "lang_parse_cwshow": "見る",
"lang_parse_fulltext":"以下全文", "lang_parse_fulltext": "以下全文",
"lang_parse_autofold":"自動折り畳み", "lang_parse_autofold": "自動折り畳み",
"lang_parse_more":"続き...", "lang_parse_more": "続き...",
"lang_parse_url":"URL解析", "lang_parse_url": "URL解析",
"lang_parse_tagTL":"{{tag}}のタイムライン", "lang_parse_tagTL": "{{tag}}のタイムライン",
"lang_parse_tagtoot":"{{tag}}でトゥート", "lang_parse_tagtoot": "{{tag}}でトゥート",
"lang_parse_tagpin":"{{tag}}をよく使うタグへ", "lang_parse_tagpin": "{{tag}}をよく使うタグへ",
"lang_parse_public":"公開", "lang_parse_public": "公開",
"lang_parse_unlisted":"未収載", "lang_parse_unlisted": "未収載",
"lang_parse_private":"非公開", "lang_parse_private": "非公開",
"lang_parse_direct":"ダイレクト", "lang_parse_direct": "ダイレクト",
"lang_parse_clickcopy":"クリックして本文をコピー", "lang_parse_clickcopy": "クリックして本文をコピー",
"lang_parse_clickcopyurl":"クリックしてトゥートURLをコピー", "lang_parse_clickcopyurl": "クリックしてトゥートURLをコピー",
"lang_parse_trans":"このトゥートを日本語に翻訳", "lang_parse_trans": "このトゥートを日本語に翻訳",
"lang_parse_replyto":"このトゥートに返信", "lang_parse_replyto": "このトゥートに返信",
"lang_parse_bt":"このトゥートをブースト", "lang_parse_bt": "このトゥートをブースト",
"lang_parse_fav":"このトゥートをお気に入り登録", "lang_parse_fav": "このトゥートをお気に入り登録",
"lang_parse_quote":"このトゥートを引用", "lang_parse_quote": "このトゥートを引用",
"lang_parse_del":"このトゥートを削除", "lang_parse_del": "このトゥートを削除",
"lang_parse_pin":"このトゥートをピン留め", "lang_parse_pin": "このトゥートをピン留め",
"lang_parse_det":"詳細(メインアカウント経由)", "lang_parse_det": "詳細(メインアカウント経由)",
"lang_parse_redraft":"このトゥートを削除して再編集", "lang_parse_redraft": "このトゥートを削除して再編集",
"lang_parse_followed":"フォローされました。", "lang_parse_followed": "フォローされました。",
"lang_parse_clientop":"クライアント処理", "lang_parse_clientop": "クライアント処理",
"lang_parse_clienttxt":"に対する処理を選択してください。", "lang_parse_clienttxt": "に対する処理を選択してください。",
"lang_parse_clientno":"何もしない", "lang_parse_clientno": "何もしない",
"lang_parse_clientemp":"強調表示/解除", "lang_parse_clientemp": "強調表示/解除",
"lang_parse_clientmute":"ミュート", "lang_parse_clientmute": "ミュート",
"lang_parse_mute":"ミュートします。設定から解除できます。", "lang_parse_mute": "ミュートします。設定から解除できます。",
"lang_parse_voted":"投票済みです", "lang_parse_voted": "投票済みです",
"lang_parse_vote":"投票", "lang_parse_vote": "投票",
"lang_parse_unvoted":"結果だけ見る", "lang_parse_unvoted": "結果だけ見る",
"lang_parse_endedvote":"終了済み", "lang_parse_endedvote": "終了済み",
"lang_parse_thread":"会話を表示", "lang_parse_thread": "会話を表示",
"lang_parse_unknown":"添付ファイル", "lang_parse_unknown": "添付ファイル",
"lang_parse_nsfw":"閲覧注意", "lang_parse_nsfw": "閲覧注意",
//misskey //misskey
"lang_misskeyparse_renote":"再投稿", "lang_misskeyparse_renote": "再投稿",
"lang_misskeyparse_renoteqt":"引用", "lang_misskeyparse_renoteqt": "引用",
"lang_misskeyparse_reaction":"リアクション", "lang_misskeyparse_reaction": "リアクション",
"lang_misskeyparse_tagnostr":"タグTLはストリーミング非対応です。", "lang_misskeyparse_tagnostr": "タグTLはストリーミング非対応です。",
"lang_misskeyparse_listnostr":"リストTLはストリーミング非対応です。", "lang_misskeyparse_listnostr": "リストTLはストリーミング非対応です。",
"lang_misskeyparse_home":"ホーム", "lang_misskeyparse_home": "ホーム",
"lang_misskeyparse_followers":"フォロワー", "lang_misskeyparse_followers": "フォロワー",
"lang_misskeyparse_specified":"ユーザー指定", "lang_misskeyparse_specified": "ユーザー指定",
"lang_misskeyparse_qt":"MisskeyのRenote(引用モード)中:Ctrl+Shift+Cでクリア", "lang_misskeyparse_qt": "MisskeyのRenote(引用モード)中:Ctrl+Shift+Cでクリア",
"lang_misskeyparse_renoted":"がRepost", "lang_misskeyparse_renoted": "がRepost",
"lang_misskeyparse_quoted":"が引用", "lang_misskeyparse_quoted": "が引用",
"lang_misskeyparse_reacted":"がリアクション", "lang_misskeyparse_reacted": "がリアクション",
//setting //setting
"lang_setting_time":"時間設定を{{set}}に設定しました。", "lang_setting_time": "時間設定を{{set}}に設定しました。",
"lang_setting_theme":"テーマ設定を{{set}}に設定しました。", "lang_setting_theme": "テーマ設定を{{set}}に設定しました。",
"lang_setting_nsfw":"画像表示設定を{{set}}に設定しました。", "lang_setting_nsfw": "画像表示設定を{{set}}に設定しました。",
"lang_setting_cw":"テキスト表示設定を{{set}}に設定しました。", "lang_setting_cw": "テキスト表示設定を{{set}}に設定しました。",
"lang_setting_cwtext":"デフォルトの警告文を「{{set}}」に設定しました。", "lang_setting_cwtext": "デフォルトの警告文を「{{set}}」に設定しました。",
"lang_setting_cws":"標準でCW:{{set}}", "lang_setting_cws": "標準でCW:{{set}}",
"lang_setting_rp":"リプライ数表示:{{set}}", "lang_setting_rp": "リプライ数表示:{{set}}",
"lang_setting_vis":"デフォルトの公開設定を{{set}}に設定しました。", "lang_setting_vis": "デフォルトの公開設定を{{set}}に設定しました。",
"lang_setting_popup":"ポップアップお知らせを{{set}}に設定しました。", "lang_setting_popup": "ポップアップお知らせを{{set}}に設定しました。",
"lang_setting_off":"オフ", "lang_setting_off": "オフ",
"lang_setting_s":"秒", "lang_setting_s": "秒",
"lang_setting_box":"デフォルトでのボックスの挙動を{{set}}に設定しました。", "lang_setting_box": "デフォルトでのボックスの挙動を{{set}}に設定しました。",
"lang_setting_gif":"アイコンアニメーション再生を{{set}}に設定しました。", "lang_setting_gif": "アイコンアニメーション再生を{{set}}に設定しました。",
"lang_setting_selt":"{{set1}}行以上または{{set2}}文字以上でテキストを隠します。", "lang_setting_selt": "{{set1}}行以上または{{set2}}文字以上でテキストを隠します。",
"lang_setting_autocw":"{{set1}}行以上または{{set2}}文字以上で警告を表示します。", "lang_setting_autocw": "{{set1}}行以上または{{set2}}文字以上で警告を表示します。",
"lang_setting_width":"横幅最低を{{set}}pxに設定しました。", "lang_setting_width": "横幅最低を{{set}}pxに設定しました。",
"lang_setting_fixwidth":"TweetDeckの横幅を{{set}}pxに設定しました。", "lang_setting_fixwidth": "TweetDeckの横幅を{{set}}pxに設定しました。",
"lang_setting_img":"画像投稿後の設定を「{{set}}」に設定しました。", "lang_setting_img": "画像投稿後の設定を「{{set}}」に設定しました。",
"lang_setting_font":"フォントを{{set}}に設定しました。", "lang_setting_font": "フォントを{{set}}に設定しました。",
"lang_setting_default":"デフォルト", "lang_setting_default": "デフォルト",
"lang_setting_size":"フォントサイズを{{set}}pxに設定しました。", "lang_setting_size": "フォントサイズを{{set}}pxに設定しました。",
"lang_setting_imgheight":"画像高さを{{set}}pxに設定しました。", "lang_setting_imgheight": "画像高さを{{set}}pxに設定しました。",
"lang_setting_ticker":"#InstanceTicker使用を{{set}}に設定しました。", "lang_setting_ticker": "#InstanceTicker使用を{{set}}に設定しました。",
"lang_setting_animation":"アニメーションを{{set}}に設定しました。", "lang_setting_animation": "アニメーションを{{set}}に設定しました。",
"lang_setting_tag":"タグの取得範囲を「{{set}}」に設定しました。", "lang_setting_tag": "タグの取得範囲を「{{set}}」に設定しました。",
"lang_setting_boxConfirm":"投稿ボックスを{{set}}", "lang_setting_boxConfirm": "投稿ボックスを{{set}}",
"lang_setting_ul":"独自ロケール設定を{{set}}に設定しました。", "lang_setting_ul": "独自ロケール設定を{{set}}に設定しました。",
"lang_setting_notf":"ネイティブ通知を{{set}}に設定しました。", "lang_setting_notf": "ネイティブ通知を{{set}}に設定しました。",
"lang_setting_quote":"引用形式を{{set}}に設定しました。", "lang_setting_quote": "引用形式を{{set}}に設定しました。",
"lang_setting_via":"via表示を{{set}}に設定しました。", "lang_setting_via": "via表示を{{set}}に設定しました。",
"lang_setting_mov":"アクションボタン非表示を{{set}}に設定しました。", "lang_setting_mov": "アクションボタン非表示を{{set}}に設定しました。",
"lang_setting_setasread":"通知カラム存在時新着非表示を{{set}}に設定しました。", "lang_setting_setasread": "通知カラム存在時新着非表示を{{set}}に設定しました。",
"lang_setting_main":"起動時・投稿時のアカウントを{{set}}に設定しました。", "lang_setting_main": "起動時・投稿時のアカウントを{{set}}に設定しました。",
"lang_setting_sec":"セカンダリートゥートボタン:{{set}}", "lang_setting_sec": "セカンダリートゥートボタン:{{set}}",
"lang_setting_ksref":"キーボードショートカットが更新されました。", "lang_setting_ksref": "キーボードショートカットが更新されました。",
"lang_setting_nomuting":"ミュートしているクライアントはありません。", "lang_setting_nomuting": "ミュートしているクライアントはありません。",
"lang_setting_notftest":"通知テスト", "lang_setting_notftest": "通知テスト",
"lang_setting_notftestprof":"アイコンはあなたのアカウントのものです。", "lang_setting_notftestprof": "アイコンはあなたのアカウントのものです。",
"lang_setting_exportwarn":"重要なデータのみエクスポートされます。エクスポートされたデータは外部に公開しないでください。全ての認証データが含まれています。", "lang_setting_exportwarn": "重要なデータのみエクスポートされます。エクスポートされたデータは外部に公開しないでください。全ての認証データが含まれています。",
"lang_setting_importwarn":"全てのデータがリセットされます。" "lang_setting_importwarn": "全てのデータがリセットされます。"
} }

View File

@ -1,4 +1,4 @@
var lang={ var lang = {
"language": "crwdns1960:0crwdne1960:0", "language": "crwdns1960:0crwdne1960:0",
"lang_toot": "crwdns1962:0crwdne1962:0", "lang_toot": "crwdns1962:0crwdne1962:0",
"lang_there": "crwdns1964:0crwdne1964:0", "lang_there": "crwdns1964:0crwdne1964:0",

View File

@ -1,126 +1,126 @@
//インスタンスリスト //インスタンスリスト
var idata={ var idata = {
"kirishima.cloud":"instance", "kirishima.cloud": "instance",
"kirishima.cloud_name":"アスタルテ", "kirishima.cloud_name": "アスタルテ",
"kirishima.cloud_letters":"6229", "kirishima.cloud_letters": "6229",
"kirishima.cloud_bbcode":"enabled", "kirishima.cloud_bbcode": "enabled",
"kirishima.cloud_markdown":"enabled", "kirishima.cloud_markdown": "enabled",
"kirishima.cloud_glitch":"enabled", "kirishima.cloud_glitch": "enabled",
"kirishima.cloud_public":"パブリックタイムライン", "kirishima.cloud_public": "パブリックタイムライン",
"minohdon.jp":"instance", "minohdon.jp": "instance",
"minohdon.jp_name":"箕面どん", "minohdon.jp_name": "箕面どん",
"minohdon.jp_letters":"500", "minohdon.jp_letters": "500",
"minohdon.jp_bbcode":"disabled", "minohdon.jp_bbcode": "disabled",
"minohdon.jp_markdown":"disabled", "minohdon.jp_markdown": "disabled",
"minohdon.jp_glitch":"disabled", "minohdon.jp_glitch": "disabled",
"knzk.me":"instance", "knzk.me": "instance",
"knzk.me_name":"Knzk", "knzk.me_name": "Knzk",
"knzk.me_letters":"5000", "knzk.me_letters": "5000",
"knzk.me_bbcode":"disabled", "knzk.me_bbcode": "disabled",
"knzk.me_markdown":"disabled", "knzk.me_markdown": "disabled",
"knzk.me_glitch":"disabled", "knzk.me_glitch": "disabled",
"mastodos.com":"instance", "mastodos.com": "instance",
"mastodos.com_name":"マストどす", "mastodos.com_name": "マストどす",
"mastodos.com_letters":"500", "mastodos.com_letters": "500",
"mastodos.com_bbcode":"disabled", "mastodos.com_bbcode": "disabled",
"mastodos.com_markdown":"disabled", "mastodos.com_markdown": "disabled",
"mastodos.com_glitch":"disabled", "mastodos.com_glitch": "disabled",
"dev.kirishima.cloud":"hidden", "dev.kirishima.cloud": "hidden",
"dev.kirishima.cloud_name":"アスタルテ(Dev)", "dev.kirishima.cloud_name": "アスタルテ(Dev)",
"dev.kirishima.cloud_letters":"6229", "dev.kirishima.cloud_letters": "6229",
"dev.kirishima.cloud_bbcode":"enabled", "dev.kirishima.cloud_bbcode": "enabled",
"dev.kirishima.cloud_markdown":"enabled", "dev.kirishima.cloud_markdown": "enabled",
"dev.kirishima.cloud_glitch":"enabled", "dev.kirishima.cloud_glitch": "enabled",
"mstdn.y-zu.org":"instance", "mstdn.y-zu.org": "instance",
"mstdn.y-zu.org_name":"Yづドン(Y-zuDon)", "mstdn.y-zu.org_name": "Yづドン(Y-zuDon)",
"mstdn.y-zu.org_letters":"500", "mstdn.y-zu.org_letters": "500",
"mstdn.y-zu.org_bbcode":"disabled", "mstdn.y-zu.org_bbcode": "disabled",
"mstdn.y-zu.org_markdown":"enabled", "mstdn.y-zu.org_markdown": "enabled",
"mstdn.y-zu.org_glitch":"disabled", "mstdn.y-zu.org_glitch": "disabled",
"imastodon.net":"instance", "imastodon.net": "instance",
"imastodon.net_name":"im@stodon", "imastodon.net_name": "im@stodon",
"imastodon.net_letters":"500", "imastodon.net_letters": "500",
"imastodon.net_bbcode":"disabled", "imastodon.net_bbcode": "disabled",
"imastodon.net_markdown":"disabled", "imastodon.net_markdown": "disabled",
"imastodon.net_home":"オフィス", "imastodon.net_home": "オフィス",
"imastodon.net_local":"楽屋", "imastodon.net_local": "楽屋",
"imastodon.net_notification":"ホワイトボード", "imastodon.net_notification": "ホワイトボード",
"imastodon.net_public":"ライブステージ", "imastodon.net_public": "ライブステージ",
"imastodon.net_post":"あふぅ", "imastodon.net_post": "あふぅ",
"imastodon.net_fav":"の頭にティンときたようです", "imastodon.net_fav": "の頭にティンときたようです",
"imastodon.net_bt":":「わかるわ」", "imastodon.net_bt": ":「わかるわ」",
"imastodon.net_follow":"名刺をいただきました", "imastodon.net_follow": "名刺をいただきました",
"imastodon.net_glitch":"disabled", "imastodon.net_glitch": "disabled",
"mstdn.osaka":"instance", "mstdn.osaka": "instance",
"mstdn.osaka_name":"大阪丼", "mstdn.osaka_name": "大阪丼",
"mstdn.osaka_letters":"500", "mstdn.osaka_letters": "500",
"mstdn.osaka_bbcode":"disabled", "mstdn.osaka_bbcode": "disabled",
"mstdn.osaka_markdown":"disabled", "mstdn.osaka_markdown": "disabled",
"mstdn.osaka_home":"ウチ", "mstdn.osaka_home": "ウチ",
"mstdn.osaka_local":"近所", "mstdn.osaka_local": "近所",
"mstdn.osaka_notification":"あめちゃん", "mstdn.osaka_notification": "あめちゃん",
"mstdn.osaka_public":"新世界", "mstdn.osaka_public": "新世界",
"mstdn.osaka_post":"なんや!", "mstdn.osaka_post": "なんや!",
"mstdn.osaka_fav":"がええやん言いました", "mstdn.osaka_fav": "がええやん言いました",
"mstdn.osaka_bt":"がしばいた", "mstdn.osaka_bt": "がしばいた",
"mstdn.osaka_follow":"ツルまれました", "mstdn.osaka_follow": "ツルまれました",
"mstdn.osaka_glitch":"disabled", "mstdn.osaka_glitch": "disabled",
"mstdn.kemono-friends.info":"instance", "mstdn.kemono-friends.info": "instance",
"mstdn.kemono-friends.info_name":"ますとどんちほー", "mstdn.kemono-friends.info_name": "ますとどんちほー",
"mstdn.kemono-friends.info_letters":"1024", "mstdn.kemono-friends.info_letters": "1024",
"mstdn.kemono-friends.info_bbcode":"disabled", "mstdn.kemono-friends.info_bbcode": "disabled",
"mstdn.kemono-friends.info_markdown":"disabled", "mstdn.kemono-friends.info_markdown": "disabled",
"mstdn.kemono-friends.info_home":"なわばり", "mstdn.kemono-friends.info_home": "なわばり",
"mstdn.kemono-friends.info_local":"ますとどんちほー", "mstdn.kemono-friends.info_local": "ますとどんちほー",
"mstdn.kemono-friends.info_notification":"ねえねえ!", "mstdn.kemono-friends.info_notification": "ねえねえ!",
"mstdn.kemono-friends.info_public":"ジャパリパーク", "mstdn.kemono-friends.info_public": "ジャパリパーク",
"mstdn.kemono-friends.info_post":"がおー!", "mstdn.kemono-friends.info_post": "がおー!",
"mstdn.kemono-friends.info_fav":":「すごーい」", "mstdn.kemono-friends.info_fav": ":「すごーい」",
"mstdn.kemono-friends.info_bt":":「たーのしー」", "mstdn.kemono-friends.info_bt": ":「たーのしー」",
"mstdn.kemono-friends.info_glitch":"disabled", "mstdn.kemono-friends.info_glitch": "disabled",
"itabashi.0j0.jp":"instance", "itabashi.0j0.jp": "instance",
"itabashi.0j0.jp_name":"板橋丼", "itabashi.0j0.jp_name": "板橋丼",
"itabashi.0j0.jp_letters":"1024", "itabashi.0j0.jp_letters": "1024",
"itabashi.0j0.jp_bbcode":"disabled", "itabashi.0j0.jp_bbcode": "disabled",
"itabashi.0j0.jp_markdown":"disabled", "itabashi.0j0.jp_markdown": "disabled",
"itabashi.0j0.jp_glitch":"disabled", "itabashi.0j0.jp_glitch": "disabled",
"dtp-mstdn.jp":"instance", "dtp-mstdn.jp": "instance",
"dtp-mstdn.jp_name":"DTP鯖", "dtp-mstdn.jp_name": "DTP鯖",
"dtp-mstdn.jp_letters":"500", "dtp-mstdn.jp_letters": "500",
"dtp-mstdn.jp_bbcode":"disabled", "dtp-mstdn.jp_bbcode": "disabled",
"dtp-mstdn.jp_markdown":"disabled", "dtp-mstdn.jp_markdown": "disabled",
"dtp-mstdn.jp_glitch":"disabled", "dtp-mstdn.jp_glitch": "disabled",
"misskey.xyz":"misskey", "misskey.xyz": "misskey",
"misskey.xyz_name":"misskey.xyz", "misskey.xyz_name": "misskey.xyz",
"misskey.xyz_letters":"1000", "misskey.xyz_letters": "1000",
"misskey.xyz_bbcode":"disabled", "misskey.xyz_bbcode": "disabled",
"misskey.xyz_markdown":"enabled", "misskey.xyz_markdown": "enabled",
"misskey.xyz_public":"Global", "misskey.xyz_public": "Global",
"misskey.xyz_post":"Post", "misskey.xyz_post": "Post",
"misskey.xyz_fav":" reacted your post.", "misskey.xyz_fav": " reacted your post.",
"misskey.xyz_bt":" reposted your post.", "misskey.xyz_bt": " reposted your post.",
"misskey.dev":"misskey", "misskey.dev": "misskey",
"misskey.dev_name":"misskey.dev", "misskey.dev_name": "misskey.dev",
"misskey.dev_letters":"1024", "misskey.dev_letters": "1024",
"misskey.dev_bbcode":"disabled", "misskey.dev_bbcode": "disabled",
"misskey.dev_markdown":"enabled", "misskey.dev_markdown": "enabled",
"misskey.dev_public":"Global", "misskey.dev_public": "Global",
"misskey.dev_post":"Post", "misskey.dev_post": "Post",
"misskey.dev_fav":" reacted your post.", "misskey.dev_fav": " reacted your post.",
"misskey.dev_bt":" reposted your post.", "misskey.dev_bt": " reposted your post.",
"precure.ml":"instance", "precure.ml": "instance",
"precure.ml_name":"キュアスタ!", "precure.ml_name": "キュアスタ!",
"precure.ml_letters":"1024", "precure.ml_letters": "1024",
"precure.ml_bbcode":"disabled", "precure.ml_bbcode": "disabled",
"precure.ml_markdown":"disabled", "precure.ml_markdown": "disabled",
"precure.ml_post":"キュア!", "precure.ml_post": "キュア!",
"precure.ml_glitch":"disabled", "precure.ml_glitch": "disabled",
"best-friends.chat":"instance", "best-friends.chat": "instance",
"best-friends.chat_name":"Best Friends", "best-friends.chat_name": "Best Friends",
"best-friends.chat_letters":"500", "best-friends.chat_letters": "500",
"best-friends.chat_bbcode":"disabled", "best-friends.chat_bbcode": "disabled",
"best-friends.chat_markdown":"disabled", "best-friends.chat_markdown": "disabled",
"best-friends.chat_glitch":"disabled", "best-friends.chat_glitch": "disabled",
}; };
localStorage.setItem("instance", JSON.stringify(idata)); localStorage.setItem("instance", JSON.stringify(idata));

View File

@ -6,52 +6,52 @@ localStorage.removeItem("kirishima")
localStorage.removeItem("imas") localStorage.removeItem("imas")
localStorage.removeItem("image"); localStorage.removeItem("image");
localStorage.removeItem("stable") localStorage.removeItem("stable")
localStorage.setItem("mode_misskey.xyz","misskey") localStorage.setItem("mode_misskey.xyz", "misskey")
function ck() { function ck() {
var main = localStorage.getItem("main"); var main = localStorage.getItem("main");
if(!main){ if (!main) {
localStorage.setItem("main",0) localStorage.setItem("main", 0)
} }
var domainz = localStorage.getItem("domain_0"); var domainz = localStorage.getItem("domain_0");
var at = localStorage.getItem("acct_0_at"); var at = localStorage.getItem("acct_0_at");
//コード受信 //コード受信
if(location.search){ if (location.search) {
var m = location.search.match(/\?mode=([a-zA-Z-0-9]+)\&code=(.+)/); var m = location.search.match(/\?mode=([a-zA-Z-0-9]+)\&code=(.+)/);
var mode=m[1]; var mode = m[1];
var codex=m[2]; var codex = m[2];
if(mode=="manager" || mode=="login"){ if (mode == "manager" || mode == "login") {
code(codex,mode); code(codex, mode);
}else{ } else {
} }
} }
var multi = localStorage.getItem("multi"); var multi = localStorage.getItem("multi");
if(!multi || multi=="[]"){ if (!multi || multi == "[]") {
location.href="acct.html?mode=first&code=true" location.href = "acct.html?mode=first&code=true"
}else{ } else {
var obj = JSON.parse(multi); var obj = JSON.parse(multi);
Object.keys(obj).forEach(function(key) { Object.keys(obj).forEach(function (key) {
var acct=obj[key]; var acct = obj[key];
if(acct.domain){ if (acct.domain) {
refresh(key,true) refresh(key, true)
}
});
if (obj[0].domain) {
$("#tl").show();
ticker();
multiSelector();
verck(ver);
$("#something-wrong img").attr("src", "../../img/thinkingdesk.png")
} }
});
if (obj[0].domain) {
$("#tl").show();
ticker();
multiSelector();
verck(ver);
$("#something-wrong img").attr("src","../../img/thinkingdesk.png")
} }
} }
} ck();
ck();
//ログインポップアップ //ログインポップアップ
function login(url) { function login(url) {
if($('#linux:checked').val()=="on"){ if ($('#linux:checked').val() == "on") {
var red = "urn:ietf:wg:oauth:2.0:oob" var red = "urn:ietf:wg:oauth:2.0:oob"
}else{ } else {
var red = 'thedesk://login'; var red = 'thedesk://login';
} }
localStorage.setItem("redirect", red); localStorage.setItem("redirect", red);
@ -66,27 +66,27 @@ function login(url) {
redirect_uris: red, redirect_uris: red,
website: "https://thedesk.top" website: "https://thedesk.top"
})); }));
httpreq.onreadystatechange = function() { httpreq.onreadystatechange = function () {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
var json = httpreq.response; var json = httpreq.response;
var auth = "https://" + url + "/oauth/authorize?client_id=" + json[ var auth = "https://" + url + "/oauth/authorize?client_id=" + json[
"client_id"] + "&client_secret=" + json["client_secret"] + "client_id"] + "&client_secret=" + json["client_secret"] +
"&response_type=code&redirect_uri="+red+"&scope=read+write+follow"; "&response_type=code&redirect_uri=" + red + "&scope=read+write+follow";
localStorage.setItem("domain_" + acct_id, url); localStorage.setItem("domain_" + acct_id, url);
localStorage.setItem("client_id", json["client_id"]); localStorage.setItem("client_id", json["client_id"]);
localStorage.setItem("client_secret", json["client_secret"]); localStorage.setItem("client_secret", json["client_secret"]);
$("#auth").show(); $("#auth").show();
$("#masara").hide(); $("#masara").hide();
const { shell } = require('electron'); const { shell } = require('electron');
shell.openExternal(auth); shell.openExternal(auth);
if($('#linux:checked').val()=="on"){ if ($('#linux:checked').val() == "on") {
}else{ } else {
var electron = require("electron"); var electron = require("electron");
var ipc = electron.ipcRenderer; var ipc = electron.ipcRenderer;
ipc.send('quit', 'go'); ipc.send('quit', 'go');
} }
} }
} }
} }
@ -99,15 +99,15 @@ function instance() {
//コードを入れた後認証 //コードを入れた後認証
function code(code,mode) { function code(code, mode) {
var red = localStorage.getItem("redirect"); var red = localStorage.getItem("redirect");
localStorage.removeItem("redirect") localStorage.removeItem("redirect")
if(!code){ if (!code) {
var code = $("#code").val(); var code = $("#code").val();
} }
if(localStorage.getItem("domain_tmp")){ if (localStorage.getItem("domain_tmp")) {
var url = localStorage.getItem("domain_tmp"); var url = localStorage.getItem("domain_tmp");
}else{ } else {
var url = localStorage.getItem("domain_" + acct_id); var url = localStorage.getItem("domain_" + acct_id);
} }
var start = "https://" + url + "/oauth/token"; var start = "https://" + url + "/oauth/token";
@ -125,21 +125,21 @@ function code(code,mode) {
client_secret: secret, client_secret: secret,
code: code code: code
}) })
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
todo(json); todo(json);
if (json["access_token"]) { if (json["access_token"]) {
localStorage.setItem(url + "_at", json["access_token"]); localStorage.setItem(url + "_at", json["access_token"]);
if(mode=="manager"){ if (mode == "manager") {
getdataAdv(url, json["access_token"]); getdataAdv(url, json["access_token"]);
}else{ } else {
getdata(); getdata();
} }
} }
}); });
} }
@ -148,7 +148,7 @@ function code(code,mode) {
function getdata() { function getdata() {
var acct_id = 0; var acct_id = 0;
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");
var start = "https://" + domain + "/api/v1/accounts/verify_credentials"; var start = "https://" + domain + "/api/v1/accounts/verify_credentials";
fetch(start, { fetch(start, {
method: 'GET', method: 'GET',
@ -156,22 +156,22 @@ function getdata() {
'content-type': 'application/json', 'content-type': 'application/json',
'Authorization': 'Bearer ' + at 'Authorization': 'Bearer ' + at
}, },
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
if (json.error) { if (json.error) {
console.error("Error:" + json.error); console.error("Error:" + json.error);
Materialize.toast(lang.lang_fatalerroroccured+"Error:" + json.error, Materialize.toast(lang.lang_fatalerroroccured + "Error:" + json.error,
5000); 5000);
return; return;
} }
var avatar=json["avatar"]; var avatar = json["avatar"];
//missingがmissingなやつ //missingがmissingなやつ
if(avatar=="/avatars/original/missing.png"){ if (avatar == "/avatars/original/missing.png") {
avatar="./img/missing.svg"; avatar = "./img/missing.svg";
} }
var obj = [{ var obj = [{
at: at, at: at,
@ -204,27 +204,27 @@ function getdataAdv(domain, at) {
'content-type': 'application/json', 'content-type': 'application/json',
'Authorization': 'Bearer ' + at 'Authorization': 'Bearer ' + at
}, },
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
if (json.error) { if (json.error) {
console.error("Error:" + json.error); console.error("Error:" + json.error);
Materialize.toast(lang.lang_fatalerroroccured+"Error:" + json.error, Materialize.toast(lang.lang_fatalerroroccured + "Error:" + json.error,
5000); 5000);
return; return;
} }
var avatar=json["avatar"]; var avatar = json["avatar"];
//missingがmissingなやつ //missingがmissingなやつ
if(avatar=="/avatars/original/missing.png"){ if (avatar == "/avatars/original/missing.png") {
avatar="../../img/missing.svg"; avatar = "../../img/missing.svg";
} }
if(json["source"]["privacy"]){ if (json["source"]["privacy"]) {
var priv=json["source"]["privacy"]; var priv = json["source"]["privacy"];
}else{ } else {
var priv="public"; var priv = "public";
} }
var add = { var add = {
at: at, at: at,
@ -245,14 +245,14 @@ function getdataAdv(domain, at) {
localStorage.setItem("prof_" + target, avatar); localStorage.setItem("prof_" + target, avatar);
var json = JSON.stringify(obj); var json = JSON.stringify(obj);
localStorage.setItem("multi", json); localStorage.setItem("multi", json);
location.href="index.html"; location.href = "index.html";
}); });
} }
//ユーザーデータ更新 //ユーザーデータ更新
function refresh(target,loadskip) { function refresh(target, loadskip) {
var multi = localStorage.getItem("multi"); var multi = localStorage.getItem("multi");
var obj = JSON.parse(multi); var obj = JSON.parse(multi);
if(obj[target].mode=="misskey"){ if (obj[target].mode == "misskey") {
return return
} }
var start = "https://" + obj[target].domain + var start = "https://" + obj[target].domain +
@ -263,22 +263,22 @@ function refresh(target,loadskip) {
'content-type': 'application/json', 'content-type': 'application/json',
'Authorization': 'Bearer ' + obj[target].at 'Authorization': 'Bearer ' + obj[target].at
}, },
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
if (json.error) { if (json.error) {
console.error("Error:" + json.error); console.error("Error:" + json.error);
Materialize.toast(lang.lang_fatalerroroccured+"Error:" + json.error, Materialize.toast(lang.lang_fatalerroroccured + "Error:" + json.error,
5000); 5000);
return; return;
} }
var avatar=json["avatar"]; var avatar = json["avatar"];
//missingがmissingなやつ //missingがmissingなやつ
if(avatar=="/avatars/original/missing.png" || !avatar){ if (avatar == "/avatars/original/missing.png" || !avatar) {
avatar="./img/missing.svg"; avatar = "./img/missing.svg";
} }
var ref = { var ref = {
at: obj[target].at, at: obj[target].at,
@ -297,7 +297,7 @@ function refresh(target,loadskip) {
obj[target] = ref; obj[target] = ref;
var json = JSON.stringify(obj); var json = JSON.stringify(obj);
localStorage.setItem("multi", json); localStorage.setItem("multi", json);
if(!loadskip){ if (!loadskip) {
load(); load();
} }
}); });
@ -316,94 +316,94 @@ function ckdb(acct_id) {
localStorage.removeItem("fav_" + acct_id); localStorage.removeItem("fav_" + acct_id);
localStorage.removeItem("bt_" + acct_id); localStorage.removeItem("bt_" + acct_id);
localStorage.removeItem("followlocale_" + acct_id); localStorage.removeItem("followlocale_" + acct_id);
if(domain=="kirishima.cloud"){ if (domain == "kirishima.cloud") {
localStorage.setItem("kirishima", "true"); localStorage.setItem("kirishima", "true");
$("#ranking-btn").show(); $("#ranking-btn").show();
}else if(domain=="imastodon.net"){ } else if (domain == "imastodon.net") {
localStorage.setItem("imas", "true"); localStorage.setItem("imas", "true");
$(".imasonly").show(); $(".imasonly").show();
} }
var at = localStorage.getItem("acct_"+ acct_id + "_at"); var at = localStorage.getItem("acct_" + acct_id + "_at");
var bbcode = domain + "_bbcode"; var bbcode = domain + "_bbcode";
var letters = domain + "_letters"; var letters = domain + "_letters";
if(localStorage.getItem("instance")){ if (localStorage.getItem("instance")) {
var json=JSON.parse(localStorage.getItem("instance")); var json = JSON.parse(localStorage.getItem("instance"));
if (json[bbcode]) { if (json[bbcode]) {
if (json[bbcode] == "enabled") { if (json[bbcode] == "enabled") {
localStorage.setItem("bb_" + acct_id, "true"); localStorage.setItem("bb_" + acct_id, "true");
} else {
localStorage.removeItem("bb_" + acct_id);
$("[data-activates='bbcode']").addClass("disabled");
$("[data-activates='bbcode']").prop("disabled", true);
}
} else { } else {
localStorage.removeItem("bb_" + acct_id); localStorage.removeItem("bb_" + acct_id);
$("[data-activates='bbcode']").addClass("disabled"); $("[data-activates='bbcode']").addClass("disabled");
$("[data-activates='bbcode']").addClass("disabled", true); $("[data-activates='bbcode']").prop("disabled", true);
}
if (json[domain + "_markdown"] == "enabled") {
localStorage.setItem("md_" + acct_id, "true");
$(".markdown").show();
}else{
$(".anti-markdown").hide();
$(".markdown").hide();
localStorage.removeItem("bb_" + acct_id);
}
if(json[domain + "_home"]){
localStorage.setItem("home_" + acct_id, json[domain + "_home"]);
}
if(json[domain + "_local"]){
localStorage.setItem("local_" + acct_id, json[domain + "_local"]);
}
if(json[domain + "_public"]){
localStorage.setItem("public_" + acct_id, json[domain + "_public"]);
}
if(json[domain + "_notification"]){
localStorage.setItem("notification_" + acct_id, json[domain + "_notification"]);
}
if(json[domain + "_post"]){
localStorage.setItem("post_" + acct_id, json[domain + "_post"]);
}
if(json[domain + "_fav"]){
localStorage.setItem("fav_" + acct_id, json[domain + "_fav"]);
}
if(json[domain + "_bt"]){
localStorage.setItem("bt_" + acct_id, json[domain + "_bt"]);
}
if(json[domain + "_follow"]){
localStorage.setItem("followlocale_" + acct_id, json[domain + "_follow"]);
} }
} else {
localStorage.removeItem("bb_" + acct_id);
$("[data-activates='bbcode']").addClass("disabled");
$("[data-activates='bbcode']").addClass("disabled", true);
}
if (json[domain + "_markdown"] == "enabled") {
localStorage.setItem("md_" + acct_id, "true");
$(".markdown").show();
} else {
$(".anti-markdown").hide();
$(".markdown").hide();
localStorage.removeItem("bb_" + acct_id);
}
if (json[domain + "_home"]) {
localStorage.setItem("home_" + acct_id, json[domain + "_home"]);
}
if (json[domain + "_local"]) {
localStorage.setItem("local_" + acct_id, json[domain + "_local"]);
}
if (json[domain + "_public"]) {
localStorage.setItem("public_" + acct_id, json[domain + "_public"]);
}
if (json[domain + "_notification"]) {
localStorage.setItem("notification_" + acct_id, json[domain + "_notification"]);
}
if (json[domain + "_post"]) {
localStorage.setItem("post_" + acct_id, json[domain + "_post"]);
}
if (json[domain + "_fav"]) {
localStorage.setItem("fav_" + acct_id, json[domain + "_fav"]);
}
if (json[domain + "_bt"]) {
localStorage.setItem("bt_" + acct_id, json[domain + "_bt"]);
}
if (json[domain + "_follow"]) {
localStorage.setItem("followlocale_" + acct_id, json[domain + "_follow"]);
}
} }
if(localStorage.getItem("mode_" + domain)!="misskey"){ if (localStorage.getItem("mode_" + domain) != "misskey") {
var start = "https://" + domain + "/api/v1/instance"; var start = "https://" + domain + "/api/v1/instance";
fetch(start, { fetch(start, {
method: 'GET', method: 'GET',
headers: { headers: {
'content-type': 'application/json' 'content-type': 'application/json'
}, },
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
if (json.error) { if (json.error) {
console.error(json.error); console.error(json.error);
return; return;
} }
if(json){ if (json) {
if(json["max_toot_chars"]){ if (json["max_toot_chars"]) {
localStorage.setItem("letters_" + acct_id, json["max_toot_chars"]); localStorage.setItem("letters_" + acct_id, json["max_toot_chars"]);
} }
if(json["urls"]["streaming_api"]){ if (json["urls"]["streaming_api"]) {
localStorage.setItem("streaming_" + acct_id, json["urls"]["streaming_api"]); localStorage.setItem("streaming_" + acct_id, json["urls"]["streaming_api"]);
} }
} }
}); });
}else{ } else {
} }
} }
@ -418,90 +418,90 @@ function multiSelector() {
var obj = JSON.parse(multi); var obj = JSON.parse(multi);
} }
var templete; var templete;
if(localStorage.getItem("mainuse")=="main"){ if (localStorage.getItem("mainuse") == "main") {
var last = localStorage.getItem("main"); var last = localStorage.getItem("main");
}else if(localStorage.getItem("last-use")){ } else if (localStorage.getItem("last-use")) {
var last = localStorage.getItem("last-use"); var last = localStorage.getItem("last-use");
}else{ } else {
var last=0; var last = 0;
} }
var sel; var sel;
if(obj.length<1){ if (obj.length < 1) {
$("#src-acct-sel").html('<option value="tootsearch">Tootsearch</option>'); $("#src-acct-sel").html('<option value="tootsearch">Tootsearch</option>');
$("#add-acct-sel").html('<option value="noauth">'+lang.lang_login_noauth+'</option>'); $("#add-acct-sel").html('<option value="noauth">' + lang.lang_login_noauth + '</option>');
}else{ } else {
Object.keys(obj).forEach(function(key) { Object.keys(obj).forEach(function (key) {
var acct = obj[key]; var acct = obj[key];
var list = key * 1 + 1; var list = key * 1 + 1;
if (key == last) { if (key == last) {
sel = "selected"; sel = "selected";
var domain = acct.domain; var domain = acct.domain;
localStorage.setItem("domain_" + key, domain); localStorage.setItem("domain_" + key, domain);
if(idata[domain+"_letters"]){ if (idata[domain + "_letters"]) {
$("#textarea").attr("data-length", idata[domain+"_letters"]) $("#textarea").attr("data-length", idata[domain + "_letters"])
}else{ } else {
var maxletters = localStorage.getItem("letters_" + key); var maxletters = localStorage.getItem("letters_" + key);
if(maxletters>0){ if (maxletters > 0) {
$("#textarea").attr("data-length", maxletters) $("#textarea").attr("data-length", maxletters)
}else{ } else {
$("#textarea").attr("data-length", 500) $("#textarea").attr("data-length", 500)
}
} }
if (idata[domain + "_glitch"]) {
$("#local-button").removeClass("hide")
}
var profimg = acct.prof;
localStorage.setItem("prof_" + key, profimg);
if (!profimg) {
profimg = "../../img/missing.svg";
}
$("#acct-sel-prof").attr("src", profimg);
if (domain) {
var cc = "(" + domain + ")";
} else {
var cc = "";
}
$("#toot-post-btn").text(lang.lang_toot + cc);
if (acct.background && acct.background != "def" && acct.text && acct.text != "def") {
$("#toot-post-btn").removeClass("indigo");
$("#toot-post-btn").css("background-color", "#" + acct.background);
$("#toot-post-btn").css("color", acct.text);
} else {
}
if (domain == "kirishima.cloud") {
$("#faicon-btn").show();
} else {
$("#faicon-btn").hide();
}
if (domain == "imastodon.net") {
trendTag();
} else {
$("#trendtag").html("");
}
} else {
sel = "";
} }
if(idata[domain+"_glitch"]){ templete = '<option value="' + key + '" data-icon="' + acct.prof +
$("#local-button").removeClass("hide") '" class="left circle" ' + sel + '>' + acct.user + '@' + acct.domain +
} '</option>';
var profimg = acct.prof; $(".acct-sel").append(templete);
localStorage.setItem("prof_" + key, profimg);
if(!profimg){ });
profimg="../../img/missing.svg";
}
$("#acct-sel-prof").attr("src",profimg);
if(domain){
var cc="("+domain+")";
}else{
var cc="";
}
$("#toot-post-btn").text(lang.lang_toot+cc);
if(acct.background && acct.background!="def" && acct.text && acct.text!="def"){
$("#toot-post-btn").removeClass("indigo");
$("#toot-post-btn").css("background-color","#"+acct.background);
$("#toot-post-btn").css("color",acct.text);
}else{
}
if(domain=="kirishima.cloud"){
$("#faicon-btn").show();
}else{
$("#faicon-btn").hide();
}
if(domain=="imastodon.net"){
trendTag();
}else{
$("#trendtag").html("");
}
} else {
sel = "";
}
templete = '<option value="' + key + '" data-icon="' + acct.prof +
'" class="left circle" ' + sel + '>' + acct.user + '@' + acct.domain +
'</option>';
$(".acct-sel").append(templete);
});
$("#src-acct-sel").append('<option value="tootsearch">Tootsearch</option>'); $("#src-acct-sel").append('<option value="tootsearch">Tootsearch</option>');
$("#add-acct-sel").append('<option value="noauth">'+lang.lang_login_noauth+'</option><option value="webview">Twitter</option>'); $("#add-acct-sel").append('<option value="noauth">' + lang.lang_login_noauth + '</option><option value="webview">Twitter</option>');
} }
$('select').material_select('update'); $('select').material_select('update');
parseColumn(true); parseColumn(true);
} }
//バージョンエンコ //バージョンエンコ
function enc(ver){ function enc(ver) {
var ver = ver.replace( /\s/g , "" ); var ver = ver.replace(/\s/g, "");
var ver = ver.replace( /\(/g , "-" ); var ver = ver.replace(/\(/g, "-");
var ver = ver.replace( /\)/g , "" ); var ver = ver.replace(/\)/g, "");
var ver = ver.replace( /\[/g , "_" ); var ver = ver.replace(/\[/g, "_");
var ver = ver.replace( /\]/g , "" ); var ver = ver.replace(/\]/g, "");
return ver; return ver;
} }
//インスタンスティッカー //インスタンスティッカー
function ticker() { function ticker() {
@ -511,15 +511,15 @@ function ticker() {
headers: { headers: {
'content-type': 'application/json' 'content-type': 'application/json'
}, },
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
if (json.error) { if (json.error) {
return; return;
} }
if(json){ if (json) {
localStorage.setItem("ticker", JSON.stringify(json)); localStorage.setItem("ticker", JSON.stringify(json));
} }
}); });

View File

@ -1,7 +1,7 @@
//ログアウトします //ログアウトします
function logout(){ function logout() {
localStorage.removeItem("acct_"+ acct_id + "_at"); localStorage.removeItem("acct_" + acct_id + "_at");
localStorage.removeItem("domain_"+acct_id); localStorage.removeItem("domain_" + acct_id);
location.href="index.html"; location.href = "index.html";
todc(); todc();
} }

View File

@ -2,13 +2,13 @@
//最初に読むやつ //最初に読むやつ
function load() { function load() {
$("#acct-list").html(""); $("#acct-list").html("");
if(location.search){ if (location.search) {
var m = location.search.match(/\?mode=([a-zA-Z-0-9]+)\&code=(.+)/); var m = location.search.match(/\?mode=([a-zA-Z-0-9]+)\&code=(.+)/);
var mode=m[1]; var mode = m[1];
var codex=m[2]; var codex = m[2];
if(mode=="first" && codex=="true"){ if (mode == "first" && codex == "true") {
$("body").addClass("first") $("body").addClass("first")
}else{ } else {
} }
} }
var prof = localStorage.getItem("prof"); var prof = localStorage.getItem("prof");
@ -25,40 +25,40 @@ function load() {
} else { } else {
var obj = JSON.parse(multi); var obj = JSON.parse(multi);
} }
if(obj[0]){ if (obj[0]) {
if(!obj[0].at){ if (!obj[0].at) {
obj=[]; obj = [];
localStorage.removeItem("multi"); localStorage.removeItem("multi");
} }
} }
console.table(obj); console.table(obj);
var templete; var templete;
Object.keys(obj).forEach(function(key) { Object.keys(obj).forEach(function (key) {
var acct = obj[key]; var acct = obj[key];
var list = key * 1 + 1; var list = key * 1 + 1;
if(acct.background!="def" && acct.text!="def"){ if (acct.background != "def" && acct.text != "def") {
var style='style="background-color:#'+acct.background+'; color:'+acct.text+';"' var style = 'style="background-color:#' + acct.background + '; color:' + acct.text + ';"'
}else{ } else {
var style="" var style = ""
} }
if(acct.name){ if (acct.name) {
var name=acct.name; var name = acct.name;
}else{ } else {
var name=acct.user; var name = acct.user;
} }
templete = '<div id="acct_' + key + '" class="card" '+style+'><div class="card-content "><span class="lts">' + list + templete = '<div id="acct_' + key + '" class="card" ' + style + '><div class="card-content "><span class="lts">' + list +
'.</span><img src="' + acct.prof + '" width="40" height="40"><span class="card-title">' + '.</span><img src="' + acct.prof + '" width="40" height="40"><span class="card-title">' +
name + '</span>' + escapeHTML(acct.user) + '@' + acct.domain + name + '</span>' + escapeHTML(acct.user) + '@' + acct.domain +
'</div><div class="card-action"><a class="waves-effect disTar pointer white-text" onclick="data(\'' + '</div><div class="card-action"><a class="waves-effect disTar pointer white-text" onclick="data(\'' +
acct.domain + acct.domain +
'\')"><i class="material-icons">info</i>'+lang.lang_manager_info+'</a><a class="waves-effect disTar pointer white-text" onclick="refresh(' + '\')"><i class="material-icons">info</i>' + lang.lang_manager_info + '</a><a class="waves-effect disTar pointer white-text" onclick="refresh(' +
key + key +
')"><i class="material-icons">refresh</i>'+lang.lang_manager_refresh+'</a><a class="waves-effect disTar pointer red-text" onclick="multiDel(' + ')"><i class="material-icons">refresh</i>' + lang.lang_manager_refresh + '</a><a class="waves-effect disTar pointer red-text" onclick="multiDel(' +
key + key +
')"><i class="material-icons">delete</i>'+lang.lang_manager_delete+'</a><br>'+lang.lang_manager_color+'<div id="colorsel_'+key+'" class="colorsel"></div></div></div>'; ')"><i class="material-icons">delete</i>' + lang.lang_manager_delete + '</a><br>' + lang.lang_manager_color + '<div id="colorsel_' + key + '" class="colorsel"></div></div></div>';
$("#acct-list").append(templete); $("#acct-list").append(templete);
colorpicker(key) colorpicker(key)
}); });
multisel(); multisel();
var acctN = localStorage.getItem("acct"); var acctN = localStorage.getItem("acct");
@ -93,12 +93,12 @@ function data(domain) {
'content-type': 'application/json', 'content-type': 'application/json',
'Authorization': 'Bearer tC8F6xWGWBUwGScyNevYlx62iO6fdQ4oIK0ad68Oo7ZKB8GQdGpjW9TKxBnIh8grAhvd5rw3iyP9JPamoDpeLQdz62EToPJUW99hDx8rfuJfGdjQuimZPTbIOx0woA5M' 'Authorization': 'Bearer tC8F6xWGWBUwGScyNevYlx62iO6fdQ4oIK0ad68Oo7ZKB8GQdGpjW9TKxBnIh8grAhvd5rw3iyP9JPamoDpeLQdz62EToPJUW99hDx8rfuJfGdjQuimZPTbIOx0woA5M'
}, },
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
if (!json.error) { if (!json.error) {
$("#ins-name").text(json.name); $("#ins-name").text(json.name);
$("#ins-upd").text(date(json.checked_at, 'full')); $("#ins-upd").text(date(json.checked_at, 'full'));
@ -109,22 +109,22 @@ function data(domain) {
$("#ins-per").text(json.uptime * 100); $("#ins-per").text(json.uptime * 100);
$("#ins-user").text(json.users); $("#ins-user").text(json.users);
$("#ins-ver").text(json.version); $("#ins-ver").text(json.version);
}else{ } else {
console.error(json.error); console.error(json.error);
} }
}); });
var start = "https://" + domain +"/api/v1/instance"; var start = "https://" + domain + "/api/v1/instance";
fetch(start, { fetch(start, {
method: 'GET', method: 'GET',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
}, },
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
if (!json.error) { if (!json.error) {
$("#ins-title").text(json.title); $("#ins-title").text(json.title);
$("#ins-desc").html(json.description); $("#ins-desc").html(json.description);
@ -133,9 +133,9 @@ function data(domain) {
$("#ins-user").text(json.stats.user_count); $("#ins-user").text(json.stats.user_count);
$("#ins-ver").text(json.version); $("#ins-ver").text(json.version);
$("#ins-prof").attr('src', json.thumbnail); $("#ins-prof").attr('src', json.thumbnail);
$("#ins-admin").text(escapeHTML(json.contact_account.display_name)+"("+json.contact_account.acct+")"); $("#ins-admin").text(escapeHTML(json.contact_account.display_name) + "(" + json.contact_account.acct + ")");
$("#ins-admin").attr("href","index.html?mode=user&code="+json.contact_account.username+"@"+domain); $("#ins-admin").attr("href", "index.html?mode=user&code=" + json.contact_account.username + "@" + domain);
}else{ } else {
console.error(json.error); console.error(json.error);
} }
}); });
@ -146,14 +146,14 @@ function multiDel(target) {
var multi = localStorage.getItem("multi"); var multi = localStorage.getItem("multi");
var obj = JSON.parse(multi); var obj = JSON.parse(multi);
//削除確認ダイアログ //削除確認ダイアログ
if (confirm(obj[target]["user"] + "@" + obj[target]["domain"] +lang.lang_manager_confirm)) { if (confirm(obj[target]["user"] + "@" + obj[target]["domain"] + lang.lang_manager_confirm)) {
Object.keys(obj).forEach(function(key) { Object.keys(obj).forEach(function (key) {
var nk=key-1; var nk = key - 1;
//公開範囲(差分のみ) //公開範囲(差分のみ)
if(key>=target){ if (key >= target) {
var oldvis=localStorage.getItem("vis-memory-"+key); var oldvis = localStorage.getItem("vis-memory-" + key);
if(oldvis){ if (oldvis) {
localStorage.setItem("vis-memory-"+nk,oldvis); localStorage.setItem("vis-memory-" + nk, oldvis);
} }
} }
//独自ロケール //独自ロケール
@ -162,11 +162,11 @@ function multiDel(target) {
localStorage.removeItem("public_" + key); localStorage.removeItem("public_" + key);
localStorage.removeItem("notification_" + key); localStorage.removeItem("notification_" + key);
//アクセストークンとドメイン、プロフ(差分) //アクセストークンとドメイン、プロフ(差分)
if(key>target){ if (key > target) {
var olddom=localStorage.getItem("domain_"+key); var olddom = localStorage.getItem("domain_" + key);
localStorage.setItem("domain_"+nk,olddom); localStorage.setItem("domain_" + nk, olddom);
var oldat=localStorage.getItem("acct_"+key+"_at"); var oldat = localStorage.getItem("acct_" + key + "_at");
localStorage.setItem("acct_"+nk+"_at",oldat); localStorage.setItem("acct_" + nk + "_at", oldat);
localStorage.setItem("name_" + nk, localStorage.getItem("name_" + key)); localStorage.setItem("name_" + nk, localStorage.getItem("name_" + key));
localStorage.setItem("user_" + target, localStorage.getItem("user_" + key)); localStorage.setItem("user_" + target, localStorage.getItem("user_" + key));
localStorage.setItem("user-id_" + target, localStorage.getItem("user-id_" + key)); localStorage.setItem("user-id_" + target, localStorage.getItem("user-id_" + key));
@ -182,18 +182,18 @@ function multiDel(target) {
//カラムデータコンフリクト //カラムデータコンフリクト
var col = localStorage.getItem("column"); var col = localStorage.getItem("column");
var oldcols = JSON.parse(col); var oldcols = JSON.parse(col);
var newcols=[]; var newcols = [];
Object.keys(oldcols).forEach(function(key) { Object.keys(oldcols).forEach(function (key) {
var nk=key-1; var nk = key - 1;
var oldcol=oldcols[key]; var oldcol = oldcols[key];
if(target<oldcol.domain){ if (target < oldcol.domain) {
var newdom=oldcol.domain-1; var newdom = oldcol.domain - 1;
}else{ } else {
var newdom=oldcol.domain; var newdom = oldcol.domain;
} }
var type=oldcol.type; var type = oldcol.type;
//消した垢のコラムじゃないときコピー //消した垢のコラムじゃないときコピー
if(target!=oldcol.domain){ if (target != oldcol.domain) {
var add = { var add = {
domain: newdom, domain: newdom,
type: type type: type
@ -203,87 +203,87 @@ function multiDel(target) {
}); });
var json = JSON.stringify(newcols); var json = JSON.stringify(newcols);
localStorage.setItem("column", json); localStorage.setItem("column", json);
} }
} }
function multiDel2(target) { function multiDel2(target) {
var multi = localStorage.getItem("multi"); var multi = localStorage.getItem("multi");
var obj = JSON.parse(multi); var obj = JSON.parse(multi);
if (confirm(obj[target]["user"] + "@" + obj[target]["domain"] +lang.lang_manager_confirm)) { if (confirm(obj[target]["user"] + "@" + obj[target]["domain"] + lang.lang_manager_confirm)) {
obj.splice(target, 1); obj.splice(target, 1);
var json = JSON.stringify(obj); var json = JSON.stringify(obj);
localStorage.setItem("multi", json); localStorage.setItem("multi", json);
Object.keys(obj).forEach(function(key) { Object.keys(obj).forEach(function (key) {
if(key>=target){ if (key >= target) {
var oldvis=localStorage.getItem("vis-memory-"+key); var oldvis = localStorage.getItem("vis-memory-" + key);
if(oldvis){ if (oldvis) {
var nk=key-1; var nk = key - 1;
localStorage.setItem("vis-memory-"+nk,oldvis); localStorage.setItem("vis-memory-" + nk, oldvis);
}
}
localStorage.removeItem("home_" + key);
localStorage.removeItem("local_" + key);
localStorage.removeItem("public_" + key);
localStorage.removeItem("notification_" + key);
refresh(key);
});
var col = localStorage.getItem("column");
if (!col) {
var obj = [{
domain: 0,
type: 'local'
}];
localStorage.setItem("card_0","true");
var json = JSON.stringify(obj);
localStorage.setItem("column", json);
} else {
var cobj = JSON.parse(col);
}
Object.keys(cobj).forEach(function(key) {
var column = cobj[key];
if(column.domain>target){
var nk=key-1;
column.domain=nk;
cobj[key]=column;
}else if(column.domain==target){
localStorage.removeItem("card_" + tlid);
cobj.splice(key, 1);
} }
}); }
var json = JSON.stringify(column); localStorage.removeItem("home_" + key);
localStorage.removeItem("local_" + key);
localStorage.removeItem("public_" + key);
localStorage.removeItem("notification_" + key);
refresh(key);
});
var col = localStorage.getItem("column");
if (!col) {
var obj = [{
domain: 0,
type: 'local'
}];
localStorage.setItem("card_0", "true");
var json = JSON.stringify(obj);
localStorage.setItem("column", json); localStorage.setItem("column", json);
} else {
var cobj = JSON.parse(col);
}
Object.keys(cobj).forEach(function (key) {
var column = cobj[key];
if (column.domain > target) {
var nk = key - 1;
column.domain = nk;
cobj[key] = column;
} else if (column.domain == target) {
localStorage.removeItem("card_" + tlid);
cobj.splice(key, 1);
}
});
var json = JSON.stringify(column);
localStorage.setItem("column", json);
load(); load();
} }
} }
//サポートインスタンス //サポートインスタンス
function support() { function support() {
Object.keys(idata).forEach(function(key) { Object.keys(idata).forEach(function (key) {
var instance = idata[key]; var instance = idata[key];
if (instance == "instance") { if (instance == "instance") {
templete = '<a onclick="login(\'' + key + templete = '<a onclick="login(\'' + key +
'\')" class="collection-item pointer transparent">' + idata[key + "_name"] + '(' + key + ')</a>'; '\')" class="collection-item pointer transparent">' + idata[key + "_name"] + '(' + key + ')</a>';
$("#support").append(templete); $("#support").append(templete);
}else if (instance == "misskey") { } else if (instance == "misskey") {
templete = '<a onclick="misskeyLogin(\'' + key + templete = '<a onclick="misskeyLogin(\'' + key +
'\')" class="collection-item pointer transparent">' + idata[key + "_name"] + '(' + key + ')</a>'; '\')" class="collection-item pointer transparent">' + idata[key + "_name"] + '(' + key + ')</a>';
$("#support").append(templete); $("#support").append(templete);
} }
}); });
} }
//URL指定してポップアップ //URL指定してポップアップ
function login(url) { function login(url) {
var multi = localStorage.getItem("multi"); var multi = localStorage.getItem("multi");
var obj = JSON.parse(multi); var obj = JSON.parse(multi);
if($('#misskey:checked').val()=="on"){ if ($('#misskey:checked').val() == "on") {
$("#misskey").prop("checked", true); $("#misskey").prop("checked", true);
misskeyLogin(url); misskeyLogin(url);
return; return;
} }
if($('#linux:checked').val()=="on"){ if ($('#linux:checked').val() == "on") {
var red = "https://thedesk.top/hello.html" var red = "https://thedesk.top/hello.html"
}else{ } else {
var red = 'thedesk://manager'; var red = 'thedesk://manager';
} }
localStorage.setItem("redirect", red); localStorage.setItem("redirect", red);
@ -298,12 +298,12 @@ function login(url) {
redirect_uris: red, redirect_uris: red,
website: "https://thedesk.top" website: "https://thedesk.top"
})); }));
httpreq.onreadystatechange = function() { httpreq.onreadystatechange = function () {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
var json = httpreq.response; var json = httpreq.response;
localStorage.setItem("msky","false"); localStorage.setItem("msky", "false");
var auth = "https://" + url + "/oauth/authorize?client_id=" + json[ var auth = "https://" + url + "/oauth/authorize?client_id=" + json[
"client_id"] + "&client_secret=" + json["client_secret"] + "client_id"] + "&client_secret=" + json["client_secret"] +
"&response_type=code&scope=read+write+follow&redirect_uri=" + encodeURIComponent(red); "&response_type=code&scope=read+write+follow&redirect_uri=" + encodeURIComponent(red);
localStorage.setItem("domain_tmp", url); localStorage.setItem("domain_tmp", url);
localStorage.setItem("client_id", json["client_id"]); localStorage.setItem("client_id", json["client_id"]);
@ -313,109 +313,109 @@ function login(url) {
const { const {
shell shell
} = require('electron'); } = require('electron');
shell.openExternal(auth); shell.openExternal(auth);
var electron = require("electron"); var electron = require("electron");
var ipc = electron.ipcRenderer; var ipc = electron.ipcRenderer;
if ($('#linux:checked').val() == "on") {} else { if ($('#linux:checked').val() == "on") { } else {
ipc.send('quit', 'go'); ipc.send('quit', 'go');
} }
} }
} }
} }
//これが後のMisskeyである。 //これが後のMisskeyである。
function misskeyLogin(url) { function misskeyLogin(url) {
if(!url){ if (!url) {
var url=$("#misskey-url").val(); var url = $("#misskey-url").val();
} }
var start = "https://"+url+"/api/app/create"; var start = "https://" + url + "/api/app/create";
var httpreq = new XMLHttpRequest(); var httpreq = new XMLHttpRequest();
httpreq.open('POST', start, true); httpreq.open('POST', start, true);
httpreq.setRequestHeader('Content-Type', 'application/json'); httpreq.setRequestHeader('Content-Type', 'application/json');
httpreq.responseType = "json"; httpreq.responseType = "json";
localStorage.setItem("msky","true"); localStorage.setItem("msky", "true");
httpreq.send(JSON.stringify({ httpreq.send(JSON.stringify({
name: "TheDesk(PC)", name: "TheDesk(PC)",
description: "Mastodon client for PC", description: "Mastodon client for PC",
permission: [ permission: [
"account-read", "account-read",
"account-write", "account-write",
"account/read", "account/read",
"account/write", "account/write",
"drive-read", "drive-read",
"drive-write", "drive-write",
"favorite-read", "favorite-read",
"favorite-write", "favorite-write",
"favorites-read", "favorites-read",
"following-read", "following-read",
"following-write", "following-write",
"messaging-read", "messaging-read",
"messaging-write", "messaging-write",
"note-read", "note-read",
"note-write", "note-write",
"notification-read", "notification-read",
"notification-write", "notification-write",
"reaction-read", "reaction-read",
"reaction-write", "reaction-write",
"vote-read", "vote-read",
"vote-write", "vote-write",
"read:account", "read:account",
"write:account", "write:account",
"read:drive", "read:drive",
"write:drive", "write:drive",
"read:blocks", "read:blocks",
"write:blocks", "write:blocks",
"read:favorites", "read:favorites",
"write:favorites", "write:favorites",
"read:following", "read:following",
"write:following", "write:following",
"read:messaging", "read:messaging",
"write:messaging", "write:messaging",
"read:mutes", "read:mutes",
"write:mutes", "write:mutes",
"write:notes", "write:notes",
"read:notifications", "read:notifications",
"write:notifications", "write:notifications",
"read:reactions", "read:reactions",
"write:reactions", "write:reactions",
"write:votes" "write:votes"
] ]
})); }));
httpreq.onreadystatechange = function() { httpreq.onreadystatechange = function () {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
var json = httpreq.response; var json = httpreq.response;
misskeyAuth(url, json.secret) misskeyAuth(url, json.secret)
} }
} }
} }
function misskeyAuth(url, mkc){ function misskeyAuth(url, mkc) {
var start = "https://"+url+"/api/auth/session/generate"; var start = "https://" + url + "/api/auth/session/generate";
var httpreq = new XMLHttpRequest(); var httpreq = new XMLHttpRequest();
httpreq.open('POST', start, true); httpreq.open('POST', start, true);
httpreq.setRequestHeader('Content-Type', 'application/json'); httpreq.setRequestHeader('Content-Type', 'application/json');
httpreq.responseType = "json"; httpreq.responseType = "json";
localStorage.setItem("mkc",mkc) localStorage.setItem("mkc", mkc)
localStorage.setItem("msky","true"); localStorage.setItem("msky", "true");
httpreq.send(JSON.stringify({ httpreq.send(JSON.stringify({
appSecret: mkc appSecret: mkc
})); }));
httpreq.onreadystatechange = function() { httpreq.onreadystatechange = function () {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
var json = httpreq.response; var json = httpreq.response;
const { const {
shell shell
} = require('electron'); } = require('electron');
var token=json.token; var token = json.token;
$("#auth").show(); $("#auth").show();
$("#code").val(token); $("#code").val(token);
$("#add").hide(); $("#add").hide();
$("#misskey").prop("checked", false); $("#misskey").prop("checked", false);
localStorage.setItem("domain_tmp",url); localStorage.setItem("domain_tmp", url);
shell.openExternal(json.url); shell.openExternal(json.url);
} }
} }
@ -424,7 +424,7 @@ function misskeyAuth(url, mkc){
//テキストボックスにURL入れた //テキストボックスにURL入れた
function instance() { function instance() {
var url = $("#url").val(); var url = $("#url").val();
if(url.indexOf("@")!=-1 || url.indexOf("https")!=-1){ if (url.indexOf("@") != -1 || url.indexOf("https") != -1) {
alert("入力形式が違います。(Cutls@mstdn.jpにログインする場合、入力するのは\"mstdn.jp\"です。)") alert("入力形式が違います。(Cutls@mstdn.jpにログインする場合、入力するのは\"mstdn.jp\"です。)")
return false; return false;
} }
@ -434,28 +434,28 @@ function instance() {
//コード入れてAccessTokenゲット //コード入れてAccessTokenゲット
function code(code) { function code(code) {
localStorage.removeItem("redirect") localStorage.removeItem("redirect")
if(!code){ if (!code) {
var code = $("#code").val(); var code = $("#code").val();
$("#code").val(""); $("#code").val("");
} }
var url = localStorage.getItem("domain_tmp"); var url = localStorage.getItem("domain_tmp");
localStorage.removeItem("domain_tmp"); localStorage.removeItem("domain_tmp");
if(localStorage.getItem("msky")=="true"){ if (localStorage.getItem("msky") == "true") {
var start = "https://"+url+"/api/auth/session/userkey"; var start = "https://" + url + "/api/auth/session/userkey";
var httpreq = new XMLHttpRequest(); var httpreq = new XMLHttpRequest();
httpreq.open('POST', start, true); httpreq.open('POST', start, true);
httpreq.setRequestHeader('Content-Type', 'application/json'); httpreq.setRequestHeader('Content-Type', 'application/json');
httpreq.responseType = "json"; httpreq.responseType = "json";
httpreq.send(JSON.stringify({ httpreq.send(JSON.stringify({
token:code, token: code,
appSecret:localStorage.getItem("mkc") appSecret: localStorage.getItem("mkc")
})); }));
httpreq.onreadystatechange = function() { httpreq.onreadystatechange = function () {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
var json = httpreq.response; var json = httpreq.response;
var i = sha256(json.accessToken + localStorage.getItem("mkc")); var i = sha256(json.accessToken + localStorage.getItem("mkc"));
var avatar=json["user"]["avatarUrl"]; var avatar = json["user"]["avatarUrl"];
var priv="public"; var priv = "public";
var add = { var add = {
at: i, at: i,
name: json["user"]["name"], name: json["user"]["name"],
@ -466,7 +466,7 @@ function code(code) {
vis: priv, vis: priv,
mode: "misskey" mode: "misskey"
}; };
localStorage.setItem("mode_" + url,"misskey") localStorage.setItem("mode_" + url, "misskey")
var multi = localStorage.getItem("multi"); var multi = localStorage.getItem("multi");
var obj = JSON.parse(multi); var obj = JSON.parse(multi);
var target = obj.lengtth; var target = obj.lengtth;
@ -477,15 +477,15 @@ function code(code) {
localStorage.setItem("prof_" + target, avatar); localStorage.setItem("prof_" + target, avatar);
var json = JSON.stringify(obj); var json = JSON.stringify(obj);
localStorage.setItem("multi", json); localStorage.setItem("multi", json);
if($("body").hasClass("first")){ if ($("body").hasClass("first")) {
location.href="index.html" location.href = "index.html"
} }
load(); load();
return; return;
} }
} }
return; return;
}else{ } else {
var start = "https://" + url + "/oauth/token"; var start = "https://" + url + "/oauth/token";
var id = localStorage.getItem("client_id"); var id = localStorage.getItem("client_id");
var secret = localStorage.getItem("client_secret"); var secret = localStorage.getItem("client_secret");
@ -500,7 +500,7 @@ function code(code) {
client_secret: secret, client_secret: secret,
code: code code: code
})); }));
httpreq.onreadystatechange = function() { httpreq.onreadystatechange = function () {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
var json = httpreq.response; var json = httpreq.response;
if (json["access_token"]) { if (json["access_token"]) {
@ -511,7 +511,7 @@ function code(code) {
} }
} }
} }
} }
//ユーザーデータ取得 //ユーザーデータ取得
function getdata(domain, at) { function getdata(domain, at) {
@ -522,27 +522,27 @@ function getdata(domain, at) {
'content-type': 'application/json', 'content-type': 'application/json',
'Authorization': 'Bearer ' + at 'Authorization': 'Bearer ' + at
}, },
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
if (json.error) { if (json.error) {
console.error("Error:" + json.error); console.error("Error:" + json.error);
Materialize.toast(lang.lang_fatalerroroccured+"Error:" + escapeHTML(json.error), Materialize.toast(lang.lang_fatalerroroccured + "Error:" + escapeHTML(json.error),
5000); 5000);
return; return;
} }
var avatar=json["avatar"]; var avatar = json["avatar"];
//missingがmissingなやつ //missingがmissingなやつ
if(avatar=="/avatars/original/missing.png"){ if (avatar == "/avatars/original/missing.png") {
avatar="../../img/missing.svg"; avatar = "../../img/missing.svg";
} }
if(json["source"]){ if (json["source"]) {
var priv=json["source"]["privacy"]; var priv = json["source"]["privacy"];
}else{ } else {
var priv="public"; var priv = "public";
} }
var add = { var add = {
at: at, at: at,
@ -564,8 +564,8 @@ function getdata(domain, at) {
localStorage.setItem("prof_" + target, avatar); localStorage.setItem("prof_" + target, avatar);
var json = JSON.stringify(obj); var json = JSON.stringify(obj);
localStorage.setItem("multi", json); localStorage.setItem("multi", json);
if($("body").hasClass("first")){ if ($("body").hasClass("first")) {
location.href="index.html" location.href = "index.html"
} }
load(); load();
}); });
@ -575,8 +575,8 @@ function getdata(domain, at) {
function refresh(target) { function refresh(target) {
var multi = localStorage.getItem("multi"); var multi = localStorage.getItem("multi");
var obj = JSON.parse(multi); var obj = JSON.parse(multi);
if(obj[target].mode=="misskey"){ if (obj[target].mode == "misskey") {
misskeyRefresh(obj,target,obj[target].domain); misskeyRefresh(obj, target, obj[target].domain);
return return
} }
var start = "https://" + obj[target].domain + var start = "https://" + obj[target].domain +
@ -587,22 +587,22 @@ function refresh(target) {
'content-type': 'application/json', 'content-type': 'application/json',
'Authorization': 'Bearer ' + obj[target].at 'Authorization': 'Bearer ' + obj[target].at
}, },
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
if (json.error) { if (json.error) {
console.error("Error:" + json.error); console.error("Error:" + json.error);
Materialize.toast(lang.lang_fatalerroroccured+"Error:" + json.error, Materialize.toast(lang.lang_fatalerroroccured + "Error:" + json.error,
5000); 5000);
return; return;
} }
var avatar=json["avatar"]; var avatar = json["avatar"];
//missingがmissingなやつ //missingがmissingなやつ
if(avatar=="/avatars/original/missing.png" || !avatar){ if (avatar == "/avatars/original/missing.png" || !avatar) {
avatar="./img/missing.svg"; avatar = "./img/missing.svg";
} }
var ref = { var ref = {
at: obj[target].at, at: obj[target].at,
@ -624,45 +624,45 @@ function refresh(target) {
load(); load();
}); });
} }
function misskeyRefresh(obj,target,url){ function misskeyRefresh(obj, target, url) {
var start = "https://"+url+"/api/users/show"; var start = "https://" + url + "/api/users/show";
var httpreq = new XMLHttpRequest(); var httpreq = new XMLHttpRequest();
httpreq.open('POST', start, true); httpreq.open('POST', start, true);
httpreq.setRequestHeader('Content-Type', 'application/json'); httpreq.setRequestHeader('Content-Type', 'application/json');
httpreq.responseType = "json"; httpreq.responseType = "json";
httpreq.send(JSON.stringify({ httpreq.send(JSON.stringify({
username:obj[target].user, username: obj[target].user,
i:localStorage.getItem("at") i: localStorage.getItem("at")
})); }));
httpreq.onreadystatechange = function() { httpreq.onreadystatechange = function () {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
var json = httpreq.response; var json = httpreq.response;
return; return;
var avatar=json["user"]["avatarURL"]; var avatar = json["user"]["avatarURL"];
var priv="public"; var priv = "public";
var add = { var add = {
at: json.accessToken, at: json.accessToken,
name: json["user"]["name"], name: json["user"]["name"],
domain: url, domain: url,
user: json["user"]["username"], user: json["user"]["username"],
prof: avatar, prof: avatar,
id: json["user"]["id"], id: json["user"]["id"],
vis: priv vis: priv
}; };
var multi = localStorage.getItem("multi"); var multi = localStorage.getItem("multi");
var obj = JSON.parse(multi); var obj = JSON.parse(multi);
var target = obj.lengtth; var target = obj.lengtth;
obj.push(add); obj.push(add);
localStorage.setItem("name_" + target, json["user"]["name"]); localStorage.setItem("name_" + target, json["user"]["name"]);
localStorage.setItem("user_" + target, json["user"]["username"]); localStorage.setItem("user_" + target, json["user"]["username"]);
localStorage.setItem("user-id_" + target, json["user"]["id"]); localStorage.setItem("user-id_" + target, json["user"]["id"]);
localStorage.setItem("prof_" + target, avatar); localStorage.setItem("prof_" + target, avatar);
var json = JSON.stringify(obj); var json = JSON.stringify(obj);
localStorage.setItem("multi", json); localStorage.setItem("multi", json);
load(); load();
return; return;
} }
} }
} }
//アカウントを選択…を実装 //アカウントを選択…を実装
function multisel() { function multisel() {
@ -677,88 +677,88 @@ function multisel() {
var templete; var templete;
var last = localStorage.getItem("main"); var last = localStorage.getItem("main");
var sel; var sel;
if(obj.length<1){ if (obj.length < 1) {
$("#src-acct-sel").html('<option value="tootsearch">Tootsearch</option>'); $("#src-acct-sel").html('<option value="tootsearch">Tootsearch</option>');
$("#add-acct-sel").html('<option value="noauth">'+lang.lang_login_noauth+'</option>'); $("#add-acct-sel").html('<option value="noauth">' + lang.lang_login_noauth + '</option>');
}else{ } else {
Object.keys(obj).forEach(function(key) { Object.keys(obj).forEach(function (key) {
var acct = obj[key]; var acct = obj[key];
var list = key * 1 + 1; var list = key * 1 + 1;
if (key == last) { if (key == last) {
sel = "selected"; sel = "selected";
mainb='('+lang.lang_manager_def+')' mainb = '(' + lang.lang_manager_def + ')'
var domain = localStorage.getItem("domain_" + key); var domain = localStorage.getItem("domain_" + key);
var profimg=localStorage.getItem("prof_"+key); var profimg = localStorage.getItem("prof_" + key);
var domain=localStorage.getItem("domain_"+key); var domain = localStorage.getItem("domain_" + key);
if(!profimg){ if (!profimg) {
profimg="../../img/missing.svg"; profimg = "../../img/missing.svg";
}
} else {
sel = "";
mainb = ""
} }
} else { templete = '<option value="' + key + '" data-icon="' + acct.prof +
sel = ""; '" class="left circle" ' + sel + '>' + acct.user + '@' + acct.domain + mainb +
mainb="" '</option>';
} $(".acct-sel").append(templete);
templete = '<option value="' + key + '" data-icon="' + acct.prof +
'" class="left circle" ' + sel + '>' + acct.user + '@' + acct.domain +mainb+ });
'</option>';
$(".acct-sel").append(templete);
});
} }
$('select').material_select('update'); $('select').material_select('update');
} }
function mainacct(){ function mainacct() {
var acct_id = $("#main-acct-sel").val(); var acct_id = $("#main-acct-sel").val();
localStorage.setItem("main", acct_id); localStorage.setItem("main", acct_id);
Materialize.toast(lang.lang_manager_mainAcct, 3000); Materialize.toast(lang.lang_manager_mainAcct, 3000);
} }
function colorpicker(key){ function colorpicker(key) {
temp= temp =
'<div onclick="coloradd('+key+',\'def\',\'def\')" class="pointer exc">'+lang.lang_manager_none+'</div>'+ '<div onclick="coloradd(' + key + ',\'def\',\'def\')" class="pointer exc">' + lang.lang_manager_none + '</div>' +
'<div onclick="coloradd('+key+',\'f44336\',\'white\')" class="red white-text pointer"></div>'+ '<div onclick="coloradd(' + key + ',\'f44336\',\'white\')" class="red white-text pointer"></div>' +
'<div onclick="coloradd('+key+',\'e91e63\',\'white\')" class="pink white-text pointer"></div>'+ '<div onclick="coloradd(' + key + ',\'e91e63\',\'white\')" class="pink white-text pointer"></div>' +
'<div onclick="coloradd('+key+',\'9c27b0\',\'white\')" class="purple white-text pointer"></div>'+ '<div onclick="coloradd(' + key + ',\'9c27b0\',\'white\')" class="purple white-text pointer"></div>' +
'<div onclick="coloradd('+key+',\'673ab7\',\'white\')" class="deep-purple white-text pointer"></div>'+ '<div onclick="coloradd(' + key + ',\'673ab7\',\'white\')" class="deep-purple white-text pointer"></div>' +
'<div onclick="coloradd('+key+',\'3f51b5\',\'white\')" class="indigo white-text pointer"></div>'+ '<div onclick="coloradd(' + key + ',\'3f51b5\',\'white\')" class="indigo white-text pointer"></div>' +
'<div onclick="coloradd('+key+',\'2196f3\',\'white\')" class="blue white-text pointer"></div>'+ '<div onclick="coloradd(' + key + ',\'2196f3\',\'white\')" class="blue white-text pointer"></div>' +
'<div onclick="coloradd('+key+',\'03a9f4\',\'black\')" class="light-blue black-text pointer"></div>'+ '<div onclick="coloradd(' + key + ',\'03a9f4\',\'black\')" class="light-blue black-text pointer"></div>' +
'<div onclick="coloradd('+key+',\'00bcd4\',\'black\')" class="cyan black-text pointer"></div>'+ '<div onclick="coloradd(' + key + ',\'00bcd4\',\'black\')" class="cyan black-text pointer"></div>' +
'<div onclick="coloradd('+key+',\'009688\',\'white\')" class="teal white-text pointer"></div>'+ '<div onclick="coloradd(' + key + ',\'009688\',\'white\')" class="teal white-text pointer"></div>' +
'<div onclick="coloradd('+key+',\'4caf50\',\'black\')" class="green black-text pointer"></div>'+ '<div onclick="coloradd(' + key + ',\'4caf50\',\'black\')" class="green black-text pointer"></div>' +
'<div onclick="coloradd('+key+',\'8bc34a\',\'black\')" class="light-green black-text pointer"></div>'+ '<div onclick="coloradd(' + key + ',\'8bc34a\',\'black\')" class="light-green black-text pointer"></div>' +
'<div onclick="coloradd('+key+',\'cddc39\',\'black\')" class="lime black-text pointer"></div>'+ '<div onclick="coloradd(' + key + ',\'cddc39\',\'black\')" class="lime black-text pointer"></div>' +
'<div onclick="coloradd('+key+',\'ffeb3b\',\'black\')" class="yellow black-text pointer"></div>'+ '<div onclick="coloradd(' + key + ',\'ffeb3b\',\'black\')" class="yellow black-text pointer"></div>' +
'<div onclick="coloradd('+key+',\'ffc107\',\'black\')" class="amber black-text pointer"></div>'+ '<div onclick="coloradd(' + key + ',\'ffc107\',\'black\')" class="amber black-text pointer"></div>' +
'<div onclick="coloradd('+key+',\'ff9800\',\'black\')" class="orange black-text pointer"></div>'+ '<div onclick="coloradd(' + key + ',\'ff9800\',\'black\')" class="orange black-text pointer"></div>' +
'<div onclick="coloradd('+key+',\'ff5722\',\'white\')" class="deep-orange white-text pointer"></div>'+ '<div onclick="coloradd(' + key + ',\'ff5722\',\'white\')" class="deep-orange white-text pointer"></div>' +
'<div onclick="coloradd('+key+',\'795548\',\'white\')" class="brown white-text pointer"></div>'+ '<div onclick="coloradd(' + key + ',\'795548\',\'white\')" class="brown white-text pointer"></div>' +
'<div onclick="coloradd('+key+',\'9e9e9e\',\'white\')" class="grey white-text pointer"></div>'+ '<div onclick="coloradd(' + key + ',\'9e9e9e\',\'white\')" class="grey white-text pointer"></div>' +
'<div onclick="coloradd('+key+',\'607d8b\',\'white\')" class="blue-grey white-text pointer"></div>'+ '<div onclick="coloradd(' + key + ',\'607d8b\',\'white\')" class="blue-grey white-text pointer"></div>' +
'<div onclick="coloradd('+key+',\'000000\',\'white\')" class="black white-text pointer"></div>'+ '<div onclick="coloradd(' + key + ',\'000000\',\'white\')" class="black white-text pointer"></div>' +
'<div onclick="coloradd('+key+',\'ffffff\',\'black\')" class="white black-text pointer"></div>'; '<div onclick="coloradd(' + key + ',\'ffffff\',\'black\')" class="white black-text pointer"></div>';
$("#colorsel_"+key).html(temp); $("#colorsel_" + key).html(temp);
} }
function coloradd(key,bg,txt){ function coloradd(key, bg, txt) {
var col = localStorage.getItem("multi"); var col = localStorage.getItem("multi");
var o = JSON.parse(col); var o = JSON.parse(col);
var obj=o[key]; var obj = o[key];
obj.background=bg; obj.background = bg;
obj.text=txt; obj.text = txt;
o[key]=obj; o[key] = obj;
var json = JSON.stringify(o); var json = JSON.stringify(o);
localStorage.setItem("multi", json); localStorage.setItem("multi", json);
if(txt=="def"){ if (txt == "def") {
$("#acct_"+key).attr("style","") $("#acct_" + key).attr("style", "")
}else{ } else {
$("#acct_"+key).css('background-color','#'+bg); $("#acct_" + key).css('background-color', '#' + bg);
if(txt=="black"){ if (txt == "black") {
var bghex="000000"; var bghex = "000000";
var ichex="9e9e9e" var ichex = "9e9e9e"
}else if(txt=="white"){ } else if (txt == "white") {
var bghex="ffffff"; var bghex = "ffffff";
var ichex="eeeeee" var ichex = "eeeeee"
} }
$("#acct_"+key+" .nex").css('color','#'+ichex); $("#acct_" + key + " .nex").css('color', '#' + ichex);
$("#acct_"+key).css('color','#'+bghex); $("#acct_" + key).css('color', '#' + bghex);
} }
} }
//入力時にハッシュタグと@をサジェスト //入力時にハッシュタグと@をサジェスト
@ -769,10 +769,10 @@ var input = document.getElementById("url");
var prev_val = input.value; var prev_val = input.value;
var oldSuggest; var oldSuggest;
var suggest; var suggest;
input.addEventListener("focus", function() { input.addEventListener("focus", function () {
$("#ins-suggest").html(""); $("#ins-suggest").html("");
window.clearInterval(timer); window.clearInterval(timer);
timer = window.setInterval(function() { timer = window.setInterval(function () {
var new_val = input.value; var new_val = input.value;
if (prev_val != new_val) { if (prev_val != new_val) {
if (new_val.length > 3) { if (new_val.length > 3) {
@ -784,21 +784,21 @@ input.addEventListener("focus", function() {
'content-type': 'application/json', 'content-type': 'application/json',
'Authorization': 'Bearer tC8F6xWGWBUwGScyNevYlx62iO6fdQ4oIK0ad68Oo7ZKB8GQdGpjW9TKxBnIh8grAhvd5rw3iyP9JPamoDpeLQdz62EToPJUW99hDx8rfuJfGdjQuimZPTbIOx0woA5M' 'Authorization': 'Bearer tC8F6xWGWBUwGScyNevYlx62iO6fdQ4oIK0ad68Oo7ZKB8GQdGpjW9TKxBnIh8grAhvd5rw3iyP9JPamoDpeLQdz62EToPJUW99hDx8rfuJfGdjQuimZPTbIOx0woA5M'
}, },
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
if (!json.error) { if (!json.error) {
var urls = "Suggest:"; var urls = "Suggest:";
Object.keys(json.instances).forEach(function(key) { Object.keys(json.instances).forEach(function (key) {
var url = json.instances[key]; var url = json.instances[key];
urls = urls + ' <a onclick="login(\'' + url.name + urls = urls + ' <a onclick="login(\'' + url.name +
'\')" class="pointer">' +escapeHTML(url.name) + '</a> '; '\')" class="pointer">' + escapeHTML(url.name) + '</a> ';
}); });
$("#ins-suggest").html(urls); $("#ins-suggest").html(urls);
}else{ } else {
console.error(json.error); console.error(json.error);
} }
}); });
@ -809,6 +809,6 @@ input.addEventListener("focus", function() {
}, 1000); }, 1000);
}, false); }, false);
input.addEventListener("blur", function() { input.addEventListener("blur", function () {
window.clearInterval(timer); window.clearInterval(timer);
}, false); }, false);

View File

@ -1,136 +1,136 @@
//プラットフォーム別 最後に読むやつ //プラットフォーム別 最後に読むやつ
//リンクを外部で開くか内部で出すか //リンクを外部で開くか内部で出すか
$(document).on('click', 'a', e => { $(document).on('click', 'a', e => {
var $a = $(e.target); var $a = $(e.target);
var url = $a.attr('href'); var url = $a.attr('href');
if (!url) { if (!url) {
var url = $a.parent().attr('href'); var url = $a.parent().attr('href');
} }
var urls=[]; var urls = [];
if(url){ if (url) {
urls = url.match(/https?:\/\/(.+)/); urls = url.match(/https?:\/\/(.+)/);
//トゥートのURLぽかったら //トゥートのURLぽかったら
toot = url.match(/https:\/\/([a-zA-Z0-9.-]+)\/@([a-zA-Z0-9_]+)\/([0-9]+)/); toot = url.match(/https:\/\/([a-zA-Z0-9.-]+)\/@([a-zA-Z0-9_]+)\/([0-9]+)/);
//タグのURLぽかったら //タグのURLぽかったら
var tags=[]; var tags = [];
tags = url.match( tags = url.match(
/https:\/\/([-a-zA-Z0-9@.]+)\/tags\/([-_.!~*\'()a-zA-Z0-9;\/?:\&=+\$,%#]+)/ /https:\/\/([-a-zA-Z0-9@.]+)\/tags\/([-_.!~*\'()a-zA-Z0-9;\/?:\&=+\$,%#]+)/
); );
//メンションっぽかったら //メンションっぽかったら
var ats=[]; var ats = [];
ats = url.match( ats = url.match(
/https:\/\/([-a-zA-Z0-9.]+)\/@([-_.!~*\'()a-zA-Z0-9;\/?:\&=+\$,%#@]+)/ /https:\/\/([-a-zA-Z0-9.]+)\/@([-_.!~*\'()a-zA-Z0-9;\/?:\&=+\$,%#@]+)/
); );
if(toot){ if (toot) {
if(toot[1]){ if (toot[1]) {
var acct_id=$a.parent().attr("data-acct"); var acct_id = $a.parent().attr("data-acct");
if(!acct_id){ if (!acct_id) {
acct_id=0; acct_id = 0;
} }
$a.parent().addClass("loadp") $a.parent().addClass("loadp")
$a.parent().text("Loading...") $a.parent().text("Loading...")
detEx(url,acct_id); detEx(url, acct_id);
} }
}else if(tags){ } else if (tags) {
if(tags[2]){ if (tags[2]) {
var acct_id=$a.parent().attr("data-acct"); var acct_id = $a.parent().attr("data-acct");
if(!acct_id){ if (!acct_id) {
acct_id=0; acct_id = 0;
} }
tl('tag',decodeURI(tags[2]),acct_id,'add') tl('tag', decodeURI(tags[2]), acct_id, 'add')
} }
}else if(ats){ } else if (ats) {
if(ats[2]){ if (ats[2]) {
//Quesdon判定 //Quesdon判定
if(!~ats[2].indexOf("@")){ if (!~ats[2].indexOf("@")) {
udgEx(ats[2]+"@"+ats[1],"main"); udgEx(ats[2] + "@" + ats[1], "main");
return false return false
}else{ } else {
const { const {
shell shell
} = require('electron'); } = require('electron');
shell.openExternal(url); shell.openExternal(url);
} }
}
}else{
//hrefがhttp/httpsならブラウザで
if(urls){
if (urls[0]) {
const {shell} = require('electron');
if(~url.indexOf("thedeks.top")){
//alert("If you recieve this alert, let the developer(Cutls@kirishima.cloud) know it with a screenshot.");
url="https://thedesk.top";
}
shell.openExternal(url);
} else {
location.href = url;
}
}else{
location.href = url;
}
}
}
return false;
});
//よく使うライブラリ
//コピー
function execCopy(string){ }
} else {
//hrefがhttp/httpsならブラウザで
if (urls) {
if (urls[0]) {
const { shell } = require('electron');
if (~url.indexOf("thedeks.top")) {
//alert("If you recieve this alert, let the developer(Cutls@kirishima.cloud) know it with a screenshot.");
url = "https://thedesk.top";
}
shell.openExternal(url);
} else {
location.href = url;
}
} else {
location.href = url;
}
}
}
return false;
});
//よく使うライブラリ
//コピー
function execCopy(string) {
var temp = $("#copy"); var temp = $("#copy");
temp.val(string); temp.val(string);
temp.select(); temp.select();
var result = document.execCommand('copy'); var result = document.execCommand('copy');
return result; return result;
} }
//Nano //Nano
function nano(){ function nano() {
var electron = require("electron"); var electron = require("electron");
var ipc = electron.ipcRenderer; var ipc = electron.ipcRenderer;
ipc.send('nano', ""); ipc.send('nano', "");
} }
function progshow(e) { function progshow(e) {
if (e.lengthComputable) { if (e.lengthComputable) {
var percent = e.loaded / e.total; var percent = e.loaded / e.total;
console.log("Progress: "+percent * 100); console.log("Progress: " + percent * 100);
$("#imgsel").hide(); $("#imgsel").hide();
if(percent<1){ if (percent < 1) {
$("#imgup").text(Math.floor(percent*100)+"%"); $("#imgup").text(Math.floor(percent * 100) + "%");
}else{ } else {
$("#imgup").text(lang.lang_progress); $("#imgup").text(lang.lang_progress);
} }
} }
} }
var electron = require("electron"); var electron = require("electron");
var ipc = electron.ipcRenderer; var ipc = electron.ipcRenderer;
ipc.on('reload', function (event, arg) { ipc.on('reload', function (event, arg) {
location.reload(); location.reload();
}) })
ipc.on('mess', function (event, arg) { ipc.on('mess', function (event, arg) {
if(arg=="unzip"){ if (arg == "unzip") {
if(lang=="ja"){ if (lang == "ja") {
$("body").text("アップデートを展開中です。"); $("body").text("アップデートを展開中です。");
}else{ } else {
$("body").text("Unzipping..."); $("body").text("Unzipping...");
} }
} }
}) })
//Native Notf //Native Notf
ipc.on('shownotf', function (event, args) { ipc.on('shownotf', function (event, args) {
if(args["type"]=="toot"){ if (args["type"] == "toot") {
details(id, acct_id) details(id, acct_id)
}else if(args["type"]=="userdata"){ } else if (args["type"] == "userdata") {
udg(user, acct_id) udg(user, acct_id)
} }
}) })
function opendev(){ function opendev() {
var webview = document.getElementById("webview"); var webview = document.getElementById("webview");
webview.openDevTools(); webview.openDevTools();
/*webview.sendInputEvent({ /*webview.sendInputEvent({
@ -144,15 +144,15 @@ var webviewDom = document.getElementById('webview');
const { const {
shell shell
} = require('electron'); } = require('electron');
webviewDom.addEventListener('new-window', function(e) { webviewDom.addEventListener('new-window', function (e) {
shell.openExternal(e.url); shell.openExternal(e.url);
}); });
function playSound() { function playSound() {
window.AudioContext = window.AudioContext || window.webkitAudioContext; window.AudioContext = window.AudioContext || window.webkitAudioContext;
context = new AudioContext(); context = new AudioContext();
context.createBufferSource().start(0); context.createBufferSource().start(0);
context.decodeAudioData(request.response, function (buf) { context.decodeAudioData(request.response, function (buf) {
console.log("Playing:"+source) console.log("Playing:" + source)
source.buffer = buf; source.buffer = buf;
source.loop = false; source.loop = false;
}); });
@ -160,6 +160,6 @@ function playSound() {
volumeControl = context.createGain(); volumeControl = context.createGain();
source.connect(volumeControl); source.connect(volumeControl);
volumeControl.connect(context.destination); volumeControl.connect(context.destination);
volumeControl.gain.value=0.8 volumeControl.gain.value = 0.8
source.start(0); source.start(0);
} }

View File

@ -1,91 +1,91 @@
//jQuery読む //jQuery読む
window.jQuery = window.$ = require('../../js/common/jquery.js'); window.jQuery = window.$ = require('../../js/common/jquery.js');
var Hammer = require('../../js/common/hammer.min.js'); var Hammer = require('../../js/common/hammer.min.js');
$.strip_tags = function(str, allowed) { $.strip_tags = function (str, allowed) {
if(!str){ if (!str) {
return "";
}
allowed = (((allowed || '') + '').toLowerCase().match(/<[a-z][a-z0-9]*>/g) || [])
.join('');
var tags = /<\/?([a-z][a-z0-9]*)\b[^>]*>?/gi,
commentsAndPhpTags = /<!--[\s\S]*?-->|<\?(?:php)?[\s\S]*?\?>/gi;
return str.replace(commentsAndPhpTags, '').replace(tags, function ($0, $1) {
return allowed.indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : '';
});
};
function escapeHTML(str) {
if (!str) {
return ""; return "";
} }
allowed = (((allowed || '') + '').toLowerCase().match(/<[a-z][a-z0-9]*>/g) || [])
.join('');
var tags = /<\/?([a-z][a-z0-9]*)\b[^>]*>?/gi,
commentsAndPhpTags = /<!--[\s\S]*?-->|<\?(?:php)?[\s\S]*?\?>/gi;
return str.replace(commentsAndPhpTags, '').replace(tags, function($0, $1) {
return allowed.indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : '';
});
};
function escapeHTML(str) {
if(!str){
return "";
}
return str.replace(/&/g, '&amp;') return str.replace(/&/g, '&amp;')
.replace(/</g, '&lt;') .replace(/</g, '&lt;')
.replace(/>/g, '&gt;') .replace(/>/g, '&gt;')
.replace(/"/g, '&quot;') .replace(/"/g, '&quot;')
.replace(/'/g, '&#039;'); .replace(/'/g, '&#039;');
} }
//PHPのnl2brと同様 //PHPのnl2brと同様
function nl2br(str) { function nl2br(str) {
if(!str){ if (!str) {
return ""; return "";
} }
str = str.replace(/\r\n/g, "<br />"); str = str.replace(/\r\n/g, "<br />");
str = str.replace(/(\n|\r)/g, "<br />"); str = str.replace(/(\n|\r)/g, "<br />");
return str; return str;
} }
function br2nl(str) { function br2nl(str) {
if(!str){ if (!str) {
return ""; return "";
} }
str = str.replace(/<br \/>/g, "\r\n"); str = str.replace(/<br \/>/g, "\r\n");
return str; return str;
} }
function formattime(date){ function formattime(date) {
var str=date.getFullYear()+"-"; var str = date.getFullYear() + "-";
if(date.getMonth()+1<10){ if (date.getMonth() + 1 < 10) {
str=str+"0"+(date.getMonth()+1)+"-"; str = str + "0" + (date.getMonth() + 1) + "-";
}else{ } else {
str=str+(date.getMonth()+1)+"-"; str = str + (date.getMonth() + 1) + "-";
} }
if(date.getDate()<10){ if (date.getDate() < 10) {
str=str+"0"+date.getDate() str = str + "0" + date.getDate()
}else{ } else {
str=str+date.getDate() str = str + date.getDate()
} }
str=str+"T"; str = str + "T";
if(date.getHours()<10){ if (date.getHours() < 10) {
str=str+"0"+date.getHours()+":" str = str + "0" + date.getHours() + ":"
}else{ } else {
str=str+date.getHours()+":" str = str + date.getHours() + ":"
} }
if(date.getMinutes()<10){ if (date.getMinutes() < 10) {
str=str+"0"+date.getMinutes() str = str + "0" + date.getMinutes()
}else{ } else {
str=str+date.getMinutes() str = str + date.getMinutes()
} }
return escapeHTML(str); return escapeHTML(str);
} }
function formattimeutc(date){ function formattimeutc(date) {
var str=date.getUTCFullYear()+"-"; var str = date.getUTCFullYear() + "-";
if(date.getUTCMonth()+1<10){ if (date.getUTCMonth() + 1 < 10) {
str=str+"0"+(date.getUTCMonth()+1)+"-"; str = str + "0" + (date.getUTCMonth() + 1) + "-";
}else{ } else {
str=str+(date.getUTCMonth()+1)+"-"; str = str + (date.getUTCMonth() + 1) + "-";
} }
if(date.getUTCDate()<10){ if (date.getUTCDate() < 10) {
str=str+"0"+date.getUTCDate() str = str + "0" + date.getUTCDate()
}else{ } else {
str=str+date.getUTCDate() str = str + date.getUTCDate()
} }
str=str+"T"; str = str + "T";
if(date.getUTCHours()<10){ if (date.getUTCHours() < 10) {
str=str+"0"+date.getUTCHours()+":" str = str + "0" + date.getUTCHours() + ":"
}else{ } else {
str=str+date.getUTCHours()+":" str = str + date.getUTCHours() + ":"
} }
if(date.getUTCMinutes()<10){ if (date.getUTCMinutes() < 10) {
str=str+"0"+date.getUTCMinutes() str = str + "0" + date.getUTCMinutes()
}else{ } else {
str=str+date.getUTCMinutes() str = str + date.getUTCMinutes()
} }
return escapeHTML(str); return escapeHTML(str);
} }
@ -93,108 +93,103 @@ var electron = require("electron");
var ipc = electron.ipcRenderer; var ipc = electron.ipcRenderer;
ipc.send('custom-css-request', ""); ipc.send('custom-css-request', "");
ipc.on('custom-css-response', function (event, arg) { ipc.on('custom-css-response', function (event, arg) {
if(arg==""){ return false; } if (arg == "") { return false; }
var styleNode = document.createElement("style"); var styleNode = document.createElement("style");
styleNode.setAttribute("type","text/css") styleNode.setAttribute("type", "text/css")
var content = document.createTextNode(arg) var content = document.createTextNode(arg)
styleNode.append(content) styleNode.append(content)
document.getElementsByTagName("head")[0].append(styleNode) document.getElementsByTagName("head")[0].append(styleNode)
}) })
ipc.on('theme-css-response', function (event, arg) { ipc.on('theme-css-response', function (event, arg) {
if(arg==""){ return false; } if (arg == "") { return false; }
var styleNode = document.createElement("style"); var styleNode = document.createElement("style");
styleNode.setAttribute("type","text/css") styleNode.setAttribute("type", "text/css")
var content = document.createTextNode(arg) var content = document.createTextNode(arg)
styleNode.append(content) styleNode.append(content)
document.getElementsByTagName("head")[0].append(styleNode) document.getElementsByTagName("head")[0].append(styleNode)
}) })
function makeCID(){ function makeCID() {
return randomStr(8)+"-"+randomStr(4)+"-"+randomStr(4)+"-"+randomStr(4)+"-"+randomStr(12); return randomStr(8) + "-" + randomStr(4) + "-" + randomStr(4) + "-" + randomStr(4) + "-" + randomStr(12);
} }
function randomStr(l){ function randomStr(l) {
// 生成する文字列に含める文字セット // 生成する文字列に含める文字セット
var c = "abcdefghijklmnopqrstuvwxyz0123456789"; var c = "abcdefghijklmnopqrstuvwxyz0123456789";
var cl = c.length; var cl = c.length;
var r = ""; var r = "";
for(var i=0; i<l; i++){ for (var i = 0; i < l; i++) {
r += c[Math.floor(Math.random()*cl)]; r += c[Math.floor(Math.random() * cl)];
} }
return r; return r;
} }
function rgbToHex(color) function rgbToHex(color) {
{ // HEXに変換したものを代入する変数
// HEXに変換したものを代入する変数 var hex = '';
var hex = '';
// 第1引数がHEXのとき変換処理は必要ないのでそのままreturn
// 第1引数がHEXのとき変換処理は必要ないのでそのままreturn // IE8の場合はjQueryのcss()関数でHEXを返すので除外
// IE8の場合はjQueryのcss()関数でHEXを返すので除外 if (color.match(/^#[a-f\d]{3}$|^#[a-f\d]{6}$/i)) {
if (color.match(/^#[a-f\d]{3}$|^#[a-f\d]{6}$/i)) return color;
{ }
return color;
} // 正規表現
var regex = color.match(/^rgb\(([0-9.]+),\s*([0-9.]+),\s*([0-9.]+)\)$/);
// 正規表現
var regex = color.match(/^rgb\(([0-9.]+),\s*([0-9.]+),\s*([0-9.]+)\)$/); // 正規表現でマッチしたとき
if (regex) {
// 正規表現でマッチしたとき var rgb =
if (regex) [
{ // RGBからHEXへ変換
var rgb = parseInt(regex[1]).toString(16),
[ parseInt(regex[2]).toString(16),
// RGBからHEXへ変換 parseInt(regex[3]).toString(16)
parseInt(regex[1]).toString(16), ];
parseInt(regex[2]).toString(16),
parseInt(regex[3]).toString(16) for (var i = 0; i < rgb.length; ++i) {
]; // rgb(1,1,1)のようなときHEXに変換すると1桁になる
// 1桁のときは前に0を足す
for (var i = 0; i < rgb.length; ++i) if (rgb[i].length == 1) {
{ rgb[i] = '0' + rgb[i];
// rgb(1,1,1)のようなときHEXに変換すると1桁になる }
// 1桁のときは前に0を足す hex += rgb[i];
if (rgb[i].length == 1) }
{
rgb[i] = '0' + rgb[i]; return hex;
} }
hex += rgb[i];
} console.error(color + ':第1引数はRGB形式で入力');
return hex;
}
console.error(color+':第1引数はRGB形式で入力');
} }
/*マルチバイト用切り出し*/ /*マルチバイト用切り出し*/
$.isSurrogatePear = function(upper, lower) { $.isSurrogatePear = function (upper, lower) {
return 0xD800 <= upper && upper <= 0xDBFF && 0xDC00 <= lower && lower <= 0xDFFF; return 0xD800 <= upper && upper <= 0xDBFF && 0xDC00 <= lower && lower <= 0xDFFF;
}; };
$.mb_strlen = function(str) { $.mb_strlen = function (str) {
var ret = 0; var ret = 0;
for (var i = 0; i < str.length; i++, ret++) { for (var i = 0; i < str.length; i++ , ret++) {
var upper = str.charCodeAt(i); var upper = str.charCodeAt(i);
var lower = str.length > (i + 1) ? str.charCodeAt(i + 1) : 0; var lower = str.length > (i + 1) ? str.charCodeAt(i + 1) : 0;
if ($.isSurrogatePear(upper, lower)) { if ($.isSurrogatePear(upper, lower)) {
i++; i++;
} }
} }
return ret; return ret;
}; };
$.mb_substr = function(str, begin, end) { $.mb_substr = function (str, begin, end) {
var ret = ''; var ret = '';
for (var i = 0, len = 0; i < str.length; i++, len++) { for (var i = 0, len = 0; i < str.length; i++ , len++) {
var upper = str.charCodeAt(i); var upper = str.charCodeAt(i);
var lower = str.length > (i + 1) ? str.charCodeAt(i + 1) : 0; var lower = str.length > (i + 1) ? str.charCodeAt(i + 1) : 0;
var s = ''; var s = '';
if ($.isSurrogatePear(upper, lower)) { if ($.isSurrogatePear(upper, lower)) {
i++; i++;
s = String.fromCharCode(upper, lower); s = String.fromCharCode(upper, lower);
} else { } else {
s = String.fromCharCode(upper); s = String.fromCharCode(upper);
} }
if (begin <= len && len < end) { if (begin <= len && len < end) {
ret += s; ret += s;
} }
} }
return ret; return ret;
}; };

View File

@ -1,16 +1,16 @@
//TL取得 //TL取得
function tl(data) { function tl(data) {
var tlid=0; var tlid = 0;
var acct_id = $("#post-acct-sel").val(); var acct_id = $("#post-acct-sel").val();
var type = $("#type-sel").val(); var type = $("#type-sel").val();
var domain = localStorage.getItem("domain_" + acct_id); var domain = localStorage.getItem("domain_" + acct_id);
//タグの場合はカラム追加して描画 //タグの場合はカラム追加して描画
if (!type) { if (!type) {
//デフォルト //デフォルト
var type = "local"; var type = "local";
} }
var at = localStorage.getItem("acct_"+ acct_id + "_at"); var at = localStorage.getItem("acct_" + acct_id + "_at");
$("#notice_nano").text(cap(type, data) + " TL(" + localStorage.getItem( $("#notice_nano").text(cap(type, data) + " TL(" + localStorage.getItem(
"user_" + acct_id) + "@" + domain + ")"); "user_" + acct_id) + "@" + domain + ")");
var start = "https://" + domain + "/api/v1/timelines/" + com(type, data); var start = "https://" + domain + "/api/v1/timelines/" + com(type, data);
@ -20,18 +20,18 @@ function tl(data) {
'content-type': 'application/json', 'content-type': 'application/json',
'Authorization': 'Bearer ' + at 'Authorization': 'Bearer ' + at
}, },
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
var templete = parse([json[0]], '', acct_id, tlid); var templete = parse([json[0]], '', acct_id, tlid);
$("#timeline_nano").html(templete); $("#timeline_nano").html(templete);
jQuery("time.timeago").timeago(); jQuery("time.timeago").timeago();
}); });
//Streaming接続 //Streaming接続
var websocket=[]; var websocket = [];
var tlid=0; var tlid = 0;
if (type == "home") { if (type == "home") {
var start = "wss://" + domain + var start = "wss://" + domain +
"/api/v1/streaming/?stream=user&access_token=" + at; "/api/v1/streaming/?stream=user&access_token=" + at;
@ -43,14 +43,14 @@ var websocket=[];
"/api/v1/streaming/?stream=public:local&access_token=" + at; "/api/v1/streaming/?stream=public:local&access_token=" + at;
} else if (type == "tag") { } else if (type == "tag") {
var start = "wss://" + domain + var start = "wss://" + domain +
"/api/v1/streaming/?stream=hashtag&tag=" + data +"&access_token=" + at; "/api/v1/streaming/?stream=hashtag&tag=" + data + "&access_token=" + at;
} }
var wsid = websocket.length; var wsid = websocket.length;
websocket[wsid] = new WebSocket(start); websocket[wsid] = new WebSocket(start);
websocket[wsid].onopen = function(mess) { websocket[wsid].onopen = function (mess) {
$("#notice_icon_" + tlid).removeClass("red-text"); $("#notice_icon_" + tlid).removeClass("red-text");
} }
websocket[wsid].onmessage = function(mess) { websocket[wsid].onmessage = function (mess) {
var typeA = JSON.parse(mess.data).event; var typeA = JSON.parse(mess.data).event;
if (typeA == "delete") { if (typeA == "delete") {
var obj = JSON.parse(mess.data).payload; var obj = JSON.parse(mess.data).payload;
@ -58,14 +58,14 @@ var websocket=[];
$("[toot-id=" + JSON.parse(mess.data).payload + "]").remove(); $("[toot-id=" + JSON.parse(mess.data).payload + "]").remove();
} else if (typeA == "update") { } else if (typeA == "update") {
var obj = JSON.parse(JSON.parse(mess.data).payload); var obj = JSON.parse(JSON.parse(mess.data).payload);
var templete = parse([obj], '', acct_id, tlid); var templete = parse([obj], '', acct_id, tlid);
$("#timeline_nano").html(templete); $("#timeline_nano").html(templete);
} }
websocket[wsid].onclose = function(mess) { websocket[wsid].onclose = function (mess) {
console.error("Close Streaming API:" + type); console.error("Close Streaming API:" + type);
} }
} }
websocket[wsid].onerror = function(error) { websocket[wsid].onerror = function (error) {
console.error('WebSocket Error ' + error); console.error('WebSocket Error ' + error);
}; };
} }
@ -117,12 +117,12 @@ function icon(type) {
return "subject" return "subject"
} }
} }
function todo(){} function todo() { }
function todc(){} function todc() { }
function hide(){} function hide() { }
$(function($) { $(function ($) {
//キーボードショートカット //キーボードショートカット
$(window).keydown(function(e) { $(window).keydown(function (e) {
var hasFocus = $('input').is(':focus'); var hasFocus = $('input').is(':focus');
var hasFocus2 = $('textarea').is(':focus'); var hasFocus2 = $('textarea').is(':focus');
//Ctrl+Enter:投稿 //Ctrl+Enter:投稿

View File

@ -3,49 +3,49 @@ const fs = require("fs");
const os = require('os') const os = require('os')
const shell = electron.shell; const shell = electron.shell;
const path = require('path') const path = require('path')
function shot(){ function shot() {
//screenshotMsg.textContent = 'Gathering screens...' //screenshotMsg.textContent = 'Gathering screens...'
$(window).height $(window).height
let options = { let options = {
types: ['screen'], types: ['screen'],
thumbnailSize: { thumbnailSize: {
width: window.parent.screen.width, width: window.parent.screen.width,
height: window.parent.screen.height height: window.parent.screen.height
} }
} }
const desktopCapturer = electron.desktopCapturer; const desktopCapturer = electron.desktopCapturer;
desktopCapturer.getSources(options, function(error, sources) { desktopCapturer.getSources(options, function (error, sources) {
if (error) return console.log(error) if (error) return console.log(error)
sources.forEach(function(source) { sources.forEach(function (source) {
if(location.search){ if (location.search) {
var m = location.search.match(/\?id=([a-zA-Z-0-9]+)/); var m = location.search.match(/\?id=([a-zA-Z-0-9]+)/);
var title=m[1]; var title = m[1];
}else{ } else {
var title="screenshot"; var title = "screenshot";
} }
if (source.name === 'Screen 1' || source.name === 'TheDesk') { if (source.name === 'Screen 1' || source.name === 'TheDesk') {
var durl=source.thumbnail.toDataURL(); var durl = source.thumbnail.toDataURL();
var b64 = durl.match( var b64 = durl.match(
/data:image\/png;base64,(.+)/ /data:image\/png;base64,(.+)/
); );
const screenshotPath = path.join(os.tmpdir(), 'screenshot.png'); const screenshotPath = path.join(os.tmpdir(), 'screenshot.png');
const savePath = path.join(os.tmpdir(), 'screenshot.png'); const savePath = path.join(os.tmpdir(), 'screenshot.png');
var ipc = electron.ipcRenderer; var ipc = electron.ipcRenderer;
var h = $(window).height()-150; var h = $(window).height() - 150;
var w = $(window).width(); var w = $(window).width();
ipc.send('shot', ['file://' + screenshotPath,w,h,b64[1],title]); ipc.send('shot', ['file://' + screenshotPath, w, h, b64[1], title]);
if($(".img-parsed").length>0){ if ($(".img-parsed").length > 0) {
for(i=0;i<$(".img-parsed").length;i++){ for (i = 0; i < $(".img-parsed").length; i++) {
var url=$(".img-parsed").eq(i).attr("data-url"); var url = $(".img-parsed").eq(i).attr("data-url");
ipc.send('shot-img-dl', [url,title+"_img"+i+".png"]); ipc.send('shot-img-dl', [url, title + "_img" + i + ".png"]);
}
} }
window.close(); }
return; window.close();
const message = `Saved screenshot to: ${screenshotPath}` return;
//screenshotMsg.textContent = message const message = `Saved screenshot to: ${screenshotPath}`
} //screenshotMsg.textContent = message
}) }
}) })
} })
}

View File

@ -12,33 +12,33 @@ function _classCallCheck(a, e) {
if (!(a instanceof e)) throw new TypeError("Cannot call a class as a function") if (!(a instanceof e)) throw new TypeError("Cannot call a class as a function")
} }
var TJScrollTask = function () { var TJScrollTask = function () {
function a(e, f, g) { function a(e, f, g) {
_classCallCheck(this, a), this.tjDeck = e, this.$t = e.$wrap, this.x = f, this.d = g, this.sl = e.wrapL, this.sTime = Date.now(), this.ended = !1, this._bindAnim = this._anim.bind(this); _classCallCheck(this, a), this.tjDeck = e, this.$t = e.$wrap, this.x = f, this.d = g, this.sl = e.wrapL, this.sTime = Date.now(), this.ended = !1, this._bindAnim = this._anim.bind(this);
var h = e.getClms(); var h = e.getClms();
0 > f || f > h[0].offsetWidth * (h.length - 1) ? this.ended = !0 : requestAnimationFrame(this._bindAnim) 0 > f || f > h[0].offsetWidth * (h.length - 1) ? this.ended = !0 : requestAnimationFrame(this._bindAnim)
}
return _createClass(a, [{
key: "stop",
value: function stop() {
this.ended || (this.ended = !0, cancelAnimationFrame(this._bindAnim))
} }
return _createClass(a, [{ }, {
key: "stop", key: "_anim",
value: function stop() { value: function _anim() {
this.ended || (this.ended = !0, cancelAnimationFrame(this._bindAnim)) if (!this.ended) {
var e = (Date.now() - this.sTime) / this.d,
f = this.sl,
g = this.x - this.sl;
1 < e && !this.ended && (this.stop(), e = 1), this.tjDeck.scrollWrap(this._easeOut(e, f, g, 1)), 1 > e && requestAnimationFrame(this._bindAnim)
} }
}, { }
key: "_anim", }, {
value: function _anim() { key: "_easeOut",
if (!this.ended) { value: function _easeOut(e, f, g, h) {
var e = (Date.now() - this.sTime) / this.d, return e /= h, --e, g * (e * e * e + 1) + f
f = this.sl, }
g = this.x - this.sl; }]), a
1 < e && !this.ended && (this.stop(), e = 1), this.tjDeck.scrollWrap(this._easeOut(e, f, g, 1)), 1 > e && requestAnimationFrame(this._bindAnim) }(),
}
}
}, {
key: "_easeOut",
value: function _easeOut(e, f, g, h) {
return e /= h, --e, g * (e * e * e + 1) + f
}
}]), a
}(),
TJDeck = function () { TJDeck = function () {
function a() { function a() {
_classCallCheck(this, a), this.version = "0.0.9", this.$wrap = document.querySelector(".js-app-columns"), this.wrapL = 0, this.scrollTask = null, this.options = this.getOptionObj(), this.setOptionFromObj(this.options), this.$options = this.createOptionPanel(), document.body.appendChild(this.$options), this.updateBlur(), this.updateLight() _classCallCheck(this, a), this.version = "0.0.9", this.$wrap = document.querySelector(".js-app-columns"), this.wrapL = 0, this.scrollTask = null, this.options = this.getOptionObj(), this.setOptionFromObj(this.options), this.$options = this.createOptionPanel(), document.body.appendChild(this.$options), this.updateBlur(), this.updateLight()
@ -117,22 +117,22 @@ var TJScrollTask = function () {
key: "observeModals", key: "observeModals",
value: function observeModals() { value: function observeModals() {
for (var e = new MutationObserver(function (j) { for (var e = new MutationObserver(function (j) {
for (var k, l, m = 0; m < j.length; m++) { for (var k, l, m = 0; m < j.length; m++) {
k = j[m]; k = j[m];
for (var o = 0; o < k.addedNodes.length; o++) l = k.addedNodes[m], this.stopAnkerFromModal(l) for (var o = 0; o < k.addedNodes.length; o++) l = k.addedNodes[m], this.stopAnkerFromModal(l)
} }
}.bind(this)), f = { }.bind(this)), f = {
attributes: !1, attributes: !1,
characterData: !0, characterData: !0,
childList: !0 childList: !0
}, g = document.querySelectorAll(".js-modals-container, .js-modal"), h = 0; h < g.length; h++) e.observe(g[h], f) }, g = document.querySelectorAll(".js-modals-container, .js-modal"), h = 0; h < g.length; h++) e.observe(g[h], f)
} }
}, { }, {
key: "stopAnkerFromModal", key: "stopAnkerFromModal",
value: function stopAnkerFromModal(e) { value: function stopAnkerFromModal(e) {
for (var g, f = e.querySelectorAll("a"), h = function (k) { for (var g, f = e.querySelectorAll("a"), h = function (k) {
return k.preventDefault(), k.target.removeEventListener("click", h), !1 return k.preventDefault(), k.target.removeEventListener("click", h), !1
}, j = 0; j < f.length; j++) g = f[j], g.href && g.href.match(/#$/) && g.addEventListener("click", h) }, j = 0; j < f.length; j++) g = f[j], g.href && g.href.match(/#$/) && g.addEventListener("click", h)
} }
}, { }, {
key: "observeClms", key: "observeClms",
@ -160,7 +160,7 @@ var TJScrollTask = function () {
if (j) { if (j) {
if (0 > j) { if (0 > j) {
var l = this._getPosObj(k); var l = this._getPosObj(k);
if (Math.abs(l.x - e.x) < Math.abs(l.y - e.y)) return void(j = 0); if (Math.abs(l.x - e.x) < Math.abs(l.y - e.y)) return void (j = 0);
j = 1 j = 1
} }
if (1 == j) { if (1 == j) {
@ -217,7 +217,7 @@ var TJScrollTask = function () {
} }
}, { }, {
key: "showTJSetting", key: "showTJSetting",
value: function showTJSetting() {} value: function showTJSetting() { }
}, { }, {
key: "addTJNav", key: "addTJNav",
value: function addTJNav() { value: function addTJNav() {
@ -298,7 +298,7 @@ var TJScrollTask = function () {
} }
}, { }, {
key: "refreshStyle", key: "refreshStyle",
value: function refreshStyle() {} value: function refreshStyle() { }
}, { }, {
key: "addStyle", key: "addStyle",
value: function addStyle() { value: function addStyle() {

View File

@ -1,67 +1,67 @@
//BBCodeとMarkdownの入力・パーサー //BBCodeとMarkdownの入力・パーサー
//アカウント変えた時にBBとかMDとか //アカウント変えた時にBBとかMDとか
function mdCheck(){ function mdCheck() {
var acct_id = $("#post-acct-sel").val(); var acct_id = $("#post-acct-sel").val();
var profimg=localStorage.getItem("prof_"+acct_id); var profimg = localStorage.getItem("prof_" + acct_id);
if(!profimg){ if (!profimg) {
profimg="../../img/missing.svg"; profimg = "../../img/missing.svg";
} }
$("#acct-sel-prof").attr("src",profimg); $("#acct-sel-prof").attr("src", profimg);
if(localStorage.getItem("post_" + acct_id)){ if (localStorage.getItem("post_" + acct_id)) {
$("#toot-post-btn").text(localStorage.getItem("post_" + acct_id)+"("+localStorage.getItem("domain_"+acct_id)+")"); $("#toot-post-btn").text(localStorage.getItem("post_" + acct_id) + "(" + localStorage.getItem("domain_" + acct_id) + ")");
}else{ } else {
$("#toot-post-btn").text(lang.lang_toot+"("+localStorage.getItem("domain_"+acct_id)+")"); $("#toot-post-btn").text(lang.lang_toot + "(" + localStorage.getItem("domain_" + acct_id) + ")");
} }
if(!localStorage.getItem("bb_"+acct_id) && !localStorage.getItem("md_"+acct_id)){ if (!localStorage.getItem("bb_" + acct_id) && !localStorage.getItem("md_" + acct_id)) {
$(".markdown").addClass("hide"); $(".markdown").addClass("hide");
$(".anti-markdown").addClass("hide"); $(".anti-markdown").addClass("hide");
}else{ } else {
$(".anti-markdown").removeClass("hide"); $(".anti-markdown").removeClass("hide");
} }
if($(".markdown").hasClass("hide")){ if ($(".markdown").hasClass("hide")) {
localStorage.setItem("md","hide"); localStorage.setItem("md", "hide");
}else{ } else {
localStorage.removeItem("md"); localStorage.removeItem("md");
} }
var domain = localStorage.getItem("domain_" + acct_id); var domain = localStorage.getItem("domain_" + acct_id);
if(domain=="itabashi.0j0.jp"){ if (domain == "itabashi.0j0.jp") {
$("#limited-button").removeClass("hide"); $("#limited-button").removeClass("hide");
}else{ } else {
$("#limited-button").addClass("hide"); $("#limited-button").addClass("hide");
} }
if(domain=="kirishima.cloud"){ if (domain == "kirishima.cloud") {
$("#faicon-btn").show(); $("#faicon-btn").show();
}else{ } else {
$("#faicon-btn").hide(); $("#faicon-btn").hide();
} }
if(domain=="imastodon.net"){ if (domain == "imastodon.net") {
trendTag(); trendTag();
}else{ } else {
$("#trendtag").html(""); $("#trendtag").html("");
} }
if(localStorage.getItem("mode_" + domain)=="misskey"){ if (localStorage.getItem("mode_" + domain) == "misskey") {
Materialize.toast(lang.lang_bbmd_misskey, 5000); Materialize.toast(lang.lang_bbmd_misskey, 5000);
} }
if(idata[domain+"_letters"]){ if (idata[domain + "_letters"]) {
$("#textarea").attr("data-length", idata[domain+"_letters"]) $("#textarea").attr("data-length", idata[domain + "_letters"])
}else{ } else {
$("#textarea").attr("data-length", 500) $("#textarea").attr("data-length", 500)
} }
if(idata[domain+"_glitch"]==="true"){ if (idata[domain + "_glitch"] === "true") {
$("#local-button").removeClass("hide"); $("#local-button").removeClass("hide");
}else{ } else {
$("#local-button").addClass("hide"); $("#local-button").addClass("hide");
} }
var multi = localStorage.getItem("multi"); var multi = localStorage.getItem("multi");
if (multi) { if (multi) {
var obj = JSON.parse(multi); var obj = JSON.parse(multi);
if(obj[acct_id].background && obj[acct_id].background!="def" && obj[acct_id].text && obj[acct_id].text!="def"){ if (obj[acct_id].background && obj[acct_id].background != "def" && obj[acct_id].text && obj[acct_id].text != "def") {
$("#toot-post-btn").removeClass("indigo"); $("#toot-post-btn").removeClass("indigo");
$("#toot-post-btn").css("background-color","#"+obj[acct_id].background); $("#toot-post-btn").css("background-color", "#" + obj[acct_id].background);
$("#toot-post-btn").css("color",obj[acct_id].text); $("#toot-post-btn").css("color", obj[acct_id].text);
}else{ } else {
$("#toot-post-btn").css("background-color",""); $("#toot-post-btn").css("background-color", "");
$("#toot-post-btn").css("color",""); $("#toot-post-btn").css("color", "");
$("#toot-post-btn").addClass("indigo"); $("#toot-post-btn").addClass("indigo");
} }
@ -69,248 +69,248 @@ function mdCheck(){
loadVis(); loadVis();
} }
//BOXのトグルボタン //BOXのトグルボタン
function mdToggle(){ function mdToggle() {
$(".markdown").toggleClass("hide"); $(".markdown").toggleClass("hide");
$(".anti-markdown").toggleClass("hide"); $(".anti-markdown").toggleClass("hide");
if($(".markdown").hasClass("hide")){ if ($(".markdown").hasClass("hide")) {
localStorage.setItem("md","hide"); localStorage.setItem("md", "hide");
}else{ } else {
localStorage.removeItem("md"); localStorage.removeItem("md");
} }
} }
//最初に読み込みます(MD対応インスタンスかチェック) //最初に読み込みます(MD対応インスタンスかチェック)
if(localStorage.getItem("md")=="hide"){ if (localStorage.getItem("md") == "hide") {
$(".markdown").addClass("hide"); $(".markdown").addClass("hide");
$(".anti-markdown").removeClass("hide"); $(".anti-markdown").removeClass("hide");
} }
//タグを選んだ時に(BB版) //タグを選んだ時に(BB版)
function tagsel(tag){ function tagsel(tag) {
var acct_id = $("#post-acct-sel").val(); var acct_id = $("#post-acct-sel").val();
if(!localStorage.getItem("bb_"+acct_id)){ if (!localStorage.getItem("bb_" + acct_id)) {
return false; return false;
} }
if(tag=="large" || tag=="size" || tag=="color" || tag=="colorhex"){ if (tag == "large" || tag == "size" || tag == "color" || tag == "colorhex") {
var sub=$("#"+tag).val(); var sub = $("#" + tag).val();
var sub = sub.replace( /#/g , "" ) ; var sub = sub.replace(/#/g, "");
surroundHTML(tag+"="+sub,tag); surroundHTML(tag + "=" + sub, tag);
}else if(tag=="flip=vertical" || tag=="flip=horizontal"){ } else if (tag == "flip=vertical" || tag == "flip=horizontal") {
surroundHTML(tag,"flip"); surroundHTML(tag, "flip");
}else{ } else {
surroundHTML(tag,tag); surroundHTML(tag, tag);
} }
$("#textarea").focus(); $("#textarea").focus();
} }
//HTMLをエスケープしてXSSを防ぐ //HTMLをエスケープしてXSSを防ぐ
function escape_html (string) { function escape_html(string) {
if(typeof string !== 'string') { if (typeof string !== 'string') {
return string; return string;
} }
return string.replace(/[&'`"<>]/g, function(match) { return string.replace(/[&'`"<>]/g, function (match) {
return { return {
'&': '&amp;', '&': '&amp;',
"'": '&#x27;', "'": '&#x27;',
'`': '&#x60;', '`': '&#x60;',
'"': '&quot;', '"': '&quot;',
'<': '&lt;', '<': '&lt;',
'>': '&gt;', '>': '&gt;',
}[match] }[match]
}); });
} }
//テキストボックスで選択したやつをタグで囲む(BB版) //テキストボックスで選択したやつをタグで囲む(BB版)
function surroundHTML(tagS,tagE) { function surroundHTML(tagS, tagE) {
var acct_id = $("#post-acct-sel").val(); var acct_id = $("#post-acct-sel").val();
if(!localStorage.getItem("bb_"+acct_id)){ if (!localStorage.getItem("bb_" + acct_id)) {
return false; return false;
} }
var target = document.getElementById("textarea"); var target = document.getElementById("textarea");
var pos = getAreaRange(target); var pos = getAreaRange(target);
var val = target.value; var val = target.value;
var range = val.slice(pos.start, pos.end); var range = val.slice(pos.start, pos.end);
var beforeNode = val.slice(0, pos.start); var beforeNode = val.slice(0, pos.start);
var afterNode = val.slice(pos.end); var afterNode = val.slice(pos.end);
var insertNode; var insertNode;
if (range || pos.start != pos.end) { if (range || pos.start != pos.end) {
insertNode = '[' + tagS + ']' + range + '[/' + tagE + ']'; insertNode = '[' + tagS + ']' + range + '[/' + tagE + ']';
target.value = beforeNode + insertNode + afterNode; target.value = beforeNode + insertNode + afterNode;
} }
else if (pos.start == pos.end) { else if (pos.start == pos.end) {
insertNode = '[' + tagS + ']' + '[/' + tagE + ']'; insertNode = '[' + tagS + ']' + '[/' + tagE + ']';
target.value = beforeNode + insertNode + afterNode; target.value = beforeNode + insertNode + afterNode;
} }
} }
function markdown(tag,ck,br,space){ function markdown(tag, ck, br, space) {
if(space=="before"){ if (space == "before") {
tagE=tag; tagE = tag;
tag=" "+tag; tag = " " + tag;
}else{ } else {
tagE=tag; tagE = tag;
} }
surroundMD(tag,tagE,ck,br); surroundMD(tag, tagE, ck, br);
$("#textarea").focus(); $("#textarea").focus();
} }
function surroundMD(tagS,tagE,ck,br) { function surroundMD(tagS, tagE, ck, br) {
var acct_id = $("#post-acct-sel").val(); var acct_id = $("#post-acct-sel").val();
if(!localStorage.getItem("md_"+acct_id)){ if (!localStorage.getItem("md_" + acct_id)) {
return false; return false;
} }
var target = document.getElementById("textarea"); var target = document.getElementById("textarea");
var pos = getAreaRange(target); var pos = getAreaRange(target);
var val = target.value; var val = target.value;
var range = val.slice(pos.start, pos.end); var range = val.slice(pos.start, pos.end);
var beforeNode = val.slice(0, pos.start); var beforeNode = val.slice(0, pos.start);
var afterNode = val.slice(pos.end); var afterNode = val.slice(pos.end);
var insertNode; var insertNode;
if(br=="yes"){ if (br == "yes") {
var br="\n"; var br = "\n";
}else{ } else {
var br=""; var br = "";
}
if ((range || pos.start != pos.end) && ck == "yes") {
insertNode = tagS + range + tagE;
target.value = beforeNode + insertNode + br + afterNode;
}
else if (pos.start == pos.end || ck == "no") {
insertNode = tagS + range;
target.value = beforeNode + insertNode + br + afterNode;
} }
if ((range || pos.start != pos.end )&& ck=="yes") {
insertNode = tagS + range + tagE ;
target.value = beforeNode + insertNode + br + afterNode;
}
else if (pos.start == pos.end || ck=="no") {
insertNode = tagS + range;
target.value = beforeNode + insertNode + br + afterNode;
}
} }
//テキストボックスの前後チェック //テキストボックスの前後チェック
function getAreaRange(obj) { function getAreaRange(obj) {
var pos = new Object(); var pos = new Object();
if(window.getSelection()) { if (window.getSelection()) {
pos.start = obj.selectionStart; pos.start = obj.selectionStart;
pos.end = obj.selectionEnd; pos.end = obj.selectionEnd;
} }
return pos; return pos;
} }
//Markdownのリンク挿入 //Markdownのリンク挿入
function markdownLink(){ function markdownLink() {
var acct_id = $("#post-acct-sel").val(); var acct_id = $("#post-acct-sel").val();
if(!localStorage.getItem("md_"+acct_id)){ if (!localStorage.getItem("md_" + acct_id)) {
return false; return false;
} }
var linkIns="["+$("#linkt").val()+"]"+"("+$("#link2").val()+")"; var linkIns = "[" + $("#linkt").val() + "]" + "(" + $("#link2").val() + ")";
if(linkIns!="[]()"){ if (linkIns != "[]()") {
$("#textarea").val($("#textarea").val()+linkIns); $("#textarea").val($("#textarea").val() + linkIns);
$("#linkt").val(""); $("#linkt").val("");
$("#link2").val(""); $("#link2").val("");
$("#textarea").focus(); $("#textarea").focus();
} }
} }
//Markdownのimg挿入 //Markdownのimg挿入
function markdownImage(){ function markdownImage() {
var acct_id = $("#post-acct-sel").val(); var acct_id = $("#post-acct-sel").val();
if(!localStorage.getItem("md_"+acct_id)){ if (!localStorage.getItem("md_" + acct_id)) {
return false; return false;
} }
var imgIns="!["+$("#image").val()+"]"+"("+$("#image2").val()+")"; var imgIns = "![" + $("#image").val() + "]" + "(" + $("#image2").val() + ")";
if(imgIns!="![]()"){ if (imgIns != "![]()") {
$("#textarea").val($("#textarea").val()+imgIns); $("#textarea").val($("#textarea").val() + imgIns);
$("#image").val(""); $("#image").val("");
$("#image2").val(""); $("#image2").val("");
$("#textarea").focus(); $("#textarea").focus();
} }
} }
//文字数をチェック(hタグ用) //文字数をチェック(hタグ用)
function str_count(all, part) { function str_count(all, part) {
return (all.match(new RegExp(part, "g")) || []).length; return (all.match(new RegExp(part, "g")) || []).length;
} }
//プレビュー //プレビュー
function preview(){ function preview() {
$("#preview-field").show(); $("#preview-field").show();
$("#toot-field").hide(); $("#toot-field").hide();
$("#preview-btn").hide(); $("#preview-btn").hide();
var bb=escape_html($("#textarea").val()); var bb = escape_html($("#textarea").val());
//quote //quote
var bb=bb.replace(/>(.+)$/g,'<blockquote>$1<\/blockquote>'); var bb = bb.replace(/>(.+)$/g, '<blockquote>$1<\/blockquote>');
//spin //spin
var bb=bb.replace(/\[spin\](.+)\[\/spin\]/g,'<span class="fa fa-spin">$1<\/span>'); var bb = bb.replace(/\[spin\](.+)\[\/spin\]/g, '<span class="fa fa-spin">$1<\/span>');
//pulse //pulse
var bb=bb.replace(/\[pulse\](.+)\[\/pulse\]/g,'<span class="bbcode-pulse-loading">$1<\/span>'); var bb = bb.replace(/\[pulse\](.+)\[\/pulse\]/g, '<span class="bbcode-pulse-loading">$1<\/span>');
//large //large
var bb=bb.replace(/\[large=([0-9]{1,2})x\](.+)\[\/large\]/g,'<span class="fa fa-$1x">$2<\/span>'); var bb = bb.replace(/\[large=([0-9]{1,2})x\](.+)\[\/large\]/g, '<span class="fa fa-$1x">$2<\/span>');
//vertical //vertical
var bb=bb.replace(/\[flip=vertical\](.+)\[\/flip\]/g,'<span class="fa fa-flip-vertical">$1<\/span>'); var bb = bb.replace(/\[flip=vertical\](.+)\[\/flip\]/g, '<span class="fa fa-flip-vertical">$1<\/span>');
//horizontal //horizontal
var bb=bb.replace(/\[flip=horizontal\](.+)\[\/flip\]/g,'<span class="fa fa-flip-horizontal">$1<\/span>'); var bb = bb.replace(/\[flip=horizontal\](.+)\[\/flip\]/g, '<span class="fa fa-flip-horizontal">$1<\/span>');
//b //b
var bb=bb.replace(/\[b\](.+)\[\/b\]/g,'<b>$1<\/b>'); var bb = bb.replace(/\[b\](.+)\[\/b\]/g, '<b>$1<\/b>');
//i //i
var bb=bb.replace(/\[i\](.+)\[\/i\]/g,'<i>$1<\/i>'); var bb = bb.replace(/\[i\](.+)\[\/i\]/g, '<i>$1<\/i>');
//u //u
var bb=bb.replace(/\[u\](.+)\[\/u\]/g,'<u>$1<\/u>'); var bb = bb.replace(/\[u\](.+)\[\/u\]/g, '<u>$1<\/u>');
//s //s
var bb=bb.replace(/\[s\](.+)\[\/s\]/g,'<s>$1<\/s>'); var bb = bb.replace(/\[s\](.+)\[\/s\]/g, '<s>$1<\/s>');
//size //size
var bb=bb.replace(/\[size=([0-9]{1,2})\](.+)\[\/size\]/g,'<span style="font-size:$1px">$2<\/span>'); var bb = bb.replace(/\[size=([0-9]{1,2})\](.+)\[\/size\]/g, '<span style="font-size:$1px">$2<\/span>');
//colorhex //colorhex
var bb=bb.replace(/\[colorhex=([A-Fa-f0-9]+)\](.+)\[\/colorhex\]/g,'<span style="color:#$1">$2<\/span>'); var bb = bb.replace(/\[colorhex=([A-Fa-f0-9]+)\](.+)\[\/colorhex\]/g, '<span style="color:#$1">$2<\/span>');
//code //code
var bb=bb.replace(/`(.+)`/g,'<code>$1<\/code>'); var bb = bb.replace(/`(.+)`/g, '<code>$1<\/code>');
//head //head
var m; var m;
m=bb.match(/^#{1,6}(.+)$/gm); m = bb.match(/^#{1,6}(.+)$/gm);
if(m){ if (m) {
for(let i = 0; i < m.length; i++) { for (let i = 0; i < m.length; i++) {
var t=m[i].match(/^#{1,6}(.+)$/); var t = m[i].match(/^#{1,6}(.+)$/);
var indexct='<h'+str_count(m[i],"#")+'>'+t[1]+'</h'+str_count(m[i],"#")+'>'; var indexct = '<h' + str_count(m[i], "#") + '>' + t[1] + '</h' + str_count(m[i], "#") + '>';
var bb=bb.replace(new RegExp(m[i], ""),indexct); var bb = bb.replace(new RegExp(m[i], ""), indexct);
} }
} }
//list(ul) //list(ul)
var li; var li;
li=bb.match(/^\- (.+)$/gm); li = bb.match(/^\- (.+)$/gm);
if(li){ if (li) {
for(let l = 0; l < li.length; l++) { for (let l = 0; l < li.length; l++) {
var u=li[l].match(/^\- (.+)$/); var u = li[l].match(/^\- (.+)$/);
var listUl='<li>'+u[1]+'</li>'; var listUl = '<li>' + u[1] + '</li>';
if(l == 0){ if (l == 0) {
listUl='<ul>'+listUl; listUl = '<ul>' + listUl;
}
if (l == li.length - 1) {
listUl = listUl + '</ul>';
}
var bb = bb.replace(new RegExp(li[l], ""), listUl);
} }
if(l==li.length-1){
listUl=listUl+'</ul>';
}
var bb=bb.replace(new RegExp(li[l], ""),listUl);
}
} }
//list(ol) //list(ol)
var li; var li;
li=bb.match(/^1\. (.+)$/gm); li = bb.match(/^1\. (.+)$/gm);
if(li){ if (li) {
for(let l = 0; l < li.length; l++) { for (let l = 0; l < li.length; l++) {
var u=li[l].match(/^1\. (.+)$/); var u = li[l].match(/^1\. (.+)$/);
var listUl='<li>'+u[1]+'</li>'; var listUl = '<li>' + u[1] + '</li>';
if(l === 0){ if (l === 0) {
listUl='<ol>'+listUl; listUl = '<ol>' + listUl;
}
if (l === li.length - 1) {
listUl = listUl + '</ol>';
}
var bb = bb.replace(new RegExp(li[l], ""), listUl);
} }
if(l===li.length-1){
listUl=listUl+'</ol>';
}
var bb=bb.replace(new RegExp(li[l], ""),listUl);
}
} }
//img //img
var bb=bb.replace(/!\[(.+)\]\((https:\/\/[-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)\)/g,'<img src="$2" text="$1" style="width:100%">'); var bb = bb.replace(/!\[(.+)\]\((https:\/\/[-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)\)/g, '<img src="$2" text="$1" style="width:100%">');
//link //link
var bb=bb.replace(/\[(.+)\]\((https?:\/\/[-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)\)/g,'<a href="$2" target="_blank">$1<\/a>'); var bb = bb.replace(/\[(.+)\]\((https?:\/\/[-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)\)/g, '<a href="$2" target="_blank">$1<\/a>');
bb=nl2br(bb); bb = nl2br(bb);
bb=bb.replace(new RegExp("</li><br />", "g"),""); bb = bb.replace(new RegExp("</li><br />", "g"), "");
$("#md-preview").html(bb); $("#md-preview").html(bb);
} }
//Editで戻る //Editで戻る
function previewEdit(){ function previewEdit() {
$("#preview-field").hide(); $("#preview-field").hide();
$("#toot-field").show(); $("#toot-field").show();
$("#preview-btn").show(); $("#preview-btn").show();
$("#md-preview").html(""); $("#md-preview").html("");
} }

View File

@ -2,26 +2,26 @@
var obj = $("body"); var obj = $("body");
var system; var system;
//ドラッグスタート //ドラッグスタート
obj.on('dragstart', function(e) { obj.on('dragstart', function (e) {
system = "locked" system = "locked"
}); });
//何もなくファイルが通過 //何もなくファイルが通過
obj.on('dragend', function(e) { obj.on('dragend', function (e) {
system = ""; system = "";
}); });
//ドラッグファイルが画面上に //ドラッグファイルが画面上に
obj.on('dragenter', function(e) { obj.on('dragenter', function (e) {
if (system != "locked") { if (system != "locked") {
$("#drag").css('display', 'flex'); $("#drag").css('display', 'flex');
} }
}); });
$("body").on('dragover', function(e) { $("body").on('dragover', function (e) {
e.stopPropagation(); e.stopPropagation();
e.preventDefault(); e.preventDefault();
}); });
//ドロップした //ドロップした
$("body").on('drop', function(e) { $("body").on('drop', function (e) {
if (system != "locked") { if (system != "locked") {
$("#drag").css('display', 'none'); $("#drag").css('display', 'none');
e.preventDefault(); e.preventDefault();
@ -30,7 +30,7 @@ $("body").on('drop', function(e) {
} }
}); });
//何もなくファイルが通過 //何もなくファイルが通過
$("#drag").on('dragleave', function(e) { $("#drag").on('dragleave', function (e) {
$("#drag").css('display', 'none'); $("#drag").css('display', 'none');
}); });
@ -38,23 +38,23 @@ $("#drag").on('dragleave', function(e) {
function pimg(files) { function pimg(files) {
console.table(files); console.table(files);
for (i = 0; i < files.length; i++) { for (i = 0; i < files.length; i++) {
var dot=files[i].path.match(/\.(.+)$/)[1]; var dot = files[i].path.match(/\.(.+)$/)[1];
if(dot=="bmp" || dot=="BMP"){ if (dot == "bmp" || dot == "BMP") {
var electron = require("electron"); var electron = require("electron");
var ipc = electron.ipcRenderer; var ipc = electron.ipcRenderer;
ipc.send('bmp-image', [files[i].path,i]); ipc.send('bmp-image', [files[i].path, i]);
todo(lang.lang_progress); todo(lang.lang_progress);
}else{ } else {
handleFileUpload(files[i], obj,i); handleFileUpload(files[i], obj, i);
} }
} }
} }
var electron = require("electron"); var electron = require("electron");
var ipc = electron.ipcRenderer; var ipc = electron.ipcRenderer;
ipc.on('bmp-img-comp', function (event, b64) { ipc.on('bmp-img-comp', function (event, b64) {
media(b64[0],"image/png",b64[1]); media(b64[0], "image/png", b64[1]);
}); });
//ドラッグ・アンド・ドロップを終了 //ドラッグ・アンド・ドロップを終了
function closedrop() { function closedrop() {
$("#drag").css('display', 'none'); $("#drag").css('display', 'none');
@ -67,7 +67,7 @@ function fileselect() {
//ファイル読み込み //ファイル読み込み
function handleFileUpload(files, obj, no) { function handleFileUpload(files, obj, no) {
var fr = new FileReader(); var fr = new FileReader();
fr.onload = function(evt) { fr.onload = function (evt) {
var b64 = evt.target.result; var b64 = evt.target.result;
$('#b64-box').val(b64); $('#b64-box').val(b64);
var ret = media(b64, files["type"], no) var ret = media(b64, files["type"], no)
@ -82,26 +82,26 @@ function media(b64, type, no) {
var c = "abcdefghijklmnopqrstuvwxyz0123456789"; var c = "abcdefghijklmnopqrstuvwxyz0123456789";
var cl = c.length; var cl = c.length;
var r = ""; var r = "";
for(var i=0; i<l; i++){ for (var i = 0; i < l; i++) {
r += c[Math.floor(Math.random()*cl)]; r += c[Math.floor(Math.random() * cl)];
} }
if ($("#media").val()) { if ($("#media").val()) {
$("#media").val($("#media").val() + ',' + "tmp_"+r); $("#media").val($("#media").val() + ',' + "tmp_" + r);
} else { } else {
$("#media").val("tmp_"+r); $("#media").val("tmp_" + r);
} }
$(".toot-btn-group").prop("disabled", true); $(".toot-btn-group").prop("disabled", true);
$("#post-acct-sel").prop("disabled", true); $("#post-acct-sel").prop("disabled", true);
localStorage.setItem("image","busy"); localStorage.setItem("image", "busy");
todo("Image Upload..."); todo("Image Upload...");
var media = toBlob(b64, type); var media = toBlob(b64, type);
var fd = new FormData(); var fd = new FormData();
fd.append('file', media); fd.append('file', media);
var acct_id = $("#post-acct-sel").val(); var acct_id = $("#post-acct-sel").val();
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");
var httpreq = new XMLHttpRequest(); var httpreq = new XMLHttpRequest();
if(localStorage.getItem("mode_" + domain)=="misskey"){ if (localStorage.getItem("mode_" + domain) == "misskey") {
var start = "https://" + domain + "/api/drive/files/create"; var start = "https://" + domain + "/api/drive/files/create";
httpreq.open('POST', start, true); httpreq.open('POST', start, true);
httpreq.upload.addEventListener("progress", progshow, false); httpreq.upload.addEventListener("progress", progshow, false);
@ -111,12 +111,12 @@ function media(b64, type, no) {
} else { } else {
var nsfw = false; var nsfw = false;
} }
var previewer="url" var previewer = "url"
fd.append('i', at); fd.append('i', at);
//fd.append('isSensitive', nsfw); //fd.append('isSensitive', nsfw);
httpreq.send(fd); httpreq.send(fd);
}else{ } else {
var previewer="preview_url" var previewer = "preview_url"
var start = "https://" + domain + "/api/v1/media"; var start = "https://" + domain + "/api/v1/media";
httpreq.open('POST', start, true); httpreq.open('POST', start, true);
httpreq.upload.addEventListener("progress", progshow, false); httpreq.upload.addEventListener("progress", progshow, false);
@ -124,12 +124,12 @@ function media(b64, type, no) {
httpreq.setRequestHeader('Authorization', 'Bearer ' + at); httpreq.setRequestHeader('Authorization', 'Bearer ' + at);
httpreq.send(fd); httpreq.send(fd);
} }
httpreq.onreadystatechange = function() { httpreq.onreadystatechange = function () {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
var json = httpreq.response; var json = httpreq.response;
var img = localStorage.getItem("img"); var img = localStorage.getItem("img");
if (json.type.indexOf("image")!=-1) { if (json.type.indexOf("image") != -1) {
var html = '<img src="' + json[previewer] + '" class="preview-img pointer" data-media="'+json["id"]+'" onclick="deleteImage(\''+json["id"]+'\')" title="'+lang.lang_postimg_delete+'">'; var html = '<img src="' + json[previewer] + '" class="preview-img pointer" data-media="' + json["id"] + '" onclick="deleteImage(\'' + json["id"] + '\')" title="' + lang.lang_postimg_delete + '">';
$('#preview').append(html); $('#preview').append(html);
} else { } else {
$('#preview').append(lang.lang_postimg_previewdis); $('#preview').append(lang.lang_postimg_previewdis);
@ -138,11 +138,11 @@ function media(b64, type, no) {
var img = "no-act"; var img = "no-act";
} }
if (img != "inline") { if (img != "inline") {
var mediav=$("#media").val(); var mediav = $("#media").val();
var regExp = new RegExp("tmp_"+r, "g"); var regExp = new RegExp("tmp_" + r, "g");
mediav = mediav.replace(regExp, json["id"]); mediav = mediav.replace(regExp, json["id"]);
$("#media").val(mediav); $("#media").val(mediav);
} }
if (img == "url") { if (img == "url") {
$("#textarea").val($("#textarea").val() + " " + json["text_url"]) $("#textarea").val($("#textarea").val() + " " + json["text_url"])
@ -178,59 +178,59 @@ function toBlob(base64, type) {
return blob; return blob;
} }
//画像を貼り付けたら… //画像を貼り付けたら…
var element = document.querySelector("#textarea"); var element = document.querySelector("#textarea");
element.addEventListener("paste", function(e){ element.addEventListener("paste", function (e) {
if (!e.clipboardData || !e.clipboardData.items) { if (!e.clipboardData || !e.clipboardData.items) {
return true; return true;
} }
// DataTransferItemList に画像が含まれいない場合は終了する // DataTransferItemList に画像が含まれいない場合は終了する
var imageItems = [...e.clipboardData.items].filter(i => i.type.startsWith('image')); var imageItems = [...e.clipboardData.items].filter(i => i.type.startsWith('image'));
if (imageItems.length == 0) { if (imageItems.length == 0) {
console.warn("it is not image") console.warn("it is not image")
return true; return true;
} }
// ファイルとして得る // ファイルとして得る
// DataTransferItem の kind は file なので getAsString ではなく getAsFile を呼ぶ // DataTransferItem の kind は file なので getAsString ではなく getAsFile を呼ぶ
var imageFile = imageItems[0].getAsFile(); var imageFile = imageItems[0].getAsFile();
var imageType = imageItems[0].type; var imageType = imageItems[0].type;
// FileReaderで読み込む // FileReaderで読み込む
var fr = new FileReader(); var fr = new FileReader();
fr.onload = function(e) { fr.onload = function (e) {
// onload内ではe.target.resultにbase64が入っているのであとは煮るなり焼くなり // onload内ではe.target.resultにbase64が入っているのであとは煮るなり焼くなり
var base64 = e.target.result; var base64 = e.target.result;
var mediav = $("#media").val(); var mediav = $("#media").val();
if(mediav){ if (mediav) {
var i=mediav.split(",").length; var i = mediav.split(",").length;
} }
// DataTransferItem の type に mime tipes があるのでそれを使う // DataTransferItem の type に mime tipes があるのでそれを使う
media(base64, imageType, i) media(base64, imageType, i)
}; };
fr.readAsDataURL(imageFile); fr.readAsDataURL(imageFile);
// 画像以外がペーストされたときのために、元に戻しておく // 画像以外がペーストされたときのために、元に戻しておく
}); });
//Adobeフォトエディタ //Adobeフォトエディタ
function adobe(){ function adobe() {
var agree = localStorage.getItem("adobeagree"); var agree = localStorage.getItem("adobeagree");
ipc.send('adobe', agree); ipc.send('adobe', agree);
} }
ipc.on('adobeagree', function (event, arg) { ipc.on('adobeagree', function (event, arg) {
localStorage.setItem("adobeagree",arg); localStorage.setItem("adobeagree", arg);
}); });
function deleteImage(key){ function deleteImage(key) {
if(!confirm(lang.lang_postimg_delete)){ if (!confirm(lang.lang_postimg_delete)) {
return false; return false;
} }
var media = $("#media").val(); var media = $("#media").val();
var arr=media.split(","); var arr = media.split(",");
for(var i=0;i<media.length;i++){ for (var i = 0; i < media.length; i++) {
if(arr[i]==key){ if (arr[i] == key) {
arr.splice(i, 1); arr.splice(i, 1);
break; break;
} }
} }
$("#media").val(arr.join(",")); $("#media").val(arr.join(","));
$('#preview [data-media='+key+']').remove(); $('#preview [data-media=' + key + ']').remove();
} }

View File

@ -1,241 +1,241 @@
//Renpost //Renpost
function renote(id, acct_id, remote) { function renote(id, acct_id, remote) {
if ($("#pub_" + id).hasClass("rted")) { if ($("#pub_" + id).hasClass("rted")) {
return false;
}
var domain = localStorage.getItem("domain_" + acct_id);
var at = localStorage.getItem("acct_"+ acct_id + "_at");
var start = "https://" + domain + "/api/notes/create";
if(localStorage.getItem("mode_" + domain)!="misskey"){
return false; return false;
} }
var httpreq = new XMLHttpRequest(); var domain = localStorage.getItem("domain_" + acct_id);
httpreq.open('POST', start, true); var at = localStorage.getItem("acct_" + acct_id + "_at");
httpreq.setRequestHeader('Content-Type', 'application/json'); var start = "https://" + domain + "/api/notes/create";
if (localStorage.getItem("mode_" + domain) != "misskey") {
return false;
}
var httpreq = new XMLHttpRequest();
httpreq.open('POST', start, true);
httpreq.setRequestHeader('Content-Type', 'application/json');
httpreq.responseType = "json"; httpreq.responseType = "json";
httpreq.send(JSON.stringify({i:at,renoteId:id})); httpreq.send(JSON.stringify({ i: at, renoteId: id }));
httpreq.onreadystatechange = function() { httpreq.onreadystatechange = function () {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
var json = httpreq.response; var json = httpreq.response;
console.log(["Success: renote",json]); console.log(["Success: renote", json]);
$("[toot-id=" + id + "]").addClass("rted"); $("[toot-id=" + id + "]").addClass("rted");
$(".rt_"+id).toggleClass("teal-text"); $(".rt_" + id).toggleClass("teal-text");
} }
} }
} }
//Renote //Renote
function renoteqt(id, acct_id) { function renoteqt(id, acct_id) {
localStorage.setItem("nohide",true); localStorage.setItem("nohide", true);
show(); show();
$("#reply").val("renote_"+id); $("#reply").val("renote_" + id);
$("#rec").text("Renote"); $("#rec").text("Renote");
$("#post-acct-sel").val(acct_id); $("#post-acct-sel").val(acct_id);
$("#post-acct-sel").prop("disabled", true); $("#post-acct-sel").prop("disabled", true);
$('select').material_select(); $('select').material_select();
$("#textarea").attr("placeholder",lang.lang_misskeyparse_qt); $("#textarea").attr("placeholder", lang.lang_misskeyparse_qt);
$("#textarea").focus(); $("#textarea").focus();
} }
//Reply //Reply
function misskeyreply(id, acct_id) { function misskeyreply(id, acct_id) {
localStorage.setItem("nohide",true); localStorage.setItem("nohide", true);
show(); show();
$("#reply").val(id); $("#reply").val(id);
$("#rec").text("Renote"); $("#rec").text("Renote");
$("#post-acct-sel").val(acct_id); $("#post-acct-sel").val(acct_id);
$("#post-acct-sel").prop("disabled", true); $("#post-acct-sel").prop("disabled", true);
$('select').material_select(); $('select').material_select();
$("#textarea").attr("placeholder",lang.lang_misskeyparse_qt); $("#textarea").attr("placeholder", lang.lang_misskeyparse_qt);
$("#textarea").focus(); $("#textarea").focus();
} }
//Reaction //Reaction
function reactiontoggle(id,acct_id,tlid){ function reactiontoggle(id, acct_id, tlid) {
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");
var start = "https://" + domain + "/api/notes/show"; var start = "https://" + domain + "/api/notes/show";
if(localStorage.getItem("mode_" + domain)!="misskey"){ if (localStorage.getItem("mode_" + domain) != "misskey") {
return false; return false;
} }
var httpreq = new XMLHttpRequest(); var httpreq = new XMLHttpRequest();
httpreq.open('POST', start, true); httpreq.open('POST', start, true);
httpreq.setRequestHeader('Content-Type', 'application/json'); httpreq.setRequestHeader('Content-Type', 'application/json');
httpreq.responseType = "json"; httpreq.responseType = "json";
httpreq.send(JSON.stringify({i:at,noteId:id})); httpreq.send(JSON.stringify({ i: at, noteId: id }));
httpreq.onreadystatechange = function() { httpreq.onreadystatechange = function () {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
var json = httpreq.response; var json = httpreq.response;
console.log(["Success: reaction",json]); console.log(["Success: reaction", json]);
if(json.reactions){ if (json.reactions) {
var reactions=["like","love","laugh","hmm","surprise","congrats","angry","confused","pudding","rip"]; var reactions = ["like", "love", "laugh", "hmm", "surprise", "congrats", "angry", "confused", "pudding", "rip"];
for(var i=0;i<reactions.length;i++){ for (var i = 0; i < reactions.length; i++) {
if(json.reactions[reactions[i]]){ if (json.reactions[reactions[i]]) {
$("#pub_" + id +" .re-"+reactions[i]+"ct").text(json.reactions[reactions[i]]) $("#pub_" + id + " .re-" + reactions[i] + "ct").text(json.reactions[reactions[i]])
$("#pub_" + id +" .re-"+reactions[i]).removeClass("hide") $("#pub_" + id + " .re-" + reactions[i]).removeClass("hide")
}else{ } else {
$("#pub_" + id +" .re-"+reactions[i]+"ct").text(0) $("#pub_" + id + " .re-" + reactions[i] + "ct").text(0)
if($("#pub_" + id +" .reactions").hasClass("fullreact")){ if ($("#pub_" + id + " .reactions").hasClass("fullreact")) {
$("#pub_" + id +" .re-"+reactions[i]).addClass("hide") $("#pub_" + id + " .re-" + reactions[i]).addClass("hide")
}else{ } else {
$("#pub_" + id +" .re-"+reactions[i]).removeClass("hide") $("#pub_" + id + " .re-" + reactions[i]).removeClass("hide")
} }
$("#pub_" + id +" .re-"+reactions[i]+"ct").text(json.reactions[reactions[i]]) $("#pub_" + id + " .re-" + reactions[i] + "ct").text(json.reactions[reactions[i]])
} }
} }
$("#pub_" + id +" .reactions").removeClass("hide"); $("#pub_" + id + " .reactions").removeClass("hide");
$("#pub_" + id +" .reactions").toggleClass("fullreact") $("#pub_" + id + " .reactions").toggleClass("fullreact")
}else{ } else {
if($("#pub_" + id +" .reactions").hasClass("fullreact")){ if ($("#pub_" + id + " .reactions").hasClass("fullreact")) {
$("#pub_" + id +" .reactions").addClass("hide") $("#pub_" + id + " .reactions").addClass("hide")
$("#pub_" + id +" .reactions").removeClass("fullreact") $("#pub_" + id + " .reactions").removeClass("fullreact")
}else{ } else {
$("#pub_" + id +" .reactions").removeClass("hide"); $("#pub_" + id + " .reactions").removeClass("hide");
$("#pub_" + id +" .reaction").removeClass("hide"); $("#pub_" + id + " .reaction").removeClass("hide");
$("#pub_" + id +" .reactions").addClass("fullreact"); $("#pub_" + id + " .reactions").addClass("fullreact");
} }
} }
} }
} }
$("#pub_" + id +" .freeReact").toggleClass("hide"); $("#pub_" + id + " .freeReact").toggleClass("hide");
} }
//reactioncustom //reactioncustom
function reactioncustom(acct_id,id){ function reactioncustom(acct_id, id) {
$("#reply").val(id); $("#reply").val(id);
$("#unreact").hide(); $("#unreact").hide();
$("#addreact").removeClass("hide"); $("#addreact").removeClass("hide");
$("#post-acct-sel").val(acct_id); $("#post-acct-sel").val(acct_id);
$('select').material_select(); $('select').material_select();
localStorage.setItem("nohide",true); localStorage.setItem("nohide", true);
show() show()
emojiToggle(true) emojiToggle(true)
$("#left-side").hide(); $("#left-side").hide();
$("#default-emoji").hide(); $("#default-emoji").hide();
} }
function reactRefresh(acct_id,id){ function reactRefresh(acct_id, 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");
var start = "https://" + domain + "/api/notes/show"; var start = "https://" + domain + "/api/notes/show";
var req={}; var req = {};
req.i=at; req.i = at;
req.noteId=id; req.noteId = id;
var i={ var i = {
method: "POST", method: "POST",
body: JSON.stringify(req), body: JSON.stringify(req),
} }
fetch(start, i, fetch(start, i,
).then(function(response) { ).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
if(!json){ if (!json) {
return false; return false;
} }
var poll=""; var poll = "";
if(json.error){ if (json.error) {
$("[toot-id=" + id + "]").hide(); $("[toot-id=" + id + "]").hide();
$("[toot-id=" + id + "]").remove(); $("[toot-id=" + id + "]").remove();
}else{ } else {
reactRefreshCore(json) reactRefreshCore(json)
} }
}); });
} }
function reactRefreshCore(json){ function reactRefreshCore(json) {
var id=json.id; var id = json.id;
if(json.reactions){ if (json.reactions) {
$("#pub_" + id +" .reactions").removeClass("hide") $("#pub_" + id + " .reactions").removeClass("hide")
var regExp = new RegExp( ":", "g" ) ; var regExp = new RegExp(":", "g");
Object.keys(json.reactions).forEach(function(keye) { Object.keys(json.reactions).forEach(function (keye) {
keyeClass=keye.replace(regExp,''); keyeClass = keye.replace(regExp, '');
if(json.reactions[keye]){ if (json.reactions[keye]) {
$("#pub_" + id +" .re-"+keyeClass+"ct").text(json.reactions[keye]) $("#pub_" + id + " .re-" + keyeClass + "ct").text(json.reactions[keye])
$("#pub_" + id +" .re-"+keyeClass).removeClass("hide") $("#pub_" + id + " .re-" + keyeClass).removeClass("hide")
}else{ } else {
$("#pub_" + id +" .re-"+keyeClass+"ct").text(0) $("#pub_" + id + " .re-" + keyeClass + "ct").text(0)
if($("#pub_" + id +" .reactions").hasClass("fullreact")){ if ($("#pub_" + id + " .reactions").hasClass("fullreact")) {
$("#pub_" + id +" .re-"+keyeClass).addClass("hide") $("#pub_" + id + " .re-" + keyeClass).addClass("hide")
} }
$("#pub_" + id +" .re-"+keyeClass+"ct").text(json.reactions[keye]) $("#pub_" + id + " .re-" + keyeClass + "ct").text(json.reactions[keye])
} }
}); });
} }
} }
function emojiReaction(emoji){ function emojiReaction(emoji) {
var acct_id = $("#post-acct-sel").val(); var acct_id = $("#post-acct-sel").val();
var id = $("#reply").val(); var id = $("#reply").val();
reaction(emoji,id,acct_id,null) reaction(emoji, id, acct_id, null)
clear(); clear();
hide(); hide();
} }
function reaction(mode,id,acct_id,tlid){ function reaction(mode, id, acct_id, tlid) {
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($(".fav_"+id).hasClass("yellow-text")){ if ($(".fav_" + id).hasClass("yellow-text")) {
var flag="delete"; var flag = "delete";
}else{ } else {
var flag="create"; var flag = "create";
} }
var start = "https://" + domain + "/api/notes/reactions/"+flag; var start = "https://" + domain + "/api/notes/reactions/" + flag;
if(localStorage.getItem("mode_" + domain)!="misskey"){ if (localStorage.getItem("mode_" + domain) != "misskey") {
return false; return false;
} }
var httpreq = new XMLHttpRequest(); var httpreq = new XMLHttpRequest();
httpreq.open('POST', start, true); httpreq.open('POST', start, true);
httpreq.setRequestHeader('Content-Type', 'application/json'); httpreq.setRequestHeader('Content-Type', 'application/json');
httpreq.responseType = "json"; httpreq.responseType = "json";
httpreq.send(JSON.stringify({i:at,noteId:id,reaction:mode})); httpreq.send(JSON.stringify({ i: at, noteId: id, reaction: mode }));
httpreq.onreadystatechange = function() { httpreq.onreadystatechange = function () {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
$(".fav_"+id).toggleClass("yellow-text"); $(".fav_" + id).toggleClass("yellow-text");
} }
} }
} }
//Vote //Vote
function vote(acct_id,id,to){ function vote(acct_id, id, to) {
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");
var start = "https://" + domain + "/api/notes/polls/vote"; var start = "https://" + domain + "/api/notes/polls/vote";
if(localStorage.getItem("mode_" + domain)!="misskey"){ if (localStorage.getItem("mode_" + domain) != "misskey") {
return false; return false;
} }
var httpreq = new XMLHttpRequest(); var httpreq = new XMLHttpRequest();
httpreq.open('POST', start, true); httpreq.open('POST', start, true);
httpreq.setRequestHeader('Content-Type', 'application/json'); httpreq.setRequestHeader('Content-Type', 'application/json');
httpreq.responseType = "json"; httpreq.responseType = "json";
httpreq.send(JSON.stringify({i:at,noteId:id,choice:to})); httpreq.send(JSON.stringify({ i: at, noteId: id, choice: to }));
httpreq.onreadystatechange = function() { httpreq.onreadystatechange = function () {
voterefresh(acct_id,id) voterefresh(acct_id, id)
} }
} }
function voterefresh(acct_id,id){ function voterefresh(acct_id, id) {
var httpreqd = new XMLHttpRequest(); var httpreqd = new XMLHttpRequest();
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");
var start = "https://" + domain + "/api/notes/show"; var start = "https://" + domain + "/api/notes/show";
httpreqd.open('POST', start, true); httpreqd.open('POST', start, true);
httpreqd.setRequestHeader('Content-Type', 'application/json'); httpreqd.setRequestHeader('Content-Type', 'application/json');
httpreqd.responseType = 'json'; httpreqd.responseType = 'json';
httpreqd.send(JSON.stringify({i:at,noteId:id})); httpreqd.send(JSON.stringify({ i: at, noteId: id }));
httpreqd.onreadystatechange = function() { httpreqd.onreadystatechange = function () {
if (httpreqd.readyState == 4) { if (httpreqd.readyState == 4) {
var json = httpreqd.response; var json = httpreqd.response;
if(!json){ if (!json) {
return false; return false;
} }
var poll=""; var poll = "";
if(json.poll){ if (json.poll) {
var choices=json.poll.choices; var choices = json.poll.choices;
Object.keys(choices).forEach(function(keyc) { Object.keys(choices).forEach(function (keyc) {
var choice = choices[keyc]; var choice = choices[keyc];
if(choice.isVoted){ if (choice.isVoted) {
var myvote=twemoji.parse("✅"); var myvote = twemoji.parse("✅");
}else{ } else {
var myvote=""; var myvote = "";
} }
poll=poll+'<div class="pointer vote" onclick="vote(\''+acct_id+'\',\''+json.id+'\','+choice.id+')">'+escapeHTML(choice.text)+'('+choice.votes+''+myvote+')</div>'; poll = poll + '<div class="pointer vote" onclick="vote(\'' + acct_id + '\',\'' + json.id + '\',' + choice.id + ')">' + escapeHTML(choice.text) + '(' + choice.votes + '' + myvote + ')</div>';
}); });
$(".vote_"+json.id).html(poll) $(".vote_" + json.id).html(poll)
} }
} }
} }
} }

View File

@ -1,163 +1,163 @@
/*投稿系*/ /*投稿系*/
//投稿 //投稿
function sec(){ function sec() {
var mode=localStorage.getItem("sec"); var mode = localStorage.getItem("sec");
var acct_id = $("#post-acct-sel").val(); var acct_id = $("#post-acct-sel").val();
var domain = localStorage.getItem("domain_" + acct_id); var domain = localStorage.getItem("domain_" + acct_id);
if(~domain.indexOf("kirishima.cloud")>=0 && mode=="local"){ if (~domain.indexOf("kirishima.cloud") >= 0 && mode == "local") {
mode="unlisted"; mode = "unlisted";
} }
post(null,mode); post(null, mode);
} }
function post(mode,postvis) { function post(mode, postvis) {
if($("#toot-post-btn").prop("disabled")){ if ($("#toot-post-btn").prop("disabled")) {
return false; return false;
} }
var str = $("#textarea").val(); var str = $("#textarea").val();
var acct_id = $("#post-acct-sel").val(); var acct_id = $("#post-acct-sel").val();
localStorage.setItem("last-use", acct_id); localStorage.setItem("last-use", acct_id);
var domain = localStorage.getItem("domain_" + acct_id); var domain = localStorage.getItem("domain_" + acct_id);
if(domain=="theboss.tech"){ if (domain == "theboss.tech") {
if(~str.indexOf("#")){ if (~str.indexOf("#")) {
if(str.indexOf("#theboss_tech")=="-1"){ if (str.indexOf("#theboss_tech") == "-1") {
if(!confirm(lang.lang_post_tagTL)){ if (!confirm(lang.lang_post_tagTL)) {
return false; return false;
} }
} }
} }
} }
if(domain=="dtp-mstdn.jp"){ if (domain == "dtp-mstdn.jp") {
if(~str.indexOf("#")){ if (~str.indexOf("#")) {
if(str.indexOf("#dtp")=="-1"){ if (str.indexOf("#dtp") == "-1") {
if(!confirm(lang.lang_post_tagTL)){ if (!confirm(lang.lang_post_tagTL)) {
return false; return false;
} }
} }
} }
} }
if(!localStorage.getItem("cw_sentence")){ if (!localStorage.getItem("cw_sentence")) {
var cw_sent=500; var cw_sent = 500;
}else{ } else {
var cw_sent=localStorage.getItem("cw_sentence"); var cw_sent = localStorage.getItem("cw_sentence");
} }
if(!localStorage.getItem("cw_letters")){ if (!localStorage.getItem("cw_letters")) {
var cw_ltres=500; var cw_ltres = 500;
}else{ } else {
var cw_ltres=localStorage.getItem("cw_letters"); var cw_ltres = localStorage.getItem("cw_letters");
} }
if(domain!="kirishima.cloud"){ if (domain != "kirishima.cloud") {
if(mode!="pass" && !$("#cw").hasClass("cw-avail") && (str.length>cw_sent || (str.split("\n").length - 1)>cw_ltres)){ if (mode != "pass" && !$("#cw").hasClass("cw-avail") && (str.length > cw_sent || (str.split("\n").length - 1) > cw_ltres)) {
var electron = require("electron"); var electron = require("electron");
var remote=electron.remote; var remote = electron.remote;
var dialog=remote.dialog; var dialog = remote.dialog;
var plus=str.replace(/\n/g,"").slice(0,10)+"..."; var plus = str.replace(/\n/g, "").slice(0, 10) + "...";
const options = { const options = {
type: 'info', type: 'info',
title: lang.lang_post_cwtitle, title: lang.lang_post_cwtitle,
message: lang.lang_post_cwtxt+plus, message: lang.lang_post_cwtxt + plus,
buttons: [lang.lang_post_btn1,lang.lang_post_btn2, lang.lang_post_btn3] buttons: [lang.lang_post_btn1, lang.lang_post_btn2, lang.lang_post_btn3]
}
dialog.showMessageBox(options, function(arg) {
if(arg===1){
$("#cw-text").show();
$("#cw").addClass("yellow-text");
$("#cw").addClass("cw-avail");
$("#cw-text").val(plus);
post("pass");
}else if(arg===2){
post("pass");
} }
}) dialog.showMessageBox(options, function (arg) {
return false; if (arg === 1) {
$("#cw-text").show();
$("#cw").addClass("yellow-text");
$("#cw").addClass("cw-avail");
$("#cw-text").val(plus);
post("pass");
} else if (arg === 2) {
post("pass");
}
})
return false;
}
} }
} if (localStorage.getItem("mode_" + domain) == "misskey") {
if(localStorage.getItem("mode_" + domain)=="misskey"){
misskeyPost(); misskeyPost();
return; return;
} }
$(".toot-btn-group").prop("disabled", true); $(".toot-btn-group").prop("disabled", true);
todo("Posting"); todo("Posting");
var at = localStorage.getItem("acct_"+ acct_id + "_at"); var at = localStorage.getItem("acct_" + acct_id + "_at");
var start = "https://" + domain + "/api/v1/statuses"; var start = "https://" + domain + "/api/v1/statuses";
var reply = $("#reply").val(); var reply = $("#reply").val();
if(str.indexOf(localStorage.getItem("stable"))==-1){ if (str.indexOf(localStorage.getItem("stable")) == -1) {
str+" #"+localStorage.getItem("stable"); str + " #" + localStorage.getItem("stable");
} }
var toot={ var toot = {
status: str status: str
} }
if(reply){ if (reply) {
toot.in_reply_to_id=reply toot.in_reply_to_id = reply
} }
var media = $("#media").val(); var media = $("#media").val();
if(media){ if (media) {
toot.media_ids=media.split(","); toot.media_ids = media.split(",");
} }
if ($("#nsfw").hasClass("nsfw-avail")) { if ($("#nsfw").hasClass("nsfw-avail")) {
var nsfw = "true"; var nsfw = "true";
toot.sensitive=nsfw; toot.sensitive = nsfw;
} else { } else {
var nsfw = "false"; var nsfw = "false";
} }
if(postvis){ if (postvis) {
var vis = postvis; var vis = postvis;
}else{ } else {
var vis = $("#vis").text(); var vis = $("#vis").text();
} }
if(vis!="inherit" && vis!="local"){ if (vis != "inherit" && vis != "local") {
toot.visibility=vis; toot.visibility = vis;
}else if(vis=="local"){ } else if (vis == "local") {
toot.status=str+"👁️"; toot.status = str + "👁️";
} }
//ここに非公開・未収載タグについてwarn //ここに非公開・未収載タグについてwarn
if(domain!="kirishima.cloud" && domain!="imastodon.net"){ if (domain != "kirishima.cloud" && domain != "imastodon.net") {
if(~str.indexOf("#")){ if (~str.indexOf("#")) {
if(vis == "local" || vis=="unlisted" || vis=="direct" || vis=="private"){ if (vis == "local" || vis == "unlisted" || vis == "direct" || vis == "private") {
if(!confirm(lang.lang_post_tagVis)){ if (!confirm(lang.lang_post_tagVis)) {
return false; return false;
}
} }
} }
} }
}
if ($("#cw").hasClass("cw-avail")) { if ($("#cw").hasClass("cw-avail")) {
var spo = $("#cw-text").val(); var spo = $("#cw-text").val();
cw(); cw();
toot.spoiler_text=spo; toot.spoiler_text = spo;
} else { } else {
var spo = ""; var spo = "";
} }
if ($("#sch-box").hasClass("sch-avail")) { if ($("#sch-box").hasClass("sch-avail")) {
var scheduled=formattimeutc(new Date(Date.parse($("#sch-date").val()))) var scheduled = formattimeutc(new Date(Date.parse($("#sch-date").val())))
console.log("This toot will be posted at:"+scheduled) console.log("This toot will be posted at:" + scheduled)
schedule(); schedule();
toot.scheduled_at=scheduled; toot.scheduled_at = scheduled;
} else { } else {
var scheduled = ""; var scheduled = "";
} }
if ($("#poll-sel").val()=="mastodon-poll") { if ($("#poll-sel").val() == "mastodon-poll") {
var options=[]; var options = [];
$(".mastodon-choice").map(function() { $(".mastodon-choice").map(function () {
var choice=$(this).val(); var choice = $(this).val();
if(choice!=""){ if (choice != "") {
options.push(choice); options.push(choice);
} }
}); });
if($("#poll-multiple:checked").val()=="1"){ if ($("#poll-multiple:checked").val() == "1") {
var mul=true; var mul = true;
}else{ } else {
var mul=false; var mul = false;
} }
if($("#poll-until:checked").val()=="1"){ if ($("#poll-until:checked").val() == "1") {
var htt=true; var htt = true;
}else{ } else {
var htt=false; var htt = false;
} }
var exin=pollCalc(); var exin = pollCalc();
if(!exin){ if (!exin) {
todc("Error: Poll expires_in param") todc("Error: Poll expires_in param")
} }
toot.poll={ toot.poll = {
options: options, options: options,
expires_in: exin, expires_in: exin,
multiple: mul, multiple: mul,
@ -171,7 +171,7 @@ function post(mode,postvis) {
httpreq.setRequestHeader('Authorization', 'Bearer ' + at); httpreq.setRequestHeader('Authorization', 'Bearer ' + at);
httpreq.responseType = "json"; httpreq.responseType = "json";
httpreq.send(JSON.stringify(toot)); httpreq.send(JSON.stringify(toot));
httpreq.onreadystatechange = function() { httpreq.onreadystatechange = function () {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
var json = httpreq.response; var json = httpreq.response;
var box = localStorage.getItem("box"); var box = localStorage.getItem("box");
@ -185,71 +185,71 @@ function post(mode,postvis) {
} }
} }
} }
function misskeyPost(){ function misskeyPost() {
var str = $("#textarea").val(); var str = $("#textarea").val();
var acct_id = $("#post-acct-sel").val(); var acct_id = $("#post-acct-sel").val();
localStorage.setItem("last-use", acct_id); localStorage.setItem("last-use", acct_id);
var domain = localStorage.getItem("domain_" + acct_id); var domain = localStorage.getItem("domain_" + acct_id);
$(".toot-btn-group").prop("disabled", true); $(".toot-btn-group").prop("disabled", true);
todo("Posting"); todo("Posting");
var at = localStorage.getItem("acct_"+ acct_id + "_at"); var at = localStorage.getItem("acct_" + acct_id + "_at");
var start = "https://" + domain + "/api/notes/create"; var start = "https://" + domain + "/api/notes/create";
var reply = $("#reply").val(); var reply = $("#reply").val();
var toot={ var toot = {
text: str text: str
} }
if(reply){ if (reply) {
if(reply.indexOf("renote")!== -1){ if (reply.indexOf("renote") !== -1) {
toot.renoteId=reply.replace("renote_","") toot.renoteId = reply.replace("renote_", "")
}else{ } else {
toot.replyId=reply toot.replyId = reply
} }
} }
var media = $("#media").val(); var media = $("#media").val();
if(media){ if (media) {
toot.mediaIds=media.split(","); toot.mediaIds = media.split(",");
} }
if ($("#nsfw").hasClass("nsfw-avail")) { if ($("#nsfw").hasClass("nsfw-avail")) {
var nsfw = "true"; var nsfw = "true";
toot.sensitive=nsfw; toot.sensitive = nsfw;
} else { } else {
var nsfw = "false"; var nsfw = "false";
} }
var vis = $("#vis").text(); var vis = $("#vis").text();
if(vis=="unlisted"){ if (vis == "unlisted") {
vis=="home" vis == "home"
}else if(vis=="direct"){ } else if (vis == "direct") {
vis=="specified"; vis == "specified";
toot.visibleUserIds=str.match(/@([a-zA-Z0-9_@.-]+)(\s|$)/g).join('').split("@"); toot.visibleUserIds = str.match(/@([a-zA-Z0-9_@.-]+)(\s|$)/g).join('').split("@");
} }
if(vis!="inherit"){ if (vis != "inherit") {
toot.visibility=vis; toot.visibility = vis;
} }
if ($("#cw").hasClass("cw-avail")) { if ($("#cw").hasClass("cw-avail")) {
var spo = $("#cw-text").val(); var spo = $("#cw-text").val();
cw(); cw();
toot.cw=spo; toot.cw = spo;
} else { } else {
var spo = ""; var spo = "";
} }
toot.i=at; toot.i = at;
var httpreq = new XMLHttpRequest(); var httpreq = new XMLHttpRequest();
httpreq.open('POST', start, true); httpreq.open('POST', start, true);
httpreq.setRequestHeader('Content-Type', 'application/json'); httpreq.setRequestHeader('Content-Type', 'application/json');
httpreq.responseType = "json"; httpreq.responseType = "json";
httpreq.send(JSON.stringify(toot)); httpreq.send(JSON.stringify(toot));
httpreq.onreadystatechange = function() { httpreq.onreadystatechange = function () {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
if(str.indexOf(localStorage.getItem("stable"))==-1){ if (str.indexOf(localStorage.getItem("stable")) == -1) {
localStorage.removeItem("stable") localStorage.removeItem("stable")
} }
var json = httpreq.response; var json = httpreq.response;
console.log(["Success: toot",json]); console.log(["Success: toot", json]);
var box = localStorage.getItem("box"); var box = localStorage.getItem("box");
if (box == "yes") { if (box == "yes") {
hide(); hide();
}else if (box == "hide"){ } else if (box == "hide") {
$("body").addClass("mini-post"); $("body").addClass("mini-post");
$(".mini-btn").text("expand_less"); $(".mini-btn").text("expand_less");
} }
@ -263,8 +263,8 @@ function misskeyPost(){
//クリア(Shift+C) //クリア(Shift+C)
function clear() { function clear() {
$("#textarea").val(""); $("#textarea").val("");
if(localStorage.getItem("stable")){ if (localStorage.getItem("stable")) {
$("#textarea").val("#"+localStorage.getItem("stable")+" ") $("#textarea").val("#" + localStorage.getItem("stable") + " ")
} }
$("#textarea").attr("placeholder", lang.lang_toot); $("#textarea").attr("placeholder", lang.lang_toot);
$("#reply").val(""); $("#reply").val("");
@ -280,7 +280,7 @@ function clear() {
$("#cw").removeClass("yellow-text"); $("#cw").removeClass("yellow-text");
$("#cw").removeClass("cw-avail"); $("#cw").removeClass("cw-avail");
$("#cw-text").hide(); $("#cw-text").hide();
}else{ } else {
$("#cw").addClass("yellow-text"); $("#cw").addClass("yellow-text");
$("#cw").addClass("cw-avail"); $("#cw").addClass("cw-avail");
$("#cw-text").show(); $("#cw-text").show();
@ -297,13 +297,13 @@ function clear() {
$(".toot-btn-group").prop("disabled", false); $(".toot-btn-group").prop("disabled", false);
$("#post-acct-sel").prop("disabled", false); $("#post-acct-sel").prop("disabled", false);
$("#days_poll").val(0); $("#days_poll").val(0);
$("#hours_poll").val(0); $("#hours_poll").val(0);
$("#mins_poll").val(6); $("#mins_poll").val(6);
$(".mastodon-choice").map(function() { $(".mastodon-choice").map(function () {
$(this).val(""); $(this).val("");
}); });
localStorage.removeItem("image"); localStorage.removeItem("image");
if(localStorage.getItem("mainuse")=="main"){ if (localStorage.getItem("mainuse") == "main") {
$("#post-acct-sel").val(localStorage.getItem("main")); $("#post-acct-sel").val(localStorage.getItem("main"));
} }
$('select').material_select(); $('select').material_select();

View File

@ -1,11 +1,11 @@
/*保護系*/ /*保護系*/
//画像保護 //画像保護
function nsfw(){ function nsfw() {
if($("#nsfw").hasClass("nsfw-avail")){ if ($("#nsfw").hasClass("nsfw-avail")) {
$("#nsfw").removeClass("yellow-text"); $("#nsfw").removeClass("yellow-text");
$("#nsfw").html("visibility_off"); $("#nsfw").html("visibility_off");
$("#nsfw").removeClass("nsfw-avail"); $("#nsfw").removeClass("nsfw-avail");
}else{ } else {
$("#nsfw").addClass("yellow-text"); $("#nsfw").addClass("yellow-text");
$("#nsfw").html("visibility"); $("#nsfw").html("visibility");
$("#nsfw").addClass("nsfw-avail"); $("#nsfw").addClass("nsfw-avail");
@ -13,7 +13,7 @@ function nsfw(){
} }
//投稿公開範囲 //投稿公開範囲
function vis(set){ function vis(set) {
$("#vis").text(set); $("#vis").text(set);
$("#vis-icon").removeClass("red-text"); $("#vis-icon").removeClass("red-text");
$("#vis-icon").removeClass("orange-text"); $("#vis-icon").removeClass("orange-text");
@ -21,105 +21,105 @@ function vis(set){
$("#vis-icon").removeClass("purple-text"); $("#vis-icon").removeClass("purple-text");
$("#vis-icon").removeClass("light-blue-text"); $("#vis-icon").removeClass("light-blue-text");
$("#vis-icon").removeClass("teal-text"); $("#vis-icon").removeClass("teal-text");
if(set=="public"){ if (set == "public") {
$("#vis-icon").text("public"); $("#vis-icon").text("public");
$("#vis-icon").addClass("purple-text"); $("#vis-icon").addClass("purple-text");
}else if(set=="unlisted"){ } else if (set == "unlisted") {
$("#vis-icon").text("lock_open"); $("#vis-icon").text("lock_open");
$("#vis-icon").addClass("blue-text"); $("#vis-icon").addClass("blue-text");
}else if(set=="private"){ } else if (set == "private") {
$("#vis-icon").text("lock"); $("#vis-icon").text("lock");
$("#vis-icon").addClass("orange-text"); $("#vis-icon").addClass("orange-text");
}else if(set=="direct"){ } else if (set == "direct") {
$("#vis-icon").text("mail"); $("#vis-icon").text("mail");
$("#vis-icon").addClass("red-text"); $("#vis-icon").addClass("red-text");
}else if(set=="limited"){ } else if (set == "limited") {
$("#vis-icon").text("group"); $("#vis-icon").text("group");
$("#vis-icon").addClass("teal-text"); $("#vis-icon").addClass("teal-text");
}else if(set=="local"){ } else if (set == "local") {
$("#vis-icon").text("visibility"); $("#vis-icon").text("visibility");
$("#vis-icon").addClass("light-blue-text"); $("#vis-icon").addClass("light-blue-text");
} }
var vis=localStorage.getItem("vis"); var vis = localStorage.getItem("vis");
if(vis=="memory"){ if (vis == "memory") {
var acct_id = $("#post-acct-sel").val(); var acct_id = $("#post-acct-sel").val();
localStorage.setItem("vis-memory-"+acct_id,set); localStorage.setItem("vis-memory-" + acct_id, set);
} }
$('.dropdown-button').dropdown('close'); $('.dropdown-button').dropdown('close');
} }
function loadVis(){ function loadVis() {
var vist = localStorage.getItem("vis"); var vist = localStorage.getItem("vis");
if (!vist) { if (!vist) {
vis("public"); vis("public");
} else { } else {
if (vist == "memory") { if (vist == "memory") {
var acct_id = $("#post-acct-sel").val(); var acct_id = $("#post-acct-sel").val();
var memory = localStorage.getItem("vis-memory-"+acct_id); var memory = localStorage.getItem("vis-memory-" + acct_id);
if (!memory) { if (!memory) {
memory = "public"; memory = "public";
}
vis(memory);
} else if(vist == "useapi") {
var acct_id = $("#post-acct-sel").val();
var multi = localStorage.getItem("multi");
var obj = JSON.parse(multi);
var memory = obj[acct_id]["vis"];
if (!memory) {
memory = "public";
}
vis(memory);
} else {
vis(vist);
} }
vis(memory);
} else if (vist == "useapi") {
var acct_id = $("#post-acct-sel").val();
var multi = localStorage.getItem("multi");
var obj = JSON.parse(multi);
var memory = obj[acct_id]["vis"];
if (!memory) {
memory = "public";
}
vis(memory);
} else {
vis(vist);
}
} }
} }
loadVis(); loadVis();
//コンテントワーニング //コンテントワーニング
function cw(){ function cw() {
if($("#cw").hasClass("cw-avail")){ if ($("#cw").hasClass("cw-avail")) {
$("#cw-text").val(); $("#cw-text").val();
$("#cw-text").hide(); $("#cw-text").hide();
$("#cw").removeClass("yellow-text"); $("#cw").removeClass("yellow-text");
$("#cw").removeClass("cw-avail"); $("#cw").removeClass("cw-avail");
}else{ } else {
$("#cw-text").show(); $("#cw-text").show();
$("#cw").addClass("yellow-text"); $("#cw").addClass("yellow-text");
$("#cw").addClass("cw-avail"); $("#cw").addClass("cw-avail");
var cwt=localStorage.getItem("cw-text"); var cwt = localStorage.getItem("cw-text");
if(cwt){ if (cwt) {
$("#cw-text").val(cwt); $("#cw-text").val(cwt);
} }
} }
} }
//TLでコンテントワーニングを表示トグル //TLでコンテントワーニングを表示トグル
function cw_show(id){ function cw_show(id) {
$(".cw_hide_"+id).toggleClass("cw"); $(".cw_hide_" + id).toggleClass("cw");
$(".cw-long-"+id).toggleClass("hide"); $(".cw-long-" + id).toggleClass("hide");
} }
$(function() { $(function () {
$('#cw-text').on('change', function(event) { $('#cw-text').on('change', function (event) {
var acct_id = $("#post-acct-sel").val(); var acct_id = $("#post-acct-sel").val();
var domain = localStorage.getItem("domain_" + acct_id); var domain = localStorage.getItem("domain_" + acct_id);
var cwlen=$('#cw-text').val().length; var cwlen = $('#cw-text').val().length;
if(idata[domain+"_letters"]){ if (idata[domain + "_letters"]) {
$("#textarea").attr("data-length", idata[domain+"_letters"]-cwlen) $("#textarea").attr("data-length", idata[domain + "_letters"] - cwlen)
}else{ } else {
$("#textarea").attr("data-length", 500-cwlen) $("#textarea").attr("data-length", 500 - cwlen)
} }
}); });
}); });
//スケジュール //スケジュール
function schedule(){ function schedule() {
if($("#sch-box").hasClass("sch-avail")){ if ($("#sch-box").hasClass("sch-avail")) {
$("#sch-box").hide(); $("#sch-box").hide();
$("#sch-box").removeClass("sch-avail"); $("#sch-box").removeClass("sch-avail");
}else{ } else {
var date = new Date(); var date = new Date();
$("#sch-box").show(); $("#sch-box").show();
$("#sch-date").val(formattime(date)); $("#sch-date").val(formattime(date));
$("#sch-box").addClass("sch-avail"); $("#sch-box").addClass("sch-avail");

View File

@ -7,7 +7,7 @@ function fav(id, acct_id, remote) {
var flag = "favourite"; var flag = "favourite";
} }
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");
var start = "https://" + domain + "/api/v1/statuses/" + id + "/" + flag; var start = "https://" + domain + "/api/v1/statuses/" + id + "/" + flag;
var httpreq = new XMLHttpRequest(); var httpreq = new XMLHttpRequest();
httpreq.open('POST', start, true); httpreq.open('POST', start, true);
@ -15,19 +15,19 @@ function fav(id, acct_id, remote) {
httpreq.setRequestHeader('Authorization', 'Bearer ' + at); httpreq.setRequestHeader('Authorization', 'Bearer ' + at);
httpreq.responseType = "json"; httpreq.responseType = "json";
httpreq.send(); httpreq.send();
httpreq.onreadystatechange = function() { httpreq.onreadystatechange = function () {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
var json = httpreq.response; var json = httpreq.response;
if(remote!="remote"){ if (remote != "remote") {
//APIのふぁぼカウントがおかしい //APIのふぁぼカウントがおかしい
if ($("[toot-id=" + id + "] .fav_ct").text() == json.favourites_count){ if ($("[toot-id=" + id + "] .fav_ct").text() == json.favourites_count) {
if(flag=="unfavourite"){ if (flag == "unfavourite") {
var fav=json.favourites_count - 1; var fav = json.favourites_count - 1;
}else{ } else {
var fav=json.favourites_count + 1; var fav = json.favourites_count + 1;
//var fav = json.favourites_count; //var fav = json.favourites_count;
} }
}else{ } else {
var fav = json.favourites_count; var fav = json.favourites_count;
} }
$("[toot-id=" + id + "] .fav_ct").text(fav); $("[toot-id=" + id + "] .fav_ct").text(fav);
@ -35,17 +35,17 @@ function fav(id, acct_id, remote) {
} else { } else {
$("[toot-id=" + id + "] .rt_ct").text(fav); $("[toot-id=" + id + "] .rt_ct").text(fav);
} }
if ($("[toot-id=" + id +"]").hasClass("faved")) { if ($("[toot-id=" + id + "]").hasClass("faved")) {
$("[toot-id=" + id +"]").removeClass("faved"); $("[toot-id=" + id + "]").removeClass("faved");
$(".fav_" + id).removeClass("yellow-text"); $(".fav_" + id).removeClass("yellow-text");
} else { } else {
$("[toot-id=" + id +"]").addClass("faved"); $("[toot-id=" + id + "]").addClass("faved");
$(".fav_" + id).addClass("yellow-text"); $(".fav_" + id).addClass("yellow-text");
} }
}else{ } else {
Materialize.toast(lang.lang_status_favWarn, 1000); Materialize.toast(lang.lang_status_favWarn, 1000);
} }
} }
} }
} }
@ -57,7 +57,7 @@ function rt(id, acct_id, remote) {
var flag = "reblog"; var flag = "reblog";
} }
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");
var start = "https://" + domain + "/api/v1/statuses/" + id + "/" + flag; var start = "https://" + domain + "/api/v1/statuses/" + id + "/" + flag;
var httpreq = new XMLHttpRequest(); var httpreq = new XMLHttpRequest();
httpreq.open('POST', start, true); httpreq.open('POST', start, true);
@ -65,10 +65,10 @@ function rt(id, acct_id, remote) {
httpreq.setRequestHeader('Authorization', 'Bearer ' + at); httpreq.setRequestHeader('Authorization', 'Bearer ' + at);
httpreq.responseType = "json"; httpreq.responseType = "json";
httpreq.send(); httpreq.send();
httpreq.onreadystatechange = function() { httpreq.onreadystatechange = function () {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
var json = httpreq.response; var json = httpreq.response;
console.log(["Success: boost",json]); console.log(["Success: boost", json]);
if (remote != "remote") { if (remote != "remote") {
$("[toot-id=" + id + "] .fav_ct").text(json.favourites_count); $("[toot-id=" + id + "] .fav_ct").text(json.favourites_count);
if (!json.reblog) { if (!json.reblog) {
@ -97,10 +97,10 @@ function rt(id, acct_id, remote) {
} }
//フォロー //フォロー
function follow(acct_id,remote) { function follow(acct_id, remote) {
if (!acct_id && acct_id!="selector") { if (!acct_id && acct_id != "selector") {
var acct_id = $('#his-data').attr("use-acct"); var acct_id = $('#his-data').attr("use-acct");
}else if (acct_id=="selector") { } else if (acct_id == "selector") {
var acct_id = $("#user-acct-sel").val(); var acct_id = $("#user-acct-sel").val();
} }
if (!remote && $("#his-data").hasClass("following")) { if (!remote && $("#his-data").hasClass("following")) {
@ -111,22 +111,22 @@ function follow(acct_id,remote) {
var flagm = "create"; var flagm = "create";
} }
var id = $("#his-data").attr("user-id"); var id = $("#his-data").attr("user-id");
if(!remote){ if (!remote) {
var remote = $("#his-data").attr("remote"); var remote = $("#his-data").attr("remote");
} }
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"){ if (localStorage.getItem("mode_" + domain) == "misskey") {
var start = "https://" + domain + "/api/following/"+flagm; var start = "https://" + domain + "/api/following/" + flagm;
var user=$("#his-acct").text(); var user = $("#his-acct").text();
var ent={"i":at,"userId":id} var ent = { "i": at, "userId": id }
}else if(remote=="true" && flag=="follow"){ } else if (remote == "true" && flag == "follow") {
var start = "https://" + domain + "/api/v1/follows"; var start = "https://" + domain + "/api/v1/follows";
var user=$("#his-acct").text(); var user = $("#his-acct").text();
var ent={"uri":user} var ent = { "uri": user }
}else{ } else {
var start = "https://" + domain + "/api/v1/accounts/" + id + "/" + flag; var start = "https://" + domain + "/api/v1/accounts/" + id + "/" + flag;
var ent={} var ent = {}
} }
var httpreq = new XMLHttpRequest(); var httpreq = new XMLHttpRequest();
httpreq.open('POST', start, true); httpreq.open('POST', start, true);
@ -134,10 +134,10 @@ function follow(acct_id,remote) {
httpreq.setRequestHeader('Authorization', 'Bearer ' + at); httpreq.setRequestHeader('Authorization', 'Bearer ' + at);
httpreq.responseType = "json"; httpreq.responseType = "json";
httpreq.send(JSON.stringify(ent)); httpreq.send(JSON.stringify(ent));
httpreq.onreadystatechange = function() { httpreq.onreadystatechange = function () {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
var json = httpreq.response; var json = httpreq.response;
console.log(["Success: folllow",json]); console.log(["Success: folllow", json]);
if ($("#his-data").hasClass("following")) { if ($("#his-data").hasClass("following")) {
$("#his-data").removeClass("following"); $("#his-data").removeClass("following");
$("#his-follow-btn").text(lang.lang_status_follow); $("#his-follow-btn").text(lang.lang_status_follow);
@ -161,7 +161,7 @@ function block(acct_id) {
var flag = "block"; var flag = "block";
} }
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");
var start = "https://" + domain + "/api/v1/accounts/" + id + "/" + flag; var start = "https://" + domain + "/api/v1/accounts/" + id + "/" + flag;
var httpreq = new XMLHttpRequest(); var httpreq = new XMLHttpRequest();
httpreq.open('POST', start, true); httpreq.open('POST', start, true);
@ -169,7 +169,7 @@ function block(acct_id) {
httpreq.setRequestHeader('Authorization', 'Bearer ' + at); httpreq.setRequestHeader('Authorization', 'Bearer ' + at);
httpreq.responseType = "json"; httpreq.responseType = "json";
httpreq.send(); httpreq.send();
httpreq.onreadystatechange = function() { httpreq.onreadystatechange = function () {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
if ($("#his-data").hasClass("blocking")) { if ($("#his-data").hasClass("blocking")) {
$("#his-data").removeClass("blocking"); $("#his-data").removeClass("blocking");
@ -196,14 +196,14 @@ function mute(acct_id) {
var flagm = "create"; var flagm = "create";
} }
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"){ if (localStorage.getItem("mode_" + domain) == "misskey") {
var start = "https://" + domain + "/api/mute/"+flagm; var start = "https://" + domain + "/api/mute/" + flagm;
var ent={"i":at,"userId":id} var ent = { "i": at, "userId": id }
var rq=JSON.stringify(ent); var rq = JSON.stringify(ent);
}else{ } else {
var start = "https://" + domain + "/api/v1/accounts/" + id + "/" + flag; var start = "https://" + domain + "/api/v1/accounts/" + id + "/" + flag;
var rq=""; var rq = "";
} }
var httpreq = new XMLHttpRequest(); var httpreq = new XMLHttpRequest();
httpreq.open('POST', start, true); httpreq.open('POST', start, true);
@ -211,7 +211,7 @@ function mute(acct_id) {
httpreq.setRequestHeader('Authorization', 'Bearer ' + at); httpreq.setRequestHeader('Authorization', 'Bearer ' + at);
httpreq.responseType = "json"; httpreq.responseType = "json";
httpreq.send(rq); httpreq.send(rq);
httpreq.onreadystatechange = function() { httpreq.onreadystatechange = function () {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
if ($("#his-data").hasClass("muting")) { if ($("#his-data").hasClass("muting")) {
$("#his-data").removeClass("muting"); $("#his-data").removeClass("muting");
@ -227,17 +227,17 @@ function mute(acct_id) {
//投稿削除 //投稿削除
function del(id, acct_id) { function del(id, 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"){ if (localStorage.getItem("mode_" + domain) == "misskey") {
var start = "https://" + domain + "/api/notes/delete"; var start = "https://" + domain + "/api/notes/delete";
var httpreq = new XMLHttpRequest(); var httpreq = new XMLHttpRequest();
httpreq.open('POST', start, true); httpreq.open('POST', start, true);
httpreq.setRequestHeader('Content-Type', 'application/json'); httpreq.setRequestHeader('Content-Type', 'application/json');
httpreq.responseType = "json"; httpreq.responseType = "json";
httpreq.send(JSON.stringify({i:at,noteId:id})); httpreq.send(JSON.stringify({ i: at, noteId: id }));
$("[toot-id=" + id+ "]").hide(); $("[toot-id=" + id + "]").hide();
$("[toot-id=" + id + "]").remove(); $("[toot-id=" + id + "]").remove();
}else{ } else {
var start = "https://" + domain + "/api/v1/statuses/" + id; var start = "https://" + domain + "/api/v1/statuses/" + id;
var httpreq = new XMLHttpRequest(); var httpreq = new XMLHttpRequest();
httpreq.open('DELETE', start, true); httpreq.open('DELETE', start, true);
@ -246,42 +246,42 @@ function del(id, acct_id) {
httpreq.responseType = "json"; httpreq.responseType = "json";
httpreq.send(); httpreq.send();
} }
httpreq.onreadystatechange = function() { httpreq.onreadystatechange = function () {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
} }
} }
} }
//redraft //redraft
function redraft(id, acct_id){ function redraft(id, acct_id) {
if(confirm(lang.lang_status_redraft)){ if (confirm(lang.lang_status_redraft)) {
show(); show();
del(id, acct_id); del(id, acct_id);
$("#post-acct-sel").prop("disabled", true); $("#post-acct-sel").prop("disabled", true);
var medias=$("[toot-id="+id+"]").attr("data-medias"); var medias = $("[toot-id=" + id + "]").attr("data-medias");
var vismode=$("[toot-id="+id+"] .vis-data").attr("data-vis"); var vismode = $("[toot-id=" + id + "] .vis-data").attr("data-vis");
vis(vismode); vis(vismode);
$("#media").val(medias); $("#media").val(medias);
var ct=medias.split(",").length; var ct = medias.split(",").length;
$("[toot-id="+id+"] img.toot-img").each(function(i, elem) { $("[toot-id=" + id + "] img.toot-img").each(function (i, elem) {
if(i<ct){ if (i < ct) {
var url=$(elem).attr("src"); var url = $(elem).attr("src");
console.log("Play back image data:"+url); console.log("Play back image data:" + url);
$('#preview').append('<img src="' + url + '" style="width:50px; max-height:100px;">'); $('#preview').append('<img src="' + url + '" style="width:50px; max-height:100px;">');
} }
}); });
var html=$("[toot-id="+id+"] .toot").html(); var html = $("[toot-id=" + id + "] .toot").html();
html = html.replace(/^<p>(.+)<\/p>$/,"$1"); html = html.replace(/^<p>(.+)<\/p>$/, "$1");
html = html.replace(/<br\s?\/?>/, "\n"); html = html.replace(/<br\s?\/?>/, "\n");
html = html.replace(/<p>/, "\n"); html = html.replace(/<p>/, "\n");
html = html.replace(/<\/p>/, "\n"); html = html.replace(/<\/p>/, "\n");
html = html.replace(/<img[\s\S]*alt="(.+?)"[\s\S]*?>/g, "$1"); html = html.replace(/<img[\s\S]*alt="(.+?)"[\s\S]*?>/g, "$1");
html=$.strip_tags(html); html = $.strip_tags(html);
localStorage.setItem("nohide",true); localStorage.setItem("nohide", true);
show(); show();
$("#textarea").val(html); $("#textarea").val(html);
var cwtxt=$("[toot-id="+id+"] .cw_text").html(); var cwtxt = $("[toot-id=" + id + "] .cw_text").html();
if(cwtxt!=""){ if (cwtxt != "") {
cwtxt=$.strip_tags(cwtxt); cwtxt = $.strip_tags(cwtxt);
cw(); cw();
$("#cw-text").val(cwtxt); $("#cw-text").val(cwtxt);
} }
@ -295,7 +295,7 @@ function pin(id, acct_id) {
var flag = "pin"; var flag = "pin";
} }
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");
var start = "https://" + domain + "/api/v1/statuses/" + id + "/" + flag; var start = "https://" + domain + "/api/v1/statuses/" + id + "/" + flag;
var httpreq = new XMLHttpRequest(); var httpreq = new XMLHttpRequest();
httpreq.open('POST', start, true); httpreq.open('POST', start, true);
@ -303,10 +303,10 @@ function pin(id, acct_id) {
httpreq.setRequestHeader('Authorization', 'Bearer ' + at); httpreq.setRequestHeader('Authorization', 'Bearer ' + at);
httpreq.responseType = "json"; httpreq.responseType = "json";
httpreq.send(); httpreq.send();
httpreq.onreadystatechange = function() { httpreq.onreadystatechange = function () {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
var json = httpreq.response; var json = httpreq.response;
console.log(["Success: pinned",json]); console.log(["Success: pinned", json]);
if ($("[toot-id=" + id + "]").hasClass("pined")) { if ($("[toot-id=" + id + "]").hasClass("pined")) {
$("[toot-id=" + id + "]").removeClass("pined"); $("[toot-id=" + id + "]").removeClass("pined");
$(".pin_" + id).removeClass("blue-text"); $(".pin_" + id).removeClass("blue-text");
@ -321,7 +321,7 @@ function pin(id, acct_id) {
//フォロリク //フォロリク
function request(id, flag, acct_id) { function request(id, flag, 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");
var start = "https://" + domain + "/api/v1/follow_requests/" + id + "/" + flag; var start = "https://" + domain + "/api/v1/follow_requests/" + id + "/" + flag;
var httpreq = new XMLHttpRequest(); var httpreq = new XMLHttpRequest();
httpreq.open('POST', start, true); httpreq.open('POST', start, true);
@ -329,10 +329,10 @@ function request(id, flag, acct_id) {
httpreq.setRequestHeader('Authorization', 'Bearer ' + at); httpreq.setRequestHeader('Authorization', 'Bearer ' + at);
httpreq.responseType = "json"; httpreq.responseType = "json";
httpreq.send(); httpreq.send();
httpreq.onreadystatechange = function() { httpreq.onreadystatechange = function () {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
var json = httpreq.response; var json = httpreq.response;
console.log(["Success: request","type:"+flag,json]); console.log(["Success: request", "type:" + flag, json]);
showReq(); showReq();
} }
} }
@ -344,7 +344,7 @@ function domainblock(add, flag, acct_id) {
var acct_id = $('#his-data').attr("use-acct"); var acct_id = $('#his-data').attr("use-acct");
} }
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");
var start = "https://" + domain + "/api/v1/domain_blocks" var start = "https://" + domain + "/api/v1/domain_blocks"
var httpreq = new XMLHttpRequest(); var httpreq = new XMLHttpRequest();
httpreq.open('POST', start, true); httpreq.open('POST', start, true);
@ -352,10 +352,10 @@ function domainblock(add, flag, acct_id) {
httpreq.setRequestHeader('Authorization', 'Bearer ' + at); httpreq.setRequestHeader('Authorization', 'Bearer ' + at);
httpreq.responseType = "json"; httpreq.responseType = "json";
httpreq.send(); httpreq.send();
httpreq.onreadystatechange = function() { httpreq.onreadystatechange = function () {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
var json = httpreq.response; var json = httpreq.response;
console.log(["Success: domain block",json]); console.log(["Success: domain block", json]);
showDom(); showDom();
} }
} }
@ -366,24 +366,24 @@ function addDomainblock() {
domainblock(domain, 'POST'); domainblock(domain, 'POST');
} }
//ユーザー強調 //ユーザー強調
function empUser(){ function empUser() {
var usr = localStorage.getItem("user_emp"); var usr = localStorage.getItem("user_emp");
var obj = JSON.parse(usr); var obj = JSON.parse(usr);
var id=$("#his-acct").attr("fullname"); var id = $("#his-acct").attr("fullname");
if(!obj){ if (!obj) {
var obj=[]; var obj = [];
obj.push(id); obj.push(id);
Materialize.toast(id+lang.lang_status_emphas, 4000); Materialize.toast(id + lang.lang_status_emphas, 4000);
}else{ } else {
var can; var can;
Object.keys(obj).forEach(function(key) { Object.keys(obj).forEach(function (key) {
var usT = obj[key]; var usT = obj[key];
if(usT!=id && !can){ if (usT != id && !can) {
can=false; can = false;
}else{ } else {
can=true; can = true;
obj.splice(key, 1); obj.splice(key, 1);
Materialize.toast(id+lang.lang_status_unemphas, 4000); Materialize.toast(id + lang.lang_status_unemphas, 4000);
} }
}); });
} }
@ -391,16 +391,16 @@ function empUser(){
localStorage.setItem("user_emp", json); localStorage.setItem("user_emp", json);
} }
//Endorse //Endorse
function pinUser(){ function pinUser() {
var id=$("#his-data").attr("user-id"); var id = $("#his-data").attr("user-id");
var acct_id=$("#his-data").attr("use-acct"); var acct_id = $("#his-data").attr("use-acct");
if ($("#his-end-btn").hasClass("endorsed")) { if ($("#his-end-btn").hasClass("endorsed")) {
var flag = "unpin"; var flag = "unpin";
} else { } else {
var flag = "pin"; var flag = "pin";
} }
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");
var start = "https://" + domain + "/api/v1/accounts/" + id + "/" + flag; var start = "https://" + domain + "/api/v1/accounts/" + id + "/" + flag;
var httpreq = new XMLHttpRequest(); var httpreq = new XMLHttpRequest();
httpreq.open('POST', start, true); httpreq.open('POST', start, true);
@ -408,7 +408,7 @@ function pinUser(){
httpreq.setRequestHeader('Authorization', 'Bearer ' + at); httpreq.setRequestHeader('Authorization', 'Bearer ' + at);
httpreq.responseType = "json"; httpreq.responseType = "json";
httpreq.send(); httpreq.send();
httpreq.onreadystatechange = function() { httpreq.onreadystatechange = function () {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
var json = httpreq.response; var json = httpreq.response;
if ($("#his-end-btn").hasClass("endorsed")) { if ($("#his-end-btn").hasClass("endorsed")) {
@ -417,63 +417,63 @@ function pinUser(){
} else { } else {
$("#his-end-btn").addClass("endorsed") $("#his-end-btn").addClass("endorsed")
$("#his-end-btn").text(lang.lang_status_unendorse) $("#his-end-btn").text(lang.lang_status_unendorse)
} }
} }
} }
} }
//URLコピー //URLコピー
function tootUriCopy(url){ function tootUriCopy(url) {
execCopy(url); execCopy(url);
Materialize.toast(lang.lang_details_url, 1500); Materialize.toast(lang.lang_details_url, 1500);
} }
//他のアカウントで… //他のアカウントで…
function staEx(mode){ function staEx(mode) {
var url=$("#tootmodal").attr("data-url"); var url = $("#tootmodal").attr("data-url");
var acct_id = $("#status-acct-sel").val(); var acct_id = $("#status-acct-sel").val();
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");
var start = "https://" + domain + "/api/v1/search?resolve=true&q="+url var start = "https://" + domain + "/api/v1/search?resolve=true&q=" + url
fetch(start, { fetch(start, {
method: 'GET', method: 'GET',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
'Authorization': 'Bearer ' + at 'Authorization': 'Bearer ' + at
} }
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
var id=json.statuses[0].id; var id = json.statuses[0].id;
if(mode=="rt"){ if (mode == "rt") {
rt(id, acct_id, 'remote') rt(id, acct_id, 'remote')
}else if(mode=="fav"){ } else if (mode == "fav") {
fav(id, acct_id, 'remote') fav(id, acct_id, 'remote')
}else if(mode=="reply"){ } else if (mode == "reply") {
reEx(id) reEx(id)
} }
}); });
return; return;
} }
function toggleAction(id,tlid,acct_id){ function toggleAction(id, tlid, acct_id) {
if(tlid=="notf"){ if (tlid == "notf") {
var tlide="[data-notf="+acct_id+"]"; var tlide = "[data-notf=" + acct_id + "]";
}else{ } else {
var tlide="[tlid="+tlid+"]"; var tlide = "[tlid=" + tlid + "]";
} }
if(!$(tlide+" [toot-id="+id+"]").hasClass("ext-mode")){ if (!$(tlide + " [toot-id=" + id + "]").hasClass("ext-mode")) {
$(tlide+" [toot-id="+id+"] .type-a").hide(); $(tlide + " [toot-id=" + id + "] .type-a").hide();
$(tlide+" [toot-id="+id+"] .type-b").show(); $(tlide + " [toot-id=" + id + "] .type-b").show();
$(tlide+" [toot-id="+id+"]").addClass("ext-mode") $(tlide + " [toot-id=" + id + "]").addClass("ext-mode")
$(tlide+" [toot-id="+id+"] .act-icon").text("expand_less"); $(tlide + " [toot-id=" + id + "] .act-icon").text("expand_less");
}else{ } else {
$(tlide+" [toot-id="+id+"] .type-b").hide(); $(tlide + " [toot-id=" + id + "] .type-b").hide();
$(tlide+" [toot-id="+id+"] .type-a").show(); $(tlide + " [toot-id=" + id + "] .type-a").show();
$(tlide+" [toot-id="+id+"]").removeClass("ext-mode") $(tlide + " [toot-id=" + id + "]").removeClass("ext-mode")
$(tlide+" [toot-id="+id+"] .act-icon").text("expand_more"); $(tlide + " [toot-id=" + id + "] .act-icon").text("expand_more");
} }
} }

View File

@ -7,102 +7,102 @@ var prev_val = input.value;
var oldSuggest; var oldSuggest;
var suggest; var suggest;
input.addEventListener("focus", function() { input.addEventListener("focus", function () {
var acct_id = $("#post-acct-sel").val(); var acct_id = $("#post-acct-sel").val();
$("#suggest").html(""); $("#suggest").html("");
window.clearInterval(timer); window.clearInterval(timer);
timer = window.setInterval(function() { timer = window.setInterval(function () {
var new_val = input.value; var new_val = input.value;
if(new_val==""){ if (new_val == "") {
$("#suggest").html(""); $("#suggest").html("");
if($("#poll").hasClass("hide") && $("#emoji").hasClass("hide")){ if ($("#poll").hasClass("hide") && $("#emoji").hasClass("hide")) {
$("#right-side").hide() $("#right-side").hide()
} }
return; return;
} }
if (prev_val != new_val) { if (prev_val != new_val) {
var semoji = new_val.match(/:(\S{3,})/); var semoji = new_val.match(/:(\S{3,})/);
if(semoji){ if (semoji) {
var obj = JSON.parse(localStorage.getItem("emoji_" + acct_id)); var obj = JSON.parse(localStorage.getItem("emoji_" + acct_id));
if(!obj){ if (!obj) {
var ehtml=lang.lang_suggest_nodata; var ehtml = lang.lang_suggest_nodata;
}else{ } else {
var num = obj.length; var num = obj.length;
var ehtml=""; var ehtml = "";
for (i = 0; i < num; i++) { for (i = 0; i < num; i++) {
var emoji = obj[i]; var emoji = obj[i];
if ( ~emoji.shortcode.indexOf(semoji[1])) { if (~emoji.shortcode.indexOf(semoji[1])) {
if (emoji) { if (emoji) {
ehtml = ehtml+'<a onclick="emojiInsert(\':' + emoji.shortcode + ehtml = ehtml + '<a onclick="emojiInsert(\':' + emoji.shortcode +
': \',\':'+semoji[1]+'\')" class="pointer"><img src="' + emoji.url + '" width="20"></a>'; ': \',\':' + semoji[1] + '\')" class="pointer"><img src="' + emoji.url + '" width="20"></a>';
} }
} }
} }
} }
if(ehtml!=""){ if (ehtml != "") {
$("#right-side").show() $("#right-side").show()
$("#poll").addClass("hide") $("#poll").addClass("hide")
$("#emoji").addClass("hide") $("#emoji").addClass("hide")
}else{ } else {
if($("#poll").hasClass("hide") && $("#emoji").hasClass("hide")){ if ($("#poll").hasClass("hide") && $("#emoji").hasClass("hide")) {
$("#right-side").hide() $("#right-side").hide()
} }
} }
$("#suggest").html(ehtml); $("#suggest").html(ehtml);
} }
var tag = new_val.match(/#(\S{3,})/); var tag = new_val.match(/#(\S{3,})/);
var acct = new_val.match(/@(\S{3,})/); var acct = new_val.match(/@(\S{3,})/);
if (tag && tag[1]) { if (tag && tag[1]) {
var q = tag[1]; var q = tag[1];
} else if (acct && acct[1]) { } else if (acct && acct[1]) {
var q = acct[1]; var q = acct[1];
}else { } else {
$("#suggest").html(""); $("#suggest").html("");
if($("#poll").hasClass("hide") && $("#emoji").hasClass("hide")){ if ($("#poll").hasClass("hide") && $("#emoji").hasClass("hide")) {
$("#right-side").hide() $("#right-side").hide()
} }
return; return;
} }
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");
suggest = "https://" + domain + "/api/v1/search?q=" + q suggest = "https://" + domain + "/api/v1/search?q=" + q
if (suggest != oldSuggest) { if (suggest != oldSuggest) {
console.log("Try to get suggest at "+suggest) console.log("Try to get suggest at " + suggest)
fetch(suggest, { fetch(suggest, {
method: 'GET', method: 'GET',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
'Authorization': 'Bearer ' + at 'Authorization': 'Bearer ' + at
}, },
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
if (json.hashtags[0] && tag) { if (json.hashtags[0] && tag) {
if(tag[1]){ if (tag[1]) {
var tags = ""; var tags = "";
Object.keys(json.hashtags).forEach(function(key4) { Object.keys(json.hashtags).forEach(function (key4) {
var tag = json.hashtags[key4]; var tag = json.hashtags[key4];
if(tag!=q){ if (tag != q) {
tags = tags + '<a onclick="tagInsert(\'#' + tag + '\',\'#' + q + tags = tags + '<a onclick="tagInsert(\'#' + tag + '\',\'#' + q +
'\')" class="pointer">#' + tag + '</a><br>'; '\')" class="pointer">#' + tag + '</a><br>';
} }
}); });
$("#right-side").show() $("#right-side").show()
$("#suggest").html("Tags:<br>" + tags); $("#suggest").html("Tags:<br>" + tags);
$("#poll").addClass("hide") $("#poll").addClass("hide")
$("#emoji").addClass("hide") $("#emoji").addClass("hide")
} }
} else if (json.accounts[0] && acct[1]) { } else if (json.accounts[0] && acct[1]) {
var accts = ""; var accts = "";
Object.keys(json.accounts).forEach(function(key3) { Object.keys(json.accounts).forEach(function (key3) {
var acct = json.accounts[key3]; var acct = json.accounts[key3];
if(acct.acct!=q){ if (acct.acct != q) {
accts = accts + '<a onclick="tagInsert(\'@' + acct.acct + accts = accts + '<a onclick="tagInsert(\'@' + acct.acct +
'\',\'@' + q + '\')" class="pointer">@' + acct.acct + '</a><br>'; '\',\'@' + q + '\')" class="pointer">@' + acct.acct + '</a><br>';
} }
}); });
$("#right-side").show() $("#right-side").show()
@ -110,7 +110,7 @@ input.addEventListener("focus", function() {
$("#poll").addClass("hide") $("#poll").addClass("hide")
$("#emoji").addClass("hide") $("#emoji").addClass("hide")
} else { } else {
if($("#poll").hasClass("hide") && $("#emoji").hasClass("hide")){ if ($("#poll").hasClass("hide") && $("#emoji").hasClass("hide")) {
$("#right-side").hide() $("#right-side").hide()
} }
} }
@ -122,7 +122,7 @@ input.addEventListener("focus", function() {
}, 1000); }, 1000);
}, false); }, false);
input.addEventListener("blur", function() { input.addEventListener("blur", function () {
window.clearInterval(timer); window.clearInterval(timer);
favTag(); favTag();
}, false); }, false);
@ -133,47 +133,47 @@ function tagInsert(code, del) {
} else { } else {
var regExp = new RegExp(del, "g"); var regExp = new RegExp(del, "g");
var now = now.replace(regExp, ""); var now = now.replace(regExp, "");
selin=selin-del.length; selin = selin - del.length;
} }
if(selin>0){ if (selin > 0) {
var before = now.substr(0, selin); var before = now.substr(0, selin);
var after = now.substr(selin, now.length); var after = now.substr(selin, now.length);
newt = before + " "+ code+" " + after; newt = before + " " + code + " " + after;
}else{ } else {
newt = code+" "+now; newt = code + " " + now;
} }
$("#textarea").val(newt); $("#textarea").val(newt);
$("#textarea").focus(); $("#textarea").focus();
if($("#poll").hasClass("hide") && $("#emoji").hasClass("hide")){ if ($("#poll").hasClass("hide") && $("#emoji").hasClass("hide")) {
$("#right-side").hide() $("#right-side").hide()
} }
$("#suggest").html(""); $("#suggest").html("");
} }
function cgNPs(q){ function cgNPs(q) {
suggest = "https://cg.toot.app/api/v1/search/light?q=" + q suggest = "https://cg.toot.app/api/v1/search/light?q=" + q
if (suggest != oldSuggest) { if (suggest != oldSuggest) {
console.log("Try to get suggest at "+suggest) console.log("Try to get suggest at " + suggest)
fetch(suggest, { fetch(suggest, {
method: 'GET', method: 'GET',
headers: { headers: {
'content-type': 'application/json' 'content-type': 'application/json'
}, },
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
if (json[0]) { if (json[0]) {
var tags = ""; var tags = "";
Object.keys(json).forEach(function(key4) { Object.keys(json).forEach(function (key4) {
var tag = json[key4]; var tag = json[key4];
tags = tags + '<a onclick="cgNP(\''+json[key4]+'\')" class="pointer">' + escapeHTML(json[key4]) + '</a> '; tags = tags + '<a onclick="cgNP(\'' + json[key4] + '\')" class="pointer">' + escapeHTML(json[key4]) + '</a> ';
});
$("#suggest").html("Cinderella NowPlaying:" + tags);
}else{
$("#suggest").html("Cinderella NowPlaying:Not Found");
}
}); });
$("#suggest").html("Cinderella NowPlaying:" + tags);
} else {
$("#suggest").html("Cinderella NowPlaying:Not Found");
} }
});
}
} }

View File

@ -1,62 +1,62 @@
/*リプライ*/ /*リプライ*/
function re(id,ats_cm,acct_id,mode){ function re(id, ats_cm, acct_id, mode) {
clear(); clear();
var ats=ats_cm.split(','); var ats = ats_cm.split(',');
localStorage.setItem("nohide",true); localStorage.setItem("nohide", true);
show(); show();
$("#reply").val(id); $("#reply").val(id);
for(var i=0;i<ats.length;i++){ for (var i = 0; i < ats.length; i++) {
var at=ats[i]; var at = ats[i];
var te=$("#textarea").val(); var te = $("#textarea").val();
if(at!=localStorage.getItem("user_"+acct_id)){ if (at != localStorage.getItem("user_" + acct_id)) {
$("#textarea").val("@"+at+" "+te); $("#textarea").val("@" + at + " " + te);
} }
} }
$("#rec").text(lang.lang_yesno); $("#rec").text(lang.lang_yesno);
$("#post-acct-sel").val(acct_id); $("#post-acct-sel").val(acct_id);
$("#post-acct-sel").prop("disabled", true); $("#post-acct-sel").prop("disabled", true);
$('select').material_select(); $('select').material_select();
$("#textarea").attr("placeholder",lang.lang_usetxtbox_reply); $("#textarea").attr("placeholder", lang.lang_usetxtbox_reply);
$("#textarea").focus(); $("#textarea").focus();
var profimg=localStorage.getItem("prof_"+acct_id); var profimg = localStorage.getItem("prof_" + acct_id);
if(!profimg){ if (!profimg) {
profimg="../../img/missing.svg"; profimg = "../../img/missing.svg";
} }
$("#acct-sel-prof").attr("src",profimg); $("#acct-sel-prof").attr("src", profimg);
vis(mode); vis(mode);
} }
function reEx(id){ function reEx(id) {
$('#tootmodal').modal('close'); $('#tootmodal').modal('close');
var at=$("#tootmodal").attr("data-user"); var at = $("#tootmodal").attr("data-user");
var acct_id = $("#status-acct-sel").val(); var acct_id = $("#status-acct-sel").val();
var mode=$("#tootmodal .vis-data").attr("data-vis"); var mode = $("#tootmodal .vis-data").attr("data-vis");
re(id,at,acct_id,mode); re(id, at, acct_id, mode);
} }
//引用 //引用
function qt(id,acct_id,at,url){ function qt(id, acct_id, at, url) {
localStorage.setItem("nohide",true); localStorage.setItem("nohide", true);
var qt = localStorage.getItem("quote"); var qt = localStorage.getItem("quote");
if(!qt){ if (!qt) {
var qt="simple"; var qt = "simple";
} }
if(qt=="nothing"){ if (qt == "nothing") {
return false; return false;
} }
if(qt=="simple"){ if (qt == "simple") {
show(); show();
$("#textarea").val("\n"+url); $("#textarea").val("\n" + url);
}else if(qt=="mention"){ } else if (qt == "mention") {
show(); show();
$("#textarea").val("\n"+url+" From:@"+at); $("#textarea").val("\n" + url + " From:@" + at);
}else if(qt=="full"){ } else if (qt == "full") {
show(); show();
var html=$("[toot-id="+id+"] .toot").html(); var html = $("[toot-id=" + id + "] .toot").html();
html = html.match(/^<p>(.+)<\/p>$/)[1]; html = html.match(/^<p>(.+)<\/p>$/)[1];
html = html.replace(/<br\s?\/?>/, "\n"); html = html.replace(/<br\s?\/?>/, "\n");
html = html.replace(/<p>/, "\n"); html = html.replace(/<p>/, "\n");
html = html.replace(/<\/p>/, "\n"); html = html.replace(/<\/p>/, "\n");
html=$.strip_tags(html); html = $.strip_tags(html);
$("#textarea").val("\n"+"@"+at+" "+html+"\n"+url); $("#textarea").val("\n" + "@" + at + " " + html + "\n" + url);
} }
$("#textarea").focus(); $("#textarea").focus();
$("#post-acct-sel").val(acct_id); $("#post-acct-sel").val(acct_id);

View File

@ -3,209 +3,208 @@
function additional(acct_id, tlid) { function additional(acct_id, tlid) {
//メンション系 //メンション系
//$(".mention").attr("href", ""); //$(".mention").attr("href", "");
$("#timeline-container .mention").addClass("parsed"); $("#timeline-container .mention").addClass("parsed");
$("#timeline-container .hashtag").each(function(i, elem) { $("#timeline-container .hashtag").each(function (i, elem) {
var tags = $(this).attr("href").match( var tags = $(this).attr("href").match(
/https?:\/\/([-a-zA-Z0-9@.]+)\/tags\/([-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)/ /https?:\/\/([-a-zA-Z0-9@.]+)\/tags\/([-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)/
); );
$(this).attr("href","#"); $(this).attr("href", "#");
if(tags){ if (tags) {
if(tags[2]){ if (tags[2]) {
$(this).attr("onclick",'tagShow(\'' + tags[2] + '\')'); $(this).attr("onclick", 'tagShow(\'' + tags[2] + '\')');
} }
} }
}); });
//トゥートサムネ //トゥートサムネ
$("#timeline_" + tlid + " .toot a:not(.parsed)").each(function(i, elem) { $("#timeline_" + tlid + " .toot a:not(.parsed)").each(function (i, elem) {
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");
var card = localStorage.getItem("card_" + tlid); var card = localStorage.getItem("card_" + tlid);
var text = $(this).attr('href'); var text = $(this).attr('href');
if(text){ if (text) {
if(text.indexOf("twimg.com")=== -1){ if (text.indexOf("twimg.com") === -1) {
var urls = text.match( var urls = text.match(
/https?:\/\/([-a-zA-Z0-9@.]+)\/media\/([-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)/ /https?:\/\/([-a-zA-Z0-9@.]+)\/media\/([-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)/
); );
} }
}else{ } else {
text="" text = ""
var urls =[] var urls = []
} }
//トゥートのURLぽかったら //トゥートのURLぽかったら
toot = text.match(/https:\/\/([a-zA-Z0-9.-]+)\/@([a-zA-Z0-9_]+)\/([0-9]+)/); toot = text.match(/https:\/\/([a-zA-Z0-9.-]+)\/@([a-zA-Z0-9_]+)\/([0-9]+)/);
if(toot){ if (toot) {
if(toot[1]){ if (toot[1]) {
$(this).attr("data-acct",acct_id); $(this).attr("data-acct", acct_id);
} }
} }
if (urls) { if (urls) {
$(this).remove(); $(this).remove();
} else if (!card) { } else if (!card) {
var id = $(this).parents('.cvo').attr("toot-id"); var id = $(this).parents('.cvo').attr("toot-id");
if(localStorage.getItem("mode_" + domain)=="misskey"){ if (localStorage.getItem("mode_" + domain) == "misskey") {
var start = "https://" + domain + "/url?url="+text; var start = "https://" + domain + "/url?url=" + text;
fetch(start, { fetch(start, {
method: 'GET', method: 'GET',
headers: { headers: {
'content-type': 'application/json' 'content-type': 'application/json'
}, },
//body: JSON.stringify({}) //body: JSON.stringify({})
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
if (json.title) { if (json.title) {
$("[toot-id=" + id + "] .additional").html( $("[toot-id=" + id + "] .additional").html(
"<span class=\"gray\">URL"+lang.lang_cards_check+":<br>Title:" + escapeHTML(json.title) + "<br>" + "<span class=\"gray\">URL" + lang.lang_cards_check + ":<br>Title:" + escapeHTML(json.title) + "<br>" +
escapeHTML(json.description) + "</span>"); escapeHTML(json.description) + "</span>");
$("[toot-id=" + id + "] a:not(.parsed)").addClass("parsed"); $("[toot-id=" + id + "] a:not(.parsed)").addClass("parsed");
$("[toot-id=" + id + "]").addClass("parsed"); $("[toot-id=" + id + "]").addClass("parsed");
} }
}); });
} }
}else{ } else {
$(this).attr("title",text); $(this).attr("title", text);
} }
}); });
$("i.unparsed").each(function(i, elem) { $("i.unparsed").each(function (i, elem) {
var dem=$(this).text(); var dem = $(this).text();
var dom=$(this); var dom = $(this);
var start = "./js/emoji/emoji-map.json"; var start = "./js/emoji/emoji-map.json";
var xmlHttpRequest = new XMLHttpRequest(); var xmlHttpRequest = new XMLHttpRequest();
xmlHttpRequest.onreadystatechange = function() xmlHttpRequest.onreadystatechange = function () {
{ if (this.readyState === 4 && this.status === 200) {
if( this.readyState === 4 && this.status === 200 ) { if (this.response) {
if( this.response){ var json = this.response;
var json=this.response; var emojis = json.emojis;
var emojis=json.emojis; for (i = 0; i < emojis.length; i++) {
for (i = 0; i < emojis.length; i++) { var emojie = emojis[i];
var emojie = emojis[i]; var regExp = new RegExp(dem, "g");
var regExp = new RegExp(dem, "g"); if (emojie.emoji.match(regExp)) {
if (emojie.emoji.match(regExp)) { var sc = emojie.name;
var sc=emojie.name; var sc = "twa-" + sc.replace(/_/g, "-");
var sc="twa-"+sc.replace(/_/g,"-"); dom.addClass(sc);
dom.addClass(sc); dom.text("");
dom.text(""); dom.removeClass("unparsed");
dom.removeClass("unparsed"); break;
break; }
} }
} }
} }
} }
} xmlHttpRequest.open('GET', start, true);
xmlHttpRequest.open( 'GET', start, true ); xmlHttpRequest.responseType = 'json';
xmlHttpRequest.responseType = 'json'; xmlHttpRequest.send(null);
xmlHttpRequest.send( null );
}); });
$("#timeline_" + tlid + " .toot:not(:has(a:not(.add-show,.parsed)))").each(function(i, elem) { $("#timeline_" + tlid + " .toot:not(:has(a:not(.add-show,.parsed)))").each(function (i, elem) {
$(this).parent().find(".add-show").hide(); $(this).parent().find(".add-show").hide();
}); });
//Markdownイメージビューワー //Markdownイメージビューワー
$("#timeline_" + tlid + " .toot a:not(.img-parsed):has(img)").each(function(i, elem) { $("#timeline_" + tlid + " .toot a:not(.img-parsed):has(img)").each(function (i, elem) {
var ilink=$(this).attr("href"); var ilink = $(this).attr("href");
var id = $(this).parents('.cvo').attr("toot-id"); var id = $(this).parents('.cvo').attr("toot-id");
$(this).attr("href","#"); $(this).attr("href", "#");
$(this).attr("onclick","imgv('"+id+"','"+i+"')"); $(this).attr("onclick", "imgv('" + id + "','" + i + "')");
$(this).attr("data-type","image"); $(this).attr("data-type", "image");
$(this).attr("id",id+"-image-"+i); $(this).attr("id", id + "-image-" + i);
$(this).attr("data-url",ilink); $(this).attr("data-url", ilink);
$(this).addClass("img-parsed"); $(this).addClass("img-parsed");
}); });
} }
function additionalIndv(tlid, acct_id, id) { function additionalIndv(tlid, acct_id, 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");
var text = $("[toot-id="+id+"] .toot a").attr('href'); var text = $("[toot-id=" + id + "] .toot a").attr('href');
var urls = text.match( var urls = text.match(
/https?:\/\/([-a-zA-Z0-9@.]+)\/media\/([-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)/ /https?:\/\/([-a-zA-Z0-9@.]+)\/media\/([-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)/
); );
if (urls) { if (urls) {
$("[toot-id="+id+"] .toot a").remove(); $("[toot-id=" + id + "] .toot a").remove();
} else {
if (localStorage.getItem("mode_" + domain) == "misskey") {
var start = "https://" + domain + "/url?url=" + text;
fetch(start, {
method: 'GET',
headers: {
'content-type': 'application/json'
},
//body: JSON.stringify({})
}).then(function (response) {
return response.json();
}).catch(function (error) {
todo(error);
console.error(error);
}).then(function (json) {
if (json.title) {
$("[toot-id=" + id + "] .additional").html(
"<span class=\"gray\">URL" + lang.lang_cards_check + ":<br>Title:" + escapeHTML(json.title) + "<br>" +
escapeHTML(json.description) + "</span>");
$("[toot-id=" + id + "] a:not(.parsed)").addClass("parsed");
$("[toot-id=" + id + "]").addClass("parsed");
}
});
} else { } else {
if(localStorage.getItem("mode_" + domain)=="misskey"){ var id = $("[toot-id=" + id + "] .toot a").parents('.cvo').attr("toot-id");
var start = "https://" + domain + "/url?url="+text; var start = "https://" + domain + "/api/v1/statuses/" + id + "/card";
fetch(start, { fetch(start, {
method: 'GET', method: 'GET',
headers: { headers: {
'content-type': 'application/json' 'content-type': 'application/json',
}, 'Authorization': 'Bearer ' + at
//body: JSON.stringify({}) },
}).then(function(response) { //body: JSON.stringify({})
return response.json(); }).then(function (response) {
}).catch(function(error) { return response.json();
todo(error); }).catch(function (error) {
console.error(error); todo(error);
}).then(function(json) { console.error(error);
}).then(function (json) {
//このリンク鳥やんけ、ってとき
if (json.provider_name == "Twitter") {
if (json.image) {
var twiImg = '<br><img src="' + json.image + '" style="max-width:100%" onclick="imgv(\'twi_' + id + '\', 0, \'twitter\');" id="twi_' + id + '-image-0" data-url="' + json.image + '" data-type="image">';
} else {
var twiImg = '';
}
$("[toot-id=" + id + "] .additional").html(
'<div class="twitter-tweet"><b>' + escapeHTML(json.author_name) + '</b><br>' + escapeHTML(json.description) + twiImg + '</div>');
} else if (json.provider_name == "pixiv") {
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">';
} else {
var pxvImg = '';
}
$("[toot-id=" + id + "] .additional").html(
'<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 {
if (json.title) { if (json.title) {
$("[toot-id=" + id + "] .additional").html( $("[toot-id=" + id + "] .additional").html(
"<span class=\"gray\">URL"+lang.lang_cards_check+":<br>Title:" + escapeHTML(json.title) + "<br>" + "<span class=\"gray\">URL" + lang.lang_cards_check + ":<br>Title:" + escapeHTML(json.title) + "<br>" +
escapeHTML(json.description) + "</span>"); escapeHTML(json.description) + "</span>");
$("[toot-id=" + id + "] a:not(.parsed)").addClass("parsed");
$("[toot-id=" + id + "]").addClass("parsed");
} }
}); if (json.html) {
}else{ $("[toot-id=" + id + "] .additional").html(json.html + '<i class="material-icons sml pointer" onclick="pip(\'' + id + '\')" title="' + lang.lang_cards_pip + '">picture_in_picture_alt</i>');
var id = $("[toot-id="+id+"] .toot a").parents('.cvo').attr("toot-id");
var start = "https://" + domain + "/api/v1/statuses/" + id + "/card";
fetch(start, {
method: 'GET',
headers: {
'content-type': 'application/json',
'Authorization': 'Bearer ' + at
},
//body: JSON.stringify({})
}).then(function(response) {
return response.json();
}).catch(function(error) {
todo(error);
console.error(error);
}).then(function(json) {
//このリンク鳥やんけ、ってとき
if (json.provider_name=="Twitter"){
if(json.image){
var twiImg='<br><img src="'+json.image+'" style="max-width:100%" onclick="imgv(\'twi_'+id+'\', 0, \'twitter\');" id="twi_'+id+'-image-0" data-url="'+json.image+'" data-type="image">';
}else{
var twiImg='';
}
$("[toot-id=" + id + "] .additional").html(
'<div class="twitter-tweet"><b>'+escapeHTML(json.author_name)+'</b><br>'+escapeHTML(json.description)+twiImg+'</div>');
}else if (json.provider_name=="pixiv"){
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">';
}else{
var pxvImg='';
}
$("[toot-id=" + id + "] .additional").html(
'<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{
if (json.title) {
$("[toot-id=" + id + "] .additional").html(
"<span class=\"gray\">URL"+lang.lang_cards_check+":<br>Title:" + escapeHTML(json.title) + "<br>" +
escapeHTML(json.description) + "</span>");
}
if (json.html) {
$("[toot-id=" + id + "] .additional").html(json.html+'<i class="material-icons sml pointer" onclick="pip(\''+id+'\')" title="'+lang.lang_cards_pip+'">picture_in_picture_alt</i>');
}
} }
if (json.title) { }
$("[toot-id=" + id + "] a:not(.parsed)").addClass("parsed"); if (json.title) {
$("[toot-id=" + id + "]").addClass("parsed"); $("[toot-id=" + id + "] a:not(.parsed)").addClass("parsed");
} $("[toot-id=" + id + "]").addClass("parsed");
}); }
} });
} }
}
} }
//各TL上方のLink[On/Off] //各TL上方のLink[On/Off]
@ -214,11 +213,11 @@ function cardToggle(tlid) {
if (!card) { if (!card) {
localStorage.setItem("card_" + tlid, "true"); localStorage.setItem("card_" + tlid, "true");
$("#sta-card-" + tlid).text("Off"); $("#sta-card-" + tlid).text("Off");
$("#sta-card-" + tlid).css("color",'red'); $("#sta-card-" + tlid).css("color", 'red');
} else { } else {
localStorage.removeItem("card_" + tlid); localStorage.removeItem("card_" + tlid);
$("#sta-card-" + tlid).text("On"); $("#sta-card-" + tlid).text("On");
$("#sta-card-" + tlid).css("color",'#009688'); $("#sta-card-" + tlid).css("color", '#009688');
} }
} }
//各TL上方のLink[On/Off]をチェック //各TL上方のLink[On/Off]をチェック
@ -226,56 +225,56 @@ function cardCheck(tlid) {
var card = localStorage.getItem("card_" + tlid); var card = localStorage.getItem("card_" + tlid);
if (!card) { if (!card) {
$("#sta-card-" + tlid).text("On"); $("#sta-card-" + tlid).text("On");
$("#sta-card-" + tlid).css("color",'#009688'); $("#sta-card-" + tlid).css("color", '#009688');
} else { } else {
$("#sta-card-" + tlid).text("Off"); $("#sta-card-" + tlid).text("Off");
$("#sta-card-" + tlid).css("color",'red'); $("#sta-card-" + tlid).css("color", 'red');
} }
} }
function mov(id,tlid,type){ function mov(id, tlid, type) {
if(tlid=="notf"){ if (tlid == "notf") {
var tlide="[data-notf="+acct_id+"]"; var tlide = "[data-notf=" + acct_id + "]";
}else if(tlid=="user"){ } else if (tlid == "user") {
var tlide="#his-data"; var tlide = "#his-data";
}else{ } else {
var tlide="[tlid="+tlid+"]"; var tlide = "[tlid=" + tlid + "]";
} }
var mouseover=localStorage.getItem("mouseover"); var mouseover = localStorage.getItem("mouseover");
if(!mouseover){ if (!mouseover) {
mouseover=""; mouseover = "";
} }
if(mouseover=="yes"){ if (mouseover == "yes") {
mouseover="hide"; mouseover = "hide";
}else if(mouseover=="click"){ } else if (mouseover == "click") {
if(type=="mv"){ if (type == "mv") {
mouseover=""; mouseover = "";
}else{ } else {
mouseover="hide"; mouseover = "hide";
} }
}else if(mouseover=="no"){ } else if (mouseover == "no") {
mouseover=""; mouseover = "";
} }
if(mouseover=="hide"){ if (mouseover == "hide") {
$(tlide+" [toot-id="+id+"] .area-actions").toggleClass("hide") $(tlide + " [toot-id=" + id + "] .area-actions").toggleClass("hide")
$(tlide+" [toot-id="+id+"] .area-side").toggleClass("hide") $(tlide + " [toot-id=" + id + "] .area-side").toggleClass("hide")
} }
} }
function resetmv(type){ function resetmv(type) {
var mouseover=localStorage.getItem("mouseover"); var mouseover = localStorage.getItem("mouseover");
if(!mouseover){ if (!mouseover) {
mouseover=""; mouseover = "";
}else if(mouseover=="yes"){ } else if (mouseover == "yes") {
mouseover="hide"; mouseover = "hide";
}else if(mouseover=="no"){ } else if (mouseover == "no") {
mouseover=""; mouseover = "";
}else if(mouseover=="click" && type!="mv"){ } else if (mouseover == "click" && type != "mv") {
mouseover="hide"; mouseover = "hide";
} }
if(mouseover=="hide"){ if (mouseover == "hide") {
$(".area-actions").addClass("hide"); $(".area-actions").addClass("hide");
$(".area-side").addClass("hide"); $(".area-side").addClass("hide");
} }
} }

View File

@ -1,31 +1,31 @@
//トゥートの詳細 //トゥートの詳細
function details(id, acct_id, tlid, mode) { function details(id, acct_id, tlid, mode) {
if(mode=="dm"){ if (mode == "dm") {
$(".dm-hide").hide(); $(".dm-hide").hide();
}else{ } else {
$(".dm-hide").show(); $(".dm-hide").show();
} }
$(".toot-reset").html('<span class="no-data">'+lang.lang_details_nodata+'</span>'); $(".toot-reset").html('<span class="no-data">' + lang.lang_details_nodata + '</span>');
var html = $("#timeline_"+tlid+" [toot-id=" + id + "]").html(); var html = $("#timeline_" + tlid + " [toot-id=" + id + "]").html();
$("#toot-this").html(html); $("#toot-this").html(html);
$('#tootmodal').modal('open'); $('#tootmodal').modal('open');
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"){ if (localStorage.getItem("mode_" + domain) == "misskey") {
var start = "https://" + domain + "/api/notes/show"; var start = "https://" + domain + "/api/notes/show";
var i={ var i = {
method: 'POST', method: 'POST',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
}, },
body:JSON.stringify({ body: JSON.stringify({
i:at, i: at,
noteId:id noteId: id
}) })
} }
}else{ } else {
var start = "https://" + domain + "/api/v1/statuses/" + id; var start = "https://" + domain + "/api/v1/statuses/" + id;
var i={ var i = {
method: 'GET', method: 'GET',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
@ -33,61 +33,61 @@ function details(id, acct_id, tlid, mode) {
}, },
} }
} }
fetch(start, i).then(function(response) { fetch(start, i).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
console.log(["Toot data:",json]); console.log(["Toot data:", json]);
if(!$("#timeline_"+tlid+" #pub_" + id).length){ if (!$("#timeline_" + tlid + " #pub_" + id).length) {
var html = parse([json], '', acct_id); var html = parse([json], '', acct_id);
$("#toot-this").html(html); $("#toot-this").html(html);
jQuery("time.timeago").timeago(); jQuery("time.timeago").timeago();
} }
if(localStorage.getItem("mode_" + domain)=="misskey"){ if (localStorage.getItem("mode_" + domain) == "misskey") {
var url="https://"+domain+"/notes/"+json.id; var url = "https://" + domain + "/notes/" + json.id;
var scn=json.user.username; var scn = json.user.username;
if(!json.user.host){ if (!json.user.host) {
var local=true; var local = true;
}else{ } else {
var local=false; var local = false;
scn=scn+"@"+host; scn = scn + "@" + host;
} }
var rep=""; var rep = "";
var uid=json.user.id; var uid = json.user.id;
if(json._replyIds){ if (json._replyIds) {
replyTL(json._replyIds[0], acct_id); replyTL(json._replyIds[0], acct_id);
} }
}else{ } else {
var url=json.url var url = json.url
if(json.account.acct==json.account.username){ if (json.account.acct == json.account.username) {
var local=true; var local = true;
}else{ } else {
var local=false; var local = false;
} }
var scn=json.account.acct; var scn = json.account.acct;
var uid=json.account.id; var uid = json.account.id;
if (json["in_reply_to_id"]) { if (json["in_reply_to_id"]) {
replyTL(json["in_reply_to_id"], acct_id); replyTL(json["in_reply_to_id"], acct_id);
} }
} }
$("#toot-this .fav_ct").text(json.favourites_count); $("#toot-this .fav_ct").text(json.favourites_count);
$("#toot-this .rt_ct").text(json.reblogs_count); $("#toot-this .rt_ct").text(json.reblogs_count);
$("#tootmodal").attr("data-url",url); $("#tootmodal").attr("data-url", url);
$("#tootmodal").attr("data-id",json.id); $("#tootmodal").attr("data-id", json.id);
if(local){ if (local) {
$("#tootmodal").attr("data-user",scn+"@"+domain); $("#tootmodal").attr("data-user", scn + "@" + domain);
}else{ } else {
$("#tootmodal").attr("data-user",scn); $("#tootmodal").attr("data-user", scn);
} }
context(id, acct_id); context(id, acct_id);
var dom=null; var dom = null;
if(!local){ if (!local) {
dom=scn.replace(/.+@/g,''); dom = scn.replace(/.+@/g, '');
}else{ } else {
dom=domain; dom = domain;
} }
beforeToot(id, acct_id, dom); beforeToot(id, acct_id, dom);
userToot(id, acct_id, uid); userToot(id, acct_id, uid);
@ -96,37 +96,37 @@ function details(id, acct_id, tlid, mode) {
afterFTLToot(id, acct_id, dom); afterFTLToot(id, acct_id, dom);
faved(id, acct_id); faved(id, acct_id);
rted(id, acct_id); rted(id, acct_id);
if($("#toot-this div").hasClass("cvo")){ if ($("#toot-this div").hasClass("cvo")) {
$("#toot-this").removeClass("cvo"); $("#toot-this").removeClass("cvo");
}else{ } else {
$("#toot-this").addClass("cvo"); $("#toot-this").addClass("cvo");
} }
if(!$("#activator").hasClass("active")){ if (!$("#activator").hasClass("active")) {
$('#det-col').collapsible('open', 4); $('#det-col').collapsible('open', 4);
} }
}); });
} }
//返信タイムライン //返信タイムライン
function replyTL(id, acct_id) { function replyTL(id, 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"){ if (localStorage.getItem("mode_" + domain) == "misskey") {
var start = "https://" + domain + "/api/notes/show"; var start = "https://" + domain + "/api/notes/show";
var i={ var i = {
method: 'POST', method: 'POST',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
}, },
body:JSON.stringify({ body: JSON.stringify({
i:at, i: at,
noteId:id noteId: id
}) })
} }
}else{ } else {
var start = "https://" + domain + "/api/v1/statuses/" + id; var start = "https://" + domain + "/api/v1/statuses/" + id;
var i={ var i = {
method: 'GET', method: 'GET',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
@ -134,65 +134,65 @@ function replyTL(id, acct_id) {
}, },
} }
} }
fetch(start, i).then(function(response) { fetch(start, i).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
if(localStorage.getItem("filter_"+ acct_id)!="undefined"){ if (localStorage.getItem("filter_" + acct_id) != "undefined") {
var mute=getFilterType(JSON.parse(localStorage.getItem("filter_"+ acct_id)),"thread"); var mute = getFilterType(JSON.parse(localStorage.getItem("filter_" + acct_id)), "thread");
}else{ } else {
var mute=[]; var mute = [];
} }
if(localStorage.getItem("mode_" + domain)=="misskey"){ if (localStorage.getItem("mode_" + domain) == "misskey") {
var templete = misskeyParse([json], '', acct_id,"","",mute); var templete = misskeyParse([json], '', acct_id, "", "", mute);
$("#toot-after").prepend(templete); $("#toot-after").prepend(templete);
$("#toot-after .hide").html(lang.lang_details_filtered); $("#toot-after .hide").html(lang.lang_details_filtered);
$("#toot-after .by_filter").css("display","block"); $("#toot-after .by_filter").css("display", "block");
$("#toot-after .by_filter").removeClass("hide"); $("#toot-after .by_filter").removeClass("hide");
var rep="_replyIds"; var rep = "_replyIds";
if (json[rep]) { if (json[rep]) {
replyTL(json[rep][0], acct_id); replyTL(json[rep][0], acct_id);
} }
}else{ } else {
var templete = parse([json], '', acct_id,"","",mute); var templete = parse([json], '', acct_id, "", "", mute);
if(templete!=""){ if (templete != "") {
$("#toot-reply .no-data").hide(); $("#toot-reply .no-data").hide();
} }
$("#toot-reply").prepend(templete); $("#toot-reply").prepend(templete);
$("#toot-reply .hide").html(lang.lang_details_filtered); $("#toot-reply .hide").html(lang.lang_details_filtered);
$("#toot-reply .by_filter").css("display","block"); $("#toot-reply .by_filter").css("display", "block");
$("#toot-reply .by_filter").removeClass("hide"); $("#toot-reply .by_filter").removeClass("hide");
jQuery("time.timeago").timeago(); jQuery("time.timeago").timeago();
var rep="in_reply_to_id"; var rep = "in_reply_to_id";
if (json[rep]) { if (json[rep]) {
replyTL(json[rep], acct_id); replyTL(json[rep], acct_id);
} }
} }
}); });
} }
//コンテクストってなんですか //コンテクストってなんですか
function context(id, acct_id) { function context(id, 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"){ if (localStorage.getItem("mode_" + domain) == "misskey") {
var start = "https://" + domain + "/api/notes/conversation"; var start = "https://" + domain + "/api/notes/conversation";
var i={ var i = {
method: 'POST', method: 'POST',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
}, },
body:JSON.stringify({ body: JSON.stringify({
i:at, i: at,
noteId:id noteId: id
}) })
} }
}else{ } else {
var start = "https://" + domain + "/api/v1/statuses/" + id + "/context"; var start = "https://" + domain + "/api/v1/statuses/" + id + "/context";
var i={ var i = {
method: 'GET', method: 'GET',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
@ -200,82 +200,82 @@ function context(id, acct_id) {
}, },
} }
} }
fetch(start, i).then(function(response) { fetch(start, i).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
if(localStorage.getItem("mode_" + domain)=="misskey"){ if (localStorage.getItem("mode_" + domain) == "misskey") {
json.reverse(); json.reverse();
var templete = misskeyParse(json, '', acct_id,"","",[]); var templete = misskeyParse(json, '', acct_id, "", "", []);
$("#toot-reply").html(templete); $("#toot-reply").html(templete);
$("#toot-reply .hide").html(lang.lang_details_filtered); $("#toot-reply .hide").html(lang.lang_details_filtered);
$("#toot-reply .by_filter").css("display","block"); $("#toot-reply .by_filter").css("display", "block");
$("#toot-reply .by_filter").removeClass("hide"); $("#toot-reply .by_filter").removeClass("hide");
jQuery("time.timeago").timeago(); jQuery("time.timeago").timeago();
}else{ } else {
if(localStorage.getItem("filter_"+ acct_id)!="undefined"){ if (localStorage.getItem("filter_" + acct_id) != "undefined") {
var mute=getFilterType(JSON.parse(localStorage.getItem("filter_"+ acct_id)),"thread"); var mute = getFilterType(JSON.parse(localStorage.getItem("filter_" + acct_id)), "thread");
}else{ } else {
var mute=[]; var mute = [];
} }
var templete = parse(json.descendants, '', acct_id,"","",mute); var templete = parse(json.descendants, '', acct_id, "", "", mute);
if(templete!=""){ if (templete != "") {
$("#toot-after .no-data").hide(); $("#toot-after .no-data").hide();
} }
$("#toot-after").html(templete); $("#toot-after").html(templete);
$("#toot-after .hide").html(lang.lang_details_filtered); $("#toot-after .hide").html(lang.lang_details_filtered);
$("#toot-after .by_filter").css("display","block"); $("#toot-after .by_filter").css("display", "block");
$("#toot-after .by_filter").removeClass("hide"); $("#toot-after .by_filter").removeClass("hide");
jQuery("time.timeago").timeago(); jQuery("time.timeago").timeago();
} }
}); });
} }
//前のトゥート(Back TL) //前のトゥート(Back TL)
function beforeToot(id, acct_id, domain) { function beforeToot(id, acct_id, domain) {
//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"){ if (localStorage.getItem("mode_" + domain) == "misskey") {
var start = "https://" + domain + var start = "https://" + domain +
"/api/notes/local-timeline" "/api/notes/local-timeline"
fetch(start, { fetch(start, {
method: 'POST', method: 'POST',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
}, },
body:JSON.stringify({ body: JSON.stringify({
i:at, i: at,
untilID:id untilID: id
}) })
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
var templete = misskeyParse(json, 'noauth', acct_id); var templete = misskeyParse(json, 'noauth', acct_id);
$("#toot-before").html(templete); $("#toot-before").html(templete);
jQuery("time.timeago").timeago(); jQuery("time.timeago").timeago();
}); });
}else{ } else {
var start = "https://" + domain + var start = "https://" + domain +
"/api/v1/timelines/public?local=true&max_id=" + id; "/api/v1/timelines/public?local=true&max_id=" + id;
fetch(start, { fetch(start, {
method: 'GET', method: 'GET',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
}, },
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
var templete = parse(json, 'noauth', acct_id); var templete = parse(json, 'noauth', acct_id);
if(templete!=""){ if (templete != "") {
$("#toot-before .no-data").hide(); $("#toot-before .no-data").hide();
} }
$("#toot-before").html(templete); $("#toot-before").html(templete);
@ -286,31 +286,31 @@ function beforeToot(id, acct_id, domain) {
//前のユーザーのトゥート //前のユーザーのトゥート
function userToot(id, acct_id, user) { function userToot(id, acct_id, user) {
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"){ if (localStorage.getItem("mode_" + domain) == "misskey") {
var start = "https://" + domain + var start = "https://" + domain +
"/api/users/notes" "/api/users/notes"
fetch(start, { fetch(start, {
method: 'POST', method: 'POST',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
}, },
body:JSON.stringify({ body: JSON.stringify({
i:at, i: at,
untilID:id, untilID: id,
userId:user userId: user
}) })
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
var templete = misskeyParse(json, 'noauth', acct_id); var templete = misskeyParse(json, 'noauth', acct_id);
$("#user-before").html(templete); $("#user-before").html(templete);
jQuery("time.timeago").timeago(); jQuery("time.timeago").timeago();
}); });
}else{ } else {
var start = "https://" + domain + "/api/v1/accounts/" + user + "/statuses?max_id=" + id; var start = "https://" + domain + "/api/v1/accounts/" + user + "/statuses?max_id=" + id;
fetch(start, { fetch(start, {
method: 'GET', method: 'GET',
@ -318,103 +318,103 @@ function userToot(id, acct_id, user) {
'content-type': 'application/json', 'content-type': 'application/json',
'Authorization': 'Bearer ' + at 'Authorization': 'Bearer ' + at
}, },
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
var templete = parse(json, '', acct_id); var templete = parse(json, '', acct_id);
if(templete!=""){ if (templete != "") {
$("#user-before .no-data").hide(); $("#user-before .no-data").hide();
} }
$("#user-before").html(templete); $("#user-before").html(templete);
jQuery("time.timeago").timeago(); jQuery("time.timeago").timeago();
}); });
} }
} }
//後のLTL //後のLTL
function afterToot(id, acct_id, domain) { function afterToot(id, acct_id, domain) {
//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");
var start = "https://" + domain + var start = "https://" + domain +
"/api/v1/timelines/public?local=true&min_id=" + id; "/api/v1/timelines/public?local=true&min_id=" + id;
fetch(start, { fetch(start, {
method: 'GET', method: 'GET',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
}, },
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
var templete = parse(json, 'noauth', acct_id); var templete = parse(json, 'noauth', acct_id);
if(templete!=""){ if (templete != "") {
$("#ltl-after .no-data").hide(); $("#ltl-after .no-data").hide();
} }
$("#ltl-after").html(templete); $("#ltl-after").html(templete);
jQuery("time.timeago").timeago(); jQuery("time.timeago").timeago();
}); });
} }
//後のUTL //後のUTL
function afterUserToot(id, acct_id, user) { function afterUserToot(id, acct_id, user) {
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");
var start = "https://" + domain + "/api/v1/accounts/" + user + "/statuses?min_id=" + id; var start = "https://" + domain + "/api/v1/accounts/" + user + "/statuses?min_id=" + id;
fetch(start, { fetch(start, {
method: 'GET', method: 'GET',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
'Authorization': 'Bearer ' + at 'Authorization': 'Bearer ' + at
}, },
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
var templete = parse(json, '', acct_id); var templete = parse(json, '', acct_id);
if(templete!=""){ if (templete != "") {
$("#user-after .no-data").hide(); $("#user-after .no-data").hide();
} }
$("#user-after").html(templete); $("#user-after").html(templete);
jQuery("time.timeago").timeago(); jQuery("time.timeago").timeago();
}); });
} }
//後のFTL //後のFTL
function afterFTLToot(id, acct_id, domain) { function afterFTLToot(id, acct_id, domain) {
//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");
var start = "https://" + domain + var start = "https://" + domain +
"/api/v1/timelines/public?min_id=" + id; "/api/v1/timelines/public?min_id=" + id;
fetch(start, { fetch(start, {
method: 'GET', method: 'GET',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
}, },
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
var templete = parse(json, 'noauth', acct_id); var templete = parse(json, 'noauth', acct_id);
if(templete!=""){ if (templete != "") {
$("#ftl-after .no-data").hide(); $("#ftl-after .no-data").hide();
} }
$("#ftl-after").html(templete); $("#ftl-after").html(templete);
jQuery("time.timeago").timeago(); jQuery("time.timeago").timeago();
}); });
} }
//ふぁぼ一覧 //ふぁぼ一覧
function faved(id, acct_id) { function faved(id, acct_id) {
var domain = localStorage.getItem("domain_" + acct_id); var domain = localStorage.getItem("domain_" + acct_id);
if(localStorage.getItem("mode_" + domain)=="misskey"){ return false; } if (localStorage.getItem("mode_" + domain) == "misskey") { return false; }
var at = localStorage.getItem("acct_"+ acct_id + "_at"); var at = localStorage.getItem("acct_" + acct_id + "_at");
var start = "https://" + domain + "/api/v1/statuses/" + id + "/favourited_by"; var start = "https://" + domain + "/api/v1/statuses/" + id + "/favourited_by";
fetch(start, { fetch(start, {
method: 'GET', method: 'GET',
@ -422,14 +422,14 @@ function faved(id, acct_id) {
'content-type': 'application/json', 'content-type': 'application/json',
'Authorization': 'Bearer ' + at 'Authorization': 'Bearer ' + at
}, },
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
var templete = userparse(json, '', acct_id); var templete = userparse(json, '', acct_id);
if(templete!=""){ if (templete != "") {
$("#toot-fav .no-data").hide(); $("#toot-fav .no-data").hide();
} }
$("#toot-fav").html(templete); $("#toot-fav").html(templete);
@ -439,8 +439,8 @@ function faved(id, acct_id) {
//ブースト一覧 //ブースト一覧
function rted(id, acct_id) { function rted(id, acct_id) {
var domain = localStorage.getItem("domain_" + acct_id); var domain = localStorage.getItem("domain_" + acct_id);
if(localStorage.getItem("mode_" + domain)=="misskey"){ return false; } if (localStorage.getItem("mode_" + domain) == "misskey") { return false; }
var at = localStorage.getItem("acct_"+ acct_id + "_at"); var at = localStorage.getItem("acct_" + acct_id + "_at");
var start = "https://" + domain + "/api/v1/statuses/" + id + "/reblogged_by"; var start = "https://" + domain + "/api/v1/statuses/" + id + "/reblogged_by";
fetch(start, { fetch(start, {
method: 'GET', method: 'GET',
@ -448,77 +448,77 @@ function rted(id, acct_id) {
'content-type': 'application/json', 'content-type': 'application/json',
'Authorization': 'Bearer ' + at 'Authorization': 'Bearer ' + at
}, },
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
var templete = userparse(json, '', acct_id); var templete = userparse(json, '', acct_id);
$("#toot-rt").html(templete); $("#toot-rt").html(templete);
}); });
} }
//URL等のコピー //URL等のコピー
function cbCopy(mode){ function cbCopy(mode) {
var url=$("#tootmodal").attr("data-url"); var url = $("#tootmodal").attr("data-url");
var urls = url.match(/https?:\/\/([-.a-zA-Z0-9]+)/); var urls = url.match(/https?:\/\/([-.a-zA-Z0-9]+)/);
var domain=urls[1]; var domain = urls[1];
if(mode=="emb"){ if (mode == "emb") {
var emb='<iframe src="'+url+'/embed" class="mastodon-embed" style="max-width: 100%; border: 0" width="400"></iframe><script src="https://'+domain+'/embed.js" async="async"></script>'; var emb = '<iframe src="' + url + '/embed" class="mastodon-embed" style="max-width: 100%; border: 0" width="400"></iframe><script src="https://' + domain + '/embed.js" async="async"></script>';
execCopy(emb) execCopy(emb)
Materialize.toast(lang.lang_details_embed, 1500); Materialize.toast(lang.lang_details_embed, 1500);
}else{ } else {
if(execCopy(url)){ if (execCopy(url)) {
Materialize.toast(lang.lang_details_url, 1500); Materialize.toast(lang.lang_details_url, 1500);
} }
} }
} }
//本文のコピー //本文のコピー
function staCopy(id){ function staCopy(id) {
var html=$("[toot-id="+id+"] .toot").html(); var html = $("[toot-id=" + id + "] .toot").html();
html = html.replace(/^<p>(.+)<\/p>$/,"$1"); html = html.replace(/^<p>(.+)<\/p>$/, "$1");
html = html.replace(/<br\s?\/?>/, "\n"); html = html.replace(/<br\s?\/?>/, "\n");
html = html.replace(/<p>/, "\n"); html = html.replace(/<p>/, "\n");
html = html.replace(/<\/p>/, "\n"); html = html.replace(/<\/p>/, "\n");
console.log("Copy it:\n"+html); console.log("Copy it:\n" + html);
html = html.replace(/<img[\s\S]*alt="(.+?)"[\s\S]*?>/g, "$1"); html = html.replace(/<img[\s\S]*alt="(.+?)"[\s\S]*?>/g, "$1");
html=$.strip_tags(html); html = $.strip_tags(html);
if(execCopy(html)){ if (execCopy(html)) {
Materialize.toast(lang.lang_details_txt, 1500); Materialize.toast(lang.lang_details_txt, 1500);
} }
} }
//翻訳 //翻訳
function trans(tar,to){ function trans(tar, to) {
var html=$("#toot-this .toot").html(); var html = $("#toot-this .toot").html();
if(html.match(/^<p>(.+)<\/p>$/)){ if (html.match(/^<p>(.+)<\/p>$/)) {
html = html.match(/^<p>(.+)<\/p>$/)[1]; html = html.match(/^<p>(.+)<\/p>$/)[1];
} }
html = html.replace(/<br\s?\/?>/g, "\n"); html = html.replace(/<br\s?\/?>/g, "\n");
html = html.replace(/<p>/g, "\n"); html = html.replace(/<p>/g, "\n");
html = html.replace(/<\/p>/g, "\n"); html = html.replace(/<\/p>/g, "\n");
html=$.strip_tags(html); html = $.strip_tags(html);
if(~tar.indexOf("zh")){ if (~tar.indexOf("zh")) {
tar="zh"; tar = "zh";
} }
$("#toot-this .additional").text("Loading...(Powered by Google Translate)"); $("#toot-this .additional").text("Loading...(Powered by Google Translate)");
var exec='https://script.google.com/macros/s/AKfycbxhwW5tjjop9Irg-y1zr_WsXlCKEzwWG6KuoOt_vVRDfEbRv0c/exec?format=json&text='+encodeURIComponent(html)+'&source='+tar+'&target='+to var exec = 'https://script.google.com/macros/s/AKfycbxhwW5tjjop9Irg-y1zr_WsXlCKEzwWG6KuoOt_vVRDfEbRv0c/exec?format=json&text=' + encodeURIComponent(html) + '&source=' + tar + '&target=' + to
console.log("Try to translate from "+tar+" to "+to+" at "+exec); console.log("Try to translate from " + tar + " to " + to + " at " + exec);
fetch(exec, { fetch(exec, {
method: 'GET', method: 'GET',
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(text) { }).then(function (text) {
$("#toot-this .additional").html('<span class="gray">'+text.text+'</span>'); $("#toot-this .additional").html('<span class="gray">' + text.text + '</span>');
}); });
} }
//ブラウザで開く //ブラウザで開く
function brws(){ function brws() {
var url=$("#tootmodal").attr("data-url"); var url = $("#tootmodal").attr("data-url");
const { const {
shell shell
} = require('electron'); } = require('electron');
@ -526,38 +526,38 @@ function brws(){
shell.openExternal(url); shell.openExternal(url);
} }
//外部からトゥート開く //外部からトゥート開く
function detEx(url,acct_id){ function detEx(url, acct_id) {
if(acct_id=="main"){ if (acct_id == "main") {
acct_id=localStorage.getItem("main"); acct_id = localStorage.getItem("main");
} }
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");
var start = "https://" + domain + "/api/v1/search?resolve=true&q="+url var start = "https://" + domain + "/api/v1/search?resolve=true&q=" + url
fetch(start, { fetch(start, {
method: 'GET', method: 'GET',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
'Authorization': 'Bearer ' + at 'Authorization': 'Bearer ' + at
} }
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
if(!json.statuses){ if (!json.statuses) {
const { const {
shell shell
} = require('electron'); } = require('electron');
shell.openExternal(url); shell.openExternal(url);
}else{ } else {
var id=json.statuses[0].id; var id = json.statuses[0].id;
$(".loadp").text($(".loadp").attr("href")); $(".loadp").text($(".loadp").attr("href"));
$(".loadp").removeClass("loadp"); $(".loadp").removeClass("loadp");
details(id, acct_id, 0) details(id, acct_id, 0)
} }
}); });
return; return;
} }

View File

@ -15,7 +15,7 @@ function date(str, datetype) {
} else { } else {
var min = date.getMinutes(); var min = date.getMinutes();
} }
var sec=null; var sec = null;
if (date.getSeconds() < 10) { if (date.getSeconds() < 10) {
sec = "0" + date.getSeconds(); sec = "0" + date.getSeconds();
} else { } else {
@ -57,31 +57,31 @@ function date(str, datetype) {
//特殊フォーマット(インスタンス情報で利用) //特殊フォーマット(インスタンス情報で利用)
function crat(str) { function crat(str) {
var date = new Date(str); var date = new Date(str);
var mnt=null; var mnt = null;
if(date.getMonth()<9){ if (date.getMonth() < 9) {
mnt="0"+(date.getMonth()+1); mnt = "0" + (date.getMonth() + 1);
}else{ } else {
mnt=date.getMonth()+1; mnt = date.getMonth() + 1;
} }
if(date.getDate()<10){ if (date.getDate() < 10) {
var dat="0"+date.getDate(); var dat = "0" + date.getDate();
}else{ } else {
var dat=date.getDate(); var dat = date.getDate();
} }
if(date.getHours()<10){ if (date.getHours() < 10) {
var hrs="0"+date.getHours(); var hrs = "0" + date.getHours();
}else{ } else {
var hrs=date.getHours(); var hrs = date.getHours();
} }
if(date.getMinutes()<10){ if (date.getMinutes() < 10) {
var mns="0"+date.getMinutes(); var mns = "0" + date.getMinutes();
}else{ } else {
var mns=date.getMinutes(); var mns = date.getMinutes();
} }
if(date.getSeconds()<10){ if (date.getSeconds() < 10) {
var sec="0"+date.getSeconds(); var sec = "0" + date.getSeconds();
}else{ } else {
var sec=date.getSeconds(); var sec = date.getSeconds();
} }
format_str = 'YYYY-MM-DD hh:mm:ss'; format_str = 'YYYY-MM-DD hh:mm:ss';
format_str = format_str.replace(/YYYY/g, date.getFullYear()); format_str = format_str.replace(/YYYY/g, date.getFullYear());

View File

@ -1,79 +1,79 @@
//DM(Conv) TL //DM(Conv) TL
function dm(acct_id, tlid, type,delc,voice) { function dm(acct_id, tlid, type, delc, voice) {
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");
var start = "https://" + domain + "/api/v1/conversations"; var start = "https://" + domain + "/api/v1/conversations";
fetch(start, { fetch(start, {
method: 'GET', method: 'GET',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
'Authorization': 'Bearer ' + at 'Authorization': 'Bearer ' + at
}, },
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
var templete = '<div id="convList'+tlid+'">'+dmListParse(json, type, acct_id, tlid, "", mute)+'</div>'; var templete = '<div id="convList' + tlid + '">' + dmListParse(json, type, acct_id, tlid, "", mute) + '</div>';
localStorage.setItem("lastobj_"+ tlid,json[0].id) localStorage.setItem("lastobj_" + tlid, json[0].id)
$("#timeline_" + tlid).html(templete); $("#timeline_" + tlid).html(templete);
additional(acct_id, tlid); additional(acct_id, tlid);
jQuery("time.timeago").timeago(); jQuery("time.timeago").timeago();
todc(); todc();
//reload(type, '', acct_id, tlid, data, mute, delc,voice); //reload(type, '', acct_id, tlid, data, mute, delc,voice);
$(window).scrollTop(0); $(window).scrollTop(0);
}); });
} }
function dmmore(tlid){ function dmmore(tlid) {
var multi = localStorage.getItem("column"); var multi = localStorage.getItem("column");
var obj = JSON.parse(multi); var obj = JSON.parse(multi);
var acct_id = obj[tlid].domain; var acct_id = obj[tlid].domain;
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");
var sid = $("#timeline_" + tlid + " .cvo").last().attr("unique-id"); var sid = $("#timeline_" + tlid + " .cvo").last().attr("unique-id");
var start = "https://" + domain + "/api/v1/conversations?max_id="+sid; var start = "https://" + domain + "/api/v1/conversations?max_id=" + sid;
var type="dm"; var type = "dm";
fetch(start, { fetch(start, {
method: 'GET', method: 'GET',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
'Authorization': 'Bearer ' + at 'Authorization': 'Bearer ' + at
}, },
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
var templete = '<div id="convList'+tlid+'">'+dmListParse(json, type, acct_id, tlid, "", mute)+'</div>'; var templete = '<div id="convList' + tlid + '">' + dmListParse(json, type, acct_id, tlid, "", mute) + '</div>';
$("#timeline_" + tlid).append(templete); $("#timeline_" + tlid).append(templete);
additional(acct_id, tlid); additional(acct_id, tlid);
jQuery("time.timeago").timeago(); jQuery("time.timeago").timeago();
moreloading=false; moreloading = false;
}) })
} }
//DMオブジェクトパーサー(トゥート) //DMオブジェクトパーサー(トゥート)
function dmListParse(obj, mix, acct_id, tlid, popup, mutefilter) { function dmListParse(obj, mix, acct_id, tlid, popup, mutefilter) {
var templete = ''; var templete = '';
if(obj[0]){ if (obj[0]) {
localStorage.setItem("lastunix_"+ tlid,date(obj[0].created_at, 'unix')); localStorage.setItem("lastunix_" + tlid, date(obj[0].created_at, 'unix'));
} }
var actb = localStorage.getItem("action_btns"); var actb = localStorage.getItem("action_btns");
var actb='re,rt,fav,qt,del,pin,red'; var actb = 're,rt,fav,qt,del,pin,red';
if(actb){ if (actb) {
var actb = actb.split(','); var actb = actb.split(',');
var disp={}; var disp = {};
for(var k=0;k<actb.length;k++){ for (var k = 0; k < actb.length; k++) {
if(k<4){ if (k < 4) {
var tp="type-a"; var tp = "type-a";
}else{ } else {
var tp="type-b"; var tp = "type-b";
} }
disp[actb[k]]=tp; disp[actb[k]] = tp;
} }
} }
var datetype = localStorage.getItem("datetype"); var datetype = localStorage.getItem("datetype");
@ -84,52 +84,52 @@ function dmListParse(obj, mix, acct_id, tlid, popup, mutefilter) {
var imh = localStorage.getItem("img-height"); var imh = localStorage.getItem("img-height");
//独自ロケール //独自ロケール
var locale = localStorage.getItem("locale"); var locale = localStorage.getItem("locale");
if(locale=="yes"){ if (locale == "yes") {
var locale=false; var locale = false;
} }
//ネイティブ通知 //ネイティブ通知
var native=localStorage.getItem("nativenotf"); var native = localStorage.getItem("nativenotf");
if(!native){ if (!native) {
native="yes"; native = "yes";
} }
//クライアント強調 //クライアント強調
var emp = localStorage.getItem("client_emp"); var emp = localStorage.getItem("client_emp");
if(emp){ if (emp) {
var emp = JSON.parse(emp); var emp = JSON.parse(emp);
} }
//クライアントミュート //クライアントミュート
var mute = localStorage.getItem("client_mute"); var mute = localStorage.getItem("client_mute");
if(mute){ if (mute) {
var mute = JSON.parse(mute); var mute = JSON.parse(mute);
} }
//ユーザー強調 //ユーザー強調
var useremp = localStorage.getItem("user_emp"); var useremp = localStorage.getItem("user_emp");
if(useremp){ if (useremp) {
var useremp = JSON.parse(useremp); var useremp = JSON.parse(useremp);
} }
//ワード強調 //ワード強調
var wordemp = localStorage.getItem("word_emp"); var wordemp = localStorage.getItem("word_emp");
if(wordemp){ if (wordemp) {
var wordemp = JSON.parse(wordemp); var wordemp = JSON.parse(wordemp);
} }
//ワードミュート //ワードミュート
var wordmute = localStorage.getItem("word_mute"); var wordmute = localStorage.getItem("word_mute");
if(wordmute){ if (wordmute) {
var wordmute = JSON.parse(wordmute); var wordmute = JSON.parse(wordmute);
wordmute = wordmute.concat(mutefilter); wordmute = wordmute.concat(mutefilter);
}else{ } else {
wordmute = mutefilter; wordmute = mutefilter;
} }
//Ticker //Ticker
var tickerck = localStorage.getItem("ticker_ok"); var tickerck = localStorage.getItem("ticker_ok");
if(tickerck){ if (tickerck) {
var ticker=true; var ticker = true;
}else{ } else {
var ticker=false; var ticker = false;
} }
//Cards //Cards
var card = localStorage.getItem("card_" + tlid); var card = localStorage.getItem("card_" + tlid);
if (!sent) { if (!sent) {
var sent = 500; var sent = 500;
} }
@ -156,91 +156,91 @@ function dmListParse(obj, mix, acct_id, tlid, popup, mutefilter) {
if (!imh) { if (!imh) {
var imh = "200"; var imh = "200";
} }
if(!emp){ if (!emp) {
var emp=[]; var emp = [];
} }
if(!mute){ if (!mute) {
var mute=[]; var mute = [];
} }
if(!useremp){ if (!useremp) {
var useremp=[]; var useremp = [];
} }
if(!wordemp){ if (!wordemp) {
var wordemp=[]; var wordemp = [];
} }
if(!wordmute){ if (!wordmute) {
var wordmute=[]; var wordmute = [];
} }
//via通知 //via通知
var viashow=localStorage.getItem("viashow"); var viashow = localStorage.getItem("viashow");
if(!viashow){ if (!viashow) {
viashow="via-hide"; viashow = "via-hide";
} }
if(viashow=="hide"){ if (viashow == "hide") {
viashow="via-hide"; viashow = "via-hide";
} }
//認証なしTL //認証なしTL
if(mix=="noauth"){ if (mix == "noauth") {
var noauth="hide"; var noauth = "hide";
var antinoauth=""; var antinoauth = "";
}else{ } else {
var noauth=""; var noauth = "";
var antinoauth="hide"; var antinoauth = "hide";
} }
//マウスオーバーのみ //マウスオーバーのみ
var mouseover=localStorage.getItem("mouseover"); var mouseover = localStorage.getItem("mouseover");
if(!mouseover){ if (!mouseover) {
mouseover=""; mouseover = "";
}else if(mouseover=="yes" || mouseover=="click"){ } else if (mouseover == "yes" || mouseover == "click") {
mouseover="hide"; mouseover = "hide";
}else if(mouseover=="no"){ } else if (mouseover == "no") {
mouseover=""; mouseover = "";
} }
var local = []; var local = [];
var times=[]; var times = [];
Object.keys(obj).forEach(function(key) { Object.keys(obj).forEach(function (key) {
var conv_id=obj[key].id; var conv_id = obj[key].id;
var toot = obj[key].last_status; var toot = obj[key].last_status;
var dis_name=escapeHTML(toot.account.display_name); var dis_name = escapeHTML(toot.account.display_name);
if(toot.account.emojis){ if (toot.account.emojis) {
var actemojick = toot.account.emojis[0]; var actemojick = toot.account.emojis[0];
}else{ } else {
var actemojick=false; var actemojick = false;
} }
//絵文字があれば //絵文字があれば
if (actemojick) { if (actemojick) {
Object.keys(toot.account.emojis).forEach(function(key5) { Object.keys(toot.account.emojis).forEach(function (key5) {
var emoji = toot.account.emojis[key5]; var emoji = toot.account.emojis[key5];
var shortcode = emoji.shortcode; var shortcode = emoji.shortcode;
var emoji_url = '<img src="' + emoji.url + var emoji_url = '<img src="' + emoji.url +
'" class="emoji-img" data-emoji="'+shortcode+'" alt=" :'+shortcode+': ">'; '" class="emoji-img" data-emoji="' + shortcode + '" alt=" :' + shortcode + ': ">';
var regExp = new RegExp(":" + shortcode + ":", "g"); var regExp = new RegExp(":" + shortcode + ":", "g");
dis_name = dis_name.replace(regExp, emoji_url); dis_name = dis_name.replace(regExp, emoji_url);
}); });
} }
var noticeavatar=""; var noticeavatar = "";
var if_notf=""; var if_notf = "";
var uniqueid=toot.id; var uniqueid = toot.id;
var notice = ""; var notice = "";
var boostback = ""; var boostback = "";
//ユーザー強調 //ユーザー強調
if(toot.account.username!=toot.account.acct){ if (toot.account.username != toot.account.acct) {
var fullname=toot.account.acct; var fullname = toot.account.acct;
}else{ } else {
var domain = localStorage.getItem("domain_" + acct_id); var domain = localStorage.getItem("domain_" + acct_id);
var fullname=toot.account.acct+"@"+domain; var fullname = toot.account.acct + "@" + domain;
} }
if(useremp){ if (useremp) {
Object.keys(useremp).forEach(function(key10) { Object.keys(useremp).forEach(function (key10) {
var user = useremp[key10]; var user = useremp[key10];
if(user==fullname){ if (user == fullname) {
boostback = "emphasized"; boostback = "emphasized";
} }
}); });
} }
var id = toot.id; var id = toot.id;
var home = ""; var home = "";
if (toot.account.locked) { if (toot.account.locked) {
var locked = ' <i class="fas fa-lock red-text"></i>'; var locked = ' <i class="fas fa-lock red-text"></i>';
} else { } else {
@ -248,25 +248,25 @@ function dmListParse(obj, mix, acct_id, tlid, popup, mutefilter) {
} }
if (!toot.application) { if (!toot.application) {
var via = ''; var via = '';
viashow="hide"; viashow = "hide";
} else { } else {
var via = escapeHTML(toot.application.name); var via = escapeHTML(toot.application.name);
//強調チェック //強調チェック
Object.keys(emp).forEach(function(key6) { Object.keys(emp).forEach(function (key6) {
var cli = emp[key6]; var cli = emp[key6];
if(cli == via){ if (cli == via) {
boostback = "emphasized"; boostback = "emphasized";
} }
}); });
//ミュートチェック //ミュートチェック
Object.keys(mute).forEach(function(key7) { Object.keys(mute).forEach(function (key7) {
var cli = mute[key7]; var cli = mute[key7];
if(cli == via){ if (cli == via) {
boostback = "hide"; boostback = "hide";
} }
}); });
} }
if(mix=="pinned"){ if (mix == "pinned") {
boostback = "emphasized"; boostback = "emphasized";
} }
if (toot.spoiler_text && cw) { if (toot.spoiler_text && cw) {
@ -275,19 +275,19 @@ function dmListParse(obj, mix, acct_id, tlid, popup, mutefilter) {
var spoiler = "cw cw_hide_" + toot.id; var spoiler = "cw cw_hide_" + toot.id;
var api_spoil = "gray"; var api_spoil = "gray";
var spoiler_show = '<a href="#" onclick="cw_show(\'' + toot.id + var spoiler_show = '<a href="#" onclick="cw_show(\'' + toot.id +
'\')" class="nex parsed">'+lang.lang_parse_cwshow+'</a><br>'; '\')" class="nex parsed">' + lang.lang_parse_cwshow + '</a><br>';
} else { } else {
var ct1 = toot.content.split('</p>').length + toot.content.split('<br />').length -2; var ct1 = toot.content.split('</p>').length + toot.content.split('<br />').length - 2;
var ct2 = toot.content.split('</p>').length + toot.content.split('<br>').length -2; var ct2 = toot.content.split('</p>').length + toot.content.split('<br>').length - 2;
if(ct1>ct2){ var ct= ct1; }else{ var ct= ct2; } if (ct1 > ct2) { var ct = ct1; } else { var ct = ct2; }
if ((sent < ct && $.mb_strlen($.strip_tags(toot.content)) > 5) || ($.strip_tags(toot.content).length > ltr && $.mb_strlen($.strip_tags(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">'+lang.lang_parse_fulltext+'</span><br>' + toot.content var content = '<span class="gray">' + lang.lang_parse_fulltext + '</span><br>' + toot.content
var spoil = '<span class="cw-long-' + toot.id + '">' + $.mb_substr($.strip_tags( var spoil = '<span class="cw-long-' + toot.id + '">' + $.mb_substr($.strip_tags(
toot.content), 0, 100) + toot.content), 0, 100) +
'</span><span class="gray">'+lang.lang_parse_autofold+'</span>'; '</span><span class="gray">' + lang.lang_parse_autofold + '</span>';
var spoiler = "cw cw_hide_" + toot.id; var spoiler = "cw cw_hide_" + toot.id;
var spoiler_show = '<a href="#" onclick="cw_show(\'' + toot.id + var spoiler_show = '<a href="#" onclick="cw_show(\'' + toot.id +
'\')" class="nex parsed">'+lang.lang_parse_more+'</a><br>'; '\')" class="nex parsed">' + lang.lang_parse_more + '</a><br>';
} else { } else {
var content = toot.content; var content = toot.content;
var spoil = escapeHTML(toot.spoiler_text); var spoil = escapeHTML(toot.spoiler_text);
@ -300,66 +300,66 @@ function dmListParse(obj, mix, acct_id, tlid, popup, mutefilter) {
); );
if (urls) { if (urls) {
var analyze = '<a onclick="additionalIndv(\'' + tlid + '\',' + acct_id + var analyze = '<a onclick="additionalIndv(\'' + tlid + '\',' + acct_id +
',\'' + id + '\')" class="add-show pointer">'+lang.lang_parse_url+'</a><br>'; ',\'' + id + '\')" class="add-show pointer">' + lang.lang_parse_url + '</a><br>';
} else { } else {
var analyze = ''; var analyze = '';
} }
var viewer = ""; var viewer = "";
var hasmedia = ""; var hasmedia = "";
var youtube = ""; var youtube = "";
if(toot.emojis){ if (toot.emojis) {
var emojick = toot.emojis[0]; var emojick = toot.emojis[0];
}else{ } else {
var emojick=false; var emojick = false;
} }
//絵文字があれば //絵文字があれば
if (emojick) { if (emojick) {
Object.keys(toot.emojis).forEach(function(key5) { Object.keys(toot.emojis).forEach(function (key5) {
var emoji = toot.emojis[key5]; var emoji = toot.emojis[key5];
var shortcode = emoji.shortcode; var shortcode = emoji.shortcode;
var emoji_url = '<img src="' + emoji.url + var emoji_url = '<img src="' + emoji.url +
'" class="emoji-img" data-emoji="'+shortcode+'" alt=" :'+shortcode+': ">'; '" class="emoji-img" data-emoji="' + shortcode + '" alt=" :' + shortcode + ': ">';
var regExp = new RegExp(":" + shortcode + ":", "g"); var regExp = new RegExp(":" + shortcode + ":", "g");
content = content.replace(regExp, emoji_url); content = content.replace(regExp, emoji_url);
spoil = spoil.replace(regExp, emoji_url); spoil = spoil.replace(regExp, emoji_url);
}); });
} }
//ニコフレ絵文字 //ニコフレ絵文字
if(toot.profile_emojis){ if (toot.profile_emojis) {
var nicoemojick = toot.profile_emojis[0]; var nicoemojick = toot.profile_emojis[0];
}else{ } else {
var nicoemojick=false; var nicoemojick = false;
} }
//絵文字があれば //絵文字があれば
if (nicoemojick) { if (nicoemojick) {
Object.keys(toot.profile_emojis).forEach(function(keynico) { Object.keys(toot.profile_emojis).forEach(function (keynico) {
var emoji = toot.profile_emojis[keynico]; var emoji = toot.profile_emojis[keynico];
var shortcode = emoji.shortcode; var shortcode = emoji.shortcode;
var emoji_url = '<img src="' + emoji.url + var emoji_url = '<img src="' + emoji.url +
'" class="emoji-img" data-emoji="'+shortcode+'" alt=" :'+shortcode+': ">'; '" class="emoji-img" data-emoji="' + shortcode + '" alt=" :' + shortcode + ': ">';
var regExp = new RegExp(":" + shortcode + ":", "g"); var regExp = new RegExp(":" + shortcode + ":", "g");
content = content.replace(regExp, emoji_url); content = content.replace(regExp, emoji_url);
spoil = spoil.replace(regExp, emoji_url); spoil = spoil.replace(regExp, emoji_url);
}); });
} }
//デフォ絵文字 //デフォ絵文字
content=twemoji.parse(content); content = twemoji.parse(content);
if(dis_name){ if (dis_name) {
dis_name=twemoji.parse(dis_name); dis_name = twemoji.parse(dis_name);
} }
if(spoil){ if (spoil) {
spoil=twemoji.parse(spoil); spoil = twemoji.parse(spoil);
} }
var mediack = toot.media_attachments[0]; var mediack = toot.media_attachments[0];
//メディアがあれば //メディアがあれば
var media_ids=""; var media_ids = "";
if (mediack) { if (mediack) {
hasmedia = "hasmedia"; hasmedia = "hasmedia";
var cwdt = 100 / toot.media_attachments.length; var cwdt = 100 / toot.media_attachments.length;
Object.keys(toot.media_attachments).forEach(function(key2) { Object.keys(toot.media_attachments).forEach(function (key2) {
var media = toot.media_attachments[key2]; var media = toot.media_attachments[key2];
var purl = media.preview_url; var purl = media.preview_url;
media_ids=media_ids+media.id+","; media_ids = media_ids + media.id + ",";
var url = media.url; var url = media.url;
if (toot.sensitive && nsfw) { if (toot.sensitive && nsfw) {
var sense = "sensitive" var sense = "sensitive"
@ -370,9 +370,9 @@ function dmListParse(obj, mix, acct_id, tlid, popup, mutefilter) {
acct_id + '\')" id="' + id + '-image-' + key2 + '" data-url="' + url + acct_id + '\')" id="' + id + '-image-' + key2 + '" data-url="' + url +
'" data-type="' + media.type + '" class="img-parsed"><img src="' + '" data-type="' + media.type + '" class="img-parsed"><img src="' +
purl + '" class="' + sense + purl + '" class="' + sense +
' toot-img pointer" style="width:' + cwdt + '%; height:'+imh+'px;"></a></span>'; ' toot-img pointer" style="width:' + cwdt + '%; height:' + imh + 'px;"></a></span>';
}); });
media_ids = media_ids.slice(0, -1) ; media_ids = media_ids.slice(0, -1);
} else { } else {
viewer = ""; viewer = "";
hasmedia = "nomedia"; hasmedia = "nomedia";
@ -382,7 +382,7 @@ function dmListParse(obj, mix, acct_id, tlid, popup, mutefilter) {
//メンションであれば //メンションであれば
if (menck) { if (menck) {
mentions = ""; mentions = "";
Object.keys(toot.mentions).forEach(function(key3) { Object.keys(toot.mentions).forEach(function (key3) {
var mention = toot.mentions[key3]; var mention = toot.mentions[key3];
mentions = mentions + '<a onclick="udg(\'' + mention.id + '\',' + mentions = mentions + '<a onclick="udg(\'' + mention.id + '\',' +
acct_id + ')" class="pointer">@' + mention.acct + '</a> '; acct_id + ')" class="pointer">@' + mention.acct + '</a> ';
@ -393,11 +393,11 @@ function dmListParse(obj, mix, acct_id, tlid, popup, mutefilter) {
var tags = ""; var tags = "";
//タグであれば //タグであれば
if (tagck) { if (tagck) {
Object.keys(toot.tags).forEach(function(key4) { Object.keys(toot.tags).forEach(function (key4) {
var tag = toot.tags[key4]; var tag = toot.tags[key4];
tags = tags + '<span class="hide" data-tag="' + tag.name + '">#' + tag.name + ':<a onclick="tl(\'tag\',\'' + tag.name + '\',' + acct_id + tags = tags + '<span class="hide" data-tag="' + tag.name + '">#' + tag.name + ':<a onclick="tl(\'tag\',\'' + tag.name + '\',' + acct_id +
',\'add\')" class="pointer" title="' +lang.lang_parse_tagTL.replace("{{tag}}" ,'#'+tag.name)+ '">TL</a> <a onclick="brInsert(\'#' + tag.name + '\')" class="pointer" title="' + lang.lang_parse_tagtoot.replace("{{tag}}" ,'#'+tag.name) + '">Toot</a> '+ ',\'add\')" class="pointer" title="' + lang.lang_parse_tagTL.replace("{{tag}}", '#' + tag.name) + '">TL</a> <a onclick="brInsert(\'#' + tag.name + '\')" class="pointer" title="' + lang.lang_parse_tagtoot.replace("{{tag}}", '#' + tag.name) + '">Toot</a> ' +
'<a onclick="tagPin(\'' + tag.name + '\')" class="pointer" title="' +lang.lang_parse_tagpin.replace("{{tag}}" ,'#'+tag.name)+ '">Pin</a></span> '; '<a onclick="tagPin(\'' + tag.name + '\')" class="pointer" title="' + lang.lang_parse_tagpin.replace("{{tag}}", '#' + tag.name) + '">Pin</a></span> ';
}); });
tags = '<div style="float:right">' + tags + '</div>'; tags = '<div style="float:right">' + tags + '</div>';
} }
@ -408,38 +408,38 @@ function dmListParse(obj, mix, acct_id, tlid, popup, mutefilter) {
var avatar = toot.account.avatar_static; var avatar = toot.account.avatar_static;
} }
//ワードミュート //ワードミュート
if(wordmute){ if (wordmute) {
Object.keys(wordmute).forEach(function(key8) { Object.keys(wordmute).forEach(function (key8) {
var worde = wordmute[key8]; var worde = wordmute[key8];
if(worde){ if (worde) {
if(worde.tag){ if (worde.tag) {
var word=worde.tag; var word = worde.tag;
}else{ } else {
var word=worde var word = worde
} }
var regExp = new RegExp( word, "g" ) ; var regExp = new RegExp(word, "g");
if($.strip_tags(content).match(regExp)){ if ($.strip_tags(content).match(regExp)) {
boostback = "hide by_filter"; boostback = "hide by_filter";
} }
} }
}); });
} }
//ワード強調 //ワード強調
if(wordemp){ if (wordemp) {
Object.keys(wordemp).forEach(function(key9) { Object.keys(wordemp).forEach(function (key9) {
var word = wordemp[key9]; var word = wordemp[key9];
if(word){ if (word) {
var word=word.tag; var word = word.tag;
var regExp = new RegExp( word, "g" ) ; var regExp = new RegExp(word, "g");
content=content.replace(regExp,'<span class="emp">'+escapeHTML(word)+"</span>"); content = content.replace(regExp, '<span class="emp">' + escapeHTML(word) + "</span>");
} }
}); });
} }
//日本語じゃない //日本語じゃない
if(toot.language!="ja"){ if (toot.language != "ja") {
var trans='<div class="action pin"><a onclick="trans(\''+toot.language+'\')" class="waves-effect waves-dark btn-flat" style="padding:0" title="'+lang.lang_parse_trans+'"><i class="material-icons">g_translate</i></a></div>'; var trans = '<div class="action pin"><a onclick="trans(\'' + toot.language + '\')" class="waves-effect waves-dark btn-flat" style="padding:0" title="' + lang.lang_parse_trans + '"><i class="material-icons">g_translate</i></a></div>';
}else{ } else {
var trans=""; var trans = "";
} }
if (toot.favourited) { if (toot.favourited) {
var if_fav = " yellow-text"; var if_fav = " yellow-text";
@ -450,72 +450,72 @@ function dmListParse(obj, mix, acct_id, tlid, popup, mutefilter) {
} }
//Cards //Cards
if (!card && toot.card) { if (!card && toot.card) {
var cards=toot.card; var cards = toot.card;
if (cards.provider_name=="Twitter"){ if (cards.provider_name == "Twitter") {
if(cards.image){ if (cards.image) {
var twiImg='<br><img src="'+cards.image+'">'; var twiImg = '<br><img src="' + cards.image + '">';
}else{ } else {
var twiImg=''; var twiImg = '';
}
analyze='<blockquote class="twitter-tweet"><b>'+escapeHTML(cards.author_name)+'</b><br>'+escapeHTML(cards.description)+twiImg+'</blockquote>';
} }
if (cards.title) { analyze = '<blockquote class="twitter-tweet"><b>' + escapeHTML(cards.author_name) + '</b><br>' + escapeHTML(cards.description) + twiImg + '</blockquote>';
analyze="<span class=\"gray\">URL"+lang.lang_cards_check+":<br>Title:" + escapeHTML(cards.title) + "<br>" + }
escapeHTML(cards.description) + "</span>"; if (cards.title) {
} analyze = "<span class=\"gray\">URL" + lang.lang_cards_check + ":<br>Title:" + escapeHTML(cards.title) + "<br>" +
if (cards.html) { escapeHTML(cards.description) + "</span>";
analyze=cards.html+'<i class="material-icons" onclick="pip('+id+')" title="'+lang.lang_cards_pip+'">picture_in_picture_alt</i>'; }
} if (cards.html) {
analyze = cards.html + '<i class="material-icons" onclick="pip(' + id + ')" title="' + lang.lang_cards_pip + '">picture_in_picture_alt</i>';
}
} }
//Ticker //Ticker
var tickerdom=""; var tickerdom = "";
if(ticker){ if (ticker) {
var tickerdata=localStorage.getItem("ticker") var tickerdata = localStorage.getItem("ticker")
if(tickerdata){ if (tickerdata) {
var tickerdata=JSON.parse(tickerdata); var tickerdata = JSON.parse(tickerdata);
var thisdomain=toot.account.acct.split("@"); var thisdomain = toot.account.acct.split("@");
if(thisdomain.length>1){ if (thisdomain.length > 1) {
thisdomain=thisdomain[1]; thisdomain = thisdomain[1];
}
for( var i=0; i<tickerdata.length; i++) {
var value=tickerdata[i];
if(value.domain==thisdomain){
var tickerdom='<div style="background:linear-gradient(to left,transparent, '+value.bg+' 96%) !important; color:'+value.text+';width:100%; height:0.9rem; font-size:0.8rem;"><img src="'+value.image+'" style="height:100%;"><span style="position:relative; top:-0.2rem;"> '+escapeHTML(value.name)+'</span></div>';
break;
} }
} for (var i = 0; i < tickerdata.length; i++) {
} var value = tickerdata[i];
if (value.domain == thisdomain) {
var tickerdom = '<div style="background:linear-gradient(to left,transparent, ' + value.bg + ' 96%) !important; color:' + value.text + ';width:100%; height:0.9rem; font-size:0.8rem;"><img src="' + value.image + '" style="height:100%;"><span style="position:relative; top:-0.2rem;"> ' + escapeHTML(value.name) + '</span></div>';
break;
}
}
}
} }
templete = templete + '<div id="pub_' + toot.id + '" class="cvo ' + templete = templete + '<div id="pub_' + toot.id + '" class="cvo ' +
boostback + ' ' + fav_app + boostback + ' ' + fav_app +
' ' + hasmedia + '" toot-id="' + id + '" unique-id="' + uniqueid + '" data-medias="'+media_ids+' " unixtime="' + date(obj[ ' ' + hasmedia + '" toot-id="' + id + '" unique-id="' + uniqueid + '" data-medias="' + media_ids + ' " unixtime="' + date(obj[
key].created_at, 'unix') + '" '+if_notf+' onclick="dmStatus()">' + key].created_at, 'unix') + '" ' + if_notf + ' onclick="dmStatus()">' +
'<div class="area-notice"><span class="gray sharesta">' + notice + home + '<div class="area-notice"><span class="gray sharesta">' + notice + home +
'</span></div>' + '</span></div>' +
'<div class="area-icon"><a onclick="udg(\'' + toot.account.id + '<div class="area-icon"><a onclick="udg(\'' + toot.account.id +
'\',' + acct_id + ');" user="' + toot.account.acct + '" class="udg">' + '\',' + acct_id + ');" user="' + toot.account.acct + '" class="udg">' +
'<img src="' + avatar + '<img src="' + avatar +
'" width="40" class="prof-img" user="' + toot.account.acct + '" width="40" class="prof-img" user="' + toot.account.acct +
'"></a>'+noticeavatar+'</div>' + '"></a>' + noticeavatar + '</div>' +
'<div class="area-display_name"><div class="flex-name"><span class="user">' + '<div class="area-display_name"><div class="flex-name"><span class="user">' +
dis_name + dis_name +
'</span><span class="sml gray" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis; cursor:text;"> @' + '</span><span class="sml gray" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis; cursor:text;"> @' +
toot.account.acct + locked + '</span></div>' + toot.account.acct + locked + '</span></div>' +
'<div class="flex-time"><span class="cbadge cbadge-hover pointer waves-effect" onclick="tootUriCopy(\'' + '<div class="flex-time"><span class="cbadge cbadge-hover pointer waves-effect" onclick="tootUriCopy(\'' +
toot.url + '\');" title="' + date(toot.created_at, 'absolute') + toot.url + '\');" title="' + date(toot.created_at, 'absolute') +
'('+lang.lang_parse_clickcopyurl+')"><i class="far fa-clock-o"></i>' + '(' + lang.lang_parse_clickcopyurl + ')"><i class="far fa-clock-o"></i>' +
date(toot.created_at, datetype) + '</span>' + date(toot.created_at, datetype) + '</span>' +
'</div></div>' + '</div></div>' +
'<div class="area-toot">'+tickerdom+'<span class="' + '<div class="area-toot">' + tickerdom + '<span class="' +
api_spoil + ' cw_text_' + toot.id + '"><span class="cw_text">' + spoil + "</span>" + spoiler_show + api_spoil + ' cw_text_' + toot.id + '"><span class="cw_text">' + spoil + "</span>" + spoiler_show +
'</span><span class="toot ' + spoiler + '">' + content + '</span><span class="toot ' + spoiler + '">' + content +
'</span>' + '</span>' +
'' + viewer + '' + '' + viewer + '' +
'<br><a onclick="details(\'' + toot.id + '\',' + acct_id + '<br><a onclick="details(\'' + toot.id + '\',' + acct_id +
',\''+tlid+'\',\'dm\')" class="pointer waves-effect">'+lang.lang_parse_thread+'</a></div>'+ ',\'' + tlid + '\',\'dm\')" class="pointer waves-effect">' + lang.lang_parse_thread + '</a></div>' +
'<div class="area-vis"></div>'+ '<div class="area-vis"></div>' +
'</div></div>'; '</div></div>';
}); });
return templete; return templete;

View File

@ -3,38 +3,38 @@
function mediaToggle(tlid) { function mediaToggle(tlid) {
var media = localStorage.getItem("media_" + tlid); var media = localStorage.getItem("media_" + tlid);
if (media) { if (media) {
localStorage.removeItem("media_" + tlid); localStorage.removeItem("media_" + tlid);
$("#sta-media-" + tlid).text("Off"); $("#sta-media-" + tlid).text("Off");
$("#sta-media-" + tlid).css("color",'red'); $("#sta-media-" + tlid).css("color", 'red');
$("#timeline_"+tlid).removeClass("media-filter") $("#timeline_" + tlid).removeClass("media-filter")
} else { } else {
localStorage.setItem("media_" + tlid, "true"); localStorage.setItem("media_" + tlid, "true");
$("#sta-media-" + tlid).text("On"); $("#sta-media-" + tlid).text("On");
$("#sta-media-" + tlid).css("color",'#009688'); $("#sta-media-" + tlid).css("color", '#009688');
$("#timeline_"+tlid).addClass("media-filter") $("#timeline_" + tlid).addClass("media-filter")
} }
} }
//各TL上方のBT[BTOnly/BTExc/Off] //各TL上方のBT[BTOnly/BTExc/Off]
function ebtToggle(tlid) { function ebtToggle(tlid) {
var ebt = localStorage.getItem("ebt_" + tlid); var ebt = localStorage.getItem("ebt_" + tlid);
if (ebt=="true") { if (ebt == "true") {
localStorage.setItem("ebt_" + tlid, "but"); localStorage.setItem("ebt_" + tlid, "but");
$("#sta-bt-" + tlid).text("BT Only"); $("#sta-bt-" + tlid).text("BT Only");
$("#sta-bt-" + tlid).css("color",'#ff9800'); $("#sta-bt-" + tlid).css("color", '#ff9800');
$("#timeline_"+tlid).addClass("except-bt-filter") $("#timeline_" + tlid).addClass("except-bt-filter")
$("#timeline_"+tlid).removeClass("bt-filter") $("#timeline_" + tlid).removeClass("bt-filter")
}else if (ebt=="but") { } else if (ebt == "but") {
localStorage.removeItem("ebt_" + tlid); localStorage.removeItem("ebt_" + tlid);
$("#sta-bt-" + tlid).text("Off"); $("#sta-bt-" + tlid).text("Off");
$("#sta-bt-" + tlid).css("color",'red'); $("#sta-bt-" + tlid).css("color", 'red');
$("#timeline_"+tlid).removeClass("bt-filter") $("#timeline_" + tlid).removeClass("bt-filter")
$("#timeline_"+tlid).removeClass("except-bt-filter") $("#timeline_" + tlid).removeClass("except-bt-filter")
} else { } else {
localStorage.setItem("ebt_" + tlid, "true"); localStorage.setItem("ebt_" + tlid, "true");
$("#sta-bt-" + tlid).text("BT Ex"); $("#sta-bt-" + tlid).text("BT Ex");
$("#sta-bt-" + tlid).css("color",'#009688'); $("#sta-bt-" + tlid).css("color", '#009688');
$("#timeline_"+tlid).addClass("bt-filter") $("#timeline_" + tlid).addClass("bt-filter")
$("#timeline_"+tlid).removeClass("except-bt-filter") $("#timeline_" + tlid).removeClass("except-bt-filter")
} }
} }
//各TL上方のMedia[On/Off]をチェック //各TL上方のMedia[On/Off]をチェック
@ -42,46 +42,46 @@ function mediaCheck(tlid) {
var media = localStorage.getItem("media_" + tlid); var media = localStorage.getItem("media_" + tlid);
if (media) { if (media) {
$("#sta-media-" + tlid).text("On"); $("#sta-media-" + tlid).text("On");
$("#sta-media-" + tlid).css("color",'#009688'); $("#sta-media-" + tlid).css("color", '#009688');
$("#timeline_"+tlid).addClass("media-filter") $("#timeline_" + tlid).addClass("media-filter")
} else { } else {
$("#sta-media-" + tlid).text("Off"); $("#sta-media-" + tlid).text("Off");
$("#sta-media-" + tlid).css("color",'red'); $("#sta-media-" + tlid).css("color", 'red');
$("#timeline_"+tlid).removeClass("media-filter") $("#timeline_" + tlid).removeClass("media-filter")
} }
} }
//各TL上方のBT[On/Off]をチェック //各TL上方のBT[On/Off]をチェック
function ebtCheck(tlid) { function ebtCheck(tlid) {
var ebt = localStorage.getItem("ebt_" + tlid); var ebt = localStorage.getItem("ebt_" + tlid);
if (ebt=="true") { if (ebt == "true") {
$("#sta-bt-" + tlid).text("BT Ex"); $("#sta-bt-" + tlid).text("BT Ex");
$("#sta-bt-" + tlid).css("color",'#009688'); $("#sta-bt-" + tlid).css("color", '#009688');
$("#timeline_"+tlid).addClass("bt-filter") $("#timeline_" + tlid).addClass("bt-filter")
$("#timeline_"+tlid).removeClass("except-bt-filter") $("#timeline_" + tlid).removeClass("except-bt-filter")
} else if (ebt=="but") { } else if (ebt == "but") {
$("#sta-bt-" + tlid).text("BT Only"); $("#sta-bt-" + tlid).text("BT Only");
$("#sta-bt-" + tlid).css("color",'#ff9800'); $("#sta-bt-" + tlid).css("color", '#ff9800');
$("#timeline_"+tlid).addClass("except-bt-filter") $("#timeline_" + tlid).addClass("except-bt-filter")
$("#timeline_"+tlid).removeClass("bt-filter") $("#timeline_" + tlid).removeClass("bt-filter")
} else{ } else {
$("#sta-bt-" + tlid).text("Off"); $("#sta-bt-" + tlid).text("Off");
$("#sta-bt-" + tlid).css("color",'red'); $("#sta-bt-" + tlid).css("color", 'red');
$("#timeline_"+tlid).removeClass("bt-filter") $("#timeline_" + tlid).removeClass("bt-filter")
$("#timeline_"+tlid).removeClass("except-bt-filter") $("#timeline_" + tlid).removeClass("except-bt-filter")
} }
} }
/* 削除追跡*/ /* 削除追跡*/
function catchToggle(tlid) { function catchToggle(tlid) {
var catchck = localStorage.getItem("catch_" + tlid); var catchck = localStorage.getItem("catch_" + tlid);
if (catchck) { if (catchck) {
localStorage.removeItem("catch_" + tlid); localStorage.removeItem("catch_" + tlid);
$("#sta-del-" + tlid).text("Off"); $("#sta-del-" + tlid).text("Off");
$("#sta-del-" + tlid).css("color",'red'); $("#sta-del-" + tlid).css("color", 'red');
parseColumn(); parseColumn();
} else { } else {
localStorage.setItem("catch_" + tlid, "true"); localStorage.setItem("catch_" + tlid, "true");
$("#sta-del-" + tlid).text("On"); $("#sta-del-" + tlid).text("On");
$("#sta-del-" + tlid).css("color",'#009688'); $("#sta-del-" + tlid).css("color", '#009688');
parseColumn(); parseColumn();
} }
} }
@ -89,101 +89,101 @@ function catchCheck(tlid) {
var catchck = localStorage.getItem("catch_" + tlid); var catchck = localStorage.getItem("catch_" + tlid);
if (catchck) { if (catchck) {
$("#sta-del-" + tlid).text("On"); $("#sta-del-" + tlid).text("On");
$("#sta-del-" + tlid).css("color",'#009688'); $("#sta-del-" + tlid).css("color", '#009688');
} else { } else {
$("#sta-del-" + tlid).text("Off"); $("#sta-del-" + tlid).text("Off");
$("#sta-del-" + tlid).css("color",'red'); $("#sta-del-" + tlid).css("color", 'red');
} }
} }
function delreset(tlid){ function delreset(tlid) {
$("[tlid=" + tlid + "] .by_delcatch").hide(); $("[tlid=" + tlid + "] .by_delcatch").hide();
$("[tlid=" + tlid + "] .by_delcatch").remove(); $("[tlid=" + tlid + "] .by_delcatch").remove();
} }
/*ワードフィルター機能*/ /*ワードフィルター機能*/
function filterMenu(){ function filterMenu() {
$("#left-menu div").removeClass("active"); $("#left-menu div").removeClass("active");
$("#filterMenu").addClass("active"); $("#filterMenu").addClass("active");
$(".menu-content").addClass("hide"); $(".menu-content").addClass("hide");
$("#filter-box").removeClass("hide"); $("#filter-box").removeClass("hide");
} }
function filter(){ function filter() {
$("#filtered-words").html(""); $("#filtered-words").html("");
$("#filter-edit-id").val("") $("#filter-edit-id").val("")
var acct_id = $("#filter-acct-sel").val(); var acct_id = $("#filter-acct-sel").val();
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");
var start = "https://" + domain + "/api/v1/filters" var start = "https://" + domain + "/api/v1/filters"
fetch(start, { fetch(start, {
method: 'GET', method: 'GET',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
'Authorization': 'Bearer ' + at 'Authorization': 'Bearer ' + at
}, },
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
if (json) { if (json) {
var filters = ""; var filters = "";
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 + escapeHTML(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.lang_edit+'</a>/<a onclick="filterDel(' + filterword.id + ',' + acct_id + '\')" class="pointer">' + lang.lang_edit + '</a>/<a onclick="filterDel(' + filterword.id + ',' + acct_id +
')" class="pointer">'+lang.lang_del+'</a><br> '; ')" class="pointer">' + lang.lang_del + '</a><br> ';
}); });
if(filters==""){ if (filters == "") {
filters=lang.lang_filter_nodata+"<br>"; filters = lang.lang_filter_nodata + "<br>";
} }
$("#filtered-words").html(filters); $("#filtered-words").html(filters);
}else{ } else {
$("#filtered-words").html(lang_filter_nodata); $("#filtered-words").html(lang_filter_nodata);
} }
}); });
} }
function filterTime(day,hour,min){ function filterTime(day, hour, min) {
$("#days_filter").val(day) $("#days_filter").val(day)
$("#hours_filter").val(hour) $("#hours_filter").val(hour)
$("#mins_filter").val(min) $("#mins_filter").val(min)
} }
function makeNewFilter(){ function makeNewFilter() {
var acct_id = $("#filter-acct-sel").val(); var acct_id = $("#filter-acct-sel").val();
var phr=$("#filter-add-word").val(); var phr = $("#filter-add-word").val();
var cont=[]; var cont = [];
if($("#home_filter:checked").val()){ if ($("#home_filter:checked").val()) {
cont.push("home"); cont.push("home");
} }
if($("#local_filter:checked").val()){ if ($("#local_filter:checked").val()) {
cont.push("public"); cont.push("public");
} }
if($("#notf_filter:checked").val()){ if ($("#notf_filter:checked").val()) {
cont.push("notifications"); cont.push("notifications");
} }
if($("#conv_filter:checked").val()){ if ($("#conv_filter:checked").val()) {
cont.push("thread"); cont.push("thread");
} }
if(!cont.length){ if (!cont.length) {
$("#filtered-words").html('Error:'+lang.lang_filter_errordegree); $("#filtered-words").html('Error:' + lang.lang_filter_errordegree);
} }
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){ if (!who) {
who=false; 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");
if($("#filter-edit-id").val()){ if ($("#filter-edit-id").val()) {
var start = "https://" + domain + "/api/v1/filters/"+$("#filter-edit-id").val(); var start = "https://" + domain + "/api/v1/filters/" + $("#filter-edit-id").val();
var method="PUT" var method = "PUT"
}else{ } else {
var start = "https://" + domain + "/api/v1/filters" var start = "https://" + domain + "/api/v1/filters"
var method="POST" var method = "POST"
} }
var httpreq = new XMLHttpRequest(); var httpreq = new XMLHttpRequest();
httpreq.open(method, start, true); httpreq.open(method, start, true);
httpreq.setRequestHeader('Content-Type', 'application/json'); httpreq.setRequestHeader('Content-Type', 'application/json');
@ -193,21 +193,21 @@ function makeNewFilter(){
phrase: phr, phrase: phr,
context: cont, context: cont,
irreversible: exc, irreversible: exc,
whole_word:who, whole_word: who,
expires_in:time expires_in: time
})); }));
httpreq.onreadystatechange = function() { httpreq.onreadystatechange = function () {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
var json = httpreq.response; var json = httpreq.response;
filter(); filter();
filterUpdate(acct_id) filterUpdate(acct_id)
$("#filter-add-word").val(""); $("#filter-add-word").val("");
$("#home_filter").prop("checked",false); $("#home_filter").prop("checked", false);
$("#local_filter").prop("checked",false); $("#local_filter").prop("checked", false);
$("#notf_filter").prop("checked",false); $("#notf_filter").prop("checked", false);
$("#conv_filter").prop("checked",false); $("#conv_filter").prop("checked", false);
$("#except_filter").prop("checked",false); $("#except_filter").prop("checked", false);
$("#wholeword_filter").prop("checked",false); $("#wholeword_filter").prop("checked", false);
$("#days_filter").val("0"); $("#days_filter").val("0");
$("#hours_filter").val("0"); $("#hours_filter").val("0");
$("#mins_filter").val("0"); $("#mins_filter").val("0");
@ -216,70 +216,70 @@ function makeNewFilter(){
} }
} }
} }
function filterEdit(id,acct_id){ function filterEdit(id, acct_id) {
$("#filter-add-word").val(""); $("#filter-add-word").val("");
$("#home_filter").prop("checked",false); $("#home_filter").prop("checked", false);
$("#local_filter").prop("checked",false); $("#local_filter").prop("checked", false);
$("#notf_filter").prop("checked",false); $("#notf_filter").prop("checked", false);
$("#conv_filter").prop("checked",false); $("#conv_filter").prop("checked", false);
$("#except_filter").prop("checked",false); $("#except_filter").prop("checked", false);
$("#wholeword_filter").prop("checked",false); $("#wholeword_filter").prop("checked", false);
$("#days_filter").val("0"); $("#days_filter").val("0");
$("#hours_filter").val("0"); $("#hours_filter").val("0");
$("#mins_filter").val("0"); $("#mins_filter").val("0");
$("#add-filter-btn").text(lang.lang_edit); $("#add-filter-btn").text(lang.lang_edit);
$("#filter-edit-id").val(id); $("#filter-edit-id").val(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");
var start = "https://" + domain + "/api/v1/filters/"+id var start = "https://" + domain + "/api/v1/filters/" + id
fetch(start, { fetch(start, {
method: 'GET', method: 'GET',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
'Authorization': 'Bearer ' + at 'Authorization': 'Bearer ' + at
}, },
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
if (json) { if (json) {
var now = new Date() ; var now = new Date();
now = now.getTime() ; now = now.getTime();
var now = Math.floor(now / 1000 ) ; var now = Math.floor(now / 1000);
$("#filter-add-word").val(json.phrase); $("#filter-add-word").val(json.phrase);
Object.keys(json.context).forEach(function(key) { Object.keys(json.context).forEach(function (key) {
var context = json.context[key]; var context = json.context[key];
$("[value="+context+"]").prop("checked",true); $("[value=" + context + "]").prop("checked", true);
}); });
if(json.irreversible){ if (json.irreversible) {
$("#except_filter").prop("checked",true); $("#except_filter").prop("checked", true);
} }
if(json.whole_word){ if (json.whole_word) {
$("#wholeword_filter").prop("checked",true); $("#wholeword_filter").prop("checked", true);
} }
var expires=date(json.expires_at, 'unix')-now; var expires = date(json.expires_at, 'unix') - now;
var mins=Math.floor(expires/60)%60; var mins = Math.floor(expires / 60) % 60;
var hours=Math.floor(expires/3600)%24; var hours = Math.floor(expires / 3600) % 24;
var days=Math.floor(expires/3600/24); var days = Math.floor(expires / 3600 / 24);
$("#days_filter").val(days); $("#days_filter").val(days);
$("#hours_filter").val(hours); $("#hours_filter").val(hours);
$("#mins_filter").val(mins); $("#mins_filter").val(mins);
} }
}); });
} }
function filterDel(id,acct_id){ function filterDel(id, 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");
var start = "https://" + domain + "/api/v1/filters/"+id; var start = "https://" + domain + "/api/v1/filters/" + id;
var httpreq = new XMLHttpRequest(); var httpreq = new XMLHttpRequest();
httpreq.open("DELETE", start, true); httpreq.open("DELETE", start, true);
httpreq.setRequestHeader('Content-Type', 'application/json'); httpreq.setRequestHeader('Content-Type', 'application/json');
httpreq.setRequestHeader('Authorization', 'Bearer ' + at); httpreq.setRequestHeader('Authorization', 'Bearer ' + at);
httpreq.responseType = "json"; httpreq.responseType = "json";
httpreq.send(); httpreq.send();
httpreq.onreadystatechange = function() { httpreq.onreadystatechange = function () {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
var json = httpreq.response; var json = httpreq.response;
filter(); filter();
@ -287,96 +287,96 @@ 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"){ if (localStorage.getItem("mode_" + domain) != "misskey") {
var start = "https://" + domain + "/api/v1/filters" var start = "https://" + domain + "/api/v1/filters"
fetch(start, { fetch(start, {
method: 'GET', method: 'GET',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
'Authorization': 'Bearer ' + at 'Authorization': 'Bearer ' + at
}, },
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
localStorage.setItem("filter_"+ acct_id ,JSON.stringify(json)); localStorage.setItem("filter_" + acct_id, JSON.stringify(json));
}); });
}else{ } else {
localStorage.setItem("filter_"+ acct_id ,JSON.stringify({})); localStorage.setItem("filter_" + acct_id, JSON.stringify({}));
} }
} }
function getFilterType(json,type){ function getFilterType(json, type) {
if(!json){ if (!json) {
return []; return [];
} }
if(type=="local"){ if (type == "local") {
type="public"; type = "public";
}else if(type=="list"){ } else if (type == "list") {
type="home"; type = "home";
}else if(type=="notf"){ } else if (type == "notf") {
type="notifi"; type = "notifi";
} }
var mutedfilters=[]; var mutedfilters = [];
Object.keys(json).forEach(function(key) { Object.keys(json).forEach(function (key) {
var filterword = json[key]; var filterword = json[key];
var phrases = filterword.phrase; var phrases = filterword.phrase;
if(filterword.context.join(",").indexOf(type)!== -1){ if (filterword.context.join(",").indexOf(type) !== -1) {
mutedfilters.push(phrases); mutedfilters.push(phrases);
} }
}); });
return mutedfilters; return mutedfilters;
} }
function filterUpdate(acct_id){ function filterUpdate(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");
var start = "https://" + domain + "/api/v1/filters" var start = "https://" + domain + "/api/v1/filters"
fetch(start, { fetch(start, {
method: 'GET', method: 'GET',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
'Authorization': 'Bearer ' + at 'Authorization': 'Bearer ' + at
}, },
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
localStorage.setItem("filter_"+ acct_id ,JSON.stringify(json)); localStorage.setItem("filter_" + acct_id, JSON.stringify(json));
filterUpdateInternal(json,"home"); filterUpdateInternal(json, "home");
filterUpdateInternal(json,"local"); filterUpdateInternal(json, "local");
filterUpdateInternal(json,"notf"); filterUpdateInternal(json, "notf");
filterUpdateInternal(json,"pub"); filterUpdateInternal(json, "pub");
}); });
} }
function filterUpdateInternal(json,type){ function filterUpdateInternal(json, type) {
var home=getFilterType(json,type); var home = getFilterType(json, type);
var wordmute = localStorage.getItem("word_mute"); var wordmute = localStorage.getItem("word_mute");
if(wordmute){ if (wordmute) {
var wordmute = JSON.parse(wordmute); var wordmute = JSON.parse(wordmute);
home = home.concat(wordmute); home = home.concat(wordmute);
} }
if(home){ if (home) {
$("[data-acct="+acct_id+"] [data-type="+type+"] .cvo").each(function(i, elem) { $("[data-acct=" + acct_id + "] [data-type=" + type + "] .cvo").each(function (i, elem) {
var id=$(elem).attr("toot-id"); var id = $(elem).attr("toot-id");
$("[toot-id="+id+"]").removeClass("hide"); $("[toot-id=" + id + "]").removeClass("hide");
var text=$(elem).find('.toot').html(); var text = $(elem).find('.toot').html();
Object.keys(home).forEach(function(key8) { Object.keys(home).forEach(function (key8) {
var word = home[key8]; var word = home[key8];
var regExp = new RegExp( word, "g" ); var regExp = new RegExp(word, "g");
if($.strip_tags(text).match(regExp)){ if ($.strip_tags(text).match(regExp)) {
$("[toot-id="+id+"]").addClass("hide"); $("[toot-id=" + id + "]").addClass("hide");
} }
});
}); });
} });
}
} }
/* /*
<a onclick="catchToggle(' + key + <a onclick="catchToggle(' + key +
@ -385,63 +385,63 @@ function filterUpdateInternal(json,type){
')" class="pointer">リセット</a><br> ')" class="pointer">リセット</a><br>
*/ */
//通知フィルター //通知フィルター
function exclude(key){ function exclude(key) {
var excludetxt=""; var excludetxt = "";
if($('#exc-reply-'+key+':checked').val()){ if ($('#exc-reply-' + key + ':checked').val()) {
excludetxt="?exclude_types[]=mention" excludetxt = "?exclude_types[]=mention"
var reply=true var reply = true
}else{ } else {
var reply=false; var reply = false;
} }
if($('#exc-fav-'+key+':checked').val()){ if ($('#exc-fav-' + key + ':checked').val()) {
if(reply){ if (reply) {
excludetxt=excludetxt+"&exclude_types[]=favourite" excludetxt = excludetxt + "&exclude_types[]=favourite"
}else{ } else {
excludetxt="?exclude_types[]=favourite" excludetxt = "?exclude_types[]=favourite"
} }
var fav=true var fav = true
}else{ } else {
var fav=false; var fav = false;
} }
if($('#exc-bt-'+key+':checked').val()){ if ($('#exc-bt-' + key + ':checked').val()) {
if(reply || fav){ if (reply || fav) {
excludetxt=excludetxt+"&exclude_types[]=reblog" excludetxt = excludetxt + "&exclude_types[]=reblog"
}else{ } else {
excludetxt="?exclude_types[]=reblog" excludetxt = "?exclude_types[]=reblog"
} }
var bt=true var bt = true
}else{ } else {
var bt=false; var bt = false;
} }
if($('#exc-follow-'+key+':checked').val()){ if ($('#exc-follow-' + key + ':checked').val()) {
if(reply || bt || fav){ if (reply || bt || fav) {
excludetxt=excludetxt+"&exclude_types[]=follow" excludetxt = excludetxt + "&exclude_types[]=follow"
}else{ } else {
excludetxt="?exclude_types[]=follow" excludetxt = "?exclude_types[]=follow"
} }
var follow=true; var follow = true;
}else{ } else {
var follow=false; var follow = false;
} }
if($('#exc-poll-'+key+':checked').val()){ if ($('#exc-poll-' + key + ':checked').val()) {
if(reply || bt || fav || follow){ if (reply || bt || fav || follow) {
excludetxt=excludetxt+"&exclude_types[]=poll" excludetxt = excludetxt + "&exclude_types[]=poll"
}else{ } else {
excludetxt="?exclude_types[]=poll" excludetxt = "?exclude_types[]=poll"
} }
}else{ } else {
} }
localStorage.setItem("exclude-"+key,excludetxt) localStorage.setItem("exclude-" + key, excludetxt)
parseColumn(); parseColumn();
} }
function excludeCk(key,target){ function excludeCk(key, target) {
var exc=localStorage.getItem("exclude-"+key); var exc = localStorage.getItem("exclude-" + key);
if(!exc){ if (!exc) {
return ""; return "";
} }
if(~exc.indexOf(target)){ if (~exc.indexOf(target)) {
return "checked" return "checked"
}else{ } else {
return ""; return "";
} }
} }

View File

@ -1,44 +1,44 @@
function listMenu(){ function listMenu() {
$("#left-menu div").removeClass("active"); $("#left-menu div").removeClass("active");
$("#listMenu").addClass("active"); $("#listMenu").addClass("active");
$(".menu-content").addClass("hide"); $(".menu-content").addClass("hide");
$("#list-box").removeClass("hide"); $("#list-box").removeClass("hide");
$('ul.tabs').tabs('select_tab', 'src-sta'); $('ul.tabs').tabs('select_tab', 'src-sta');
$("#src-contents").html(""); $("#src-contents").html("");
} }
function list(){ function list() {
$("#lists-user").html(""); $("#lists-user").html("");
var acct_id = $("#list-acct-sel").val(); var acct_id = $("#list-acct-sel").val();
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"){ if (localStorage.getItem("mode_" + domain) == "misskey") {
var start = "https://" + domain + "/api/users/lists/list" var start = "https://" + domain + "/api/users/lists/list"
fetch(start, { fetch(start, {
method: 'POST', method: 'POST',
body: JSON.stringify({ body: JSON.stringify({
i:at i: at
}), }),
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
if (json) { if (json) {
var lists = ""; var lists = "";
Object.keys(json).forEach(function(key) { Object.keys(json).forEach(function (key) {
var list = json[key]; var list = json[key];
lists = lists + escapeHTML(list.title)+':<a onclick="listShow(\'' + list.id + '\',\'' + escapeHTML(list.title) + '\',\'' + acct_id + lists = lists + escapeHTML(list.title) + ':<a onclick="listShow(\'' + list.id + '\',\'' + escapeHTML(list.title) + '\',\'' + acct_id +
'\')" class="pointer">'+lang.lang_list_show+'</a><br>'; '\')" class="pointer">' + lang.lang_list_show + '</a><br>';
}); });
$("#lists").html(lists); $("#lists").html(lists);
}else{ } else {
$("#lists").html(lang.lang_list_nodata); $("#lists").html(lang.lang_list_nodata);
} }
}); });
}else{ } else {
var start = "https://" + domain + "/api/v1/lists" var start = "https://" + domain + "/api/v1/lists"
fetch(start, { fetch(start, {
method: 'GET', method: 'GET',
@ -46,196 +46,196 @@ function list(){
'content-type': 'application/json', 'content-type': 'application/json',
'Authorization': 'Bearer ' + at 'Authorization': 'Bearer ' + at
}, },
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
if (json) { if (json) {
var lists = ""; var lists = "";
Object.keys(json).forEach(function(key) { Object.keys(json).forEach(function (key) {
var list = json[key]; var list = json[key];
lists = lists + escapeHTML(list.title)+':<a onclick="listShow(\'' + list.id + '\',\'' + escapeHTML(list.title) + '\',\'' + acct_id + lists = lists + escapeHTML(list.title) + ':<a onclick="listShow(\'' + list.id + '\',\'' + escapeHTML(list.title) + '\',\'' + acct_id +
'\')" class="pointer">'+lang.lang_list_show+'</a>/<a onclick="listUser(\'' + list.id + '\',' + acct_id + '\')" class="pointer">' + lang.lang_list_show + '</a>/<a onclick="listUser(\'' + list.id + '\',' + acct_id +
')" class="pointer">'+lang.lang_list_users+'</a><br>'; ')" class="pointer">' + lang.lang_list_users + '</a><br>';
}); });
$("#lists").html(lists); $("#lists").html(lists);
}else{ } else {
$("#lists").html(lang.lang_list_nodata); $("#lists").html(lang.lang_list_nodata);
} }
}); });
} }
} }
function makeNewList(){ function makeNewList() {
var acct_id = $("#list-acct-sel").val(); var acct_id = $("#list-acct-sel").val();
var text=$("#list-add").val(); var text = $("#list-add").val();
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"){ if (localStorage.getItem("mode_" + domain) != "misskey") {
var start = "https://" + domain + "/api/v1/lists" var start = "https://" + domain + "/api/v1/lists"
var httpreq = new XMLHttpRequest(); var httpreq = new XMLHttpRequest();
httpreq.open('POST', start, true); httpreq.open('POST', start, true);
httpreq.setRequestHeader('Content-Type', 'application/json'); httpreq.setRequestHeader('Content-Type', 'application/json');
httpreq.setRequestHeader('Authorization', 'Bearer ' + at); httpreq.setRequestHeader('Authorization', 'Bearer ' + at);
httpreq.responseType = "json"; httpreq.responseType = "json";
httpreq.send(JSON.stringify({ httpreq.send(JSON.stringify({
title: text title: text
})); }));
httpreq.onreadystatechange = function() { httpreq.onreadystatechange = function () {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
var json = httpreq.response; var json = httpreq.response;
list(); list();
$("#list-add").val("") $("#list-add").val("")
}
} }
} } else {
}else{ var start = "https://" + domain + "/api/users/lists/create"
var start = "https://" + domain + "/api/users/lists/create" var httpreq = new XMLHttpRequest();
var httpreq = new XMLHttpRequest(); httpreq.open('POST', start, true);
httpreq.open('POST', start, true); httpreq.setRequestHeader('Content-Type', 'application/json');
httpreq.setRequestHeader('Content-Type', 'application/json'); httpreq.responseType = "json";
httpreq.responseType = "json"; httpreq.send(JSON.stringify({
httpreq.send(JSON.stringify({ i: at,
i:at, title: text
title: text }));
})); httpreq.onreadystatechange = function () {
httpreq.onreadystatechange = function() { if (httpreq.readyState === 4) {
if (httpreq.readyState === 4) { var json = httpreq.response;
var json = httpreq.response; list();
list(); $("#list-add").val("")
$("#list-add").val("") }
} }
} }
} }
function listShow(id, title, acct_id) {
localStorage.setItem("list_" + id + "_" + acct_id, title);
tl('list', id, acct_id, 'add');
} }
function listShow(id,title,acct_id){ function listUser(id, acct_id) {
localStorage.setItem("list_"+id+"_"+acct_id,title); var domain = localStorage.getItem("domain_" + acct_id);
tl('list',id,acct_id,'add'); var at = localStorage.getItem("acct_" + acct_id + "_at");
} var start = "https://" + domain + "/api/v1/lists/" + id + "/accounts"
function listUser(id,acct_id){
var domain = localStorage.getItem("domain_" + acct_id);
var at = localStorage.getItem("acct_"+ acct_id + "_at");
var start = "https://" + domain + "/api/v1/lists/"+id+"/accounts"
fetch(start, { fetch(start, {
method: 'GET', method: 'GET',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
'Authorization': 'Bearer ' + at 'Authorization': 'Bearer ' + at
}, },
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
if (json) { if (json) {
var lists = ""; var lists = "";
var templete = userparse(json,'',acct_id); var templete = userparse(json, '', acct_id);
if(!json[0]){ if (!json[0]) {
templete=lang.lang_list_nouser; templete = lang.lang_list_nouser;
} }
$("#lists-user").html(templete); $("#lists-user").html(templete);
}else{ } else {
$("#lists-user").html(lang.lang_list_nouser); $("#lists-user").html(lang.lang_list_nouser);
} }
}); });
} }
function hisList(user,acct_id){ function hisList(user, 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"){ if (localStorage.getItem("mode_" + domain) != "misskey") {
var start = "https://" + domain + "/api/v1/lists" var start = "https://" + domain + "/api/v1/lists"
fetch(start, { fetch(start, {
method: 'GET', method: 'GET',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
'Authorization': 'Bearer ' + at 'Authorization': 'Bearer ' + at
}, },
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
if (json) { if (json) {
var lists = lang.lang_list_add+"<br>"; var lists = lang.lang_list_add + "<br>";
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">'+escapeHTML(list.title)+'</a><br> '; '\')" class="pointer">' + escapeHTML(list.title) + '</a><br> ';
}); });
$("#his-lists-a").html(lists); $("#his-lists-a").html(lists);
}else{ } else {
$("#his-lists-a").html(lang.lang_list_nodata); $("#his-lists-a").html(lang.lang_list_nodata);
} }
}); });
var start = "https://" + domain + "/api/v1/accounts/"+user+"/lists" var start = "https://" + domain + "/api/v1/accounts/" + user + "/lists"
fetch(start, { fetch(start, {
method: 'GET', method: 'GET',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
'Authorization': 'Bearer ' + at 'Authorization': 'Bearer ' + at
}, },
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
if (json) { if (json) {
var lists = lang.lang_list_remove+"<br>"; var lists = lang.lang_list_remove + "<br>";
Object.keys(json).forEach(function(key) { Object.keys(json).forEach(function (key) {
var list = json[key]; var list = json[key];
lists = lists + '<a onclick="listRemove(\'' + list.id + '\',\'' + user + '\',\'' + acct_id + lists = lists + '<a onclick="listRemove(\'' + list.id + '\',\'' + user + '\',\'' + acct_id +
'\')" class="pointer">'+escapeHTML(list.title)+'</a><br> '; '\')" class="pointer">' + escapeHTML(list.title) + '</a><br> ';
}); });
$("#his-lists-b").html(lists); $("#his-lists-b").html(lists);
}else{ } else {
$("#his-lists-b").html(lang.lang_list_nodata); $("#his-lists-b").html(lang.lang_list_nodata);
} }
}); });
}else{ } else {
var start = "https://" + domain + "/api/users/lists/list" var start = "https://" + domain + "/api/users/lists/list"
fetch(start, { fetch(start, {
method: 'POST', method: 'POST',
body: JSON.stringify({ body: JSON.stringify({
i:at i: at
}), }),
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
if (json) { if (json) {
var lists = ""; var lists = "";
Object.keys(json).forEach(function(key) { Object.keys(json).forEach(function (key) {
var list = json[key]; var list = json[key];
lists = lists + list.title+':<a onclick="listShow(\'' + list.id + '\',\'' + escapeHTML(list.title) + '\',\'' + acct_id + lists = lists + list.title + ':<a onclick="listShow(\'' + list.id + '\',\'' + escapeHTML(list.title) + '\',\'' + acct_id +
'\')" class="pointer">'+lang.lang_list_show+'</a>/<a onclick="listAdd(\'' + list.id + '\',\'' + user + '\',\'' + acct_id + '\')" class="pointer">' + lang.lang_list_show + '</a>/<a onclick="listAdd(\'' + list.id + '\',\'' + user + '\',\'' + acct_id +
'\')" class="pointer">'+lang.lang_list_add+lang.lang_list_add_misskey+'</a><br>'; '\')" class="pointer">' + lang.lang_list_add + lang.lang_list_add_misskey + '</a><br>';
}); });
$("#his-lists-a").html(lists); $("#his-lists-a").html(lists);
}else{ } else {
$("#his-lists-a").html(lang.lang_list_nodata); $("#his-lists-a").html(lang.lang_list_nodata);
} }
}); });
$("#his-lists-b").html(""); $("#his-lists-b").html("");
}
} }
} function listAdd(id, user, acct_id) {
function listAdd(id,user,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") {
if(localStorage.getItem("mode_" + domain)=="misskey"){
var start = "https://" + domain + "/api/users/lists/push" var start = "https://" + domain + "/api/users/lists/push"
var i={ var i = {
i:at, i: at,
listId:id, listId: id,
userId:user userId: user
} }
}else{ } else {
var start = "https://" + domain + "/api/v1/lists/"+id+"/accounts" var start = "https://" + domain + "/api/v1/lists/" + id + "/accounts"
var i={ var i = {
account_ids: [user] account_ids: [user]
} }
} }
@ -245,28 +245,28 @@ function listAdd(id,user,acct_id){
httpreq.setRequestHeader('Authorization', 'Bearer ' + at); httpreq.setRequestHeader('Authorization', 'Bearer ' + at);
httpreq.responseType = "json"; httpreq.responseType = "json";
httpreq.send(JSON.stringify(i)); httpreq.send(JSON.stringify(i));
httpreq.onreadystatechange = function() { httpreq.onreadystatechange = function () {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
var json = httpreq.response; var json = httpreq.response;
hisList(user,acct_id) hisList(user, acct_id)
} }
} }
} }
function listRemove(id,user,acct_id){ function listRemove(id, user, 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"){ if (localStorage.getItem("mode_" + domain) == "misskey") {
var start = "https://" + domain + "/api/users/lists/push" var start = "https://" + domain + "/api/users/lists/push"
var method='POST' var method = 'POST'
var i={ var i = {
i:at, i: at,
listId:id, listId: id,
userId:user userId: user
} }
}else{ } else {
var start = "https://" + domain + "/api/v1/lists/"+id+"/accounts" var start = "https://" + domain + "/api/v1/lists/" + id + "/accounts"
var method='DELETE' var method = 'DELETE'
var i={ var i = {
account_ids: [user] account_ids: [user]
} }
} }
@ -276,10 +276,10 @@ function listRemove(id,user,acct_id){
httpreq.setRequestHeader('Authorization', 'Bearer ' + at); httpreq.setRequestHeader('Authorization', 'Bearer ' + at);
httpreq.responseType = "json"; httpreq.responseType = "json";
httpreq.send(JSON.stringify(i)); httpreq.send(JSON.stringify(i));
httpreq.onreadystatechange = function() { httpreq.onreadystatechange = function () {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
var json = httpreq.response; var json = httpreq.response;
hisList(user,acct_id) hisList(user, acct_id)
} }
} }
} }

View File

@ -749,10 +749,10 @@ function misskeyParse(obj, mix, acct_id, tlid, popup, mutefilter) {
var fullhide = ""; var fullhide = "";
} else { } else {
var like = 0; var love = 0; var laugh = 0; var hmm = 0; var surprise = 0; var congrats = 0; var angry = 0; var confused = 0; var pudding = 0; var like = 0; var love = 0; var laugh = 0; var hmm = 0; var surprise = 0; var congrats = 0; var angry = 0; var confused = 0; var pudding = 0;
var likehide = "hide"; var lovehide = "hide"; var laughhide = "hide"; var hmmhide = "hide"; var suphide = "hide"; var conghide = "hide"; var anghide = "hide"; var confhide = "hide"; var riphide="hide" var likehide = "hide"; var lovehide = "hide"; var laughhide = "hide"; var hmmhide = "hide"; var suphide = "hide"; var conghide = "hide"; var anghide = "hide"; var confhide = "hide"; var riphide = "hide"
var fullhide = "hide"; var fullhide = "hide";
} }
if (!addReact && likehide == "hide" && lovehide == "hide" && laughhide == "hide" && hmmhide == "hide" && suphide == "hide" && conghide == "hide" && anghide == "hide" && confhide == "hide" && riphide=="hide") { if (!addReact && likehide == "hide" && lovehide == "hide" && laughhide == "hide" && hmmhide == "hide" && suphide == "hide" && conghide == "hide" && anghide == "hide" && confhide == "hide" && riphide == "hide") {
var fullhide = "hide"; var fullhide = "hide";
} }
if (toot.myReaction) { if (toot.myReaction) {
@ -857,11 +857,11 @@ function misskeyParse(obj, mix, acct_id, tlid, popup, mutefilter) {
//オブジェクトパーサー(ユーザーデータ) //オブジェクトパーサー(ユーザーデータ)
function misskeyUserparse(obj, auth, acct_id, tlid, popup) { function misskeyUserparse(obj, auth, acct_id, tlid, popup) {
console.log(["Parse them ",obj]) console.log(["Parse them ", obj])
if (popup > 0 || popup == -1) { if (popup > 0 || popup == -1) {
} else { } else {
if(obj.users){ if (obj.users) {
var obj = obj.users; var obj = obj.users;
} }
} }
@ -869,10 +869,10 @@ function misskeyUserparse(obj, auth, acct_id, tlid, popup) {
var datetype = localStorage.getItem("datetype"); var datetype = localStorage.getItem("datetype");
Object.keys(obj).forEach(function (key) { Object.keys(obj).forEach(function (key) {
var toot = obj[key]; var toot = obj[key];
if(toot.followee){ if (toot.followee) {
toot=toot.followee toot = toot.followee
}else if(toot.follower){ } else if (toot.follower) {
toot=toot.follower toot = toot.follower
} }
var locked = ""; var locked = "";
if (auth) { if (auth) {
@ -930,15 +930,15 @@ function misskeyUserparse(obj, auth, acct_id, tlid, popup) {
} else { } else {
var dis_name = toot.username; var dis_name = toot.username;
} }
if(toot.followersCount){ if (toot.followersCount) {
var ferct=toot.followersCount var ferct = toot.followersCount
}else{ } else {
var ferct="unknown" var ferct = "unknown"
} }
if(toot.followingCount){ if (toot.followingCount) {
var fingct=toot.followingCount var fingct = toot.followingCount
}else{ } else {
var fingct="unknown" var fingct = "unknown"
} }
templete = templete + templete = templete +
'<div class="cvo" style="padding-top:5px;" user-id="' + toot.id + '"><div class="area-notice">' + '<div class="cvo" style="padding-top:5px;" user-id="' + toot.id + '"><div class="area-notice">' +
@ -973,98 +973,98 @@ function goGoogle(id) {
shell.openExternal(url); shell.openExternal(url);
} }
var misskeyws=[] var misskeyws = []
var misskeywsstate=[] var misskeywsstate = []
function connectMisskey(acct_id) { function connectMisskey(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");
var start = "wss://" + domain + var start = "wss://" + domain +
"/streaming?i="+at; "/streaming?i=" + at;
var wsid = misskeyws.length; var wsid = misskeyws.length;
localStorage.setItem("misskey_wss_" + acct_id, wsid); localStorage.setItem("misskey_wss_" + acct_id, wsid);
misskeyws[wsid] = new WebSocket(start); misskeyws[wsid] = new WebSocket(start);
misskeyws[wsid].onopen = function (mess) { misskeyws[wsid].onopen = function (mess) {
console.table({"tlid":tlid,"type":"Connect Streaming API","domain":domain,"message":[mess]}) console.table({ "tlid": tlid, "type": "Connect Streaming API", "domain": domain, "message": [mess] })
misskeywsstate[wsid]=true misskeywsstate[wsid] = true
//$("#notice_icon_" + tlid).removeClass("red-text"); //$("#notice_icon_" + tlid).removeClass("red-text");
var send='{"type":"connect","body":{"channel":"main","id":"notf:'+acct_id+'"}}' var send = '{"type":"connect","body":{"channel":"main","id":"notf:' + acct_id + '"}}'
misskeyws[wsid].send(send) misskeyws[wsid].send(send)
} }
misskeyws[wsid].onmessage = function (mess) { misskeyws[wsid].onmessage = function (mess) {
console.log([domain + ":Receive Streaming API:",data]); console.log([domain + ":Receive Streaming API:", data]);
var data=JSON.parse(mess.data) var data = JSON.parse(mess.data)
var obj=data.body.body var obj = data.body.body
if (data.body.id.indexOf("notf:")!== -1) { if (data.body.id.indexOf("notf:") !== -1) {
var obj = JSON.parse(mess.data).body; var obj = JSON.parse(mess.data).body;
console.log(obj); console.log(obj);
var popup = localStorage.getItem("popup"); var popup = localStorage.getItem("popup");
if (!popup) { if (!popup) {
popup = 0; popup = 0;
} }
if(JSON.parse(mess.data).body.type!="follow"){ if (JSON.parse(mess.data).body.type != "follow") {
templete = misskeyParse([obj.body], 'notf', acct_id, 'notf', popup); templete = misskeyParse([obj.body], 'notf', acct_id, 'notf', popup);
}else{ } else {
templete = misskeyUserparse([obj.body], 'notf', acct_id, 'notf', popup); templete = misskeyUserparse([obj.body], 'notf', acct_id, 'notf', popup);
} }
if(JSON.parse(mess.data).body.type=="reaction"){ if (JSON.parse(mess.data).body.type == "reaction") {
console.log("reaction refresh") console.log("reaction refresh")
reactRefresh(acct_id,obj.body.note.id) reactRefresh(acct_id, obj.body.note.id)
} }
if(!$("div[data-notfIndv=" + acct_id +"_"+obj.body.id+"]").length){ if (!$("div[data-notfIndv=" + acct_id + "_" + obj.body.id + "]").length) {
$("div[data-notf=" + acct_id +"]").prepend(templete); $("div[data-notf=" + acct_id + "]").prepend(templete);
$("div[data-const=notf_"+acct_id+"]").prepend(templete); $("div[data-const=notf_" + acct_id + "]").prepend(templete);
} }
jQuery("time.timeago").timeago(); jQuery("time.timeago").timeago();
}else if (data.body.type == "note") { } else if (data.body.type == "note") {
var tlid=data.body.id*1 var tlid = data.body.id * 1
var multi = localStorage.getItem("column"); var multi = localStorage.getItem("column");
var col = JSON.parse(multi)[tlid]; var col = JSON.parse(multi)[tlid];
if(localStorage.getItem("voice_" + tlid)){ if (localStorage.getItem("voice_" + tlid)) {
var voice=true; var voice = true;
}else{ } else {
var voice=false; var voice = false;
}
if (voice) {
say(obj.text)
}
var templete = misskeyParse([obj], col.type, acct_id, tlid, "", mute);
misskeyws[wsid].send(JSON.stringify({
type: 'sn',
body: {
id: obj.id
}
}))
var pool = localStorage.getItem("pool_" + tlid);
if (pool) {
pool = templete + pool;
} else {
pool = templete
}
localStorage.setItem("pool_" + tlid, pool);
scrollck();
jQuery("time.timeago").timeago();
}else if (data.type == "noteUpdated") {
if(data.body.type=="reacted"){
reactRefresh(acct_id,data.body.id)
}else if(data.body.type=="deleted"){
$("#pub_"+data.body.id).hide();
$("#pub_"+data.body.id).remove();
}
} }
if (voice) {
say(obj.text)
}
var templete = misskeyParse([obj], col.type, acct_id, tlid, "", mute);
misskeyws[wsid].send(JSON.stringify({
type: 'sn',
body: {
id: obj.id
}
}))
var pool = localStorage.getItem("pool_" + tlid);
if (pool) {
pool = templete + pool;
} else {
pool = templete
}
localStorage.setItem("pool_" + tlid, pool);
scrollck();
jQuery("time.timeago").timeago();
} else if (data.type == "noteUpdated") {
if (data.body.type == "reacted") {
reactRefresh(acct_id, data.body.id)
} else if (data.body.type == "deleted") {
$("#pub_" + data.body.id).hide();
$("#pub_" + data.body.id).remove();
}
}
} }
misskeyws[wsid].onerror = function (error) { misskeyws[wsid].onerror = function (error) {
console.error("Error closing "+tlid); console.error("Error closing " + tlid);
console.error(error); console.error(error);
misskeywsstate[wsid]=false misskeywsstate[wsid] = false
connectMisskey(acct_id) connectMisskey(acct_id)
return false; return false;
}; };
misskeyws[wsid].onclose = function () { misskeyws[wsid].onclose = function () {
console.warn("Closing "+tlid); console.warn("Closing " + tlid);
misskeywsstate[wsid]=false misskeywsstate[wsid] = false
connectMisskey(acct_id) connectMisskey(acct_id)
return false; return false;
}; };

View File

@ -1,127 +1,127 @@
//Integrated TL //Integrated TL
function mixtl(acct_id, tlid, type,delc,voice) { function mixtl(acct_id, tlid, type, delc, voice) {
localStorage.removeItem("morelock") localStorage.removeItem("morelock")
localStorage.setItem("now", type); localStorage.setItem("now", type);
todo("Integrated TL Loading...(Local)"); todo("Integrated TL Loading...(Local)");
//まずLocal //まずLocal
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");
var start = "https://" + domain + "/api/v1/timelines/public?local=true"; var start = "https://" + domain + "/api/v1/timelines/public?local=true";
fetch(start, { fetch(start, {
method: 'GET', method: 'GET',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
'Authorization': 'Bearer ' + at 'Authorization': 'Bearer ' + at
}, },
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(jsonL) { }).then(function (jsonL) {
var start = "https://" + domain + "/api/v1/timelines/home"; var start = "https://" + domain + "/api/v1/timelines/home";
fetch(start, { fetch(start, {
method: 'GET', method: 'GET',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
'Authorization': 'Bearer ' + at 'Authorization': 'Bearer ' + at
}, },
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(jsonH) { }).then(function (jsonH) {
var homearr=[]; var homearr = [];
var timeline = jsonL.concat(jsonH); var timeline = jsonL.concat(jsonH);
timeline.sort(function(a,b){ timeline.sort(function (a, b) {
if(date(a.created_at,"unix")>=date(b.created_at,"unix")) return -1; if (date(a.created_at, "unix") >= date(b.created_at, "unix")) return -1;
if(date(a.created_at,"unix")<date(b.created_at,"unix")) return 1; if (date(a.created_at, "unix") < date(b.created_at, "unix")) return 1;
return 0; return 0;
}); });
if(type=="integrated"){ if (type == "integrated") {
timeline.splice(20); timeline.splice(20);
} }
var templete=""; var templete = "";
Object.keys(timeline).forEach(function(key) { Object.keys(timeline).forEach(function (key) {
var pkey=key*1+1; var pkey = key * 1 + 1;
if(pkey<timeline.length){ if (pkey < timeline.length) {
if(date(timeline[key].created_at,"unix")!=date(timeline[pkey].created_at,"unix")){ if (date(timeline[key].created_at, "unix") != date(timeline[pkey].created_at, "unix")) {
if(localStorage.getItem("filter_"+ acct_id)!="undefined"){ if (localStorage.getItem("filter_" + acct_id) != "undefined") {
var mute=getFilterType(JSON.parse(localStorage.getItem("filter_"+ acct_id)),"mix"); var mute = getFilterType(JSON.parse(localStorage.getItem("filter_" + acct_id)), "mix");
}else{ } else {
var mute=[]; var mute = [];
} }
if(type=="integrated"){ if (type == "integrated") {
templete = templete+parse([timeline[key]], '', acct_id, tlid, "", mute, "mix"); templete = templete + parse([timeline[key]], '', acct_id, tlid, "", mute, "mix");
}else if(type=="plus"){ } else if (type == "plus") {
if(timeline[key].account.acct==timeline[key].account.username){ if (timeline[key].account.acct == timeline[key].account.username) {
templete = templete+parse([timeline[key]], '', acct_id, tlid, "", mute, "plus"); templete = templete + parse([timeline[key]], '', acct_id, tlid, "", mute, "plus");
} }
} }
} }
} }
}); });
$("#landing_" + tlid).hide(); $("#landing_" + tlid).hide();
$("#timeline_" + tlid).html(templete); $("#timeline_" + tlid).html(templete);
mixre(acct_id, tlid, type, mute,delc,voice); mixre(acct_id, tlid, type, mute, delc, voice);
additional(acct_id, tlid); additional(acct_id, tlid);
jQuery("time.timeago").timeago(); jQuery("time.timeago").timeago();
todc(); todc();
}); });
}); });
} }
//Streamingに接続 //Streamingに接続
function mixre(acct_id, tlid, TLtype, mute,delc,voice,mode) { function mixre(acct_id, tlid, TLtype, mute, delc, voice, mode) {
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("streaming_" + acct_id)){ if (localStorage.getItem("streaming_" + acct_id)) {
var wss=localStorage.getItem("streaming_" + acct_id) var wss = localStorage.getItem("streaming_" + acct_id)
}else{ } else {
var wss="wss://"+domain var wss = "wss://" + domain
} }
var startHome = wss+ var startHome = wss +
"/api/v1/streaming/?stream=user&access_token=" + at; "/api/v1/streaming/?stream=user&access_token=" + at;
var startLocal = wss+ var startLocal = wss +
"/api/v1/streaming/?stream=public:local&access_token=" + at; "/api/v1/streaming/?stream=public:local&access_token=" + at;
var wshid = websocketHome.length; var wshid = websocketHome.length;
var wslid = websocketLocal.length; var wslid = websocketLocal.length;
websocketHome[wshid] = new WebSocket(startHome); websocketHome[wshid] = new WebSocket(startHome);
websocketLocal[wslid] = new WebSocket(startLocal); websocketLocal[wslid] = new WebSocket(startLocal);
websocketHome[wshid].onopen = function(mess) { websocketHome[wshid].onopen = function (mess) {
localStorage.setItem("wssH_" + tlid, wshid); localStorage.setItem("wssH_" + tlid, wshid);
console.table({"tlid":tlid,"type":"Connect Streaming API(Integrated:Home)","domain":domain,"message":mess}) console.table({ "tlid": tlid, "type": "Connect Streaming API(Integrated:Home)", "domain": domain, "message": mess })
$("#notice_icon_" + tlid).removeClass("red-text"); $("#notice_icon_" + tlid).removeClass("red-text");
} }
websocketLocal[wslid].onopen = function(mess) { websocketLocal[wslid].onopen = function (mess) {
localStorage.setItem("wssL_" + tlid, wslid); localStorage.setItem("wssL_" + tlid, wslid);
console.table({"tlid":tlid,"type":"Connect Streaming API(Integrated:Local)","domain":domain,"message":mess}) console.table({ "tlid": tlid, "type": "Connect Streaming API(Integrated:Local)", "domain": domain, "message": mess })
$("#notice_icon_" + tlid).removeClass("red-text"); $("#notice_icon_" + tlid).removeClass("red-text");
} }
websocketLocal[wslid].onmessage = function(mess) { websocketLocal[wslid].onmessage = function (mess) {
console.log(["Receive Streaming API:(Integrated:Local)",obj]); console.log(["Receive Streaming API:(Integrated:Local)", obj]);
var obj = JSON.parse(JSON.parse(mess.data).payload); var obj = JSON.parse(JSON.parse(mess.data).payload);
var type = JSON.parse(mess.data).event; var type = JSON.parse(mess.data).event;
if (type == "delete") { if (type == "delete") {
if(delc=="true"){ if (delc == "true") {
$("#timeline_"+tlid+" [toot-id=" + JSON.parse(mess.data).payload + "]").addClass("emphasized"); $("#timeline_" + tlid + " [toot-id=" + JSON.parse(mess.data).payload + "]").addClass("emphasized");
$("#timeline_"+tlid+" [toot-id=" + JSON.parse(mess.data).payload + "]").addClass("by_delcatch"); $("#timeline_" + tlid + " [toot-id=" + JSON.parse(mess.data).payload + "]").addClass("by_delcatch");
}else{ } else {
$("[toot-id=" + JSON.parse(mess.data).payload + "]").hide(); $("[toot-id=" + JSON.parse(mess.data).payload + "]").hide();
$("[toot-id=" + JSON.parse(mess.data).payload + "]").remove(); $("[toot-id=" + JSON.parse(mess.data).payload + "]").remove();
} }
} else if (type == "update") { } else if (type == "update") {
var templete = parse([obj], '', acct_id, tlid,"",mute); var templete = parse([obj], '', acct_id, tlid, "", mute);
if($("#timeline_" + tlid +" [toot-id=" + obj.id + "]").length < 1){ if ($("#timeline_" + tlid + " [toot-id=" + obj.id + "]").length < 1) {
if(voice){ if (voice) {
say(obj.content) say(obj.content)
} }
var templete = parse([obj], type, acct_id, tlid,"",mute, "mix"); var templete = parse([obj], type, acct_id, tlid, "", mute, "mix");
var pool = localStorage.getItem("pool_" + tlid); var pool = localStorage.getItem("pool_" + tlid);
if (pool) { if (pool) {
pool = templete + pool; pool = templete + pool;
@ -129,50 +129,50 @@ function mixre(acct_id, tlid, TLtype, mute,delc,voice,mode) {
pool = templete pool = templete
} }
localStorage.setItem("pool_" + tlid, pool); localStorage.setItem("pool_" + tlid, pool);
scrollck(); scrollck();
additional(acct_id, tlid); additional(acct_id, tlid);
jQuery("time.timeago").timeago(); jQuery("time.timeago").timeago();
}else{ } else {
todo("二重取得発生中"); todo("二重取得発生中");
} }
} }
} }
websocketHome[wshid].onmessage = function(mess) { websocketHome[wshid].onmessage = function (mess) {
console.log(["Receive Streaming API:(Integrated:Home)",obj]); console.log(["Receive Streaming API:(Integrated:Home)", obj]);
var obj = JSON.parse(JSON.parse(mess.data).payload); var obj = JSON.parse(JSON.parse(mess.data).payload);
var type = JSON.parse(mess.data).event; var type = JSON.parse(mess.data).event;
if (type == "delete") { if (type == "delete") {
if(del>10){ if (del > 10) {
reconnector(tlid,type,acct_id,data) reconnector(tlid, type, acct_id, data)
}else{ } else {
localStorage.setItem("delete",del*1+1) localStorage.setItem("delete", del * 1 + 1)
} }
if(delc=="true"){ if (delc == "true") {
$("[toot-id=" + JSON.parse(mess.data).payload + "]").addClass("emphasized"); $("[toot-id=" + JSON.parse(mess.data).payload + "]").addClass("emphasized");
$("[toot-id=" + JSON.parse(mess.data).payload + "]").addClass("by_delcatch"); $("[toot-id=" + JSON.parse(mess.data).payload + "]").addClass("by_delcatch");
}else{ } else {
$("[toot-id=" + JSON.parse(mess.data).payload + "]").hide(); $("[toot-id=" + JSON.parse(mess.data).payload + "]").hide();
$("[toot-id=" + JSON.parse(mess.data).payload + "]").remove(); $("[toot-id=" + JSON.parse(mess.data).payload + "]").remove();
} }
} else if (type == "update") { } else if (type == "update") {
localStorage.removeItem("delete"); localStorage.removeItem("delete");
if(TLtype=="integrated"){ if (TLtype == "integrated") {
var templete = parse([obj], '', acct_id, tlid); var templete = parse([obj], '', acct_id, tlid);
}else if(TLtype=="plus"){ } else if (TLtype == "plus") {
if(obj.account.acct==obj.account.username){ if (obj.account.acct == obj.account.username) {
var templete = parse([obj], '', acct_id, tlid,"",mute, "mix"); var templete = parse([obj], '', acct_id, tlid, "", mute, "mix");
}else{ } else {
var templete=""; var templete = "";
} }
} }
if($("#timeline_" + tlid +" [toot-id=" + obj.id + "]").length < 1){ if ($("#timeline_" + tlid + " [toot-id=" + obj.id + "]").length < 1) {
if(voice){ if (voice) {
say(obj.content) say(obj.content)
} }
var templete = parse([obj], type, acct_id, tlid,"",mute,"mix"); var templete = parse([obj], type, acct_id, tlid, "", mute, "mix");
var pool = localStorage.getItem("pool_" + tlid); var pool = localStorage.getItem("pool_" + tlid);
if (pool) { if (pool) {
pool = templete + pool; pool = templete + pool;
@ -180,148 +180,148 @@ function mixre(acct_id, tlid, TLtype, mute,delc,voice,mode) {
pool = templete pool = templete
} }
localStorage.setItem("pool_" + tlid, pool); localStorage.setItem("pool_" + tlid, pool);
scrollck(); scrollck();
additional(acct_id, tlid); additional(acct_id, tlid);
jQuery("time.timeago").timeago(); jQuery("time.timeago").timeago();
}else{ } else {
todo("二重取得発生中"); todo("二重取得発生中");
} }
} }
} }
websocketLocal[wslid].onerror = function(error) { websocketLocal[wslid].onerror = function (error) {
console.error('WebSocketLocal Error') console.error('WebSocketLocal Error')
console.error(error); console.error(error);
if(mode=="error"){ if (mode == "error") {
$("#notice_icon_" + tlid).addClass("red-text"); $("#notice_icon_" + tlid).addClass("red-text");
todo('WebSocket Error ' + error); todo('WebSocket Error ' + error);
}else{ } else {
var errorct=localStorage.getItem("wserror_" + tlid)*1+1; var errorct = localStorage.getItem("wserror_" + tlid) * 1 + 1;
localStorage.setItem("wserror_" + tlid,errorct); localStorage.setItem("wserror_" + tlid, errorct);
if(errorct<3){ if (errorct < 3) {
reconnector(tlid,TLtype,acct_id,"","error"); reconnector(tlid, TLtype, acct_id, "", "error");
} }
} }
}; };
websocketLocal[wslid].onclose = function() { websocketLocal[wslid].onclose = function () {
console.warn('WebSocketLocal Closing:' + tlid); console.warn('WebSocketLocal Closing:' + tlid);
if(mode=="error"){ if (mode == "error") {
$("#notice_icon_" + tlid).addClass("red-text"); $("#notice_icon_" + tlid).addClass("red-text");
todo('WebSocket Closed'); todo('WebSocket Closed');
}else{ } else {
var errorct=localStorage.getItem("wserror_" + tlid)*1+1; var errorct = localStorage.getItem("wserror_" + tlid) * 1 + 1;
localStorage.setItem("wserror_" + tlid,errorct); localStorage.setItem("wserror_" + tlid, errorct);
if(errorct<3){ if (errorct < 3) {
reconnector(tlid,TLtype,acct_id,"","error"); reconnector(tlid, TLtype, acct_id, "", "error");
} }
} }
}; };
websocketHome[wshid].onerror = function(error) { websocketHome[wshid].onerror = function (error) {
console.error(['WebSocketHome Error',error]) console.error(['WebSocketHome Error', error])
if(mode=="error"){ if (mode == "error") {
$("#notice_icon_" + tlid).addClass("red-text"); $("#notice_icon_" + tlid).addClass("red-text");
todo('WebSocket Error ' + error); todo('WebSocket Error ' + error);
}else{ } else {
var errorct=localStorage.getItem("wserror_" + tlid)*1+1; var errorct = localStorage.getItem("wserror_" + tlid) * 1 + 1;
localStorage.setItem("wserror_" + tlid,errorct); localStorage.setItem("wserror_" + tlid, errorct);
if(errorct<3){ if (errorct < 3) {
reconnector(tlid,TLtype,acct_id,"","error"); reconnector(tlid, TLtype, acct_id, "", "error");
} }
} }
}; };
websocketHome[wshid].onclose = function() { websocketHome[wshid].onclose = function () {
console.warn('WebSocketHome Closing:' + tlid); console.warn('WebSocketHome Closing:' + tlid);
if(mode=="error"){ if (mode == "error") {
$("#notice_icon_" + tlid).addClass("red-text"); $("#notice_icon_" + tlid).addClass("red-text");
todo('WebSocket Closed'); todo('WebSocket Closed');
}else{ } else {
var errorct=localStorage.getItem("wserror_" + tlid)*1+1; var errorct = localStorage.getItem("wserror_" + tlid) * 1 + 1;
localStorage.setItem("wserror_" + tlid,errorct); localStorage.setItem("wserror_" + tlid, errorct);
if(errorct<3){ if (errorct < 3) {
reconnector(tlid,TLtype,acct_id,"","error"); reconnector(tlid, TLtype, acct_id, "", "error");
} }
} }
}; };
} }
//ある程度のスクロールで発火 //ある程度のスクロールで発火
function mixmore(tlid,type) { function mixmore(tlid, type) {
var multi = localStorage.getItem("column"); var multi = localStorage.getItem("column");
var obj = JSON.parse(multi); var obj = JSON.parse(multi);
var acct_id = obj[tlid].domain; var acct_id = obj[tlid].domain;
moreloading=true; moreloading = true;
todo("Integrated TL MoreLoading...(Local)"); todo("Integrated TL MoreLoading...(Local)");
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");
var sid = $("#timeline_" + tlid + " .cvo").last().attr("unique-id"); var sid = $("#timeline_" + tlid + " .cvo").last().attr("unique-id");
var start = "https://" + domain + "/api/v1/timelines/public?local=true&max_id="+sid; var start = "https://" + domain + "/api/v1/timelines/public?local=true&max_id=" + sid;
fetch(start, { fetch(start, {
method: 'GET', method: 'GET',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
'Authorization': 'Bearer ' + at 'Authorization': 'Bearer ' + at
}, },
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(jsonL) { }).then(function (jsonL) {
var start = "https://" + domain + "/api/v1/timelines/home?max_id="+sid; var start = "https://" + domain + "/api/v1/timelines/home?max_id=" + sid;
fetch(start, { fetch(start, {
method: 'GET', method: 'GET',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
'Authorization': 'Bearer ' + at 'Authorization': 'Bearer ' + at
}, },
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(jsonH) { }).then(function (jsonH) {
var homearr=[]; var homearr = [];
var timeline = jsonL.concat(jsonH); var timeline = jsonL.concat(jsonH);
timeline.sort(function(a,b){ timeline.sort(function (a, b) {
if(date(a.created_at,"unix")>date(b.created_at,"unix")) return -1; if (date(a.created_at, "unix") > date(b.created_at, "unix")) return -1;
if(date(a.created_at,"unix")<date(b.created_at,"unix")) return 1; if (date(a.created_at, "unix") < date(b.created_at, "unix")) return 1;
return 0; return 0;
}); });
timeline.splice(20); timeline.splice(20);
var templete=""; var templete = "";
Object.keys(timeline).forEach(function(key) { Object.keys(timeline).forEach(function (key) {
var pkey=key*1+1; var pkey = key * 1 + 1;
if(pkey<20){ if (pkey < 20) {
if(date(timeline[key].created_at,"unix")!=date(timeline[pkey].created_at,"unix")){ if (date(timeline[key].created_at, "unix") != date(timeline[pkey].created_at, "unix")) {
if(localStorage.getItem("filter_"+ acct_id)!="undefined"){ if (localStorage.getItem("filter_" + acct_id) != "undefined") {
var mute=getFilterType(JSON.parse(localStorage.getItem("filter_"+ acct_id)),"mix"); var mute = getFilterType(JSON.parse(localStorage.getItem("filter_" + acct_id)), "mix");
}else{ } else {
var mute=[]; var mute = [];
} }
if(type=="integrated"){ if (type == "integrated") {
templete = templete+parse([timeline[key]], '', acct_id, tlid,"",mute,"mix"); templete = templete + parse([timeline[key]], '', acct_id, tlid, "", mute, "mix");
}else if(type=="plus"){ } else if (type == "plus") {
if(timeline[key].account.acct==timeline[key].account.username){ if (timeline[key].account.acct == timeline[key].account.username) {
templete = templete+parse([timeline[key]], '', acct_id, tlid,"",mute,"mix"); templete = templete + parse([timeline[key]], '', acct_id, tlid, "", mute, "mix");
} }
} }
} }
} }
}); });
$("#timeline_" + tlid).append(templete); $("#timeline_" + tlid).append(templete);
additional(acct_id, tlid); additional(acct_id, tlid);
jQuery("time.timeago").timeago(); jQuery("time.timeago").timeago();
moreloading=false; moreloading = false;
todc(); todc();
}); });
}); });
} }

View File

@ -1,144 +1,144 @@
//通知 //通知
//取得+Streaming接続 //取得+Streaming接続
function notf(acct_id, tlid, sys){ function notf(acct_id, tlid, sys) {
if (sys == "direct") { if (sys == "direct") {
notfColumn(acct_id, tlid, sys) notfColumn(acct_id, tlid, sys)
} else { } else {
notfCommon(acct_id, tlid, sys) notfCommon(acct_id, tlid, sys)
} }
} }
function notfColumn(acct_id, tlid, sys){ function notfColumn(acct_id, tlid, sys) {
todo("Notifications Loading..."); todo("Notifications Loading...");
var native=localStorage.getItem("nativenotf"); var native = localStorage.getItem("nativenotf");
var at = localStorage.getItem("acct_"+ acct_id + "_at"); var at = localStorage.getItem("acct_" + acct_id + "_at");
if(!native){ if (!native) {
native="yes"; native = "yes";
} }
var domain = localStorage.getItem("domain_" + acct_id); var domain = localStorage.getItem("domain_" + acct_id);
var httpreq = new XMLHttpRequest(); var httpreq = new XMLHttpRequest();
if(localStorage.getItem("mode_" + domain)=="misskey"){ if (localStorage.getItem("mode_" + domain) == "misskey") {
var misskey=true; var misskey = true;
var start = "https://" + domain + "/api/i/notifications"; var start = "https://" + domain + "/api/i/notifications";
httpreq.open("POST", start, true); httpreq.open("POST", start, true);
httpreq.setRequestHeader('Content-Type', 'application/json'); httpreq.setRequestHeader('Content-Type', 'application/json');
var body=JSON.stringify({ var body = JSON.stringify({
i:at i: at
}); });
}else{ } else {
var misskey=false; var misskey = false;
if(localStorage.getItem("exclude-"+tlid)){ if (localStorage.getItem("exclude-" + tlid)) {
var exc=localStorage.getItem("exclude-"+tlid); var exc = localStorage.getItem("exclude-" + tlid);
}else{ } else {
var exc=""; var exc = "";
} }
var start = "https://" + domain + "/api/v1/notifications"+exc; var start = "https://" + domain + "/api/v1/notifications" + exc;
httpreq.open("GET", start, true); httpreq.open("GET", start, true);
httpreq.setRequestHeader('Content-Type', 'application/json'); httpreq.setRequestHeader('Content-Type', 'application/json');
httpreq.setRequestHeader('Authorization', 'Bearer ' + at); httpreq.setRequestHeader('Authorization', 'Bearer ' + at);
var body=""; var body = "";
} }
httpreq.responseType = "json"; httpreq.responseType = "json";
httpreq.send(body); httpreq.send(body);
httpreq.onreadystatechange = function() { httpreq.onreadystatechange = function () {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
var json = httpreq.response; var json = httpreq.response;
var max_id = httpreq.getResponseHeader("link"); var max_id = httpreq.getResponseHeader("link");
if(max_id){ if (max_id) {
max_id=max_id.match(/[?&]{1}max_id=([0-9]+)/)[1] max_id = max_id.match(/[?&]{1}max_id=([0-9]+)/)[1]
} }
if(json[0]){ if (json[0]) {
var templete=""; var templete = "";
var lastnotf=localStorage.getItem("lastnotf_" + acct_id); var lastnotf = localStorage.getItem("lastnotf_" + acct_id);
localStorage.setItem("lastnotf_" + acct_id,json[0].id); localStorage.setItem("lastnotf_" + acct_id, json[0].id);
Object.keys(json).forEach(function(key) { Object.keys(json).forEach(function (key) {
var obj = json[key]; var obj = json[key];
if(lastnotf==obj.id && key>0 && native=="yes"){ if (lastnotf == obj.id && key > 0 && native == "yes") {
var ct=key; var ct = key;
if(key>14){ if (key > 14) {
ct="15+"; ct = "15+";
} }
var electron = require("electron"); var electron = require("electron");
var ipc = electron.ipcRenderer; var ipc = electron.ipcRenderer;
var os = electron.remote.process.platform; var os = electron.remote.process.platform;
var options = { var options = {
body: ct+lang.lang_notf_new, body: ct + lang.lang_notf_new,
icon: localStorage.getItem("prof_"+acct_id) icon: localStorage.getItem("prof_" + acct_id)
}; };
if(os=="darwin"){ if (os == "darwin") {
var n = new Notification('TheDesk:'+domain, options); var n = new Notification('TheDesk:' + domain, options);
}else{ } else {
ipc.send('native-notf', ['TheDesk:'+domain,ct+lang.lang_notf_new,localStorage.getItem("prof_"+acct_id)]); ipc.send('native-notf', ['TheDesk:' + domain, ct + lang.lang_notf_new, localStorage.getItem("prof_" + acct_id)]);
}
}
if(localStorage.getItem("filter_"+ acct_id)!="undefined"){
var mute=getFilterType(JSON.parse(localStorage.getItem("filter_"+ acct_id)),"notif");
}else{
var mute=[];
}
if(obj.type!="follow"){
if(misskey){
templete = templete+misskeyParse([obj], 'notf', acct_id, 'notf', -1, mute);
}else{
templete = templete+parse([obj], 'notf', acct_id, 'notf', -1, mute);
} }
}else{
if(misskey){ }
templete = templete+misskeyUserparse([obj], 'notf', acct_id, 'notf', -1, mute); if (localStorage.getItem("filter_" + acct_id) != "undefined") {
}else{ var mute = getFilterType(JSON.parse(localStorage.getItem("filter_" + acct_id)), "notif");
templete = templete+userparse([obj.account], 'notf', acct_id, 'notf', -1); } else {
var mute = [];
}
if (obj.type != "follow") {
if (misskey) {
templete = templete + misskeyParse([obj], 'notf', acct_id, 'notf', -1, mute);
} else {
templete = templete + parse([obj], 'notf', acct_id, 'notf', -1, mute);
} }
} else {
if (misskey) {
templete = templete + misskeyUserparse([obj], 'notf', acct_id, 'notf', -1, mute);
} else {
templete = templete + userparse([obj.account], 'notf', acct_id, 'notf', -1);
}
} }
}); });
templete=templete+'<div class="hide notif-marker" data-maxid="'+max_id+'"></div>'; templete = templete + '<div class="hide notif-marker" data-maxid="' + max_id + '"></div>';
$("#timeline_" + tlid).html(templete); $("#timeline_" + tlid).html(templete);
$("#landing_" + tlid).hide(); $("#landing_" + tlid).hide();
jQuery("time.timeago").timeago(); jQuery("time.timeago").timeago();
} }
$("#notf-box").addClass("fetched"); $("#notf-box").addClass("fetched");
todc(); todc();
} }
} }
if(!misskey){ if (!misskey) {
if(localStorage.getItem("streaming_" + acct_id)){ if (localStorage.getItem("streaming_" + acct_id)) {
var wss=localStorage.getItem("streaming_" + acct_id) var wss = localStorage.getItem("streaming_" + acct_id)
}else{ } else {
var wss="wss://"+domain var wss = "wss://" + domain
} }
var start = wss + "/api/v1/streaming/?stream=user&access_token=" + var start = wss + "/api/v1/streaming/?stream=user&access_token=" +
at; at;
}else{ } else {
var start = "wss://" + domain + "/?i=" + var start = "wss://" + domain + "/?i=" +
at; at;
} }
} }
function notfCommon(acct_id, tlid, sys) { function notfCommon(acct_id, tlid, sys) {
todo("Notifications Loading..."); todo("Notifications Loading...");
var native=localStorage.getItem("nativenotf"); var native = localStorage.getItem("nativenotf");
var at = localStorage.getItem("acct_"+ acct_id + "_at"); var at = localStorage.getItem("acct_" + acct_id + "_at");
if(!native){ if (!native) {
native="yes"; native = "yes";
} }
var domain = localStorage.getItem("domain_" + acct_id); var domain = localStorage.getItem("domain_" + acct_id);
if(localStorage.getItem("mode_" + domain)=="misskey"){ if (localStorage.getItem("mode_" + domain) == "misskey") {
var misskey=true; var misskey = true;
var start = "https://" + domain + "/api/i/notifications"; var start = "https://" + domain + "/api/i/notifications";
var i={ var i = {
method: 'POST', method: 'POST',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
}, },
body:JSON.stringify({ body: JSON.stringify({
i:at i: at
}) })
} }
}else{ } else {
var misskey=false; var misskey = false;
var start = "https://" + domain + "/api/v1/notifications"; var start = "https://" + domain + "/api/v1/notifications";
var i={ var i = {
method: 'GET', method: 'GET',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
@ -146,231 +146,231 @@ function notfCommon(acct_id, tlid, sys) {
}, },
} }
} }
fetch(start, i).then(function(response) { fetch(start, i).then(function (response) {
console.log("header to get param:"+response.headers.get('link')); console.log("header to get param:" + response.headers.get('link'));
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
if(json[0]){ if (json[0]) {
var templete=""; var templete = "";
var lastnotf=localStorage.getItem("lastnotf_" + acct_id); var lastnotf = localStorage.getItem("lastnotf_" + acct_id);
localStorage.setItem("lastnotf_" + acct_id,json[0].id); localStorage.setItem("lastnotf_" + acct_id, json[0].id);
Object.keys(json).forEach(function(key) { Object.keys(json).forEach(function (key) {
var obj = json[key]; var obj = json[key];
if(lastnotf==obj.id && key>0 && native=="yes"){ if (lastnotf == obj.id && key > 0 && native == "yes") {
var ct=key; var ct = key;
if(key>14){ if (key > 14) {
ct="15+"; ct = "15+";
}
var electron = require("electron");
var ipc = electron.ipcRenderer;
var os = electron.remote.process.platform;
var options = {
body: ct+lang.lang_notf_new,
icon: localStorage.getItem("prof_"+acct_id)
};
if(os=="darwin"){
var n = new Notification('TheDesk:'+domain, options);
}else{
ipc.send('native-notf', ['TheDesk:'+domain,ct+lang.lang_notf_new,localStorage.getItem("prof_"+acct_id)]);
} }
var electron = require("electron");
} var ipc = electron.ipcRenderer;
if(localStorage.getItem("filter_"+ acct_id)!="undefined"){ var os = electron.remote.process.platform;
var mute=getFilterType(JSON.parse(localStorage.getItem("filter_"+ acct_id)),"notif"); var options = {
}else{ body: ct + lang.lang_notf_new,
var mute=[]; icon: localStorage.getItem("prof_" + acct_id)
} };
if(obj.type!="follow"){ if (os == "darwin") {
if(misskey){ var n = new Notification('TheDesk:' + domain, options);
templete = templete+misskeyParse([obj], 'notf', acct_id, 'notf', -1, mute); } else {
}else{ ipc.send('native-notf', ['TheDesk:' + domain, ct + lang.lang_notf_new, localStorage.getItem("prof_" + acct_id)]);
templete = templete+parse([obj], 'notf', acct_id, 'notf', -1, mute); }
} }
}else{ if (localStorage.getItem("filter_" + acct_id) != "undefined") {
if(misskey){ var mute = getFilterType(JSON.parse(localStorage.getItem("filter_" + acct_id)), "notif");
templete = templete+misskeyUserparse([obj], 'notf', acct_id, 'notf', -1, mute); } else {
}else{ var mute = [];
templete = templete+userparse([obj.account], 'notf', acct_id, 'notf', -1);
} }
if (obj.type != "follow") {
} if (misskey) {
}); templete = templete + misskeyParse([obj], 'notf', acct_id, 'notf', -1, mute);
$("div[data-notf=" + acct_id +"]").html(templete); } else {
$("#landing_" + tlid).hide(); templete = templete + parse([obj], 'notf', acct_id, 'notf', -1, mute);
jQuery("time.timeago").timeago(); }
} else {
if (misskey) {
templete = templete + misskeyUserparse([obj], 'notf', acct_id, 'notf', -1, mute);
} else {
templete = templete + userparse([obj.account], 'notf', acct_id, 'notf', -1);
}
}
});
$("div[data-notf=" + acct_id + "]").html(templete);
$("#landing_" + tlid).hide();
jQuery("time.timeago").timeago();
} }
$("#notf-box").addClass("fetched"); $("#notf-box").addClass("fetched");
todc(); todc();
notfWS(misskey,acct_id,tlid,domain,at) notfWS(misskey, acct_id, tlid, domain, at)
}); });
} }
function notfWS(misskey,acct_id,tlid,domain,at){ function notfWS(misskey, acct_id, tlid, domain, at) {
if(!misskey){ if (!misskey) {
if(localStorage.getItem("streaming_" + acct_id)){ if (localStorage.getItem("streaming_" + acct_id)) {
var wss=localStorage.getItem("streaming_" + acct_id) var wss = localStorage.getItem("streaming_" + acct_id)
}else{ } else {
var wss="wss://"+domain var wss = "wss://" + domain
} }
var start = wss + "/api/v1/streaming/?stream=user&access_token=" + var start = wss + "/api/v1/streaming/?stream=user&access_token=" +
at; at;
var wsid = websocketNotf.length; var wsid = websocketNotf.length;
websocketNotf[acct_id] = new WebSocket(start); websocketNotf[acct_id] = new WebSocket(start);
websocketNotf[acct_id].onopen = function(mess) { websocketNotf[acct_id].onopen = function (mess) {
console.table({"acct_id":acct_id,"type":"Connect Streaming API(Notf)","domain":domain,"message":[mess]}) console.table({ "acct_id": acct_id, "type": "Connect Streaming API(Notf)", "domain": domain, "message": [mess] })
$("i[data-notf=" + acct_id +"]").removeClass("red-text"); $("i[data-notf=" + acct_id + "]").removeClass("red-text");
} }
websocketNotf[acct_id].onmessage = function(mess) { websocketNotf[acct_id].onmessage = function (mess) {
console.log(["Receive Streaming API(Notf):"+acct_id+"("+domain+")",JSON.parse(JSON.parse(mess.data).payload)]); console.log(["Receive Streaming API(Notf):" + acct_id + "(" + domain + ")", JSON.parse(JSON.parse(mess.data).payload)]);
var popup = localStorage.getItem("popup"); var popup = localStorage.getItem("popup");
if (!popup) { if (!popup) {
popup = 0; popup = 0;
} }
var obj = JSON.parse(JSON.parse(mess.data).payload); var obj = JSON.parse(JSON.parse(mess.data).payload);
var type = JSON.parse(mess.data).event; var type = JSON.parse(mess.data).event;
if (type == "notification") { if (type == "notification") {
var templete=""; var templete = "";
localStorage.setItem("lastnotf_" + acct_id,obj.id); localStorage.setItem("lastnotf_" + acct_id, obj.id);
if(obj.type!="follow"){ if (obj.type != "follow") {
templete = parse([obj], 'notf', acct_id, 'notf', popup); templete = parse([obj], 'notf', acct_id, 'notf', popup);
}else{ } else {
templete = userparse([obj], 'notf', acct_id, 'notf', popup); templete = userparse([obj], 'notf', acct_id, 'notf', popup);
}
if (!$("div[data-notfIndv=" + acct_id + "_" + obj.id + "]").length) {
$("div[data-notf=" + acct_id + "]").prepend(templete);
$("div[data-const=notf_" + acct_id + "]").prepend(templete);
}
jQuery("time.timeago").timeago();
} else if (type == "delete") {
$("[toot-id=" + obj + "]").hide();
$("[toot-id=" + obj + "]").remove();
} }
if(!$("div[data-notfIndv=" + acct_id +"_"+obj.id+"]").length){
$("div[data-notf=" + acct_id +"]").prepend(templete);
$("div[data-const=notf_"+acct_id+"]").prepend(templete);
}
jQuery("time.timeago").timeago();
} else if (type == "delete") {
$("[toot-id=" + obj + "]").hide();
$("[toot-id=" + obj + "]").remove();
} }
websocketNotf[acct_id].onerror = function (error) {
console.error('WebSocket Error ' + error);
notfWS(misskey, acct_id, tlid, domain, at)
};
} }
websocketNotf[acct_id].onerror = function(error) {
console.error('WebSocket Error ' + error);
notfWS(misskey,acct_id,tlid,domain,at)
};
}
} }
//一定のスクロールで発火 //一定のスクロールで発火
function notfmore(tlid) { function notfmore(tlid) {
console.log({"status":"kicked","status":moreloading}); console.log({ "status": "kicked", "status": moreloading });
var multi = localStorage.getItem("column"); var multi = localStorage.getItem("column");
var obj = JSON.parse(multi); var obj = JSON.parse(multi);
var acct_id = obj[tlid].domain; var acct_id = obj[tlid].domain;
if (!type) { if (!type) {
var type = obj[tlid].type; var type = obj[tlid].type;
}else{ } else {
var data; var data;
} }
var sid = $("#timeline_" + tlid + " .notif-marker").last().attr("data-maxid"); var sid = $("#timeline_" + tlid + " .notif-marker").last().attr("data-maxid");
var at = localStorage.getItem("acct_"+ acct_id + "_at"); var at = localStorage.getItem("acct_" + acct_id + "_at");
var domain = localStorage.getItem("domain_" + acct_id); var domain = localStorage.getItem("domain_" + acct_id);
if (sid && !moreloading) { if (sid && !moreloading) {
moreloading=true; moreloading = true;
var httpreq = new XMLHttpRequest(); var httpreq = new XMLHttpRequest();
if(localStorage.getItem("mode_" + domain)=="misskey"){ if (localStorage.getItem("mode_" + domain) == "misskey") {
var misskey=true; var misskey = true;
var start = "https://" + domain + "/api/i/notifications"; var start = "https://" + domain + "/api/i/notifications";
httpreq.open(POST, start, true); httpreq.open(POST, start, true);
httpreq.setRequestHeader('Content-Type', 'application/json'); httpreq.setRequestHeader('Content-Type', 'application/json');
var body=JSON.stringify({ var body = JSON.stringify({
i:at, i: at,
untilID:sid untilID: sid
}); });
}else{ } else {
var misskey=false; var misskey = false;
if(localStorage.getItem("exclude-"+tlid)){ if (localStorage.getItem("exclude-" + tlid)) {
var exc=localStorage.getItem("exclude-"+tlid)+"&max_id="+sid; var exc = localStorage.getItem("exclude-" + tlid) + "&max_id=" + sid;
}else{ } else {
var exc="?max_id="+sid; var exc = "?max_id=" + sid;
}
var start = "https://" + domain + "/api/v1/notifications" + exc;
httpreq.open("GET", start, true);
httpreq.setRequestHeader('Content-Type', 'application/json');
httpreq.setRequestHeader('Authorization', 'Bearer ' + at);
var body = "";
} }
var start = "https://" + domain + "/api/v1/notifications"+exc;
httpreq.open("GET", start, true); httpreq.responseType = "json";
httpreq.setRequestHeader('Content-Type', 'application/json'); httpreq.send(body);
httpreq.setRequestHeader('Authorization', 'Bearer ' + at); httpreq.onreadystatechange = function () {
var body=""; if (httpreq.readyState === 4) {
} var json = httpreq.response;
console.log(["More notifications on " + tlid, json]);
httpreq.responseType = "json"; var max_id = httpreq.getResponseHeader("link").match(/[?&]{1}max_id=([0-9]+)/)[1];
httpreq.send(body); if (json[0]) {
httpreq.onreadystatechange = function() { var templete = "";
if (httpreq.readyState === 4) { var lastnotf = localStorage.getItem("lastnotf_" + acct_id);
var json = httpreq.response; localStorage.setItem("lastnotf_" + acct_id, json[0].id);
console.log(["More notifications on "+tlid,json]); Object.keys(json).forEach(function (key) {
var max_id = httpreq.getResponseHeader("link").match(/[?&]{1}max_id=([0-9]+)/)[1]; var obj = json[key];
if(json[0]){ if (localStorage.getItem("filter_" + acct_id) != "undefined") {
var templete=""; var mute = getFilterType(JSON.parse(localStorage.getItem("filter_" + acct_id)), "notif");
var lastnotf=localStorage.getItem("lastnotf_" + acct_id); } else {
localStorage.setItem("lastnotf_" + acct_id,json[0].id); var mute = [];
Object.keys(json).forEach(function(key) {
var obj = json[key];
if(localStorage.getItem("filter_"+ acct_id)!="undefined"){
var mute=getFilterType(JSON.parse(localStorage.getItem("filter_"+ acct_id)),"notif");
}else{
var mute=[];
}
if(obj.type!="follow"){
if(misskey){
templete = templete+misskeyParse([obj], 'notf', acct_id, 'notf', -1, mute);
}else{
templete = templete+parse([obj], 'notf', acct_id, 'notf', -1, mute);
} }
}else{ if (obj.type != "follow") {
if(misskey){ if (misskey) {
templete = templete+misskeyUserparse([obj], 'notf', acct_id, 'notf', -1, mute); templete = templete + misskeyParse([obj], 'notf', acct_id, 'notf', -1, mute);
}else{ } else {
templete = templete+userparse([obj.account], 'notf', acct_id, 'notf', -1); templete = templete + parse([obj], 'notf', acct_id, 'notf', -1, mute);
}
} else {
if (misskey) {
templete = templete + misskeyUserparse([obj], 'notf', acct_id, 'notf', -1, mute);
} else {
templete = templete + userparse([obj.account], 'notf', acct_id, 'notf', -1);
}
} }
});
} moreloading = false;
}); templete = templete + '<div class="hide notif-marker" data-maxid="' + max_id + '"></div>';
moreloading=false; $("#timeline_" + tlid).append(templete);
templete=templete+'<div class="hide notif-marker" data-maxid="'+max_id+'"></div>'; $("#landing_" + tlid).hide();
$("#timeline_" + tlid).append(templete); jQuery("time.timeago").timeago();
$("#landing_" + tlid).hide();
jQuery("time.timeago").timeago();
} }
$("#notf-box").addClass("fetched"); $("#notf-box").addClass("fetched");
todc(); todc();
}
} }
} }
} }
}
//通知トグルボタン //通知トグルボタン
function notfToggle(acct, tlid) { function notfToggle(acct, tlid) {
if($("#notf-box_" + tlid).hasClass("column-hide")){ if ($("#notf-box_" + tlid).hasClass("column-hide")) {
$("#notf-box_" + tlid).css("display","block") $("#notf-box_" + tlid).css("display", "block")
$("#notf-box_" + tlid).animate({ $("#notf-box_" + tlid).animate({
'height': '400px' 'height': '400px'
},{ }, {
'duration': 300, 'duration': 300,
'complete': function(){ 'complete': function () {
$("#notf-box_" + tlid).css("overflow-y","scroll") $("#notf-box_" + tlid).css("overflow-y", "scroll")
$("#notf-box_" + tlid).removeClass("column-hide") $("#notf-box_" + tlid).removeClass("column-hide")
} }
}); });
}else{ } else {
$("#notf-box_" + tlid).css("overflow-y","hidden") $("#notf-box_" + tlid).css("overflow-y", "hidden")
$("#notf-box_" + tlid).animate({ $("#notf-box_" + tlid).animate({
'height': '0' 'height': '0'
},{ }, {
'duration': 300, 'duration': 300,
'complete': function(){ 'complete': function () {
$("#notf-box_" + tlid).addClass("column-hide") $("#notf-box_" + tlid).addClass("column-hide")
$("#notf-box_" + tlid).css("display","none") $("#notf-box_" + tlid).css("display", "none")
} }
}); });
} }
notfCanceler(acct) notfCanceler(acct)
} }
function notfCanceler(acct){ function notfCanceler(acct) {
$(".notf-reply_" + acct).text(0); $(".notf-reply_" + acct).text(0);
localStorage.removeItem("notf-reply_" + acct) localStorage.removeItem("notf-reply_" + acct)
$(".notf-reply_" + acct).addClass("hide"); $(".notf-reply_" + acct).addClass("hide");
@ -385,13 +385,13 @@ function notfCanceler(acct){
$(".notf-follow_" + acct).addClass("hide"); $(".notf-follow_" + acct).addClass("hide");
$(".notf-icon_" + acct).removeClass("red-text"); $(".notf-icon_" + acct).removeClass("red-text");
} }
function allNotfRead(){ function allNotfRead() {
var multi = localStorage.getItem("multi"); var multi = localStorage.getItem("multi");
if (multi) { if (multi) {
var obj = JSON.parse(multi); var obj = JSON.parse(multi);
Object.keys(obj).forEach(function(key) { Object.keys(obj).forEach(function (key) {
notfCanceler(key) notfCanceler(key)
}); });
} }
} }
allNotfRead() allNotfRead()

File diff suppressed because it is too large Load Diff

View File

@ -1,17 +1,17 @@
//アンケートのトグル //アンケートのトグル
function pollToggle() { function pollToggle() {
if ($("#poll").hasClass("hide")) { if ($("#poll").hasClass("hide")) {
$("#right-side").show() $("#right-side").show()
$("#poll").removeClass("hide") $("#poll").removeClass("hide")
} else { } else {
$("#right-side").hide() $("#right-side").hide()
$("#emoji").addClass("hide") $("#emoji").addClass("hide")
$("#poll").addClass("hide") $("#poll").addClass("hide")
} }
} }
function pollProviderCk(){ function pollProviderCk() {
$(".poll-provider").addClass("hide"); $(".poll-provider").addClass("hide");
$("#"+$("#poll-sel").val()).removeClass("hide"); $("#" + $("#poll-sel").val()).removeClass("hide");
} }
/* /*
function pollAddtime(num){ function pollAddtime(num){
@ -21,98 +21,98 @@ function pollAddtime(num){
pollCalc(); pollCalc();
} }
*/ */
function pollCalc(){ function pollCalc() {
var days=$("#days_poll").val(); var days = $("#days_poll").val();
var hrs=$("#hours_poll").val(); var hrs = $("#hours_poll").val();
var mins=$("#mins_poll").val(); var mins = $("#mins_poll").val();
console.log("Poll calc:"+days*86400+hrs*3600+mins*60) console.log("Poll calc:" + days * 86400 + hrs * 3600 + mins * 60)
return days*86400+hrs*3600+mins*60; return days * 86400 + hrs * 3600 + mins * 60;
} }
//Vote //Vote
function voteSelMastodon(acct_id,id,to,mul){ function voteSelMastodon(acct_id, id, to, mul) {
if($('.vote_'+acct_id+'_'+id+'_'+to).hasClass("sel")){ if ($('.vote_' + acct_id + '_' + id + '_' + to).hasClass("sel")) {
$('.vote_'+acct_id+'_'+id+'_'+to).css("background-color","transparent") $('.vote_' + acct_id + '_' + id + '_' + to).css("background-color", "transparent")
$('.vote_'+acct_id+'_'+id+'_'+to).removeClass("sel"); $('.vote_' + acct_id + '_' + id + '_' + to).removeClass("sel");
}else{ } else {
if(!mul){ if (!mul) {
$('.vote_'+acct_id+'_'+id+' div' ).each(function(i, elem) { $('.vote_' + acct_id + '_' + id + ' div').each(function (i, elem) {
if(i==to){ if (i == to) {
$(this).css("background-color","var(--emphasized)"); $(this).css("background-color", "var(--emphasized)");
$(this).addClass("sel"); $(this).addClass("sel");
}else{ } else {
$(this).css("background-color","transparent") $(this).css("background-color", "transparent")
$(this).removeClass("sel"); $(this).removeClass("sel");
} }
}); });
}else{ } else {
$('.vote_'+acct_id+'_'+id+'_'+to).css("background-color","var(--emphasized)") $('.vote_' + acct_id + '_' + id + '_' + to).css("background-color", "var(--emphasized)")
$('.vote_'+acct_id+'_'+id+'_'+to).addClass("sel"); $('.vote_' + acct_id + '_' + id + '_' + to).addClass("sel");
} }
} }
} }
function voteMastodon(acct_id,id){ function voteMastodon(acct_id, id) {
var choice=[]; var choice = [];
$('.vote_'+acct_id+'_'+id+' div' ).each(function(i, elem) { $('.vote_' + acct_id + '_' + id + ' div').each(function (i, elem) {
if($(this).hasClass("sel")){ if ($(this).hasClass("sel")) {
choice.push(i+""); choice.push(i + "");
} }
}); });
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");
var start = "https://" + domain + "/api/v1/polls/"+id+"/votes"; var start = "https://" + domain + "/api/v1/polls/" + id + "/votes";
if(localStorage.getItem("mode_" + domain)=="misskey"){ if (localStorage.getItem("mode_" + domain) == "misskey") {
return false; return false;
} }
var httpreq = new XMLHttpRequest(); var httpreq = new XMLHttpRequest();
httpreq.open('POST', start, true); httpreq.open('POST', start, true);
httpreq.setRequestHeader('Content-Type', 'application/json'); httpreq.setRequestHeader('Content-Type', 'application/json');
httpreq.setRequestHeader('Authorization', 'Bearer ' + at); httpreq.setRequestHeader('Authorization', 'Bearer ' + at);
httpreq.responseType = "json"; httpreq.responseType = "json";
httpreq.send(JSON.stringify({choices:choice})); httpreq.send(JSON.stringify({ choices: choice }));
httpreq.onreadystatechange = function() { httpreq.onreadystatechange = function () {
voteMastodonrefresh(acct_id,id) voteMastodonrefresh(acct_id, id)
} }
} }
function showResult(acct_id,id){ function showResult(acct_id, id) {
$('.vote_'+acct_id+'_'+id+'_result').toggleClass("hide") $('.vote_' + acct_id + '_' + id + '_result').toggleClass("hide")
} }
function voteMastodonrefresh(acct_id,id){ function voteMastodonrefresh(acct_id, id) {
var datetype = localStorage.getItem("datetype"); var datetype = localStorage.getItem("datetype");
if (!datetype) { if (!datetype) {
datetype = "absolute"; datetype = "absolute";
} }
var httpreqd = new XMLHttpRequest(); var httpreqd = new XMLHttpRequest();
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");
var start = "https://" + domain + "/api/v1/polls/"+id; var start = "https://" + domain + "/api/v1/polls/" + id;
httpreqd.open('GET', start, true); httpreqd.open('GET', start, true);
httpreqd.setRequestHeader('Content-Type', 'application/json'); httpreqd.setRequestHeader('Content-Type', 'application/json');
httpreqd.responseType = 'json'; httpreqd.responseType = 'json';
httpreqd.send(JSON.stringify({i:at,noteId:id})); httpreqd.send(JSON.stringify({ i: at, noteId: id }));
httpreqd.onreadystatechange = function() { httpreqd.onreadystatechange = function () {
if (httpreqd.readyState == 4) { if (httpreqd.readyState == 4) {
var json = httpreqd.response; var json = httpreqd.response;
console.log(["Refresh vote",json]); console.log(["Refresh vote", json]);
if(!json){ if (!json) {
return false; return false;
} }
var poll=""; var poll = "";
var choices=json.options; var choices = json.options;
var myvote=lang.lang_parse_voted; var myvote = lang.lang_parse_voted;
var result_hide=""; var result_hide = "";
Object.keys(choices).forEach(function(keyc) { Object.keys(choices).forEach(function (keyc) {
var choice = choices[keyc]; var choice = choices[keyc];
if(!json.voted){ if (!json.voted) {
votesel='voteSelMastodon(\''+acct_id+'\',\''+json.id+'\','+keyc+','+json.multiple+')'; votesel = 'voteSelMastodon(\'' + acct_id + '\',\'' + json.id + '\',' + keyc + ',' + json.multiple + ')';
} }
poll=poll+'<div class="pointer vote vote_'+acct_id+'_'+json.id+'_'+keyc+'" onclick="'+votesel+'">'+escapeHTML(choice.title)+'<span class="vote_'+acct_id+'_'+json.id+'_result '+result_hide+'">('+choice.votes_count+')</span></div>'; poll = poll + '<div class="pointer vote vote_' + acct_id + '_' + json.id + '_' + keyc + '" onclick="' + votesel + '">' + escapeHTML(choice.title) + '<span class="vote_' + acct_id + '_' + json.id + '_result ' + result_hide + '">(' + choice.votes_count + ')</span></div>';
}); });
poll=poll+myvote+'<span class="cbadge cbadge-hover" title="' + date(json.expires_at, 'absolute') + poll = poll + myvote + '<span class="cbadge cbadge-hover" title="' + date(json.expires_at, 'absolute') +
'"><i class="far fa-calendar-times"></i>' + '"><i class="far fa-calendar-times"></i>' +
date(json.expires_at, datetype) + '</span>'; date(json.expires_at, datetype) + '</span>';
$('.vote_'+acct_id+'_'+json.id).html(poll) $('.vote_' + acct_id + '_' + json.id).html(poll)
} }
} }
} }

View File

@ -1,38 +1,38 @@
$voise = null; $voise = null;
$voiseName = lang.lang_speech; $voiseName = lang.lang_speech;
$voices = speechSynthesis.getVoices(); $voices = speechSynthesis.getVoices();
$synthes = new SpeechSynthesisUtterance(); $synthes = new SpeechSynthesisUtterance();
$voise = $.grep($voices, function(n, i){return n.name == $voiseName})[0]; $voise = $.grep($voices, function (n, i) { return n.name == $voiseName })[0];
$synthes.voice = $voise; // 音声の設定 $synthes.voice = $voise; // 音声の設定
localStorage.removeItem("voicebank"); localStorage.removeItem("voicebank");
speechSynthesis.cancel() speechSynthesis.cancel()
if(!localStorage.getItem("voice_vol")){ if (!localStorage.getItem("voice_vol")) {
localStorage.setItem("voice_vol",1) localStorage.setItem("voice_vol", 1)
}
$synthes.rate=localStorage.getItem("voice_speed");
$synthes.pitch=localStorage.getItem("voice_pitch");
$synthes.volume=localStorage.getItem("voice_vol");
function say(msgr){
msg=voiceParse(msgr);
var voice=localStorage.getItem("voicebank");
var obj = JSON.parse(voice);
if(!obj){
var json = JSON.stringify([msg]);
localStorage.setItem("voicebank", json);
}else{
obj.push([msg]);
var json = JSON.stringify(obj);
localStorage.setItem("voicebank", json);
}
} }
$repeat = setInterval(function() { $synthes.rate = localStorage.getItem("voice_speed");
if(!speechSynthesis.speaking){ $synthes.pitch = localStorage.getItem("voice_pitch");
var voice=localStorage.getItem("voicebank"); $synthes.volume = localStorage.getItem("voice_vol");
if(voice){ function say(msgr) {
msg = voiceParse(msgr);
var voice = localStorage.getItem("voicebank");
var obj = JSON.parse(voice);
if (!obj) {
var json = JSON.stringify([msg]);
localStorage.setItem("voicebank", json);
} else {
obj.push([msg]);
var json = JSON.stringify(obj);
localStorage.setItem("voicebank", json);
}
}
$repeat = setInterval(function () {
if (!speechSynthesis.speaking) {
var voice = localStorage.getItem("voicebank");
if (voice) {
var obj = JSON.parse(voice); var obj = JSON.parse(voice);
if(obj[0]){ if (obj[0]) {
$synthes.text = obj[0]; $synthes.text = obj[0];
speechSynthesis.speak($synthes); speechSynthesis.speak($synthes);
obj.splice(0, 1); obj.splice(0, 1);
var json = JSON.stringify(obj); var json = JSON.stringify(obj);
@ -41,68 +41,68 @@ $repeat = setInterval(function() {
} }
} }
}, 300); }, 300);
function voiceParse(msg){ function voiceParse(msg) {
msg = $.strip_tags(msg); msg = $.strip_tags(msg);
msg = msg.replace(/#/g, ""); msg = msg.replace(/#/g, "");
msg = msg.replace(/'/g, ""); msg = msg.replace(/'/g, "");
msg = msg.replace(/"/g, ""); msg = msg.replace(/"/g, "");
msg = msg.replace(/https?:\/\/[a-zA-Z0-9./-@_=?%&-]+/g, ""); msg = msg.replace(/https?:\/\/[a-zA-Z0-9./-@_=?%&-]+/g, "");
return msg; return msg;
} }
function voiceToggle(tlid) { function voiceToggle(tlid) {
var voiceck = localStorage.getItem("voice_" + tlid); var voiceck = localStorage.getItem("voice_" + tlid);
if (voiceck) { if (voiceck) {
localStorage.removeItem("voice_" + tlid); localStorage.removeItem("voice_" + tlid);
speechSynthesis.cancel() speechSynthesis.cancel()
$("#sta-voice-" + tlid).text("Off"); $("#sta-voice-" + tlid).text("Off");
$("#sta-voice-" + tlid).css("color",'red'); $("#sta-voice-" + tlid).css("color", 'red');
parseColumn(); parseColumn();
} else { } else {
localStorage.setItem("voice_" + tlid, "true"); localStorage.setItem("voice_" + tlid, "true");
$("#sta-voice-" + tlid).text("On"); $("#sta-voice-" + tlid).text("On");
$("#sta-voice-" + tlid).css("color",'#009688'); $("#sta-voice-" + tlid).css("color", '#009688');
parseColumn(); parseColumn();
} }
} }
function voiceCheck(tlid) { function voiceCheck(tlid) {
var voiceck = localStorage.getItem("voice_" + tlid); var voiceck = localStorage.getItem("voice_" + tlid);
if (voiceck) { if (voiceck) {
$("#sta-voice-" + tlid).text("On"); $("#sta-voice-" + tlid).text("On");
$("#sta-voice-" + tlid).css("color",'#009688'); $("#sta-voice-" + tlid).css("color", '#009688');
} else { } else {
$("#sta-voice-" + tlid).text("Off"); $("#sta-voice-" + tlid).text("Off");
$("#sta-voice-" + tlid).css("color",'red'); $("#sta-voice-" + tlid).css("color", 'red');
} }
} }
function voicePlay(){ function voicePlay() {
if(speechSynthesis.speaking){ if (speechSynthesis.speaking) {
speechSynthesis.cancel() speechSynthesis.cancel()
}else{ } else {
$synthes.text = $("#voicetxt").val(); $synthes.text = $("#voicetxt").val();
$synthes.rate = $("#voicespeed").val()/10; $synthes.rate = $("#voicespeed").val() / 10;
$synthes.pitch = $("#voicepitch").val()/50; $synthes.pitch = $("#voicepitch").val() / 50;
$synthes.volume = $("#voicevol").val()/100; $synthes.volume = $("#voicevol").val() / 100;
speechSynthesis.speak($synthes); speechSynthesis.speak($synthes);
} }
} }
function voiceSettings(){ function voiceSettings() {
localStorage.setItem("voice_speed", $("#voicespeed").val()/10); localStorage.setItem("voice_speed", $("#voicespeed").val() / 10);
localStorage.setItem("voice_pitch", $("#voicepitch").val()/50); localStorage.setItem("voice_pitch", $("#voicepitch").val() / 50);
localStorage.setItem("voice_vol", $("#voicevol").val()/100); localStorage.setItem("voice_vol", $("#voicevol").val() / 100);
Materialize.toast(lang.lang_speech_refresh, 3000); Materialize.toast(lang.lang_speech_refresh, 3000);
} }
function voiceSettingLoad(){ function voiceSettingLoad() {
var speed=localStorage.getItem("voice_speed"); var speed = localStorage.getItem("voice_speed");
var pitch=localStorage.getItem("voice_pitch"); var pitch = localStorage.getItem("voice_pitch");
var vol=localStorage.getItem("voice_vol"); var vol = localStorage.getItem("voice_vol");
if(speed){ if (speed) {
$("#voicespeed").val(speed*10); $("#voicespeed").val(speed * 10);
} }
if(pitch){ if (pitch) {
$("#voicepitch").val(pitch*50); $("#voicepitch").val(pitch * 50);
} }
if(vol){ if (vol) {
$("#voicevol").val(vol*100); $("#voicevol").val(vol * 100);
} }
} }

View File

@ -4,7 +4,7 @@ function searchMenu() {
$("#left-menu div").removeClass("active"); $("#left-menu div").removeClass("active");
$("#searchMenu").addClass("active"); $("#searchMenu").addClass("active");
$(".menu-content").addClass("hide"); $(".menu-content").addClass("hide");
$("#src-box").removeClass("hide"); $("#src-box").removeClass("hide");
$('ul.tabs').tabs('select_tab', 'src-sta'); $('ul.tabs').tabs('select_tab', 'src-sta');
$("#src-contents").html(""); $("#src-contents").html("");
} }
@ -14,178 +14,178 @@ function src(mode) {
$("#src-contents").html(""); $("#src-contents").html("");
var q = $("#src").val(); var q = $("#src").val();
var acct_id = $("#src-acct-sel").val(); var acct_id = $("#src-acct-sel").val();
if(acct_id=="tootsearch"){ if (acct_id == "tootsearch") {
tsAdd(q) tsAdd(q)
return false; return false;
} }
localStorage.setItem("last-use", acct_id); localStorage.setItem("last-use", 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");
var m = q.match(/^#(.+)$/); var m = q.match(/^#(.+)$/);
if(m){q=m[1];} if (m) { q = m[1]; }
if (user == "--now") { if (user == "--now") {
var user = $('#his-data').attr("user-id"); var user = $('#his-data').attr("user-id");
} }
if(!mode){ if (!mode) {
var start = "https://" + domain + "/api/v2/search?q=" + q var start = "https://" + domain + "/api/v2/search?q=" + q
}else{ } else {
var start = "https://" + domain + "/api/v1/search?q=" + q var start = "https://" + domain + "/api/v1/search?q=" + q
} }
console.log("Try to search at "+start) console.log("Try to search at " + start)
fetch(start, { fetch(start, {
method: 'GET', method: 'GET',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
'Authorization': 'Bearer ' + at 'Authorization': 'Bearer ' + at
}, },
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
src("v1") src("v1")
return false; return false;
}).then(function(json) { }).then(function (json) {
console.log(["Search",json]); console.log(["Search", json]);
//ハッシュタグ //ハッシュタグ
if (json.hashtags[0]) { if (json.hashtags[0]) {
var tags = ""; var tags = "";
Object.keys(json.hashtags).forEach(function(key4) { Object.keys(json.hashtags).forEach(function (key4) {
var tag = json.hashtags[key4]; var tag = json.hashtags[key4];
if(mode){ if (mode) {
tags = tags + '<a onclick="tl(\'tag\',\'' + tag + '\',\'' + acct_id + tags = tags + '<a onclick="tl(\'tag\',\'' + tag + '\',\'' + acct_id +
'\',\'add\')" class="pointer">#' + escapeHTML(tag) + '</a><br> '; '\',\'add\')" class="pointer">#' + escapeHTML(tag) + '</a><br> ';
}else{ } else {
tags=tags+graphDraw(tag); tags = tags + graphDraw(tag);
} }
}); });
$("#src-contents").append("Tags<br>" + tags); $("#src-contents").append("Tags<br>" + tags);
} }
//トゥート //トゥート
if (json.statuses[0]) { if (json.statuses[0]) {
var templete = parse(json.statuses,'',acct_id); var templete = parse(json.statuses, '', acct_id);
$("#src-contents").append("Mentions<br>" + templete); $("#src-contents").append("Mentions<br>" + templete);
} }
//アカウント //アカウント
if (json.accounts[0]) { if (json.accounts[0]) {
var templete = userparse(json.accounts,'',acct_id); var templete = userparse(json.accounts, '', acct_id);
$("#src-contents").append("Accounts<br>" + templete); $("#src-contents").append("Accounts<br>" + templete);
} }
jQuery("time.timeago").timeago(); jQuery("time.timeago").timeago();
}); });
} }
function tsAdd(q){ function tsAdd(q) {
var add = { var add = {
domain: acct_id, domain: acct_id,
type: "tootsearch", type: "tootsearch",
data: q data: q
}; };
var multi = localStorage.getItem("column"); var multi = localStorage.getItem("column");
var obj = JSON.parse(multi); var obj = JSON.parse(multi);
localStorage.setItem("card_" + obj.length,"true"); localStorage.setItem("card_" + obj.length, "true");
obj.push(add); obj.push(add);
var json = JSON.stringify(obj); var json = JSON.stringify(obj);
localStorage.setItem("column", json); localStorage.setItem("column", json);
parseColumn(); parseColumn();
} }
function tootsearch(tlid,q){ function tootsearch(tlid, q) {
var start = "https://tootsearch.chotto.moe/api/v1/search?from=0&sort=created_at%3Adesc&q=" + q var start = "https://tootsearch.chotto.moe/api/v1/search?from=0&sort=created_at%3Adesc&q=" + q
console.log("Toot srrach at "+start) console.log("Toot srrach at " + start)
$("#notice_" + tlid).text("tootsearch("+q+")"); $("#notice_" + tlid).text("tootsearch(" + q + ")");
$("#notice_icon_" + tlid).text("search"); $("#notice_icon_" + tlid).text("search");
fetch(start, { fetch(start, {
method: 'GET', method: 'GET',
headers: { headers: {
'content-type': 'application/json' 'content-type': 'application/json'
}, },
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(raw) { }).then(function (raw) {
var templete=""; var templete = "";
var json=raw.hits.hits; var json = raw.hits.hits;
var max_id = raw["hits"].length; var max_id = raw["hits"].length;
for(var i=0;i<json.length;i++){ for (var i = 0; i < json.length; i++) {
var toot = json[i]["_source"]; var toot = json[i]["_source"];
if(lastid!=toot.uri){ if (lastid != toot.uri) {
if(toot && toot.account){ if (toot && toot.account) {
templete = templete+parse([toot], "noauth", null, tlid, 0, [], "tootsearch") templete = templete + parse([toot], "noauth", null, tlid, 0, [], "tootsearch")
}
} }
var lastid=toot.uri;
} }
if(!templete){ var lastid = toot.uri;
templete=lang.lang_details_nodata;
}else{
templete=templete+'<div class="hide ts-marker" data-maxid="'+max_id+'"></div>';
}
$("#timeline_" + tlid).html(templete);
jQuery("time.timeago").timeago();
});
}
function moreTs(tlid,q){
var sid = $("#timeline_" + tlid + " .ts-marker").last().attr("data-maxid");
moreloading=true;
var start = "https://tootsearch.chotto.moe/api/v1/search?from="+sid+"&sort=created_at%3Adesc&q=" + q
$("#notice_" + tlid).text("tootsearch("+q+")");
$("#notice_icon_" + tlid).text("search");
fetch(start, {
method: 'GET',
headers: {
'content-type': 'application/json'
},
}).then(function(response) {
return response.json();
}).catch(function(error) {
todo(error);
console.error(error);
}).then(function(raw) {
var templete="";
var json=raw.hits.hits;
var max_id = raw["hits"].length;
for(var i=0;i<json.length;i++){
var toot = json[i]["_source"];
if(lastid!=toot.uri){
if(toot && toot.account){
templete = templete+parse([toot], "noauth", null, tlid, 0, [], "tootsearch")
}
}
var lastid=toot.uri;
}
if(!templete){
templete=lang.lang_details_nodata;
}else{
templete=templete+'<div class="hide ts-marker" data-maxid="'+max_id+'"></div>';
}
$("#timeline_" + tlid).append(templete);
jQuery("time.timeago").timeago();
});
}
function graphDraw(tag){
var tags="";
var his=tag.history;
var max=Math.max.apply(null, [his[0].uses,his[1].uses,his[2].uses,his[3].uses,his[4].uses,his[5].uses,his[6].uses]);
var six=50-(his[6].uses/max*50);
var five=50-(his[5].uses/max*50);
var four=50-(his[4].uses/max*50);
var three=50-(his[3].uses/max*50);
var two=50-(his[2].uses/max*50);
var one=50-(his[1].uses/max*50);
var zero=50-(his[0].uses/max*50);
if(max===0){
tags = '<br><br><svg version="1.1" viewbox="0 0 60 50" width="60" height="50">'+
'</svg><span style="font-size:200%">'+his[0].uses+'</span>toots&nbsp;<a onclick="tl(\'tag\',\'' + escapeHTML(tag.name) + '\',\'' + acct_id +
'\',\'add\')" class="pointer">#' + escapeHTML(tag.name) + '</a>&nbsp;'+his[0].accounts+lang.lang_src_people;
}else{
tags = '<br><br><svg version="1.1" viewbox="0 0 60 50" width="60" height="50">'+
'<g><path d="M0,'+six+' L10,'+five+' 20,'+four+' 30,'+three+' 40,'+two+' 50,'+one+' 60,'+zero+'" style="stroke: #9e9e9e; stroke-width: 1;fill: none;"></path></g>'+
'</svg><span style="font-size:200%">'+his[0].uses+'</span>toots&nbsp;<a onclick="tl(\'tag\',\'' + escapeHTML(tag.name) + '\',\'' + acct_id +
'\',\'add\')" class="pointer">#' + escapeHTML(tag.name) + '</a>&nbsp;'+his[0].accounts+lang.lang_src_people;
} }
if (!templete) {
templete = lang.lang_details_nodata;
} else {
templete = templete + '<div class="hide ts-marker" data-maxid="' + max_id + '"></div>';
}
$("#timeline_" + tlid).html(templete);
jQuery("time.timeago").timeago();
});
}
function moreTs(tlid, q) {
var sid = $("#timeline_" + tlid + " .ts-marker").last().attr("data-maxid");
moreloading = true;
var start = "https://tootsearch.chotto.moe/api/v1/search?from=" + sid + "&sort=created_at%3Adesc&q=" + q
$("#notice_" + tlid).text("tootsearch(" + q + ")");
$("#notice_icon_" + tlid).text("search");
fetch(start, {
method: 'GET',
headers: {
'content-type': 'application/json'
},
}).then(function (response) {
return response.json();
}).catch(function (error) {
todo(error);
console.error(error);
}).then(function (raw) {
var templete = "";
var json = raw.hits.hits;
var max_id = raw["hits"].length;
for (var i = 0; i < json.length; i++) {
var toot = json[i]["_source"];
if (lastid != toot.uri) {
if (toot && toot.account) {
templete = templete + parse([toot], "noauth", null, tlid, 0, [], "tootsearch")
}
}
var lastid = toot.uri;
}
if (!templete) {
templete = lang.lang_details_nodata;
} else {
templete = templete + '<div class="hide ts-marker" data-maxid="' + max_id + '"></div>';
}
$("#timeline_" + tlid).append(templete);
jQuery("time.timeago").timeago();
});
}
function graphDraw(tag) {
var tags = "";
var his = tag.history;
var max = Math.max.apply(null, [his[0].uses, his[1].uses, his[2].uses, his[3].uses, his[4].uses, his[5].uses, his[6].uses]);
var six = 50 - (his[6].uses / max * 50);
var five = 50 - (his[5].uses / max * 50);
var four = 50 - (his[4].uses / max * 50);
var three = 50 - (his[3].uses / max * 50);
var two = 50 - (his[2].uses / max * 50);
var one = 50 - (his[1].uses / max * 50);
var zero = 50 - (his[0].uses / max * 50);
if (max === 0) {
tags = '<br><br><svg version="1.1" viewbox="0 0 60 50" width="60" height="50">' +
'</svg><span style="font-size:200%">' + his[0].uses + '</span>toots&nbsp;<a onclick="tl(\'tag\',\'' + escapeHTML(tag.name) + '\',\'' + acct_id +
'\',\'add\')" class="pointer">#' + escapeHTML(tag.name) + '</a>&nbsp;' + his[0].accounts + lang.lang_src_people;
} else {
tags = '<br><br><svg version="1.1" viewbox="0 0 60 50" width="60" height="50">' +
'<g><path d="M0,' + six + ' L10,' + five + ' 20,' + four + ' 30,' + three + ' 40,' + two + ' 50,' + one + ' 60,' + zero + '" style="stroke: #9e9e9e; stroke-width: 1;fill: none;"></path></g>' +
'</svg><span style="font-size:200%">' + his[0].uses + '</span>toots&nbsp;<a onclick="tl(\'tag\',\'' + escapeHTML(tag.name) + '\',\'' + acct_id +
'\',\'add\')" class="pointer">#' + escapeHTML(tag.name) + '</a>&nbsp;' + his[0].accounts + lang.lang_src_people;
}
return tags; return tags;
} }
/* /*

View File

@ -1,35 +1,35 @@
//タグ表示 //タグ表示
if(location.search){ if (location.search) {
var m = location.search.match(/\?mode=([a-zA-Z-0-9]+)\&code=(.+)/); var m = location.search.match(/\?mode=([a-zA-Z-0-9]+)\&code=(.+)/);
var mode=m[1]; var mode = m[1];
var codex=m[2]; var codex = m[2];
if(mode=="tag"){ if (mode == "tag") {
var acct_id=localStorage.getItem("main"); var acct_id = localStorage.getItem("main");
tl('tag',decodeURI(codex),acct_id,'add'); tl('tag', decodeURI(codex), acct_id, 'add');
} }
} }
//よく使うタグ //よく使うタグ
function tagShow(tag){ function tagShow(tag) {
$("[data-tag="+decodeURI(tag)+"]").toggleClass("hide"); $("[data-tag=" + decodeURI(tag) + "]").toggleClass("hide");
} }
//タグ追加 //タグ追加
function tagPin(tag){ function tagPin(tag) {
var tags = localStorage.getItem("tag"); var tags = localStorage.getItem("tag");
if(!tags){ if (!tags) {
var obj=[]; var obj = [];
}else{ } else {
var obj = JSON.parse(tags); var obj = JSON.parse(tags);
} }
var can; var can;
Object.keys(obj).forEach(function(key) { Object.keys(obj).forEach(function (key) {
var tagT = obj[key]; var tagT = obj[key];
if(tagT==tag){ if (tagT == tag) {
can=true; can = true;
}else{ } else {
can=false; can = false;
} }
}); });
if(!can){ if (!can) {
obj.push(tag); obj.push(tag);
} }
var json = JSON.stringify(obj); var json = JSON.stringify(obj);
@ -45,86 +45,86 @@ function tagRemove(key) {
localStorage.setItem("tag", json); localStorage.setItem("tag", json);
favTag(); favTag();
} }
function favTag(){ function favTag() {
$("#taglist").html(""); $("#taglist").html("");
var tagarr = localStorage.getItem("tag"); var tagarr = localStorage.getItem("tag");
if(!tagarr){ if (!tagarr) {
var obj=[]; var obj = [];
}else{ } else {
var obj = JSON.parse(tagarr); var obj = JSON.parse(tagarr);
} }
var tags=""; var tags = "";
var nowPT=localStorage.getItem("stable") var nowPT = localStorage.getItem("stable")
Object.keys(obj).forEach(function(key) { Object.keys(obj).forEach(function (key) {
var tag = obj[key]; var tag = obj[key];
if(nowPT!=tag){ if (nowPT != tag) {
console.log("stable tags:"+nowPT+"/"+tag); console.log("stable tags:" + nowPT + "/" + tag);
var ptt=lang.lang_tags_realtime; var ptt = lang.lang_tags_realtime;
var nowon=""; var nowon = "";
}else{ } else {
var ptt=lang.lang_tags_unrealtime; var ptt = lang.lang_tags_unrealtime;
var nowon="("+lang.lang_tags_realtime+")"; var nowon = "(" + lang.lang_tags_realtime + ")";
} }
tag=escapeHTML(tag); tag = escapeHTML(tag);
tags = tags + '<a onclick="tagShow(\'' + tag + '\')" class="pointer">#' + tag + '</a>'+nowon+'<span class="hide" data-tag="' + tag + '"> <a onclick="tagTL(\'tag\',\'' + tag + '\',false,\'add\')" class="pointer" title="' +lang.lang_parse_tagTL.replace("{{tag}}" ,'#'+tag)+ '">TL</a> <a onclick="brInsert(\'#' + tag + '\')" class="pointer" title="' + lang.lang_parse_tagtoot.replace("{{tag}}" ,'#'+tag) + '">Toot</a> '+ tags = tags + '<a onclick="tagShow(\'' + tag + '\')" class="pointer">#' + tag + '</a>' + nowon + '<span class="hide" data-tag="' + tag + '"> <a onclick="tagTL(\'tag\',\'' + tag + '\',false,\'add\')" class="pointer" title="' + lang.lang_parse_tagTL.replace("{{tag}}", '#' + tag) + '">TL</a> <a onclick="brInsert(\'#' + tag + '\')" class="pointer" title="' + lang.lang_parse_tagtoot.replace("{{tag}}", '#' + tag) + '">Toot</a> ' +
'<a onclick="autoToot(\'' + tag + '\');" class="pointer" title="'+lang.lang_tags_always + lang.lang_parse_tagtoot.replace("{{tag}}" ,'#'+tag) + '">'+ptt+'</a> <a onclick="tagRemove(\'' + key + '\')" class="pointer" title="' +lang.lang_tags_tagunpin.replace("{{tag}}" ,'#'+tag)+ '">'+lang.lang_del+'</a></span> '; '<a onclick="autoToot(\'' + tag + '\');" class="pointer" title="' + lang.lang_tags_always + lang.lang_parse_tagtoot.replace("{{tag}}", '#' + tag) + '">' + ptt + '</a> <a onclick="tagRemove(\'' + key + '\')" class="pointer" title="' + lang.lang_tags_tagunpin.replace("{{tag}}", '#' + tag) + '">' + lang.lang_del + '</a></span> ';
}); });
if(obj.length>0){ if (obj.length > 0) {
$("#taglist").append("My Tags:" + tags); $("#taglist").append("My Tags:" + tags);
}else{ } else {
$("#taglist").append(""); $("#taglist").append("");
} }
} }
function trendTag(){ function trendTag() {
$(".trendtag").remove(); $(".trendtag").remove();
var domain="imastodon.net" var domain = "imastodon.net"
var at = localStorage.getItem("acct_"+ acct_id + "_at"); var at = localStorage.getItem("acct_" + acct_id + "_at");
var start = "https://" + domain + "/api/v1/trend_tags" var start = "https://" + domain + "/api/v1/trend_tags"
fetch(start, { fetch(start, {
method: 'GET', method: 'GET',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
'Authorization': 'Bearer ' + at 'Authorization': 'Bearer ' + at
}, },
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
if (json) { if (json) {
var tags=""; var tags = "";
json=json.score; json = json.score;
Object.keys(json).forEach(function(tag) { Object.keys(json).forEach(function (tag) {
tag=escapeHTML(tag); tag = escapeHTML(tag);
tags = tags + '<a onclick="tagShow(\'' + tag + '\')" class="pointer">#' + tag + '</a><span class="hide" data-tag="' + tag + '"> <a onclick="tagTL(\'tag\',\'' + tag + '\',false,\'add\')" class="pointer" title="#' + tag + 'のタイムライン">TL</a> <a onclick="show();brInsert(\'#' + tag + '\')" class="pointer" title="#' + tag + 'でトゥート">Toot</a></span> '; tags = tags + '<a onclick="tagShow(\'' + tag + '\')" class="pointer">#' + tag + '</a><span class="hide" data-tag="' + tag + '"> <a onclick="tagTL(\'tag\',\'' + tag + '\',false,\'add\')" class="pointer" title="#' + tag + 'のタイムライン">TL</a> <a onclick="show();brInsert(\'#' + tag + '\')" class="pointer" title="#' + tag + 'でトゥート">Toot</a></span> ';
}); });
$("#taglist").append('<div class="trendtag">アイマストドントレンドタグ<i class="material-icons pointer" onclick="trendTag()" style="font-size:12px">refresh</i>:' + tags+'</div>'); $("#taglist").append('<div class="trendtag">アイマストドントレンドタグ<i class="material-icons pointer" onclick="trendTag()" style="font-size:12px">refresh</i>:' + tags + '</div>');
trendintervalset() trendintervalset()
}else{ } else {
$("#taglist").html(""); $("#taglist").html("");
} }
}); });
} }
function trendintervalset(){ function trendintervalset() {
setTimeout(trendTag, 6000000); setTimeout(trendTag, 6000000);
} }
function tagTL(a,b,c,d){ function tagTL(a, b, c, d) {
var acct_id = $("#post-acct-sel").val(); var acct_id = $("#post-acct-sel").val();
tl(a,b,acct_id,d); tl(a, b, acct_id, d);
} }
function autoToot(tag){ function autoToot(tag) {
tag=escapeHTML(tag) tag = escapeHTML(tag)
var nowPT=localStorage.getItem("stable") var nowPT = localStorage.getItem("stable")
if(nowPT==tag){ if (nowPT == tag) {
localStorage.removeItem("stable"); localStorage.removeItem("stable");
Materialize.toast(lang.lang_tags_unrealtime,3000); Materialize.toast(lang.lang_tags_unrealtime, 3000);
}else{ } else {
localStorage.setItem("stable",tag); localStorage.setItem("stable", tag);
Materialize.toast(lang.lang_tags_tagwarn.replace("{{tag}}" ,tag).replace("{{tag}}" ,tag),3000); Materialize.toast(lang.lang_tags_tagwarn.replace("{{tag}}", tag).replace("{{tag}}", tag), 3000);
brInsert('#' + tag+" ") brInsert('#' + tag + " ")
} }
favTag(); favTag();
} }

View File

@ -124,14 +124,14 @@ function tl(type, data, acct_id, tlid, delc, voice, mode) {
}; };
} }
console.log(["Try to get timeline of "+tlid,start]) console.log(["Try to get timeline of " + tlid, start])
fetch(start, i).then(function (response) { fetch(start, i).then(function (response) {
return response.json(); return response.json();
}).catch(function (error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function (json) { }).then(function (json) {
console.log(["Result of getting timeline of "+tlid,json]) console.log(["Result of getting timeline of " + tlid, json])
$("#landing_" + tlid).hide(); $("#landing_" + tlid).hide();
if (localStorage.getItem("filter_" + acct_id) != "undefined") { if (localStorage.getItem("filter_" + acct_id) != "undefined") {
var mute = getFilterType(JSON.parse(localStorage.getItem("filter_" + acct_id)), type); var mute = getFilterType(JSON.parse(localStorage.getItem("filter_" + acct_id)), type);
@ -216,11 +216,11 @@ function reload(type, cc, acct_id, tlid, data, mute, delc, voice, mode) {
localStorage.setItem("wss_" + tlid, wsid); localStorage.setItem("wss_" + tlid, wsid);
websocket[wsid] = new WebSocket(start); websocket[wsid] = new WebSocket(start);
websocket[wsid].onopen = function (mess) { websocket[wsid].onopen = function (mess) {
console.table({"tlid":tlid,"type":"Connect Streaming API"+type,"domain":domain,"message":[mess]}) console.table({ "tlid": tlid, "type": "Connect Streaming API" + type, "domain": domain, "message": [mess] })
$("#notice_icon_" + tlid).removeClass("red-text"); $("#notice_icon_" + tlid).removeClass("red-text");
} }
websocket[wsid].onmessage = function (mess) { websocket[wsid].onmessage = function (mess) {
console.log([tlid + ":Receive Streaming API:",JSON.parse(mess.data)]); console.log([tlid + ":Receive Streaming API:", JSON.parse(mess.data)]);
if (misskey) { if (misskey) {
if (JSON.parse(mess.data).type == "note") { if (JSON.parse(mess.data).type == "note") {
var obj = JSON.parse(mess.data).body; var obj = JSON.parse(mess.data).body;
@ -310,7 +310,7 @@ function reload(type, cc, acct_id, tlid, data, mute, delc, voice, mode) {
return false; return false;
}; };
websocket[wsid].onclose = function () { websocket[wsid].onclose = function () {
console.warn("Closing "+tlid); console.warn("Closing " + tlid);
if (mode == "error") { if (mode == "error") {
$("#notice_icon_" + tlid).addClass("red-text"); $("#notice_icon_" + tlid).addClass("red-text");
todo('WebSocket Closed'); todo('WebSocket Closed');
@ -440,7 +440,7 @@ function moreload(type, tlid) {
} }
//TL差分取得 //TL差分取得
function tlDiff(type, data, acct_id, tlid, delc, voice, mode) { function tlDiff(type, data, acct_id, tlid, delc, voice, mode) {
console.log("Get diff of TL"+tlid) console.log("Get diff of TL" + tlid)
var multi = localStorage.getItem("column"); var multi = localStorage.getItem("column");
var obj = JSON.parse(multi); var obj = JSON.parse(multi);
var acct_id = obj[tlid].domain; var acct_id = obj[tlid].domain;
@ -533,7 +533,7 @@ function tlDiff(type, data, acct_id, tlid, delc, voice, mode) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function (json) { }).then(function (json) {
console.log(["Result diff of TL"+tlid,json]); console.log(["Result diff of TL" + tlid, json]);
if (misskey) { if (misskey) {
var templete = misskeyParse(json, '', acct_id, tlid, "", mute); var templete = misskeyParse(json, '', acct_id, tlid, "", mute);
} else { } else {
@ -557,12 +557,12 @@ function tlCloser() {
Object.keys(websocket).forEach(function (tlid) { Object.keys(websocket).forEach(function (tlid) {
if (websocketOld[tlid]) { if (websocketOld[tlid]) {
websocketOld[tlid].close(); websocketOld[tlid].close();
console.log("%c Close Streaming API: Old" + tlid,"color:blue"); console.log("%c Close Streaming API: Old" + tlid, "color:blue");
} }
if (websocket[0]) { if (websocket[0]) {
console.log(websocket[0]); console.log(websocket[0]);
websocket[tlid].close(); websocket[tlid].close();
console.log("%c Close Streaming API:" + tlid,"color:blue"); console.log("%c Close Streaming API:" + tlid, "color:blue");
} }
}); });
@ -570,7 +570,7 @@ function tlCloser() {
Object.keys(websocketHome).forEach(function (tlid) { Object.keys(websocketHome).forEach(function (tlid) {
if (websocketHome[tlid]) { if (websocketHome[tlid]) {
websocketHome[tlid].close(); websocketHome[tlid].close();
console.log("%c Close Streaming API:Integrated Home" + tlid,"color:blue"); console.log("%c Close Streaming API:Integrated Home" + tlid, "color:blue");
} }
}); });
@ -578,7 +578,7 @@ function tlCloser() {
Object.keys(websocketLocal).forEach(function (tlid) { Object.keys(websocketLocal).forEach(function (tlid) {
if (websocketLocal[tlid]) { if (websocketLocal[tlid]) {
websocketLocal[tlid].close(); websocketLocal[tlid].close();
console.log("%c Close Streaming API:Integrated Local" + tlid,"color:blue"); console.log("%c Close Streaming API:Integrated Local" + tlid, "color:blue");
} }
}); });
@ -586,17 +586,17 @@ function tlCloser() {
Object.keys(websocketNotf).forEach(function (tlid) { Object.keys(websocketNotf).forEach(function (tlid) {
if (websocketNotf[tlid]) { if (websocketNotf[tlid]) {
websocketNotf[tlid].close(); websocketNotf[tlid].close();
console.log("%c Close Streaming API:Notf" + tlid,"color:blue"); console.log("%c Close Streaming API:Notf" + tlid, "color:blue");
} }
}); });
Object.keys(misskeyws).forEach(function (tlid) { Object.keys(misskeyws).forEach(function (tlid) {
if (misskeyws[tlid]) { if (misskeyws[tlid]) {
misskeyws[tlid].close(); misskeyws[tlid].close();
console.log("%c Close Streaming API:Misskey" + tlid,"color:blue"); console.log("%c Close Streaming API:Misskey" + tlid, "color:blue");
} }
}); });
misskeyws={} misskeyws = {}
} }
//TLのタイトル //TLのタイトル
@ -782,7 +782,7 @@ function strAliveInt() {
setTimeout(strAlive, 10000); setTimeout(strAlive, 10000);
} }
function reconnector(tlid, type, acct_id, data, mode) { function reconnector(tlid, type, acct_id, data, mode) {
console.log("%c Reconnector:" + mode+"(timeline"+tlid+")","color:pink") console.log("%c Reconnector:" + mode + "(timeline" + tlid + ")", "color:pink")
if (type == "mix" || type == "integrated" || type == "plus") { if (type == "mix" || type == "integrated" || type == "plus") {
if (localStorage.getItem("voice_" + tlid)) { if (localStorage.getItem("voice_" + tlid)) {
var voice = true; var voice = true;

View File

@ -6,25 +6,25 @@ function imgv(id, key, acct_id) {
$('#imgmodal').attr('src', '../../img/loading.svg'); $('#imgmodal').attr('src', '../../img/loading.svg');
var murl = $("#" + id + "-image-" + key).attr("data-url"); var murl = $("#" + id + "-image-" + key).attr("data-url");
var type = $("#" + id + "-image-" + key).attr("data-type"); var type = $("#" + id + "-image-" + key).attr("data-type");
$("#imagemodal").attr("data-id",id); $("#imagemodal").attr("data-id", id);
$("#imagemodal").attr("data-acct",acct_id); $("#imagemodal").attr("data-acct", acct_id);
$(document).ready(function() { $(document).ready(function () {
if (type == "image") { if (type == "image") {
$('#imagemodal').modal('open'); $('#imagemodal').modal('open');
xhr = new XMLHttpRequest; xhr = new XMLHttpRequest;
xhr.open('GET', murl, true); xhr.open('GET', murl, true);
xhr.addEventListener('progress', function (event) { xhr.addEventListener('progress', function (event) {
if (event.lengthComputable) { if (event.lengthComputable) {
var total=event.total; var total = event.total;
var now=event.loaded; var now = event.loaded;
var per=now/total*100; var per = now / total * 100;
$("#imgprog").text(Math.floor(per)); $("#imgprog").text(Math.floor(per));
} }
}, false); }, false);
xhr.addEventListener('loadend', function (event) { xhr.addEventListener('loadend', function (event) {
var total=event.total; var total = event.total;
var now=event.loaded; var now = event.loaded;
var per=now/total*100; var per = now / total * 100;
$("#imgprog").text(Math.floor(per)); $("#imgprog").text(Math.floor(per));
}, false); }, false);
xhr.send(); xhr.send();
@ -40,37 +40,37 @@ function imgv(id, key, acct_id) {
} }
var element = new Image(); var element = new Image();
var width; var width;
element.onload = function() { element.onload = function () {
var width = element.naturalWidth; var width = element.naturalWidth;
var height = element.naturalHeight; var height = element.naturalHeight;
var windowH = $(window).height(); var windowH = $(window).height();
var windowW = $(window).width(); var windowW = $(window).width();
$("#imagemodal").css("bottom","0") $("#imagemodal").css("bottom", "0")
$("#imagemodal img").css("width","auto") $("#imagemodal img").css("width", "auto")
if(height<windowH){ if (height < windowH) {
$("#imagemodal").css("height",height+60+"px") $("#imagemodal").css("height", height + 60 + "px")
$("#imagemodal img").css("height","100%") $("#imagemodal img").css("height", "100%")
if(width>windowW*0.8){ if (width > windowW * 0.8) {
$("#imagemodal").css("width","80vw") $("#imagemodal").css("width", "80vw")
$("#imagemodal img").css("width","100%") $("#imagemodal img").css("width", "100%")
var heightS=windowW*0.8/width*height; var heightS = windowW * 0.8 / width * height;
$("#imagemodal").css("height",heightS+60+"px") $("#imagemodal").css("height", heightS + 60 + "px")
}else{ } else {
$("#imagemodal").css("width",width+"px") $("#imagemodal").css("width", width + "px")
} }
}else{ } else {
$("#imagemodal img").css("width","auto") $("#imagemodal img").css("width", "auto")
var widthS=windowH/height*width; var widthS = windowH / height * width;
if(widthS<windowW){ if (widthS < windowW) {
$("#imagemodal").css("width",widthS+"px") $("#imagemodal").css("width", widthS + "px")
}else{ } else {
$("#imagemodal").css("width","100vw") $("#imagemodal").css("width", "100vw")
} }
$("#imagemodal").css("height","100vh") $("#imagemodal").css("height", "100vh")
$("#imagemodal img").css("height","calc(100vh - 60px)") $("#imagemodal img").css("height", "calc(100vh - 60px)")
} }
} }
if ($("#" + id + "-image-" + (key * 1 + 1)).length == 0) { if ($("#" + id + "-image-" + (key * 1 + 1)).length == 0) {
$("#image-next").prop("disabled", true); $("#image-next").prop("disabled", true);
@ -96,99 +96,99 @@ function imgCont(type) {
key = key * 1 - 1; key = key * 1 - 1;
} }
var murl = $("#" + id + "-image-" + key).attr("data-url"); var murl = $("#" + id + "-image-" + key).attr("data-url");
if(murl){ if (murl) {
$('#imgmodal').attr('src', '../../img/loading.svg'); $('#imgmodal').attr('src', '../../img/loading.svg');
var type = $("#" + id + "-image-" + key).attr("data-type"); var type = $("#" + id + "-image-" + key).attr("data-type");
$(document).ready(function() { $(document).ready(function () {
if (type == "image") { if (type == "image") {
xhr = new XMLHttpRequest; xhr = new XMLHttpRequest;
xhr.open('GET', murl, true); xhr.open('GET', murl, true);
xhr.responseType = "arraybuffer"; xhr.responseType = "arraybuffer";
xhr.addEventListener('progress', function (event) { xhr.addEventListener('progress', function (event) {
if (event.lengthComputable) { if (event.lengthComputable) {
var total=event.total; var total = event.total;
var now=event.loaded; var now = event.loaded;
var per=now/total*100; var per = now / total * 100;
$("#imgprog").text(Math.floor(per)); $("#imgprog").text(Math.floor(per));
} }
}, false); }, false);
xhr.addEventListener('loadend', function (event) { xhr.addEventListener('loadend', function (event) {
var total=event.total; var total = event.total;
var now=event.loaded; var now = event.loaded;
var per=now/total*100; var per = now / total * 100;
$("#imgprog").text(Math.floor(per)); $("#imgprog").text(Math.floor(per));
}, false); }, false);
xhr.send(); xhr.send();
$('#imgmodal').attr('src', murl); $('#imgmodal').attr('src', murl);
$('#imagewrap').dragScroll(); // ドラッグスクロール設定 $('#imagewrap').dragScroll(); // ドラッグスクロール設定
$('#imagemodal').attr('data-key', key); $('#imagemodal').attr('data-key', key);
$('#imagemodal').attr('data-id', id); $('#imagemodal').attr('data-id', id);
} else if (type == "video" || type == "gifv") { } else if (type == "video" || type == "gifv") {
$('#video').attr('src', murl); $('#video').attr('src', murl);
$('#videomodal').modal('open'); $('#videomodal').modal('open');
}
var element = new Image();
var width;
element.onload = function() {
var width = element.naturalWidth;
var height = element.naturalHeight;
var windowH = $(window).height();
var windowW = $(window).width();
$("#imagemodal").css("bottom","0")
$("#imagemodal img").css("width","auto")
if(height<windowH){
$("#imagemodal").css("height",height+60+"px")
$("#imagemodal img").css("height","100%")
if(width>windowW*0.8){
$("#imagemodal").css("width","80vw")
$("#imagemodal img").css("width","100%")
var heightS=windowW*0.8/width*height;
$("#imagemodal").css("height",heightS+60+"px")
}else{
$("#imagemodal").css("width",width+"px")
}
}else{
$("#imagemodal img").css("width","auto")
var widthS=windowH/height*width;
if(widthS<windowW){
$("#imagemodal").css("width",widthS+"px")
}else{
$("#imagemodal").css("width","100vw")
}
$("#imagemodal").css("height","100vh")
$("#imagemodal img").css("height","calc(100vh - 60px)")
} }
} var element = new Image();
if ($("#" + id + "-image-" + (key * 1 + 1)).length === 0) { var width;
$("#image-next").prop("disabled", true); element.onload = function () {
} else { var width = element.naturalWidth;
$("#image-next").prop("disabled", false); var height = element.naturalHeight;
} var windowH = $(window).height();
if ($("#" + id + "-image-" + (key * 1 - 1)).length === 0) { var windowW = $(window).width();
$("#image-prev").prop("disabled", true); $("#imagemodal").css("bottom", "0")
} else { $("#imagemodal img").css("width", "auto")
$("#image-prev").prop("disabled", false); if (height < windowH) {
} $("#imagemodal").css("height", height + 60 + "px")
element.src = murl; $("#imagemodal img").css("height", "100%")
if (width > windowW * 0.8) {
}); $("#imagemodal").css("width", "80vw")
$("#imagemodal img").css("width", "100%")
var heightS = windowW * 0.8 / width * height;
$("#imagemodal").css("height", heightS + 60 + "px")
} else {
$("#imagemodal").css("width", width + "px")
}
} else {
$("#imagemodal img").css("width", "auto")
var widthS = windowH / height * width;
if (widthS < windowW) {
$("#imagemodal").css("width", widthS + "px")
} else {
$("#imagemodal").css("width", "100vw")
}
$("#imagemodal").css("height", "100vh")
$("#imagemodal img").css("height", "calc(100vh - 60px)")
}
}
if ($("#" + id + "-image-" + (key * 1 + 1)).length === 0) {
$("#image-next").prop("disabled", true);
} else {
$("#image-next").prop("disabled", false);
}
if ($("#" + id + "-image-" + (key * 1 - 1)).length === 0) {
$("#image-prev").prop("disabled", true);
} else {
$("#image-prev").prop("disabled", false);
}
element.src = murl;
});
} }
} }
//ズームボタン(z:倍率) //ズームボタン(z:倍率)
function zoom(z) { function zoom(z) {
var wdth = $('#imagewrap img').width(); var wdth = $('#imagewrap img').width();
var wdth = wdth * z; var wdth = wdth * z;
$('#imagewrap img').css("width", wdth+"px"); $('#imagewrap img').css("width", wdth + "px");
var hgt = $('#imagewrap img').height(); var hgt = $('#imagewrap img').height();
var hgt = hgt * z; var hgt = hgt * z;
$('#imagewrap img').css("height", hgt+"px"); $('#imagewrap img').css("height", hgt + "px");
} }
//スマホ対応ドラッグ移動システム //スマホ対応ドラッグ移動システム
(function() { (function () {
$.fn.dragScroll = function() { $.fn.dragScroll = function () {
var target = this; var target = this;
$(this).mousedown(function(event) { $(this).mousedown(function (event) {
$(this) $(this)
.data('down', true) .data('down', true)
.data('x', event.clientX) .data('x', event.clientX)
@ -201,7 +201,7 @@ function zoom(z) {
'cursor': 'move' 'cursor': 'move'
}); });
// ウィンドウから外れてもイベント実行 // ウィンドウから外れてもイベント実行
$(document).mousemove(function(event) { $(document).mousemove(function (event) {
if ($(target).data('down') == true) { if ($(target).data('down') == true) {
// スクロール // スクロール
target.scrollLeft($(target).data('scrollLeft') + $(target).data('x') - target.scrollLeft($(target).data('scrollLeft') + $(target).data('x') -
@ -210,10 +210,10 @@ function zoom(z) {
event.clientY); event.clientY);
return false; // 文字列選択を抑止 return false; // 文字列選択を抑止
} }
}).mouseup(function(event) { }).mouseup(function (event) {
$(target).data('down', false); $(target).data('down', false);
}); });
$(this).on('touchstart', function(event) { $(this).on('touchstart', function (event) {
$(this) $(this)
.data('down', true) .data('down', true)
.data('x', getX(event)) .data('x', getX(event))
@ -225,7 +225,7 @@ function zoom(z) {
'overflow': 'hidden', // スクロールバー非表示 'overflow': 'hidden', // スクロールバー非表示
'cursor': 'move' 'cursor': 'move'
}); //指が触れたか検知 }); //指が触れたか検知
$(this).on('touchmove', function(event) { $(this).on('touchmove', function (event) {
if ($(target).data('down') === true) { if ($(target).data('down') === true) {
// スクロール // スクロール
target.scrollLeft($(target).data('scrollLeft') + $(target).data('x') - target.scrollLeft($(target).data('scrollLeft') + $(target).data('x') -
@ -233,9 +233,9 @@ function zoom(z) {
target.scrollTop($(target).data('scrollTop') + $(target).data('y') - target.scrollTop($(target).data('scrollTop') + $(target).data('y') -
getY(event)); getY(event));
return false; // 文字列選択を抑止 return false; // 文字列選択を抑止
} else {} } else { }
}); //指が動いたか検知 }); //指が動いたか検知
$(this).on('touchend', function(event) { $(this).on('touchend', function (event) {
$(target).data('down', false); $(target).data('down', false);
}); });
@ -252,7 +252,7 @@ function getY(event) {
} }
//マウスホイールで拡大 //マウスホイールで拡大
var element = document.getElementById("imagemodal"); var element = document.getElementById("imagemodal");
element.onmousewheel = function(e) { element.onmousewheel = function (e) {
var delta = e.wheelDelta; var delta = e.wheelDelta;
if (delta > 0) { if (delta > 0) {
zoom(1.1) zoom(1.1)
@ -262,31 +262,31 @@ element.onmousewheel = function(e) {
} }
//当該トゥート //当該トゥート
function detFromImg(){ function detFromImg() {
var id=$("#imagemodal").attr("data-id"); var id = $("#imagemodal").attr("data-id");
var acct_id=$("#imagemodal").attr("data-acct"); var acct_id = $("#imagemodal").attr("data-acct");
$('#imagemodal').modal('close'); $('#imagemodal').modal('close');
details(id,acct_id); details(id, acct_id);
} }
//画像保存 //画像保存
function dlImg(){ function dlImg() {
var url=$("#imgmodal").attr("src"); var url = $("#imgmodal").attr("src");
var electron = require("electron"); var electron = require("electron");
var ipc = electron.ipcRenderer; var ipc = electron.ipcRenderer;
if(localStorage.getItem("savefolder")){ if (localStorage.getItem("savefolder")) {
var save=localStorage.getItem("savefolder"); var save = localStorage.getItem("savefolder");
}else{ } else {
var save=""; var save = "";
} }
ipc.send('general-dl', [url,save,false]); ipc.send('general-dl', [url, save, false]);
ipc.on('general-dl-prog', function (event, arg) { ipc.on('general-dl-prog', function (event, arg) {
console.log("Progress: "+arg); console.log("Progress: " + arg);
}) })
ipc.on('general-dl-message', function (event, arg) { ipc.on('general-dl-message', function (event, arg) {
var argC=arg.replace(/\\/g,"\\\\")+"\\\\."; var argC = arg.replace(/\\/g, "\\\\") + "\\\\.";
Materialize.toast(lang.lang_img_DLDone+arg+'<button class="btn-flat toast-action" onclick="openFinder(\''+argC+'\')">Show</button>', 5000); Materialize.toast(lang.lang_img_DLDone + arg + '<button class="btn-flat toast-action" onclick="openFinder(\'' + argC + '\')">Show</button>', 5000);
}) })
} }
function openFinder(dir){ function openFinder(dir) {
ipc.send('open-finder', dir); ipc.send('open-finder', dir);
} }

View File

@ -11,55 +11,55 @@ function addColumnMenu() {
$("#left-menu div").removeClass("active"); $("#left-menu div").removeClass("active");
$("#addColumnMenu").addClass("active"); $("#addColumnMenu").addClass("active");
$(".menu-content").addClass("hide"); $(".menu-content").addClass("hide");
$("#add-box").removeClass("hide"); $("#add-box").removeClass("hide");
addselCk() addselCk()
} }
$('.type').click(function() { $('.type').click(function () {
$(".type").removeClass("active"); $(".type").removeClass("active");
$(this).addClass("active"); $(this).addClass("active");
$("#type-sel").val($(this).attr("data-type")) $("#type-sel").val($(this).attr("data-type"))
}) })
//最初、カラム変更時に発火 //最初、カラム変更時に発火
function parseColumn(dontclose) { function parseColumn(dontclose) {
console.log("%c Parse column","color:red;font-size:125%"); console.log("%c Parse column", "color:red;font-size:125%");
var size = localStorage.getItem("size"); var size = localStorage.getItem("size");
if (size) { if (size) {
$("#timeline-container").css("font-size", size + "px"); $("#timeline-container").css("font-size", size + "px");
$(".toot-reset").css("font-size", size + "px"); $(".toot-reset").css("font-size", size + "px");
$(".cont-series").css("font-size", size + "px"); $(".cont-series").css("font-size", size + "px");
} }
if(localStorage.getItem("menu-done")){ if (localStorage.getItem("menu-done")) {
$("#fukidashi").addClass("hide") $("#fukidashi").addClass("hide")
} }
if(!dontclose){ if (!dontclose) {
tlCloser(); tlCloser();
} }
var multi = localStorage.getItem("multi"); var multi = localStorage.getItem("multi");
if (multi) { if (multi) {
var obj = JSON.parse(multi); var obj = JSON.parse(multi);
var templete; var templete;
Object.keys(obj).forEach(function(key) { Object.keys(obj).forEach(function (key) {
var acct = obj[key]; var acct = obj[key];
localStorage.setItem("name_" + key, acct.name); localStorage.setItem("name_" + key, acct.name);
localStorage.setItem("user_" + key, acct.user); localStorage.setItem("user_" + key, acct.user);
localStorage.setItem("user-id_" + key, acct.id); localStorage.setItem("user-id_" + key, acct.id);
localStorage.setItem("prof_" + key, acct.prof); localStorage.setItem("prof_" + key, acct.prof);
localStorage.setItem("domain_" + key, acct.domain); localStorage.setItem("domain_" + key, acct.domain);
localStorage.setItem("acct_"+ key + "_at", acct.at); localStorage.setItem("acct_" + key + "_at", acct.at);
notf(key, 0); notf(key, 0);
ckdb(key); ckdb(key);
//フィルターデータ読もう //フィルターデータ読もう
getFilter(key); getFilter(key);
var domain = localStorage.getItem("domain_" + key); var domain = localStorage.getItem("domain_" + key);
if(localStorage.getItem("mode_" + domain)=="misskey"){ if (localStorage.getItem("mode_" + domain) == "misskey") {
localStorage.removeItem("misskey_wss_" + key) localStorage.removeItem("misskey_wss_" + key)
connectMisskey(key) connectMisskey(key)
} }
}); });
} }
var acctlist=obj; var acctlist = obj;
console.table(obj); console.table(obj);
/*var xed=localStorage.getItem("xed"); /*var xed=localStorage.getItem("xed");
if(xed){ if(xed){
@ -79,223 +79,223 @@ function parseColumn(dontclose) {
if ($("#timeline-container").length) { if ($("#timeline-container").length) {
$("#timeline-container").html(""); $("#timeline-container").html("");
} }
var basekey=0; var basekey = 0;
for(var key=0;key<obj.length;key++){ for (var key = 0; key < obj.length; key++) {
var next=key+1; var next = key + 1;
var acct = obj[key]; var acct = obj[key];
if(acct.type=="notf"){ if (acct.type == "notf") {
var notf_attr=' data-notf='+acct.domain; var notf_attr = ' data-notf=' + acct.domain;
var if_notf="hide"; var if_notf = "hide";
}else{ } else {
var notf_attr=''; var notf_attr = '';
var if_notf=""; var if_notf = "";
} }
if(localStorage.getItem("notification_" + acct.domain)){ if (localStorage.getItem("notification_" + acct.domain)) {
var unique_notf=lang.lang_layout_thisacct.replace("{{notf}}" ,localStorage.getItem("notification_" + acct.domain)); var unique_notf = lang.lang_layout_thisacct.replace("{{notf}}", localStorage.getItem("notification_" + acct.domain));
}else{ } else {
if(lang.language=="ja"){ if (lang.language == "ja") {
var notflocale="通知"; var notflocale = "通知";
}else if(lang.language=="en"){ } else if (lang.language == "en") {
var notflocale="Notification"; var notflocale = "Notification";
}
var unique_notf=lang.lang_layout_thisacct.replace("{{notf}}" ,notflocale);
}
var insert="";
var icnsert="";
if(acct.background){
if(acct.text=="def"){
}else{
if(acct.text=="black"){
var txhex="000000";
var ichex="9e9e9e"
}else if(acct.text=="white"){
var txhex="ffffff";
var ichex="eeeeee"
} }
insert='background-color:#'+acct.background+'; color: #'+txhex+'; '; var unique_notf = lang.lang_layout_thisacct.replace("{{notf}}", notflocale);
icnsert=' style="color: #'+ichex+'" '; }
var insert = "";
var icnsert = "";
if (acct.background) {
if (acct.text == "def") {
} else {
if (acct.text == "black") {
var txhex = "000000";
var ichex = "9e9e9e"
} else if (acct.text == "white") {
var txhex = "ffffff";
var ichex = "eeeeee"
}
insert = 'background-color:#' + acct.background + '; color: #' + txhex + '; ';
icnsert = ' style="color: #' + ichex + '" ';
} }
} }
console.log(acct); console.log(acct);
if(acctlist[acct.domain]){ if (acctlist[acct.domain]) {
if(acctlist[acct.domain].background!="def"){ if (acctlist[acct.domain].background != "def") {
insert=insert+" border-bottom:medium solid #"+acctlist[acct.domain].background+";"; insert = insert + " border-bottom:medium solid #" + acctlist[acct.domain].background + ";";
} }
} }
if(acct.type=="notf" && localStorage.getItem("setasread")=="no"){ if (acct.type == "notf" && localStorage.getItem("setasread") == "no") {
localStorage.setItem("hasNotfC_" + acct.domain,"true"); localStorage.setItem("hasNotfC_" + acct.domain, "true");
}else{ } else {
localStorage.removeItem("hasNotfC_" + acct.domain); localStorage.removeItem("hasNotfC_" + acct.domain);
} }
if(acct.type=="webview"){ if (acct.type == "webview") {
if(localStorage.getItem("fixwidth")){ if (localStorage.getItem("fixwidth")) {
var fixwidth=localStorage.getItem("fixwidth"); var fixwidth = localStorage.getItem("fixwidth");
var css=" min-width:"+fixwidth+"px;" var css = " min-width:" + fixwidth + "px;"
}else{ } else {
var css=""; var css = "";
} }
var html =webviewParse("https://tweetdeck.twitter.com",key,insert,icnsert,css); var html = webviewParse("https://tweetdeck.twitter.com", key, insert, icnsert, css);
$("#timeline-container").append(html); $("#timeline-container").append(html);
}else if(acct.type=="tootsearch"){ } else if (acct.type == "tootsearch") {
if(!acct.left_fold){ if (!acct.left_fold) {
basekey=key; basekey = key;
} }
var width = localStorage.getItem("width"); var width = localStorage.getItem("width");
if (width) { if (width) {
var css=" min-width:"+width+"px;" var css = " min-width:" + width + "px;"
} }
var anime = localStorage.getItem("animation"); var anime = localStorage.getItem("animation");
if (anime=="yes" || !anime) { if (anime == "yes" || !anime) {
var animecss="box-anime"; var animecss = "box-anime";
}else{ } else {
var animecss=""; var animecss = "";
} }
unstreamingTL(acct.type,key,basekey,insert,icnsert,acct.left_fold,css,animecss,acct.data); unstreamingTL(acct.type, key, basekey, insert, icnsert, acct.left_fold, css, animecss, acct.data);
}else{
var width = localStorage.getItem("width");
if (width) {
var css=" min-width:"+width+"px;"
}
var anime = localStorage.getItem("animation");
if (anime=="yes" || !anime) {
var animecss="box-anime";
}else{
var animecss="";
}
if(acct.type=="notf"){
var exclude=lang.lang_excluded+':<br><input type="checkbox" class="filled-in" id="exc-reply-'+key+'" '+excludeCk(key,"mention")+' /><label for="exc-reply-'+key+'" class="exc-chb"><i class="fas fa-share exc-icons"></i></label> '+
'<input type="checkbox" class="filled-in" id="exc-fav-'+key+'" '+excludeCk(key,"favourite")+' /><label for="exc-fav-'+key+'" class="exc-chb"><i class="fas fa-star exc-icons"></i></label> '+
'<input type="checkbox" class="filled-in" id="exc-bt-'+key+'" '+excludeCk(key,"reblog")+' /><label for="exc-bt-'+key+'" class="exc-chb" ><i class="fas fa-retweet exc-icons"></i></label> '+
'<input type="checkbox" class="filled-in" id="exc-follow-'+key+'" '+excludeCk(key,"follow")+' /><label for="exc-follow-'+key+'" class="exc-chb" ><i class="fas fa-users exc-icons"></i></label> '+
'<input type="checkbox" class="filled-in" id="exc-poll-'+key+'" '+excludeCk(key,"poll")+' /><label for="exc-poll-'+key+'" class="exc-chb" ><i class="fas fa-tasks exc-icons"></i></label> '+
'<button class="btn waves-effect" style="width:60px; padding:0;" onclick="exclude('+key+')">Filter</button><br>';
}else if(acct.type=="home"){
var exclude='<a onclick="ebtToggle(' + key +
')" class="setting nex"><i class="fas fa-retweet waves-effect nex" title="'+lang.lang_layout_excludingbt +'" style="font-size:24px"></i><span id="sta-bt-' +
key + '">Off</span></a>'+lang.lang_layout_excludingbt+'<br>';
}else{
var exclude="";
}
if(!acct.left_fold){
basekey=key;
var basehtml = '<div style="'+css+'" class="box '+animecss+'" id="timeline_box_' + basekey + '_parentBox"></div>';
$("#timeline-container").append(basehtml);
var left_hold='<a onclick="leftFoldSet(' + key +')" class="setting nex"><i class="material-icons waves-effect nex" title="'+lang.lang_layout_leftFold+'">view_agenda</i></a>'+lang.lang_layout_leftFold+'</span><br>';
}else{
var left_hold='<a onclick="leftFoldRemove(' + key +')" class="setting nex"><i class="material-icons waves-effect nex" title="'+lang.lang_layout_leftUnfold+'">view_column</i></a>'+lang.lang_layout_leftUnfold+'</span><br>';
}
if(key===0){
left_hold='';
}
if(localStorage.getItem("mode_" + localStorage.getItem("domain_" + acct.domain))=="misskey"){
var isMisRed=""
exclude=""
var if_misskey_hide="hide"
}else{
var isMisRed="red-text"
var if_misskey_hide=""
}
var html='<div class="boxIn" id="timeline_box_' + key + '_box" tlid="' + key +
'" data-acct="'+acct.domain+'"><div class="notice-box z-depth-2" id="menu_'+key+'" style="'+insert+' ">'+
'<div class="area-notice"><i class="material-icons waves-effect '+isMisRed+'" id="notice_icon_' + key + '"'+notf_attr+' style="font-size:40px; padding-top:25%;" onclick="checkStr(\''+acct.type+'\', \''+data+'\', \''+acct.domain+'\', \''+key+'\', \''+delc+'\',\''+voice+'\',null)" title="'+lang.lang_layout_gotop +'"></i></div>'+
'<div class="area-notice_name"><span id="notice_' + key + '" class="tl-title"></span></div>'+
'<div class="area-a1"><a onclick="notfToggle(' + acct.domain + ',' + key +
')" class="setting nex '+if_notf+'" title="'+unique_notf+'"'+icnsert+'><i class="material-icons waves-effect nex notf-icon_' +
acct.domain + '">notifications</i></div><div class="area-sta"><span class="new badge teal notf-reply_'+acct.domain+' hide" data-badge-caption="Reply">0</span><span class="new badge yellow black-text notf-fav_'+acct.domain+' hide" data-badge-caption="Fav">0</span><span class="new badge blue notf-bt_'+acct.domain+' hide" data-badge-caption="BT">0</span><span class="new badge orange notf-follow_'+acct.domain+' hide" data-badge-caption="Follow">0</span></a></div>'+
'<div class="area-a2"><a onclick="removeColumn(' + key +
')" class="setting nex"><i class="material-icons waves-effect nex" title="'+lang.lang_layout_delthis +'"'+icnsert+'>cancel</i></a></div>'+
'<div class="area-a3"><a onclick="setToggle(' + key +
')" class="setting nex" title="'+lang.lang_layout_setthis +'"'+icnsert+'><i class="material-icons waves-effect nex">settings</i></a></div></div>'+
'<div class="column-hide notf-indv-box z-depth-4" id="notf-box_' + key +
'"><div id="notifications_' + key +
'" data-notf="' + acct.domain + '" data-type="notf" class="notf-timeline"></div></div><div class="column-hide notf-indv-box" id="util-box_' + key +
'" style="padding:5px;">'+exclude+left_hold+'<a onclick="mediaToggle(' + key +
')" class="setting nex"><i class="material-icons waves-effect nex" title="'+lang.lang_layout_mediafil +'">perm_media</i><span id="sta-media-' +
key + '">On</span></a>'+lang.lang_layout_mediafil +'<br><a onclick="cardToggle(' + key +
')" class="setting nex"><i class="material-icons waves-effect nex" title="'+lang.lang_layout_linkanades +'">link</i><span id="sta-card-' +
key + '">On</span></a>'+lang.lang_layout_linkana +'<br><a onclick="voiceToggle(' + key +
')" class="setting nex"><i class="material-icons waves-effect nex" title="'+lang.lang_layout_tts +'">hearing</i><span id="sta-voice-' +
key + '">On</span></a>'+lang.lang_layout_tts +'TL<br><a onclick="reconnector(' + key +
',\''+acct.type+'\',\''+acct.domain+'\',\''+escapeHTML(acct.data)+'\')" class="setting nex '+if_notf+' '+if_misskey_hide+'"><i class="material-icons waves-effect nex '+if_notf+'" title="'+lang.lang_layout_reconnect+'">low_priority</i></a><span class="'+if_notf+'">'+lang.lang_layout_reconnect+'</span><br>'+lang.lang_layout_headercolor +'<br><div id="picker_'+key+'" class="color-picker"></div></div><div class="tl-box" tlid="' + key + '"><div id="timeline_' + key +
'" class="tl '+acct.type+'-timeline " tlid="' + key + '" data-type="' + acct.type + '" data-acct="'+acct.domain+'" data-const="' + acct.type + '_'+acct.domain+'"><div id="landing_'+key+'" style="text-align:center">'+lang.lang_layout_nodata +'</div></div></div>'
$('#timeline_box_' + basekey + '_parentBox').append(html);
localStorage.removeItem("pool_" + key);
if (acct.data) {
var data = acct.data;
} else { } else {
var data = ""; var width = localStorage.getItem("width");
} if (width) {
if(localStorage.getItem("catch_" + key)){ var css = " min-width:" + width + "px;"
var delc="true"; }
}else{ var anime = localStorage.getItem("animation");
var delc="false"; if (anime == "yes" || !anime) {
} var animecss = "box-anime";
} else {
var animecss = "";
}
if (acct.type == "notf") {
var exclude = lang.lang_excluded + ':<br><input type="checkbox" class="filled-in" id="exc-reply-' + key + '" ' + excludeCk(key, "mention") + ' /><label for="exc-reply-' + key + '" class="exc-chb"><i class="fas fa-share exc-icons"></i></label> ' +
'<input type="checkbox" class="filled-in" id="exc-fav-' + key + '" ' + excludeCk(key, "favourite") + ' /><label for="exc-fav-' + key + '" class="exc-chb"><i class="fas fa-star exc-icons"></i></label> ' +
'<input type="checkbox" class="filled-in" id="exc-bt-' + key + '" ' + excludeCk(key, "reblog") + ' /><label for="exc-bt-' + key + '" class="exc-chb" ><i class="fas fa-retweet exc-icons"></i></label> ' +
'<input type="checkbox" class="filled-in" id="exc-follow-' + key + '" ' + excludeCk(key, "follow") + ' /><label for="exc-follow-' + key + '" class="exc-chb" ><i class="fas fa-users exc-icons"></i></label> ' +
'<input type="checkbox" class="filled-in" id="exc-poll-' + key + '" ' + excludeCk(key, "poll") + ' /><label for="exc-poll-' + key + '" class="exc-chb" ><i class="fas fa-tasks exc-icons"></i></label> ' +
'<button class="btn waves-effect" style="width:60px; padding:0;" onclick="exclude(' + key + ')">Filter</button><br>';
} else if (acct.type == "home") {
var exclude = '<a onclick="ebtToggle(' + key +
')" class="setting nex"><i class="fas fa-retweet waves-effect nex" title="' + lang.lang_layout_excludingbt + '" style="font-size:24px"></i><span id="sta-bt-' +
key + '">Off</span></a>' + lang.lang_layout_excludingbt + '<br>';
} else {
var exclude = "";
}
if (!acct.left_fold) {
basekey = key;
var basehtml = '<div style="' + css + '" class="box ' + animecss + '" id="timeline_box_' + basekey + '_parentBox"></div>';
$("#timeline-container").append(basehtml);
var left_hold = '<a onclick="leftFoldSet(' + key + ')" class="setting nex"><i class="material-icons waves-effect nex" title="' + lang.lang_layout_leftFold + '">view_agenda</i></a>' + lang.lang_layout_leftFold + '</span><br>';
} else {
var left_hold = '<a onclick="leftFoldRemove(' + key + ')" class="setting nex"><i class="material-icons waves-effect nex" title="' + lang.lang_layout_leftUnfold + '">view_column</i></a>' + lang.lang_layout_leftUnfold + '</span><br>';
}
if (key === 0) {
left_hold = '';
}
if (localStorage.getItem("mode_" + localStorage.getItem("domain_" + acct.domain)) == "misskey") {
var isMisRed = ""
exclude = ""
var if_misskey_hide = "hide"
} else {
var isMisRed = "red-text"
var if_misskey_hide = ""
}
var html = '<div class="boxIn" id="timeline_box_' + key + '_box" tlid="' + key +
'" data-acct="' + acct.domain + '"><div class="notice-box z-depth-2" id="menu_' + key + '" style="' + insert + ' ">' +
'<div class="area-notice"><i class="material-icons waves-effect ' + isMisRed + '" id="notice_icon_' + key + '"' + notf_attr + ' style="font-size:40px; padding-top:25%;" onclick="checkStr(\'' + acct.type + '\', \'' + data + '\', \'' + acct.domain + '\', \'' + key + '\', \'' + delc + '\',\'' + voice + '\',null)" title="' + lang.lang_layout_gotop + '"></i></div>' +
'<div class="area-notice_name"><span id="notice_' + key + '" class="tl-title"></span></div>' +
'<div class="area-a1"><a onclick="notfToggle(' + acct.domain + ',' + key +
')" class="setting nex ' + if_notf + '" title="' + unique_notf + '"' + icnsert + '><i class="material-icons waves-effect nex notf-icon_' +
acct.domain + '">notifications</i></div><div class="area-sta"><span class="new badge teal notf-reply_' + acct.domain + ' hide" data-badge-caption="Reply">0</span><span class="new badge yellow black-text notf-fav_' + acct.domain + ' hide" data-badge-caption="Fav">0</span><span class="new badge blue notf-bt_' + acct.domain + ' hide" data-badge-caption="BT">0</span><span class="new badge orange notf-follow_' + acct.domain + ' hide" data-badge-caption="Follow">0</span></a></div>' +
'<div class="area-a2"><a onclick="removeColumn(' + key +
')" class="setting nex"><i class="material-icons waves-effect nex" title="' + lang.lang_layout_delthis + '"' + icnsert + '>cancel</i></a></div>' +
'<div class="area-a3"><a onclick="setToggle(' + key +
')" class="setting nex" title="' + lang.lang_layout_setthis + '"' + icnsert + '><i class="material-icons waves-effect nex">settings</i></a></div></div>' +
'<div class="column-hide notf-indv-box z-depth-4" id="notf-box_' + key +
'"><div id="notifications_' + key +
'" data-notf="' + acct.domain + '" data-type="notf" class="notf-timeline"></div></div><div class="column-hide notf-indv-box" id="util-box_' + key +
'" style="padding:5px;">' + exclude + left_hold + '<a onclick="mediaToggle(' + key +
')" class="setting nex"><i class="material-icons waves-effect nex" title="' + lang.lang_layout_mediafil + '">perm_media</i><span id="sta-media-' +
key + '">On</span></a>' + lang.lang_layout_mediafil + '<br><a onclick="cardToggle(' + key +
')" class="setting nex"><i class="material-icons waves-effect nex" title="' + lang.lang_layout_linkanades + '">link</i><span id="sta-card-' +
key + '">On</span></a>' + lang.lang_layout_linkana + '<br><a onclick="voiceToggle(' + key +
')" class="setting nex"><i class="material-icons waves-effect nex" title="' + lang.lang_layout_tts + '">hearing</i><span id="sta-voice-' +
key + '">On</span></a>' + lang.lang_layout_tts + 'TL<br><a onclick="reconnector(' + key +
',\'' + acct.type + '\',\'' + acct.domain + '\',\'' + escapeHTML(acct.data) + '\')" class="setting nex ' + if_notf + ' ' + if_misskey_hide + '"><i class="material-icons waves-effect nex ' + if_notf + '" title="' + lang.lang_layout_reconnect + '">low_priority</i></a><span class="' + if_notf + '">' + lang.lang_layout_reconnect + '</span><br>' + lang.lang_layout_headercolor + '<br><div id="picker_' + key + '" class="color-picker"></div></div><div class="tl-box" tlid="' + key + '"><div id="timeline_' + key +
'" class="tl ' + acct.type + '-timeline " tlid="' + key + '" data-type="' + acct.type + '" data-acct="' + acct.domain + '" data-const="' + acct.type + '_' + acct.domain + '"><div id="landing_' + key + '" style="text-align:center">' + lang.lang_layout_nodata + '</div></div></div>'
$('#timeline_box_' + basekey + '_parentBox').append(html);
localStorage.removeItem("pool_" + key);
if (acct.data) {
var data = acct.data;
} else {
var data = "";
}
if (localStorage.getItem("catch_" + key)) {
var delc = "true";
} else {
var delc = "false";
}
if(localStorage.getItem("voice_" + key)){ if (localStorage.getItem("voice_" + key)) {
var voice=true; var voice = true;
}else{ } else {
var voice=false; var voice = false;
} }
tl(acct.type, data, acct.domain, key, delc,voice,""); tl(acct.type, data, acct.domain, key, delc, voice, "");
cardCheck(key); cardCheck(key);
ebtCheck(key); ebtCheck(key);
mediaCheck(key); mediaCheck(key);
catchCheck(key); catchCheck(key);
voiceCheck(key); voiceCheck(key);
} }
} }
var box = localStorage.getItem("box"); var box = localStorage.getItem("box");
if (box == "absolute") { if (box == "absolute") {
setTimeout(show, 1000); setTimeout(show, 1000);
} }
if(localStorage.getItem("reverse")){ if (localStorage.getItem("reverse")) {
$("#bottom").removeClass("reverse"); $("#bottom").removeClass("reverse");
$(".leftside").removeClass("reverse"); $(".leftside").removeClass("reverse");
} }
if(localStorage.getItem("sec") && localStorage.getItem("sec")!="nothing"){ if (localStorage.getItem("sec") && localStorage.getItem("sec") != "nothing") {
secvis(localStorage.getItem("sec")); secvis(localStorage.getItem("sec"));
} }
favTag(); favTag();
var cw = localStorage.getItem("always-cw"); var cw = localStorage.getItem("always-cw");
if (cw == "yes") { if (cw == "yes") {
if(!$("#cw").hasClass("cw-avail")){ if (!$("#cw").hasClass("cw-avail")) {
$("#cw-text").show(); $("#cw-text").show();
$("#cw").addClass("yellow-text"); $("#cw").addClass("yellow-text");
$("#cw").addClass("cw-avail"); $("#cw").addClass("cw-avail");
var cwt=localStorage.getItem("cw-text"); var cwt = localStorage.getItem("cw-text");
if(cwt){ if (cwt) {
$("#cw-text").val(cwt); $("#cw-text").val(cwt);
} }
} }
} }
} }
function checkStr(type, data, acct_id, key, delc,voice){ function checkStr(type, data, acct_id, key, delc, voice) {
if($('#notice_icon_' + key).hasClass("red-text") && type!="notf" && type!="mix"){ if ($('#notice_icon_' + key).hasClass("red-text") && type != "notf" && type != "mix") {
goTop(key); goTop(key);
tlDiff(type, data, acct_id, key, delc,voice,""); tlDiff(type, data, acct_id, key, delc, voice, "");
}else{ } else {
goTop(key); goTop(key);
} }
} }
//セカンダリートゥートボタン //セカンダリートゥートボタン
function secvis(set){ function secvis(set) {
if(set=="public"){ if (set == "public") {
$("#toot-sec-icon").text("public"); $("#toot-sec-icon").text("public");
$("#toot-sec-btn").addClass("purple"); $("#toot-sec-btn").addClass("purple");
}else if(set=="unlisted"){ } else if (set == "unlisted") {
$("#toot-sec-icon").text("lock_open"); $("#toot-sec-icon").text("lock_open");
$("#toot-sec-btn").addClass("blue"); $("#toot-sec-btn").addClass("blue");
}else if(set=="private"){ } else if (set == "private") {
$("#toot-sec-icon").text("lock"); $("#toot-sec-icon").text("lock");
$("#toot-sec-btn").addClass("orange"); $("#toot-sec-btn").addClass("orange");
}else if(set=="direct"){ } else if (set == "direct") {
$("#toot-sec-icon").text("mail"); $("#toot-sec-icon").text("mail");
$("#toot-sec-btn").addClass("red"); $("#toot-sec-btn").addClass("red");
}else if(set=="limited"){ } else if (set == "limited") {
$("#toot-sec-icon").text("group"); $("#toot-sec-icon").text("group");
$("#toot-sec-btn").addClass("teal"); $("#toot-sec-btn").addClass("teal");
}else if(set=="local"){ } else if (set == "local") {
$("#toot-sec-icon").text("visibility"); $("#toot-sec-icon").text("visibility");
$("#toot-sec-btn").addClass("light-blue"); $("#toot-sec-btn").addClass("light-blue");
} }
@ -306,12 +306,12 @@ function addColumn() {
var acct = $("#add-acct-sel").val(); var acct = $("#add-acct-sel").val();
localStorage.setItem("last-use", acct); localStorage.setItem("last-use", acct);
var type = $("#type-sel").val(); var type = $("#type-sel").val();
if(acct=="noauth"){ if (acct == "noauth") {
acct=$("#noauth-url").val(); acct = $("#noauth-url").val();
type="noauth" type = "noauth"
}else if(acct=="webview"){ } else if (acct == "webview") {
acct=""; acct = "";
type="webview" type = "webview"
} }
var add = { var add = {
domain: acct, domain: acct,
@ -319,38 +319,38 @@ function addColumn() {
}; };
var multi = localStorage.getItem("column"); var multi = localStorage.getItem("column");
var obj = JSON.parse(multi); var obj = JSON.parse(multi);
if(!obj){ if (!obj) {
var leng=0; var leng = 0;
var json = JSON.stringify([add]); var json = JSON.stringify([add]);
localStorage.setItem("column", json); localStorage.setItem("column", json);
}else{ } else {
var leng=obj.length; var leng = obj.length;
obj.push(add); obj.push(add);
var json = JSON.stringify(obj); var json = JSON.stringify(obj);
localStorage.setItem("column", json); localStorage.setItem("column", json);
} }
parseColumn(); parseColumn();
} }
function addselCk(){ function addselCk() {
var acct = $("#add-acct-sel").val(); var acct = $("#add-acct-sel").val();
var domain=localStorage.getItem("domain_" + acct); var domain = localStorage.getItem("domain_" + acct);
if(acct=="webview"){ if (acct == "webview") {
$("#auth").addClass("hide"); $("#auth").addClass("hide");
$("#noauth").addClass("hide"); $("#noauth").addClass("hide");
$("#webview-add").removeClass("hide"); $("#webview-add").removeClass("hide");
}else if(acct=="noauth"){ } else if (acct == "noauth") {
$("#auth").addClass("hide"); $("#auth").addClass("hide");
$("#noauth").removeClass("hide"); $("#noauth").removeClass("hide");
$("#webview-add").addClass("hide"); $("#webview-add").addClass("hide");
}else{ } else {
$("#auth").removeClass("hide"); $("#auth").removeClass("hide");
$("#noauth").addClass("hide"); $("#noauth").addClass("hide");
$("#webview-add").addClass("hide"); $("#webview-add").addClass("hide");
} }
if(domain=="knzk.me" || domain=="mstdn.y-zu.org"){ if (domain == "knzk.me" || domain == "mstdn.y-zu.org") {
$("#type-sel").append('<option value="dm" data-trans="dm" id="direct-add">'+lang.layout_dm +'</option>'); $("#type-sel").append('<option value="dm" data-trans="dm" id="direct-add">' + lang.layout_dm + '</option>');
}else{ } else {
$("#direct-add").remove(); $("#direct-add").remove();
} }
} }
@ -365,11 +365,11 @@ function removeColumn(tlid) {
var ipc = electron.ipcRenderer; var ipc = electron.ipcRenderer;
ipc.send('column-del', ""); ipc.send('column-del', "");
ipc.on('column-del-reply', function (event, arg) { ipc.on('column-del-reply', function (event, arg) {
if(arg===1){ if (arg === 1) {
localStorage.removeItem("card_" + tlid); localStorage.removeItem("card_" + tlid);
obj.splice(tlid, 1); obj.splice(tlid, 1);
for(var i=0;i<obj.length;i++){ for (var i = 0; i < obj.length; i++) {
localStorage.setItem("card_" + i,"true"); localStorage.setItem("card_" + i, "true");
localStorage.removeItem("catch_" + i); localStorage.removeItem("catch_" + i);
} }
var json = JSON.stringify(obj); var json = JSON.stringify(obj);
@ -383,123 +383,123 @@ function removeColumn(tlid) {
//設定トグル //設定トグル
function setToggle(tlid) { function setToggle(tlid) {
colorpicker(tlid); colorpicker(tlid);
if($("#util-box_" + tlid).hasClass("column-hide")){ if ($("#util-box_" + tlid).hasClass("column-hide")) {
$("#util-box_" + tlid).css("display","block") $("#util-box_" + tlid).css("display", "block")
$("#util-box_" + tlid).animate({ $("#util-box_" + tlid).animate({
'height': '200px' 'height': '200px'
},{ }, {
'duration': 300, 'duration': 300,
'complete': function(){ 'complete': function () {
$("#util-box_" + tlid).css("overflow-y","scroll") $("#util-box_" + tlid).css("overflow-y", "scroll")
$("#util-box_" + tlid).removeClass("column-hide") $("#util-box_" + tlid).removeClass("column-hide")
} }
}); });
}else{ } else {
$("#util-box_" + tlid).css("overflow-y","hidden") $("#util-box_" + tlid).css("overflow-y", "hidden")
$("#util-box_" + tlid).animate({ $("#util-box_" + tlid).animate({
'height': '0' 'height': '0'
},{ }, {
'duration': 300, 'duration': 300,
'complete': function(){ 'complete': function () {
$("#util-box_" + tlid).addClass("column-hide") $("#util-box_" + tlid).addClass("column-hide")
$("#util-box_" + tlid).css("display","none") $("#util-box_" + tlid).css("display", "none")
} }
}); });
} }
} }
function colorpicker(key){ function colorpicker(key) {
temp= temp =
'<div onclick="coloradd('+key+',\'def\',\'def\')" class="pointer">Default</div>'+ '<div onclick="coloradd(' + key + ',\'def\',\'def\')" class="pointer">Default</div>' +
'<div onclick="coloradd('+key+',\'f44336\',\'white\')" class="red white-text pointer">Red</div>'+ '<div onclick="coloradd(' + key + ',\'f44336\',\'white\')" class="red white-text pointer">Red</div>' +
'<div onclick="coloradd('+key+',\'e91e63\',\'white\')" class="pink white-text pointer">Pink</div>'+ '<div onclick="coloradd(' + key + ',\'e91e63\',\'white\')" class="pink white-text pointer">Pink</div>' +
'<div onclick="coloradd('+key+',\'9c27b0\',\'white\')" class="purple white-text pointer">Purple</div>'+ '<div onclick="coloradd(' + key + ',\'9c27b0\',\'white\')" class="purple white-text pointer">Purple</div>' +
'<div onclick="coloradd('+key+',\'673ab7\',\'white\')" class="deep-purple white-text pointer">Deep-purple</div>'+ '<div onclick="coloradd(' + key + ',\'673ab7\',\'white\')" class="deep-purple white-text pointer">Deep-purple</div>' +
'<div onclick="coloradd('+key+',\'3f51b5\',\'white\')" class="indigo white-text pointer">Indigo</div>'+ '<div onclick="coloradd(' + key + ',\'3f51b5\',\'white\')" class="indigo white-text pointer">Indigo</div>' +
'<div onclick="coloradd('+key+',\'2196f3\',\'white\')" class="blue white-text pointer">Blue</div>'+ '<div onclick="coloradd(' + key + ',\'2196f3\',\'white\')" class="blue white-text pointer">Blue</div>' +
'<div onclick="coloradd('+key+',\'03a9f4\',\'black\')" class="light-blue black-text pointer">Light-blue</div>'+ '<div onclick="coloradd(' + key + ',\'03a9f4\',\'black\')" class="light-blue black-text pointer">Light-blue</div>' +
'<div onclick="coloradd('+key+',\'00bcd4\',\'black\')" class="cyan black-text pointer">Cyan</div>'+ '<div onclick="coloradd(' + key + ',\'00bcd4\',\'black\')" class="cyan black-text pointer">Cyan</div>' +
'<div onclick="coloradd('+key+',\'009688\',\'white\')" class="teal white-text pointer">Teal</div>'+ '<div onclick="coloradd(' + key + ',\'009688\',\'white\')" class="teal white-text pointer">Teal</div>' +
'<div onclick="coloradd('+key+',\'4caf50\',\'black\')" class="green black-text pointer">Green</div>'+ '<div onclick="coloradd(' + key + ',\'4caf50\',\'black\')" class="green black-text pointer">Green</div>' +
'<div onclick="coloradd('+key+',\'8bc34a\',\'black\')" class="light-green black-text pointer">Light-green</div>'+ '<div onclick="coloradd(' + key + ',\'8bc34a\',\'black\')" class="light-green black-text pointer">Light-green</div>' +
'<div onclick="coloradd('+key+',\'cddc39\',\'black\')" class="lime black-text pointer">Lime</div>'+ '<div onclick="coloradd(' + key + ',\'cddc39\',\'black\')" class="lime black-text pointer">Lime</div>' +
'<div onclick="coloradd('+key+',\'ffeb3b\',\'black\')" class="yellow black-text pointer">Yellow</div>'+ '<div onclick="coloradd(' + key + ',\'ffeb3b\',\'black\')" class="yellow black-text pointer">Yellow</div>' +
'<div onclick="coloradd('+key+',\'ffc107\',\'black\')" class="amber black-text pointer">Amber</div>'+ '<div onclick="coloradd(' + key + ',\'ffc107\',\'black\')" class="amber black-text pointer">Amber</div>' +
'<div onclick="coloradd('+key+',\'ff9800\',\'black\')" class="orange black-text pointer">Orange</div>'+ '<div onclick="coloradd(' + key + ',\'ff9800\',\'black\')" class="orange black-text pointer">Orange</div>' +
'<div onclick="coloradd('+key+',\'ff5722\',\'white\')" class="deep-orange white-text pointer">Deep-orange</div>'+ '<div onclick="coloradd(' + key + ',\'ff5722\',\'white\')" class="deep-orange white-text pointer">Deep-orange</div>' +
'<div onclick="coloradd('+key+',\'795548\',\'white\')" class="brown white-text pointer">Brown</div>'+ '<div onclick="coloradd(' + key + ',\'795548\',\'white\')" class="brown white-text pointer">Brown</div>' +
'<div onclick="coloradd('+key+',\'9e9e9e\',\'white\')" class="grey white-text pointer">Grey</div>'+ '<div onclick="coloradd(' + key + ',\'9e9e9e\',\'white\')" class="grey white-text pointer">Grey</div>' +
'<div onclick="coloradd('+key+',\'607d8b\',\'white\')" class="blue-grey white-text pointer">Blue-grey</div>'+ '<div onclick="coloradd(' + key + ',\'607d8b\',\'white\')" class="blue-grey white-text pointer">Blue-grey</div>' +
'<div onclick="coloradd('+key+',\'000000\',\'white\')" class="black white-text pointer">Black</div>'+ '<div onclick="coloradd(' + key + ',\'000000\',\'white\')" class="black white-text pointer">Black</div>' +
'<div onclick="coloradd('+key+',\'ffffff\',\'black\')" class="white black-text pointer">White</div>'; '<div onclick="coloradd(' + key + ',\'ffffff\',\'black\')" class="white black-text pointer">White</div>';
$("#picker_"+key).html(temp); $("#picker_" + key).html(temp);
} }
function coloradd(key,bg,txt){ function coloradd(key, bg, txt) {
var col = localStorage.getItem("column"); var col = localStorage.getItem("column");
var o = JSON.parse(col); var o = JSON.parse(col);
var obj=o[key]; var obj = o[key];
obj.background=bg; obj.background = bg;
obj.text=txt; obj.text = txt;
o[key]=obj; o[key] = obj;
var json = JSON.stringify(o); var json = JSON.stringify(o);
localStorage.setItem("column", json); localStorage.setItem("column", json);
if(txt=="def"){ if (txt == "def") {
$("#menu_"+key).css("background-color",""); $("#menu_" + key).css("background-color", "");
$("#menu_"+key).css("color",""); $("#menu_" + key).css("color", "");
}else{ } else {
$("#menu_"+key).css('background-color','#'+bg); $("#menu_" + key).css('background-color', '#' + bg);
if(txt=="black"){ if (txt == "black") {
var bghex="000000"; var bghex = "000000";
var ichex="9e9e9e" var ichex = "9e9e9e"
}else if(txt=="white"){ } else if (txt == "white") {
var bghex="ffffff"; var bghex = "ffffff";
var ichex="eeeeee" var ichex = "eeeeee"
} }
$("#menu_"+key+" .nex").css('color','#'+ichex); $("#menu_" + key + " .nex").css('color', '#' + ichex);
$("#menu_"+key).css('color','#'+bghex); $("#menu_" + key).css('color', '#' + bghex);
} }
} }
//禁断のTwitter //禁断のTwitter
function webviewParse(url,key,insert,icnsert,css){ function webviewParse(url, key, insert, icnsert, css) {
var html = '<div class="box" id="timeline_box_' + key + '_box" tlid="' + key + var html = '<div class="box" id="timeline_box_' + key + '_box" tlid="' + key +
'" style="'+css+'"><div class="notice-box z-depth-2" id="menu_'+key+'" style="'+insert+'">'+ '" style="' + css + '"><div class="notice-box z-depth-2" id="menu_' + key + '" style="' + insert + '">' +
'<div class="area-notice"><i class="fab fa-twitter waves-effect" id="notice_icon_' + key + '" style="font-size:40px; padding-top:25%;"></i></div>'+ '<div class="area-notice"><i class="fab fa-twitter waves-effect" id="notice_icon_' + key + '" style="font-size:40px; padding-top:25%;"></i></div>' +
'<div class="area-notice_name tl-title">WebView('+url+')</div>'+ '<div class="area-notice_name tl-title">WebView(' + url + ')</div>' +
'<div class="area-sta"><input type="checkbox" id="webviewsel" value="true" class="filled-in"><label for="webviewsel">'+lang.lang_layout_webviewmode +'</label></div>'+ '<div class="area-sta"><input type="checkbox" id="webviewsel" value="true" class="filled-in"><label for="webviewsel">' + lang.lang_layout_webviewmode + '</label></div>' +
'<div class="area-a2"><a onclick="removeColumn(' + key + '<div class="area-a2"><a onclick="removeColumn(' + key +
')" class="setting nex"><i class="material-icons waves-effect nex" title="'+lang.lang_layout_delthis +'"'+icnsert+'>cancel</i></a></div>'+ ')" class="setting nex"><i class="material-icons waves-effect nex" title="' + lang.lang_layout_delthis + '"' + icnsert + '>cancel</i></a></div>' +
'<div class="area-a3"><a onclick="setToggle(' + key + '<div class="area-a3"><a onclick="setToggle(' + key +
')" class="setting nex" title="'+lang.lang_layout_setthis +'"'+icnsert+'><i class="material-icons waves-effect nex">settings</i></a></div></div>'+ ')" class="setting nex" title="' + lang.lang_layout_setthis + '"' + icnsert + '><i class="material-icons waves-effect nex">settings</i></a></div></div>' +
'<div class="column-hide notf-indv-box z-depth-4" id="notf-box_' + key + '<div class="column-hide notf-indv-box z-depth-4" id="notf-box_' + key +
'"></div><div class="column-hide notf-indv-box" id="util-box_' + key + '"></div><div class="column-hide notf-indv-box" id="util-box_' + key +
'" style="padding:5px;">'+lang.lang_layout_headercolor +'<br><div id="picker_'+key+'" class="color-picker"></div></div><div class="tl-box" tlid="' + key + '" style="width:100%;height:100%;"><div id="timeline_' + key + '" style="padding:5px;">' + lang.lang_layout_headercolor + '<br><div id="picker_' + key + '" class="color-picker"></div></div><div class="tl-box" tlid="' + key + '" style="width:100%;height:100%;"><div id="timeline_' + key +
'" class="tl" tlid="' + key + '" data-type="webview" style="width:100%;height:100%;"><webview src="'+url+'" style="width:100%;height:100%;" id="webview" preload="./js/platform/twitter.js"></webview></div></div></div>'; '" class="tl" tlid="' + key + '" data-type="webview" style="width:100%;height:100%;"><webview src="' + url + '" style="width:100%;height:100%;" id="webview" preload="./js/platform/twitter.js"></webview></div></div></div>';
return html; return html;
} }
function unstreamingTL(type,key,basekey,insert,icnsert,left_fold,css,animecss,q){ function unstreamingTL(type, key, basekey, insert, icnsert, left_fold, css, animecss, q) {
if(!left_fold){ if (!left_fold) {
var basehtml = '<div style="'+css+'" class="box '+animecss+'" id="timeline_box_' + basekey + '_parentBox"></div>'; var basehtml = '<div style="' + css + '" class="box ' + animecss + '" id="timeline_box_' + basekey + '_parentBox"></div>';
$("#timeline-container").append(basehtml); $("#timeline-container").append(basehtml);
var left_hold='<a onclick="leftFoldSet(' + key +')" class="setting nex"><i class="material-icons waves-effect nex" title="'+lang.lang_layout_leftFold+'">view_agenda</i></a>'+lang.lang_layout_leftFold+'</span><br>'; var left_hold = '<a onclick="leftFoldSet(' + key + ')" class="setting nex"><i class="material-icons waves-effect nex" title="' + lang.lang_layout_leftFold + '">view_agenda</i></a>' + lang.lang_layout_leftFold + '</span><br>';
}else{ } else {
var left_hold='<a onclick="leftFoldRemove(' + key +')" class="setting nex"><i class="material-icons waves-effect nex" title="'+lang.lang_layout_leftUnfold+'">view_column</i></a>'+lang.lang_layout_leftUnfold+'</span><br>'; var left_hold = '<a onclick="leftFoldRemove(' + key + ')" class="setting nex"><i class="material-icons waves-effect nex" title="' + lang.lang_layout_leftUnfold + '">view_column</i></a>' + lang.lang_layout_leftUnfold + '</span><br>';
} }
var html='<div class="boxIn" id="timeline_box_' + key + '_box" tlid="' + key + var html = '<div class="boxIn" id="timeline_box_' + key + '_box" tlid="' + key +
'"><div class="notice-box z-depth-2" id="menu_'+key+'" style="'+insert+' ">'+ '"><div class="notice-box z-depth-2" id="menu_' + key + '" style="' + insert + ' ">' +
'<div class="area-notice"><i class="material-icons waves-effect" id="notice_icon_' + key + '" style="font-size:40px; padding-top:25%;" onclick="tootsearch('+key+',\''+q+'\');" title="'+lang.lang_layout_gotop +'"></i></div>'+ '<div class="area-notice"><i class="material-icons waves-effect" id="notice_icon_' + key + '" style="font-size:40px; padding-top:25%;" onclick="tootsearch(' + key + ',\'' + q + '\');" title="' + lang.lang_layout_gotop + '"></i></div>' +
'<div class="area-notice_name"><span id="notice_' + key + '" class="tl-title"></span></div>'+ '<div class="area-notice_name"><span id="notice_' + key + '" class="tl-title"></span></div>' +
'<div class="area-a1"></div><div class="area-sta"></div>'+ '<div class="area-a1"></div><div class="area-sta"></div>' +
'<div class="area-a2"><a onclick="removeColumn(' + key + '<div class="area-a2"><a onclick="removeColumn(' + key +
')" class="setting nex"><i class="material-icons waves-effect nex" title="'+lang.lang_layout_delthis +'"'+icnsert+'>cancel</i></a></div>'+ ')" class="setting nex"><i class="material-icons waves-effect nex" title="' + lang.lang_layout_delthis + '"' + icnsert + '>cancel</i></a></div>' +
'<div class="area-a3"><a onclick="setToggle(' + key + '<div class="area-a3"><a onclick="setToggle(' + key +
')" class="setting nex" title="'+lang.lang_layout_setthis +'"'+icnsert+'><i class="material-icons waves-effect nex">settings</i></a></div></div>'+ ')" class="setting nex" title="' + lang.lang_layout_setthis + '"' + icnsert + '><i class="material-icons waves-effect nex">settings</i></a></div></div>' +
'<div class="column-hide notf-indv-box" id="util-box_' + key + '<div class="column-hide notf-indv-box" id="util-box_' + key +
'" style="padding:5px;">'+left_hold+'<a onclick="mediaToggle(' + key + '" style="padding:5px;">' + left_hold + '<a onclick="mediaToggle(' + key +
')" class="setting nex"><i class="material-icons waves-effect nex" title="'+lang.lang_layout_mediafil +'">perm_media</i><span id="sta-media-' + ')" class="setting nex"><i class="material-icons waves-effect nex" title="' + lang.lang_layout_mediafil + '">perm_media</i><span id="sta-media-' +
key + '">On</span></a>'+lang.lang_layout_mediafil +'<br>'+lang.lang_layout_headercolor +'<br><div id="picker_'+key+'" class="color-picker"></div></div><div class="tl-box" tlid="' + key + '"><div id="timeline_' + key + key + '">On</span></a>' + lang.lang_layout_mediafil + '<br>' + lang.lang_layout_headercolor + '<br><div id="picker_' + key + '" class="color-picker"></div></div><div class="tl-box" tlid="' + key + '"><div id="timeline_' + key +
'" class="tl '+type+'-timeline " tlid="' + key + '" data-type="' + type + '" data-acct="nostr"><div id="landing_'+key+'" style="text-align:center">'+lang.lang_layout_nodata +'</div></div></div>' '" class="tl ' + type + '-timeline " tlid="' + key + '" data-type="' + type + '" data-acct="nostr"><div id="landing_' + key + '" style="text-align:center">' + lang.lang_layout_nodata + '</div></div></div>'
$('#timeline_box_' + basekey + '_parentBox').append(html); $('#timeline_box_' + basekey + '_parentBox').append(html);
tootsearch(key,q); tootsearch(key, q);
cardCheck(key); cardCheck(key);
ebtCheck(key); ebtCheck(key);
mediaCheck(key); mediaCheck(key);
@ -507,18 +507,18 @@ function unstreamingTL(type,key,basekey,insert,icnsert,left_fold,css,animecss,q)
voiceCheck(key); voiceCheck(key);
return true; return true;
} }
function leftFoldSet(key){ function leftFoldSet(key) {
var multi = localStorage.getItem("column"); var multi = localStorage.getItem("column");
var obj = JSON.parse(multi); var obj = JSON.parse(multi);
obj[key].left_fold=true; obj[key].left_fold = true;
var json = JSON.stringify(obj); var json = JSON.stringify(obj);
localStorage.setItem("column", json); localStorage.setItem("column", json);
parseColumn(); parseColumn();
} }
function leftFoldRemove(key){ function leftFoldRemove(key) {
var multi = localStorage.getItem("column"); var multi = localStorage.getItem("column");
var obj = JSON.parse(multi); var obj = JSON.parse(multi);
obj[key].left_fold=false; obj[key].left_fold = false;
var json = JSON.stringify(obj); var json = JSON.stringify(obj);
localStorage.setItem("column", json); localStorage.setItem("column", json);
parseColumn(); parseColumn();

View File

@ -1,55 +1,56 @@
function menu(){ function menu() {
localStorage.setItem("menu-done",true); localStorage.setItem("menu-done", true);
$("#fukidashi").addClass("hide") $("#fukidashi").addClass("hide")
if(!$("#menu").hasClass("appear")){ if (!$("#menu").hasClass("appear")) {
$("#menu").addClass("appear") $("#menu").addClass("appear")
var left=localStorage.getItem("menu-left"); var left = localStorage.getItem("menu-left");
if(left>$('body').width()-$('#menu').width()){ if (left > $('body').width() - $('#menu').width()) {
left=$('body').width()-$('#menu').width(); left = $('body').width() - $('#menu').width();
}else if(left<0){ } else if (left < 0) {
left=0; left = 0;
}
var top=localStorage.getItem("menu-top");
if(top>$('body').height()-$('#menu').height()){
top=$('body').height()-$('#menu').height();
}else if(top<0){
top=0;
}
$('#menu').css("left",left+"px")
$('#menu').css("top",top+"px")
$('#menu').fadeIn();
$("#menu-bar").html("TheDesk "+localStorage.getItem("ver"));
$(".menu-content").addClass("hide");
$("#add-box").removeClass("hide");
$("#left-menu div").removeClass("active");
$("#addColumnMenu").addClass("active");
}else{
$('#menu').fadeOut()
$("#menu").removeClass("appear")
} }
var top = localStorage.getItem("menu-top");
if (top > $('body').height() - $('#menu').height()) {
top = $('body').height() - $('#menu').height();
} else if (top < 0) {
top = 0;
}
$('#menu').css("left", left + "px")
$('#menu').css("top", top + "px")
$('#menu').fadeIn();
$("#menu-bar").html("TheDesk " + localStorage.getItem("ver"));
$(".menu-content").addClass("hide");
$("#add-box").removeClass("hide");
$("#left-menu div").removeClass("active");
$("#addColumnMenu").addClass("active");
} else {
$('#menu').fadeOut()
$("#menu").removeClass("appear")
}
} }
$(function() { $(function () {
$( "#menu" ).draggable({handle: "#menu-bar", $("#menu").draggable({
stop: function() { handle: "#menu-bar",
var left=$('#menu').offset().left; stop: function () {
if(left>$('body').width()-$('#menu').width()){ var left = $('#menu').offset().left;
left=$('body').width()-$('#menu').width(); if (left > $('body').width() - $('#menu').width()) {
}else if(left<0){ left = $('body').width() - $('#menu').width();
left=0; } else if (left < 0) {
left = 0;
} }
var top=$('#menu').offset().top; var top = $('#menu').offset().top;
if(top>$('body').height()-$('#menu').height()){ if (top > $('body').height() - $('#menu').height()) {
top=$('body').height()-$('#menu').height(); top = $('body').height() - $('#menu').height();
}else if(top<0){ } else if (top < 0) {
top=0; top = 0;
} }
localStorage.setItem("menu-left",left); localStorage.setItem("menu-left", left);
localStorage.setItem("menu-top",top); localStorage.setItem("menu-top", top);
} }
});
}); });
function help(){ });
const {shell} = require('electron'); function help() {
shell.openExternal("https://docs.thedesk.top"); const { shell } = require('electron');
shell.openExternal("https://docs.thedesk.top");
} }

View File

@ -1,30 +1,30 @@
function pip(id){ function pip(id) {
$("#pip-content").html($("[toot-id=" + id + "] .additional").html()); $("#pip-content").html($("[toot-id=" + id + "] .additional").html());
$("#pip").removeClass("hide"); $("#pip").removeClass("hide");
} }
function endPip(){ function endPip() {
$("#pip-content").html(""); $("#pip-content").html("");
$("#pip").addClass("hide"); $("#pip").addClass("hide");
} }
function pipHoriz(){ function pipHoriz() {
if($("#pip").hasClass("pip-left")){ if ($("#pip").hasClass("pip-left")) {
$("#pip").removeClass("pip-left"); $("#pip").removeClass("pip-left");
$(".pip-horiz").text("chevron_left"); $(".pip-horiz").text("chevron_left");
$("#pip").addClass("pip-right"); $("#pip").addClass("pip-right");
}else{ } else {
$("#pip").addClass("pip-left"); $("#pip").addClass("pip-left");
$("#pip").removeClass("pip-right"); $("#pip").removeClass("pip-right");
$(".pip-horiz").text("chevron_right"); $(".pip-horiz").text("chevron_right");
} }
} }
function pipVert(){ function pipVert() {
if($("#pip").hasClass("pip-top")){ if ($("#pip").hasClass("pip-top")) {
$("#pip").removeClass("pip-top"); $("#pip").removeClass("pip-top");
$("#pip").addClass("pip-bottom"); $("#pip").addClass("pip-bottom");
$(".pip-vert").text("expand_less"); $(".pip-vert").text("expand_less");
}else{ } else {
$("#pip").addClass("pip-top"); $("#pip").addClass("pip-top");
$("#pip").removeClass("pip-bottom"); $("#pip").removeClass("pip-bottom");
$(".pip-vert").text("expand_more"); $(".pip-vert").text("expand_more");

View File

@ -13,9 +13,9 @@ function hide() {
//最小化 //最小化
function mini() { function mini() {
$("body").toggleClass("mini-post"); $("body").toggleClass("mini-post");
if($("body").hasClass("mini-post")){ if ($("body").hasClass("mini-post")) {
$(".mini-btn").text("expand_less"); $(".mini-btn").text("expand_less");
}else{ } else {
$(".mini-btn").text("expand_more"); $(".mini-btn").text("expand_more");
} }
} }
@ -23,51 +23,52 @@ function mini() {
function show() { function show() {
$("#post-box").addClass("appear") $("#post-box").addClass("appear")
$("#textarea").focus(); $("#textarea").focus();
console.log("show"+localStorage.getItem("postbox-left")); console.log("show" + localStorage.getItem("postbox-left"));
var left=localStorage.getItem("postbox-left"); var left = localStorage.getItem("postbox-left");
if(left>$('body').width()-$('#post-box').width()){ if (left > $('body').width() - $('#post-box').width()) {
left=$('body').width()-$('#post-box').width(); left = $('body').width() - $('#post-box').width();
}else if(left<0){ } else if (left < 0) {
left=0; left = 0;
} }
var top=localStorage.getItem("postbox-top"); var top = localStorage.getItem("postbox-top");
if(top>$('body').height()-$('#post-box').height()){ if (top > $('body').height() - $('#post-box').height()) {
top=$('body').height()-$('#post-box').height(); top = $('body').height() - $('#post-box').height();
}else if(top<0){ } else if (top < 0) {
top=0; top = 0;
} }
$('#post-box').css("left",left+"px") $('#post-box').css("left", left + "px")
$('#post-box').css("top",top+"px") $('#post-box').css("top", top + "px")
$('#post-box').fadeIn(); $('#post-box').fadeIn();
} }
$(function() { $(function () {
$( "#post-box" ).draggable({handle: "#post-bar", $("#post-box").draggable({
stop: function() { handle: "#post-bar",
var left=$('#post-box').offset().left; stop: function () {
if(left>$('body').width()-$('#post-box').width()){ var left = $('#post-box').offset().left;
left=$('body').width()-$('#post-box').width(); if (left > $('body').width() - $('#post-box').width()) {
}else if(left<0){ left = $('body').width() - $('#post-box').width();
left=0; } else if (left < 0) {
} left = 0;
var top=$('#post-box').offset().top; }
if(top>$('body').height()-$('#post-box').height()){ var top = $('#post-box').offset().top;
top=$('body').height()-$('#post-box').height(); if (top > $('body').height() - $('#post-box').height()) {
}else if(top<0){ top = $('body').height() - $('#post-box').height();
top=0; } else if (top < 0) {
} top = 0;
localStorage.setItem("postbox-left",left); }
localStorage.setItem("postbox-top",top); localStorage.setItem("postbox-left", left);
} localStorage.setItem("postbox-top", top);
}); }
});
}); });
//コード受信 //コード受信
if(location.search){ if (location.search) {
var m = location.search.match(/\?mode=([a-zA-Z-0-9]+)\&code=(.+)/); var m = location.search.match(/\?mode=([a-zA-Z-0-9]+)\&code=(.+)/);
var mode=m[1]; var mode = m[1];
var codex=m[2]; var codex = m[2];
if(mode=="share"){ if (mode == "share") {
console.log(codex); console.log(codex);
$('textarea').focus(); $('textarea').focus();
$("#textarea").val(decodeURI(codex)); $("#textarea").val(decodeURI(codex));
@ -76,27 +77,27 @@ if(location.search){
$(".mini-btn").text("expand_less"); $(".mini-btn").text("expand_less");
} }
} }
$('#posttgl').click(function(e) { $('#posttgl').click(function (e) {
if(!$('#post-box').hasClass("appear")){ if (!$('#post-box').hasClass("appear")) {
show(); show();
}else{ } else {
hide(); hide();
} }
}); });
$("#timeline-container,#group").click(function(e) { $("#timeline-container,#group").click(function (e) {
if(localStorage.getItem("box")!="absolute"){ if (localStorage.getItem("box") != "absolute") {
if($('#post-box').hasClass("appear") && !localStorage.getItem("nohide")){ if ($('#post-box').hasClass("appear") && !localStorage.getItem("nohide")) {
hide(); hide();
} }
} }
localStorage.removeItem("nohide") localStorage.removeItem("nohide")
}); });
$('#textarea,#cw-text').focusout(function(e) { $('#textarea,#cw-text').focusout(function (e) {
localStorage.setItem("nohide",true) localStorage.setItem("nohide", true)
var countup = function(){ var countup = function () {
localStorage.removeItem("nohide") localStorage.removeItem("nohide")
} }
//setTimeout(remove, 100); //setTimeout(remove, 100);
}); });

View File

@ -1,39 +1,39 @@
var r = document.getElementById("radio"); var r = document.getElementById("radio");
function Rtoggle(){ function Rtoggle() {
if($("#radio").hasClass("play")){ if ($("#radio").hasClass("play")) {
Rstop(); Rstop();
}else{ } else {
$("#radio-view").toggleClass("hide"); $("#radio-view").toggleClass("hide");
$("#radio-view").toggleClass("show"); $("#radio-view").toggleClass("show");
$("#radio-input").addClass("hide"); $("#radio-input").addClass("hide");
} }
} }
function Rplay(url,name){ function Rplay(url, name) {
$("#radio").attr('src',url); $("#radio").attr('src', url);
r.load(); r.load();
r.play(); r.play();
$("#radio").addClass("play"); $("#radio").addClass("play");
$("#radio-btn").addClass("teal-text"); $("#radio-btn").addClass("teal-text");
$("#radio-sta").html("<br>Now Playing:"+name); $("#radio-sta").html("<br>Now Playing:" + name);
} }
function Rstop(){ function Rstop() {
$("#radio").attr("src",""); $("#radio").attr("src", "");
r.pause(); r.pause();
$("#radio").removeClass("play"); $("#radio").removeClass("play");
$("#radio-btn").removeClass("teal-text"); $("#radio-btn").removeClass("teal-text");
$("#radio-sta").html(""); $("#radio-sta").html("");
} }
function Ryourself(){ function Ryourself() {
$("#radio-input").removeClass("hide"); $("#radio-input").removeClass("hide");
$("#radio-view").addClass("hide"); $("#radio-view").addClass("hide");
} }
function Rselect(){ function Rselect() {
$("#radio-input").addClass("hide"); $("#radio-input").addClass("hide");
$("#radio-view").removeClass("hide"); $("#radio-view").removeClass("hide");
} }
function Rinput(){ function Rinput() {
var url=$("#radio-url").val(); var url = $("#radio-url").val();
Rplay(url,url) Rplay(url, url)
} }
/* /*
<span id="radio-sta" class="radio"></span> <span id="radio-sta" class="radio"></span>

View File

@ -1,13 +1,13 @@
//スクロールで続きを読む //スクロールで続きを読む
function scrollevent() { function scrollevent() {
$(".tl-box").scroll(function() { $(".tl-box").scroll(function () {
scrollck(); scrollck();
}); });
} }
scrollevent(); scrollevent();
function scrollck() { function scrollck() {
$(".tl-box").each(function(i, elem) { $(".tl-box").each(function (i, elem) {
var tlid = $(this).attr('tlid'); var tlid = $(this).attr('tlid');
//一番上ならためていた新しいトゥートを表示 //一番上ならためていた新しいトゥートを表示
if ($(this).scrollTop() === 0) { if ($(this).scrollTop() === 0) {
@ -18,9 +18,9 @@ function scrollck() {
localStorage.removeItem("pool_" + tlid); localStorage.removeItem("pool_" + tlid);
} }
//自動リフレッシュ //自動リフレッシュ
if( $("#timeline_" + tlid+" .cvo").length > 30 ){ if ($("#timeline_" + tlid + " .cvo").length > 30) {
for(var i=30;i<$("#timeline_" + tlid +" .cvo").length;i++){ for (var i = 30; i < $("#timeline_" + tlid + " .cvo").length; i++) {
$("#timeline_" + tlid +" .cvo").eq(i).remove(); $("#timeline_" + tlid + " .cvo").eq(i).remove();
} }
} }
} }
@ -28,22 +28,22 @@ function scrollck() {
var scrt = $(this).find(".tl").height() - $(window).height(); var scrt = $(this).find(".tl").height() - $(window).height();
var scr = $(this).scrollTop(); var scr = $(this).scrollTop();
if (scr > scrt) { if (scr > scrt) {
console.log("kicked more loading:"+tlid); console.log("kicked more loading:" + tlid);
moreload('', tlid); moreload('', tlid);
} }
}); });
} }
function goTop(id){ function goTop(id) {
if ($("#timeline_box_"+id+"_box .tl-box").scrollTop() > 500){ if ($("#timeline_box_" + id + "_box .tl-box").scrollTop() > 500) {
$("#timeline_box_"+id+"_box .tl-box").scrollTop(500) $("#timeline_box_" + id + "_box .tl-box").scrollTop(500)
} }
$("#timeline_box_"+id+"_box .tl-box").animate({scrollTop:0}); $("#timeline_box_" + id + "_box .tl-box").animate({ scrollTop: 0 });
} }
function goColumn(key){ function goColumn(key) {
$("#sort-box").addClass("hide"); $("#sort-box").addClass("hide");
$("#sort-box").removeClass("show"); $("#sort-box").removeClass("show");
if($('[tlid='+key+']').length){ if ($('[tlid=' + key + ']').length) {
$("#timeline-container").animate({scrollLeft:$("#timeline-container").scrollLeft()+$('[tlid='+key+']').offset().left}); $("#timeline-container").animate({ scrollLeft: $("#timeline-container").scrollLeft() + $('[tlid=' + key + ']').offset().left });
} }
} }

View File

@ -1,17 +1,17 @@
//設定(setting.html)で読む //設定(setting.html)で読む
var envView = new Vue({ var envView = new Vue({
el: '#envView', el: '#envView',
data: {config:envConstruction}, data: { config: envConstruction },
methods: { methods: {
complete: function (i,val) { complete: function (i, val) {
var ls=envView.config[i].storage; var ls = envView.config[i].storage;
Materialize.toast("Complete", 3000); Materialize.toast("Complete", 3000);
if(!val){ if (!val) {
var id=envView.config[i].id; var id = envView.config[i].id;
var val=$("#"+id).val() var val = $("#" + id).val()
} }
localStorage.setItem(ls,val) localStorage.setItem(ls, val)
if(ls=="ha"){ if (ls == "ha") {
hardwareAcceleration(val) hardwareAcceleration(val)
} }
return true return true
@ -20,32 +20,32 @@ var envView = new Vue({
}); });
var tlView = new Vue({ var tlView = new Vue({
el: '#tlView', el: '#tlView',
data: {config:tlConstruction}, data: { config: tlConstruction },
methods: { methods: {
complete: function (i,val) { complete: function (i, val) {
var ls=tlView.config[i].storage; var ls = tlView.config[i].storage;
if(!val){ if (!val) {
var id=tlView.config[i].id; var id = tlView.config[i].id;
var val=$("#"+id).val() var val = $("#" + id).val()
} }
Materialize.toast("Complete", 3000); Materialize.toast("Complete", 3000);
localStorage.setItem(ls,val) localStorage.setItem(ls, val)
return true return true
} }
} }
}); });
var postView = new Vue({ var postView = new Vue({
el: '#postView', el: '#postView',
data: {config:postConstruction,kirishima:localStorage.getItem('kirishima')}, data: { config: postConstruction, kirishima: localStorage.getItem('kirishima') },
methods: { methods: {
complete: function (i,val) { complete: function (i, val) {
var ls=postView.config[i].storage; var ls = postView.config[i].storage;
Materialize.toast("Complete", 3000); Materialize.toast("Complete", 3000);
if(!val){ if (!val) {
var id=postView.config[i].id; var id = postView.config[i].id;
var val=$("#"+id).val() var val = $("#" + id).val()
} }
localStorage.setItem(ls,val) localStorage.setItem(ls, val)
return true return true
} }
} }
@ -53,32 +53,32 @@ var postView = new Vue({
//設定ボタン押した。 //設定ボタン押した。
function settings() { function settings() {
var cd = $("[name=theme]:checked").val(); var cd = $("[name=theme]:checked").val();
var ct = $("[for="+cd+"]").html(); var ct = $("[for=" + cd + "]").html();
if(cd=="custom" && !$("#custom-sel-sel").val()){ if (cd == "custom" && !$("#custom-sel-sel").val()) {
var theme = localStorage.getItem("theme"); var theme = localStorage.getItem("theme");
if (!theme) { if (!theme) {
var theme = "white"; var theme = "white";
} }
$("#" + theme).prop("checked", true); $("#" + theme).prop("checked", true);
}else{ } else {
if (cd != localStorage.getItem("theme")) { if (cd != localStorage.getItem("theme")) {
Materialize.toast(lang.lang_setting_theme.replace("{{set}}" ,ct), 3000); Materialize.toast(lang.lang_setting_theme.replace("{{set}}", ct), 3000);
} }
//テーマはこの場で設定 //テーマはこの場で設定
themes(cd); themes(cd);
localStorage.setItem("theme", cd); localStorage.setItem("theme", cd);
} }
var fontd = $("#font").val(); var fontd = $("#font").val();
if(fontd){ if (fontd) {
if (fontd != localStorage.getItem("font")) { if (fontd != localStorage.getItem("font")) {
Materialize.toast(lang.lang_setting_font.replace("{{set}}" ,fontd), 3000); Materialize.toast(lang.lang_setting_font.replace("{{set}}", fontd), 3000);
} }
localStorage.setItem("font", fontd); localStorage.setItem("font", fontd);
themes(); themes();
}else{ } else {
if(localStorage.getItem("font")){ if (localStorage.getItem("font")) {
localStorage.removeItem("font"); localStorage.removeItem("font");
Materialize.toast(lang.lang_setting_font.replace("{{set}}" ,lang.lang_setting_default), 3000); Materialize.toast(lang.lang_setting_font.replace("{{set}}", lang.lang_setting_default), 3000);
themes(); themes();
} }
} }
@ -86,31 +86,31 @@ function settings() {
//読み込み時の設定ロード //読み込み時の設定ロード
function load() { function load() {
var max=envView.config.length; var max = envView.config.length;
for(var i=0;i<max;i++){ for (var i = 0; i < max; i++) {
var ls=envView.config[i].storage; var ls = envView.config[i].storage;
if(localStorage.getItem(ls)){ if (localStorage.getItem(ls)) {
envView.config[i].setValue=localStorage.getItem(ls) envView.config[i].setValue = localStorage.getItem(ls)
} }
} }
var max=tlView.config.length; var max = tlView.config.length;
for(var i=0;i<max;i++){ for (var i = 0; i < max; i++) {
var ls=tlView.config[i].storage; var ls = tlView.config[i].storage;
if(localStorage.getItem(ls)){ if (localStorage.getItem(ls)) {
tlView.config[i].setValue=localStorage.getItem(ls) tlView.config[i].setValue = localStorage.getItem(ls)
} }
} }
var max=postView.config.length; var max = postView.config.length;
for(var i=0;i<max;i++){ for (var i = 0; i < max; i++) {
var ls=postView.config[i].storage; var ls = postView.config[i].storage;
if(localStorage.getItem(ls)){ if (localStorage.getItem(ls)) {
postView.config[i].setValue=localStorage.getItem(ls) postView.config[i].setValue = localStorage.getItem(ls)
} }
} }
if(localStorage.getItem("imas")){ if (localStorage.getItem("imas")) {
$(".imas").removeClass("hide"); $(".imas").removeClass("hide");
} }
if(localStorage.getItem("kirishima")){ if (localStorage.getItem("kirishima")) {
$(".kirishima").removeClass("hide"); $(".kirishima").removeClass("hide");
} }
var theme = localStorage.getItem("theme"); var theme = localStorage.getItem("theme");
@ -129,30 +129,30 @@ function load() {
$("#c4-file").text(localStorage.getItem("custom4")); $("#c4-file").text(localStorage.getItem("custom4"));
} }
function climute(){ function climute() {
//クライアントミュート //クライアントミュート
var cli = localStorage.getItem("client_mute"); var cli = localStorage.getItem("client_mute");
var obj = JSON.parse(cli); var obj = JSON.parse(cli);
if(!obj){ if (!obj) {
$("#mute-cli").html(lang.lang_setting_nomuting); $("#mute-cli").html(lang.lang_setting_nomuting);
}else{ } else {
if(!obj[0]){ if (!obj[0]) {
$("#mute-cli").html(lang.lang_setting_nomuting); $("#mute-cli").html(lang.lang_setting_nomuting);
return; return;
} }
var templete; var templete;
Object.keys(obj).forEach(function(key) { Object.keys(obj).forEach(function (key) {
var cli = obj[key]; var cli = obj[key];
var list = key * 1 + 1; var list = key * 1 + 1;
templete = '<div class="acct" id="acct_' + key + '">' + list + templete = '<div class="acct" id="acct_' + key + '">' + list +
'.' + '.' +
escapeHTML(cli) + '<button class="btn waves-effect red disTar" onclick="cliMuteDel(' + escapeHTML(cli) + '<button class="btn waves-effect red disTar" onclick="cliMuteDel(' +
key + ')">'+lang.lang_del+'</button><br></div>'; key + ')">' + lang.lang_del + '</button><br></div>';
$("#mute-cli").append(templete); $("#mute-cli").append(templete);
}); });
}
} }
} function cliMuteDel(key) {
function cliMuteDel(key){
var cli = localStorage.getItem("client_mute"); var cli = localStorage.getItem("client_mute");
var obj = JSON.parse(cli); var obj = JSON.parse(cli);
obj.splice(key, 1); obj.splice(key, 1);
@ -161,113 +161,113 @@ function cliMuteDel(key){
climute(); climute();
} }
function wordmute(){ function wordmute() {
var word = localStorage.getItem("word_mute"); var word = localStorage.getItem("word_mute");
var obj = JSON.parse(word); var obj = JSON.parse(word);
$('#wordmute').material_chip({ $('#wordmute').material_chip({
data: obj, data: obj,
}); });
} }
function wordmuteSave(){ function wordmuteSave() {
var word=$('#wordmute').material_chip('data'); var word = $('#wordmute').material_chip('data');
var json = JSON.stringify(word); var json = JSON.stringify(word);
localStorage.setItem("word_mute", json); localStorage.setItem("word_mute", json);
} }
function wordemp(){ function wordemp() {
var word = localStorage.getItem("word_emp"); var word = localStorage.getItem("word_emp");
var obj = JSON.parse(word); var obj = JSON.parse(word);
$('#wordemp').material_chip({ $('#wordemp').material_chip({
data: obj, data: obj,
}); });
} }
function wordempSave(){ function wordempSave() {
var word=$('#wordemp').material_chip('data'); var word = $('#wordemp').material_chip('data');
var json = JSON.stringify(word); var json = JSON.stringify(word);
localStorage.setItem("word_emp", json); localStorage.setItem("word_emp", json);
} }
function notftest(){ function notftest() {
var electron = require("electron");
var ipc = electron.ipcRenderer;
var os = electron.remote.process.platform;
var options = {
body: lang.lang_setting_notftest+'('+lang.lang_setting_notftestprof+')',
icon: localStorage.getItem("prof_0")
};
if(os=="darwin"){
var n = new Notification('TheDesk'+lang.lang_setting_notftest, options);
}else{
ipc.send('native-notf', ['TheDesk'+lang.lang_setting_notftest,lang.lang_setting_notftest+'('+lang.lang_setting_notftestprof+')',localStorage.getItem('prof_0'),"",""]);
}
}
function oks(no){
var txt=$("#oks-"+no).val();
localStorage.setItem("oks-"+no, txt);
Materialize.toast(lang.lang_setting_ksref, 3000);
}
function oksload(){
if(localStorage.getItem("oks-1")){$("#oks-1").val(localStorage.getItem("oks-1"))}
if(localStorage.getItem("oks-2")){$("#oks-2").val(localStorage.getItem("oks-2"))}
if(localStorage.getItem("oks-3")){$("#oks-3").val(localStorage.getItem("oks-3"))}
}
function changelang(lang){
var electron = require("electron"); var electron = require("electron");
var ipc = electron.ipcRenderer; var ipc = electron.ipcRenderer;
ipc.send('lang',lang); var os = electron.remote.process.platform;
var options = {
body: lang.lang_setting_notftest + '(' + lang.lang_setting_notftestprof + ')',
icon: localStorage.getItem("prof_0")
};
if (os == "darwin") {
var n = new Notification('TheDesk' + lang.lang_setting_notftest, options);
} else {
ipc.send('native-notf', ['TheDesk' + lang.lang_setting_notftest, lang.lang_setting_notftest + '(' + lang.lang_setting_notftestprof + ')', localStorage.getItem('prof_0'), "", ""]);
}
}
function oks(no) {
var txt = $("#oks-" + no).val();
localStorage.setItem("oks-" + no, txt);
Materialize.toast(lang.lang_setting_ksref, 3000);
}
function oksload() {
if (localStorage.getItem("oks-1")) { $("#oks-1").val(localStorage.getItem("oks-1")) }
if (localStorage.getItem("oks-2")) { $("#oks-2").val(localStorage.getItem("oks-2")) }
if (localStorage.getItem("oks-3")) { $("#oks-3").val(localStorage.getItem("oks-3")) }
}
function changelang(lang) {
var electron = require("electron");
var ipc = electron.ipcRenderer;
ipc.send('lang', lang);
ipc.on('langres', function (event, arg) { ipc.on('langres', function (event, arg) {
location.href="../"+lang+"/setting.html" location.href = "../" + lang + "/setting.html"
}); });
} }
function exportSettings(){ function exportSettings() {
if(!confirm(lang.lang_setting_exportwarn)){ if (!confirm(lang.lang_setting_exportwarn)) {
return false; return false;
} }
var electron = require("electron"); var electron = require("electron");
var remote=electron.remote; var remote = electron.remote;
var dialog=remote.dialog; var dialog = remote.dialog;
var ipc = electron.ipcRenderer; var ipc = electron.ipcRenderer;
dialog.showSaveDialog(null, { dialog.showSaveDialog(null, {
title: 'Export', title: 'Export',
properties: ['openFile', 'createDirectory'], properties: ['openFile', 'createDirectory'],
defaultPath: "export.thedeskconfigv2" defaultPath: "export.thedeskconfigv2"
}, (savedFiles) => { }, (savedFiles) => {
if(!savedFiles){ if (!savedFiles) {
return false; return false;
} }
var exp={}; var exp = {};
//Accounts //Accounts
var multi = localStorage.getItem("multi"); var multi = localStorage.getItem("multi");
var acct = JSON.parse(multi); var acct = JSON.parse(multi);
exp.accts=acct; exp.accts = acct;
//Columns //Columns
var multi = localStorage.getItem("column"); var multi = localStorage.getItem("column");
var column = JSON.parse(multi); var column = JSON.parse(multi);
exp.columns=column; exp.columns = column;
//Themes //Themes
var config={}; var config = {};
config.theme=localStorage.getItem("theme"); config.theme = localStorage.getItem("theme");
//Other configs //Other configs
var max=envView.config.length; var max = envView.config.length;
for(var i=0;i<max;i++){ for (var i = 0; i < max; i++) {
var ls=envView.config[i].storage; var ls = envView.config[i].storage;
config[ls]=localStorage.getItem(ls) config[ls] = localStorage.getItem(ls)
} }
var max=tlView.config.length; var max = tlView.config.length;
for(var i=0;i<max;i++){ for (var i = 0; i < max; i++) {
var ls=tlView.config[i].storage; var ls = tlView.config[i].storage;
config[ls]=localStorage.getItem(ls) config[ls] = localStorage.getItem(ls)
} }
var max=postView.config.length; var max = postView.config.length;
for(var i=0;i<max;i++){ for (var i = 0; i < max; i++) {
var ls=postView.config[i].storage; var ls = postView.config[i].storage;
config[ls]=localStorage.getItem(ls) config[ls] = localStorage.getItem(ls)
} }
//Font //Font
config.font=localStorage.getItem("font"); config.font = localStorage.getItem("font");
exp.config=config; exp.config = config;
//keysc //keysc
exp.ksc=[ exp.ksc = [
localStorage.getItem("oks-1"), localStorage.getItem("oks-1"),
localStorage.getItem("oks-2"), localStorage.getItem("oks-2"),
localStorage.getItem("oks-3") localStorage.getItem("oks-3")
@ -275,135 +275,135 @@ function exportSettings(){
//climu //climu
var cli = localStorage.getItem("client_mute"); var cli = localStorage.getItem("client_mute");
var climu = JSON.parse(cli); var climu = JSON.parse(cli);
exp.clientMute=climu; exp.clientMute = climu;
//wordmu //wordmu
var wdm = localStorage.getItem("word_mute"); var wdm = localStorage.getItem("word_mute");
var wordmu = JSON.parse(wdm); var wordmu = JSON.parse(wdm);
exp.wordMute=wordmu; exp.wordMute = wordmu;
//spotify //spotify
exp.spotifyArtwork=localStorage.getItem("artwork") exp.spotifyArtwork = localStorage.getItem("artwork")
var content=localStorage.getItem("np-temp"); var content = localStorage.getItem("np-temp");
if(content || content=="" || content=="null"){ if (content || content == "" || content == "null") {
exp.spotifyTemplete=content; exp.spotifyTemplete = content;
}else{ } else {
exp.spotifyTemplete=null; 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);
exp.favoriteTags=favtag; exp.favoriteTags = favtag;
ipc.send('export', [savedFiles,JSON.stringify(exp)]); ipc.send('export', [savedFiles, JSON.stringify(exp)]);
alert("Done.") alert("Done.")
//cards //cards
//lang //lang
}); });
} }
function importSettings(){ function importSettings() {
if(!confirm(lang.lang_setting_importwarn)){ if (!confirm(lang.lang_setting_importwarn)) {
return false; return false;
} }
var electron = require("electron"); var electron = require("electron");
var remote=electron.remote; var remote = electron.remote;
var dialog=remote.dialog; var dialog = remote.dialog;
var ipc = electron.ipcRenderer; var ipc = electron.ipcRenderer;
dialog.showOpenDialog(null, { dialog.showOpenDialog(null, {
title: 'Import', title: 'Import',
properties: ['openFile'], properties: ['openFile'],
filters: [ filters: [
{name: 'TheDesk Config', extensions: ['thedeskconfig','thedeskconfigv2']}, { name: 'TheDesk Config', extensions: ['thedeskconfig', 'thedeskconfigv2'] },
] ]
}, (fileNames) => { }, (fileNames) => {
if(!fileNames){ if (!fileNames) {
return false; return false;
} }
ipc.send('import', fileNames[0]); ipc.send('import', fileNames[0]);
ipc.on('config', function (event, arg) { ipc.on('config', function (event, arg) {
var obj = JSON.parse(arg); var obj = JSON.parse(arg);
if(obj){ if (obj) {
localStorage.clear(); localStorage.clear();
localStorage.setItem("multi",JSON.stringify(obj.accts)); localStorage.setItem("multi", JSON.stringify(obj.accts));
for(var key=0;key<obj.accts.length;key++){ for (var key = 0; key < obj.accts.length; key++) {
var acct=obj.accts[key]; var acct = obj.accts[key];
localStorage.setItem("name_" + key, acct.name); localStorage.setItem("name_" + key, acct.name);
localStorage.setItem("user_" + key, acct.user); localStorage.setItem("user_" + key, acct.user);
localStorage.setItem("user-id_" + key, acct.id); localStorage.setItem("user-id_" + key, acct.id);
localStorage.setItem("prof_" + key, acct.prof); localStorage.setItem("prof_" + key, acct.prof);
localStorage.setItem("domain_" + key, acct.domain); localStorage.setItem("domain_" + key, acct.domain);
localStorage.setItem("acct_"+ key + "_at", acct.at); localStorage.setItem("acct_" + key + "_at", acct.at);
} }
localStorage.setItem("column",JSON.stringify(obj.columns)); localStorage.setItem("column", JSON.stringify(obj.columns));
if(obj.config){ if (obj.config) {
//Version 2 //Version 2
var max=envView.config.length; var max = envView.config.length;
for(var i=0;i<max;i++){ for (var i = 0; i < max; i++) {
var ls=envView.config[i].storage; var ls = envView.config[i].storage;
if(obj.config[ls]){ if (obj.config[ls]) {
localStorage.setItem(ls,obj.config[ls]) localStorage.setItem(ls, obj.config[ls])
} }
} }
var max=tlView.config.length; var max = tlView.config.length;
for(var i=0;i<max;i++){ for (var i = 0; i < max; i++) {
var ls=tlView.config[i].storage; var ls = tlView.config[i].storage;
if(obj.config[ls]){ if (obj.config[ls]) {
localStorage.setItem(ls,obj.config[ls]) localStorage.setItem(ls, obj.config[ls])
} }
} }
var max=postView.config.length; var max = postView.config.length;
for(var i=0;i<max;i++){ for (var i = 0; i < max; i++) {
var ls=postView.config[i].storage; var ls = postView.config[i].storage;
if(obj.config[ls]){ if (obj.config[ls]) {
localStorage.setItem(ls,obj.config[ls]) localStorage.setItem(ls, obj.config[ls])
} }
} }
}else{ } else {
//Version 1 //Version 1
localStorage.setItem("theme",obj.theme); localStorage.setItem("theme", obj.theme);
if(obj.width){ if (obj.width) {
localStorage.setItem("width",obj.width); localStorage.setItem("width", obj.width);
} }
if(obj.font){ if (obj.font) {
localStorage.setItem("font",obj.font); localStorage.setItem("font", obj.font);
} }
if(obj.size){ if (obj.size) {
localStorage.setItem("size",obj.size); localStorage.setItem("size", obj.size);
} }
themes(obj.theme); themes(obj.theme);
if(obj.imgheight){ if (obj.imgheight) {
localStorage.setItem("img-height",obj.imgheight); localStorage.setItem("img-height", obj.imgheight);
} }
localStorage.setItem("mainuse",obj.mainuse); localStorage.setItem("mainuse", obj.mainuse);
if(obj.cw){ if (obj.cw) {
localStorage.setItem("cwtext",obj.cw); localStorage.setItem("cwtext", obj.cw);
} }
localStorage.setItem("vis",obj.vis); localStorage.setItem("vis", obj.vis);
//End //End
} }
if(obj.ksc[0]){ if (obj.ksc[0]) {
localStorage.setItem("oks-1",obj.ksc[0]); localStorage.setItem("oks-1", obj.ksc[0]);
} }
if(obj.ksc[1]){ if (obj.ksc[1]) {
localStorage.setItem("oks-2",obj.ksc[1]); localStorage.setItem("oks-2", obj.ksc[1]);
} }
if(obj.ksc[2]){ if (obj.ksc[2]) {
localStorage.setItem("oks-3",obj.ksc[2]); localStorage.setItem("oks-3", obj.ksc[2]);
} }
if(obj.clientMute){ if (obj.clientMute) {
localStorage.setItem("client_mute",JSON.stringify(obj.clientMute)); localStorage.setItem("client_mute", JSON.stringify(obj.clientMute));
} }
if(obj.wordMute){ if (obj.wordMute) {
localStorage.setItem("word_mute",JSON.stringify(obj.wordMute)); localStorage.setItem("word_mute", JSON.stringify(obj.wordMute));
} }
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");
localStorage.removeItem("catch_" + i); localStorage.removeItem("catch_" + i);
} }
location.href="index.html"; location.href = "index.html";
}else{ } else {
alert("Error.") alert("Error.")
} }
}) })
@ -411,39 +411,39 @@ function importSettings(){
//lang //lang
}); });
} }
function savefolder(){ function savefolder() {
var electron = require("electron"); var electron = require("electron");
var remote=electron.remote; var remote = electron.remote;
var dialog=remote.dialog; var dialog = remote.dialog;
dialog.showOpenDialog(null, { dialog.showOpenDialog(null, {
title: 'Save folder', title: 'Save folder',
properties: ['openDirectory'], properties: ['openDirectory'],
}, (fileNames) => { }, (fileNames) => {
localStorage.setItem("savefolder",fileNames[0]); localStorage.setItem("savefolder", fileNames[0]);
}); });
} }
function font(){ function font() {
var electron = require("electron"); var electron = require("electron");
var ipc = electron.ipcRenderer; var ipc = electron.ipcRenderer;
ipc.send('fonts', []); ipc.send('fonts', []);
ipc.on('font-list', function (event, arg) { ipc.on('font-list', function (event, arg) {
$("#fonts").removeClass("hide"); $("#fonts").removeClass("hide");
for( var i=0; i<arg.length; i++) { for (var i = 0; i < arg.length; i++) {
var font=arg[i]; var font = arg[i];
$("#fonts").append('<div class="font pointer" style="font-family:'+font.family+'" onclick="insertFont(\''+font.family+'\')">'+font.family+"</div>") $("#fonts").append('<div class="font pointer" style="font-family:' + font.family + '" onclick="insertFont(\'' + font.family + '\')">' + font.family + "</div>")
} }
}); });
} }
function insertFont(name){ function insertFont(name) {
$("#font").val(name); $("#font").val(name);
} }
$(".color-picker").each(function(i, elem) { $(".color-picker").each(function (i, elem) {
pickerDefine(i,"fff"); pickerDefine(i, "fff");
}); });
function pickerDefine(i,color){ function pickerDefine(i, color) {
var pickr = new Pickr({ var pickr = new Pickr({
el: '#color-picker'+i, el: '#color-picker' + i,
default: color, default: color,
showAlways: true, showAlways: true,
appendToBody: true, appendToBody: true,
@ -459,70 +459,50 @@ function pickerDefine(i,color){
} }
}, },
strings: { strings: {
save: 'Save', // Default for save button save: 'Save', // Default for save button
clear: 'Clear' // Default for clear button clear: 'Clear' // Default for clear button
} }
}); });
pickr.on('change', (...args) => { pickr.on('change', (...args) => {
var rgb='rgb('+args[0].toRGBA()[0]+','+args[0].toRGBA()[1]+','+args[0].toRGBA()[2]+')'; var rgb = 'rgb(' + args[0].toRGBA()[0] + ',' + args[0].toRGBA()[1] + ',' + args[0].toRGBA()[2] + ')';
$("#color-picker"+i+"_value").val(rgb) $("#color-picker" + i + "_value").val(rgb)
}); });
} }
function customComp(){ function customComp() {
var nameC=$("#custom_name").val(); var nameC = $("#custom_name").val();
if(!nameC){return false;} if (!nameC) { return false; }
var descC=$("#custom_desc").val(); var descC = $("#custom_desc").val();
var primaryC=$("#color-picker0_value").val(); var primaryC = $("#color-picker0_value").val();
if(!primaryC){primaryC="rgb(255,255,255)"} if (!primaryC) { primaryC = "rgb(255,255,255)" }
var secondaryC=$("#color-picker1_value").val(); var secondaryC = $("#color-picker1_value").val();
if(!secondaryC){secondaryC="rgb(255,255,255)"} if (!secondaryC) { secondaryC = "rgb(255,255,255)" }
var textC=$("#color-picker2_value").val(); var textC = $("#color-picker2_value").val();
if(!textC){textC="rgb(255,255,255)"} if (!textC) { textC = "rgb(255,255,255)" }
var accentC=$("#color-picker3_value").val(); var accentC = $("#color-picker3_value").val();
if(!accentC){accentC="rgb(255,255,255)"} if (!accentC) { accentC = "rgb(255,255,255)" }
var multi = localStorage.getItem("multi"); var multi = localStorage.getItem("multi");
var my=JSON.parse(multi)[0].name; var my = JSON.parse(multi)[0].name;
var id=$("#custom-edit-sel").val(); var id = $("#custom-edit-sel").val();
if(id=="add_new"){ if (id == "add_new") {
id=makeCID(); id = makeCID();
} }
var json={ var json = {
"name": nameC, "name": nameC,
"author": my, "author": my,
"desc": descC, "desc": descC,
"base": $("[name=direction]:checked").val(), "base": $("[name=direction]:checked").val(),
"vars": { "vars": {
"primary": primaryC, "primary": primaryC,
"secondary": secondaryC, "secondary": secondaryC,
"text": textC "text": textC
}, },
"props": { "props": {
"TheDeskAccent": accentC "TheDeskAccent": accentC
}, },
"id": id "id": id
} }
$("#custom_json").val(JSON.stringify(json)); $("#custom_json").val(JSON.stringify(json));
themes(); themes();
$("#custom_name").val("");
$("#custom_desc").val("");
$("#dark").prop("checked", true);
$("#custom_json").val("");
$("#color-picker0-wrap").html('<div class="color-picker" id="color-picker0"></div>')
$("#color-picker1-wrap").html('<div class="color-picker" id="color-picker1"></div>')
$("#color-picker2-wrap").html('<div class="color-picker" id="color-picker2"></div>')
$("#color-picker3-wrap").html('<div class="color-picker" id="color-picker3"></div>')
$("#color-picker0_value").val("");
$("#color-picker1_value").val("");
$("#color-picker2_value").val("");
$("#color-picker3_value").val("");
pickerDefine(0,"fff");
pickerDefine(1,"fff");
pickerDefine(2,"fff");
pickerDefine(3,"fff");
ipc.send('theme-json-create', JSON.stringify(json));
}
function deleteIt(){
var id=$("#custom-sel-sel").val();
$("#custom_name").val(""); $("#custom_name").val("");
$("#custom_desc").val(""); $("#custom_desc").val("");
$("#dark").prop("checked", true); $("#dark").prop("checked", true);
@ -535,40 +515,60 @@ function deleteIt(){
$("#color-picker1_value").val(""); $("#color-picker1_value").val("");
$("#color-picker2_value").val(""); $("#color-picker2_value").val("");
$("#color-picker3_value").val(""); $("#color-picker3_value").val("");
pickerDefine(0,"fff"); pickerDefine(0, "fff");
pickerDefine(1,"fff"); pickerDefine(1, "fff");
pickerDefine(2,"fff"); pickerDefine(2, "fff");
pickerDefine(3,"fff"); pickerDefine(3, "fff");
ipc.send('theme-json-create', JSON.stringify(json));
}
function deleteIt() {
var id = $("#custom-sel-sel").val();
$("#custom_name").val("");
$("#custom_desc").val("");
$("#dark").prop("checked", true);
$("#custom_json").val("");
$("#color-picker0-wrap").html('<div class="color-picker" id="color-picker0"></div>')
$("#color-picker1-wrap").html('<div class="color-picker" id="color-picker1"></div>')
$("#color-picker2-wrap").html('<div class="color-picker" id="color-picker2"></div>')
$("#color-picker3-wrap").html('<div class="color-picker" id="color-picker3"></div>')
$("#color-picker0_value").val("");
$("#color-picker1_value").val("");
$("#color-picker2_value").val("");
$("#color-picker3_value").val("");
pickerDefine(0, "fff");
pickerDefine(1, "fff");
pickerDefine(2, "fff");
pickerDefine(3, "fff");
ipc.on('theme-json-delete-complete', function (event, args) { ipc.on('theme-json-delete-complete', function (event, args) {
ctLoad() ctLoad()
}); });
ipc.send('theme-json-delete', id); ipc.send('theme-json-delete', id);
} }
function ctLoad(){ function ctLoad() {
ipc.send('theme-json-list', ""); ipc.send('theme-json-list', "");
ipc.on('theme-json-list-response', function (event, args) { ipc.on('theme-json-list-response', function (event, args) {
var templete=""; var templete = "";
Object.keys(args).forEach(function(key) { Object.keys(args).forEach(function (key) {
var theme = args[key]; var theme = args[key];
var themeid=theme.id var themeid = theme.id
templete = templete+'<option value="'+themeid+'">' + theme.name +'</option>'; templete = templete + '<option value="' + themeid + '">' + theme.name + '</option>';
}); });
if(args[0]){ if (args[0]) {
localStorage.setItem("customtheme-id",args[0].id) localStorage.setItem("customtheme-id", args[0].id)
} }
$("#custom-sel-sel").html(templete); $("#custom-sel-sel").html(templete);
templete='<option value="add_new">'+$("#edit-selector").attr("data-add")+'</option>'+templete; templete = '<option value="add_new">' + $("#edit-selector").attr("data-add") + '</option>' + templete;
$("#custom-edit-sel").html(templete); $("#custom-edit-sel").html(templete);
$('select').material_select('update'); $('select').material_select('update');
}); });
} }
function customSel(){ function customSel() {
var id=$("#custom-sel-sel").val(); var id = $("#custom-sel-sel").val();
localStorage.setItem("customtheme-id",id) localStorage.setItem("customtheme-id", id)
} }
function custom(){ function custom() {
var id=$("#custom-edit-sel").val(); var id = $("#custom-edit-sel").val();
if(id=="add_new"){ if (id == "add_new") {
$("#custom_name").val(""); $("#custom_name").val("");
$("#custom_desc").val(""); $("#custom_desc").val("");
$("#dark").prop("checked", true); $("#dark").prop("checked", true);
@ -581,51 +581,51 @@ function custom(){
$("#color-picker1_value").val(""); $("#color-picker1_value").val("");
$("#color-picker2_value").val(""); $("#color-picker2_value").val("");
$("#color-picker3_value").val(""); $("#color-picker3_value").val("");
pickerDefine(0,"fff"); pickerDefine(0, "fff");
pickerDefine(1,"fff"); pickerDefine(1, "fff");
pickerDefine(2,"fff"); pickerDefine(2, "fff");
pickerDefine(3,"fff"); pickerDefine(3, "fff");
$("#delTheme").addClass("disabled") $("#delTheme").addClass("disabled")
}else{ } else {
$("#delTheme").removeClass("disabled") $("#delTheme").removeClass("disabled")
ipc.send('theme-json-request', id); ipc.send('theme-json-request', id);
ipc.on('theme-json-response', function (event, args) { ipc.on('theme-json-response', function (event, args) {
$("#custom_name").val(args.name); $("#custom_name").val(args.name);
$("#custom_desc").val(args.desc); $("#custom_desc").val(args.desc);
$("#"+args.base).prop("checked", true); $("#" + args.base).prop("checked", true);
$("#color-picker0-wrap").html('<div class="color-picker" id="color-picker0"></div>') $("#color-picker0-wrap").html('<div class="color-picker" id="color-picker0"></div>')
pickerDefine(0,rgbToHex(args.vars.primary)) pickerDefine(0, rgbToHex(args.vars.primary))
$("#color-picker0_value").val(args.vars.primary); $("#color-picker0_value").val(args.vars.primary);
$("#color-picker1-wrap").html('<div class="color-picker" id="color-picker1"></div>') $("#color-picker1-wrap").html('<div class="color-picker" id="color-picker1"></div>')
pickerDefine(1,rgbToHex(args.vars.secondary)) pickerDefine(1, rgbToHex(args.vars.secondary))
$("#color-picker1_value").val(args.vars.secondary); $("#color-picker1_value").val(args.vars.secondary);
$("#color-picker2-wrap").html('<div class="color-picker" id="color-picker2"></div>') $("#color-picker2-wrap").html('<div class="color-picker" id="color-picker2"></div>')
$("#color-picker2_value").val(args.vars.text); $("#color-picker2_value").val(args.vars.text);
pickerDefine(2,rgbToHex(args.vars.text)) pickerDefine(2, rgbToHex(args.vars.text))
if(args.props){ if (args.props) {
if(args.props.TheDeskAccent){ if (args.props.TheDeskAccent) {
var accent=args.props.TheDeskAccent; var accent = args.props.TheDeskAccent;
}else{ } else {
var accent=args.vars.secondary; var accent = args.vars.secondary;
} }
}else{ } else {
var accent=args.vars.secondary; var accent = args.vars.secondary;
} }
$("#color-picker3-wrap").html('<div class="color-picker" id="color-picker3"></div>') $("#color-picker3-wrap").html('<div class="color-picker" id="color-picker3"></div>')
pickerDefine(3,rgbToHex(accent)) pickerDefine(3, rgbToHex(accent))
$("#custom_json").val(JSON.stringify(args)); $("#custom_json").val(JSON.stringify(args));
}); });
} }
} }
function customImp(){ function customImp() {
var json=$("#custom_import").val(); var json = $("#custom_import").val();
if(JSON5.parse(json)){ if (JSON5.parse(json)) {
ipc.send('theme-json-create', json); ipc.send('theme-json-create', json);
}else{ } else {
alert("Error") alert("Error")
} }
} }
function hardwareAcceleration(had){ function hardwareAcceleration(had) {
ipc.send('ha', had); ipc.send('ha', had);
} }
@ -633,32 +633,32 @@ ipc.on('theme-json-create-complete', function (event, args) {
$("#custom_import").val(""); $("#custom_import").val("");
ctLoad() ctLoad()
}); });
function customSound(key){ function customSound(key) {
var electron = require("electron"); var electron = require("electron");
var remote=electron.remote; var remote = electron.remote;
var dialog=remote.dialog; var dialog = remote.dialog;
dialog.showOpenDialog(null, { dialog.showOpenDialog(null, {
title: 'Custom sound', title: 'Custom sound',
properties: ['openFile'], properties: ['openFile'],
filters: [ filters: [
{name: 'Audio', extensions: ['mp3','aac','wav','flac','m4a']}, { name: 'Audio', extensions: ['mp3', 'aac', 'wav', 'flac', 'm4a'] },
{name: 'All', extensions: ['*']}, { name: 'All', extensions: ['*'] },
] ]
}, (fileNames) => { }, (fileNames) => {
localStorage.setItem("custom"+key,fileNames[0]); localStorage.setItem("custom" + key, fileNames[0]);
$("#c1-file").text(fileNames[0]) $("#c1-file").text(fileNames[0])
}); });
} }
window.onload = function() { window.onload = function () {
//最初に読む //最初に読む
load(); load();
climute(); climute();
wordmute(); wordmute();
wordemp(); wordemp();
checkSpotify(); checkSpotify();
voiceSettingLoad(); voiceSettingLoad();
oksload(); oksload();
npprovider(); npprovider();
ctLoad() ctLoad()
}; };

View File

@ -1,43 +1,43 @@
//ソートデータ読み込み //ソートデータ読み込み
function sortload(){ function sortload() {
var col = localStorage.getItem("column"); var col = localStorage.getItem("column");
if (col) { if (col) {
var obj = JSON.parse(col); var obj = JSON.parse(col);
}
Object.keys(obj).forEach(function (key) {
var acct = obj[key];
var flag = "false";
if (localStorage.getItem("card_" + key) == "true") {
flag = "true"
} }
Object.keys(obj).forEach(function(key) { var insert = "";
var acct = obj[key];
var flag="false";
if(localStorage.getItem("card_" + key)=="true"){
flag="true"
}
var insert="";
if(acct.background){ if (acct.background) {
if(acct.text=="def"){ if (acct.text == "def") {
}else{ } else {
if(acct.text=="black"){ if (acct.text == "black") {
var txhex="000000"; var txhex = "000000";
}else if(acct.text=="white"){ } else if (acct.text == "white") {
var txhex="ffffff"; var txhex = "ffffff";
} }
insert=' style="background-color:#'+acct.background+'; color: #'+txhex+'" '; insert = ' style="background-color:#' + acct.background + '; color: #' + txhex + '" ';
} }
} }
var user=localStorage.getItem("user_" + acct.domain); var user = localStorage.getItem("user_" + acct.domain);
var domain=localStorage.getItem("domain_" + acct.domain); var domain = localStorage.getItem("domain_" + acct.domain);
if(!user || !domain){ if (!user || !domain) {
var acctdata=""; var acctdata = "";
}else{ } else {
var acctdata=user+"@"+domain; var acctdata = user + "@" + domain;
} }
var html='<li class="drag-content" data-id="'+key+'" data-flag="'+flag+'"'+insert+'><div class="sorticon"><i class="material-icons">'+icon(acct.type)+'</i></div><div class="sorttitle">'+cap(acct.type, escapeHTML(acct.data),acct.domain)+'</div><div class="sortaction"><a onclick="goColumn(' + key + var html = '<li class="drag-content" data-id="' + key + '" data-flag="' + flag + '"' + insert + '><div class="sorticon"><i class="material-icons">' + icon(acct.type) + '</i></div><div class="sorttitle">' + cap(acct.type, escapeHTML(acct.data), acct.domain) + '</div><div class="sortaction"><a onclick="goColumn(' + key +
')" class="setting nex"><i class="material-icons waves-effect nex" title="'+lang.lang_sort_gothis+'">forward</i></a> <a onclick="removeColumn(' + key + ')" class="setting nex"><i class="material-icons waves-effect nex" title="' + lang.lang_sort_gothis + '">forward</i></a> <a onclick="removeColumn(' + key +
')" class="setting nex"><i class="material-icons waves-effect nex" title="このカラムを削除">cancel</i></a></div><div class="sortacct">'+acctdata+'</div></li>'; ')" class="setting nex"><i class="material-icons waves-effect nex" title="このカラムを削除">cancel</i></a></div><div class="sortacct">' + acctdata + '</div></li>';
$("#sort").append(html); $("#sort").append(html);
}); });
drag(); drag();
} }
//TLのタイトル //TLのタイトル
@ -56,47 +56,47 @@ function Scap(type, data) {
return "Notification" return "Notification"
} else if (type == "mix") { } else if (type == "mix") {
return "Integrated" return "Integrated"
}else if (type == "webview") { } else if (type == "webview") {
return "Twitter" return "Twitter"
}else if (type == "tootsearch") { } else if (type == "tootsearch") {
return "tootsearch(" + data + ")" return "tootsearch(" + data + ")"
}else{ } else {
console.error("unknown timeline type: "+type); console.error("unknown timeline type: " + type);
} }
} }
//jquery-ui依存 //jquery-ui依存
function drag(){ function drag() {
$('#sort').sortable(); $('#sort').sortable();
$('#sort').disableSelection(); $('#sort').disableSelection();
} }
//ソート指定 //ソート指定
function sort(){ function sort() {
var arr=[]; var arr = [];
var flags=[]; var flags = [];
$(".drag-content").each(function(i, elem) { $(".drag-content").each(function (i, elem) {
var id=$(this).attr("data-id"); var id = $(this).attr("data-id");
var flag=$(this).attr("data-flag"); var flag = $(this).attr("data-flag");
arr.push(id) arr.push(id)
flags.push(flag); flags.push(flag);
}); });
var col = localStorage.getItem("column"); var col = localStorage.getItem("column");
var obj = JSON.parse(col); var obj = JSON.parse(col);
var newobj=[]; var newobj = [];
for(i=0;i<arr.length;i++){ for (i = 0; i < arr.length; i++) {
var data=obj[arr[i]]; var data = obj[arr[i]];
var add = { var add = {
domain: data.domain, domain: data.domain,
type: data.type, type: data.type,
data:data.data, data: data.data,
background:data.background, background: data.background,
text:data.text text: data.text
}; };
newobj.push(add); newobj.push(add);
if(flags[i]=="true"){ if (flags[i] == "true") {
localStorage.setItem("card_" + i, "true"); localStorage.setItem("card_" + i, "true");
}else{ } else {
localStorage.removeItem("card_" + i); localStorage.removeItem("card_" + i);
} }
} }
@ -109,11 +109,11 @@ function sort(){
sortMenu() sortMenu()
} }
//ソートボタントグル //ソートボタントグル
function sortMenu(){ function sortMenu() {
$("#left-menu div").removeClass("active"); $("#left-menu div").removeClass("active");
$("#sortMenu").addClass("active"); $("#sortMenu").addClass("active");
$(".menu-content").addClass("hide"); $(".menu-content").addClass("hide");
$("#sort-box").removeClass("hide"); $("#sort-box").removeClass("hide");
$("#sort").html(""); $("#sort").html("");
sortload(); sortload();
} }

View File

@ -1,153 +1,153 @@
function spotifyConnect(){ function spotifyConnect() {
var auth = "https://accounts.spotify.com/authorize?client_id=0f18e54abe0b4aedb4591e353d3aff69&redirect_uri=https://thedesk.top/spotify-connect&response_type=code&scope=user-read-currently-playing"; var auth = "https://accounts.spotify.com/authorize?client_id=0f18e54abe0b4aedb4591e353d3aff69&redirect_uri=https://thedesk.top/spotify-connect&response_type=code&scope=user-read-currently-playing";
const { const {
shell shell
} = require('electron'); } = require('electron');
var electron = require("electron");
var remote = electron.remote;
var platform = remote.process.platform;
if (platform == "win32") {
shell.openExternal(auth);
var ipc = electron.ipcRenderer;
ipc.send('quit', 'go');
} else {
auth = auth + "&state=code";
$("#spotify-code-show").removeClass("hide");
shell.openExternal(auth);
}
var electron = require("electron");
var remote=electron.remote;
var platform=remote.process.platform;
if(platform=="win32"){
shell.openExternal(auth);
var ipc = electron.ipcRenderer;
ipc.send('quit', 'go');
}else{
auth=auth+"&state=code";
$("#spotify-code-show").removeClass("hide");
shell.openExternal(auth);
}
} }
function spotifyAuth(){ function spotifyAuth() {
var code=$("#spotify-code").val(); var code = $("#spotify-code").val();
localStorage.setItem("spotify", "code"); localStorage.setItem("spotify", "code");
localStorage.setItem("spotify-refresh", code); localStorage.setItem("spotify-refresh", code);
$("#spotify-code-show").addClass("hide"); $("#spotify-code-show").addClass("hide");
$("#spotify-enable").addClass("disabled"); $("#spotify-enable").addClass("disabled");
$("#spotify-disable").removeClass("disabled"); $("#spotify-disable").removeClass("disabled");
} }
function spotifyDisconnect(){ function spotifyDisconnect() {
localStorage.removeItem("spotify"); localStorage.removeItem("spotify");
localStorage.removeItem("spotify-refresh"); localStorage.removeItem("spotify-refresh");
checkSpotify(); checkSpotify();
} }
function checkSpotify(){ function checkSpotify() {
if(localStorage.getItem("spotify")){ if (localStorage.getItem("spotify")) {
$("#spotify-enable").addClass("disabled"); $("#spotify-enable").addClass("disabled");
$("#spotify-disable").removeClass("disabled"); $("#spotify-disable").removeClass("disabled");
}else{ } else {
$("#spotify-enable").removeClass("disabled"); $("#spotify-enable").removeClass("disabled");
$("#spotify-disable").addClass("disabled"); $("#spotify-disable").addClass("disabled");
} }
var content=localStorage.getItem("np-temp"); var content = localStorage.getItem("np-temp");
if(!content || content=="" || content=="null"){ 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);
var flag=localStorage.getItem("artwork"); var flag = localStorage.getItem("artwork");
if(flag){ if (flag) {
$("#awk_yes").prop("checked", true); $("#awk_yes").prop("checked", true);
}else{ } else {
$("#awk_no").prop("checked", true); $("#awk_no").prop("checked", true);
} }
} }
function spotifyFlagSave(){ function spotifyFlagSave() {
var awk = $("[name=awk]:checked").val(); var awk = $("[name=awk]:checked").val();
if(awk=="yes"){ if (awk == "yes") {
localStorage.setItem("artwork","yes"); localStorage.setItem("artwork", "yes");
Materialize.toast(lang.lang_spotify_img, 3000); Materialize.toast(lang.lang_spotify_img, 3000);
}else{ } else {
localStorage.removeItem("artwork"); localStorage.removeItem("artwork");
Materialize.toast(lang.lang_spotify_imgno, 3000); Materialize.toast(lang.lang_spotify_imgno, 3000);
} }
} }
function nowplaying(mode){ function nowplaying(mode) {
if(mode=="spotify"){ if (mode == "spotify") {
var start = "https://thedesk.top/now-playing?at="+localStorage.getItem("spotify")+"&rt="+localStorage.getItem("spotify-refresh"); var start = "https://thedesk.top/now-playing?at=" + localStorage.getItem("spotify") + "&rt=" + localStorage.getItem("spotify-refresh");
var at = localStorage.getItem("spotify"); var at = localStorage.getItem("spotify");
if(at){ if (at) {
fetch(start, { fetch(start, {
method: 'GET', method: 'GET',
headers: { headers: {
'content-type': 'application/json' 'content-type': 'application/json'
} }
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
console.table(json); console.table(json);
if(json.length<1){ if (json.length < 1) {
return false; 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");
var ipc = electron.ipcRenderer; var ipc = electron.ipcRenderer;
var flag=localStorage.getItem("artwork"); var flag = localStorage.getItem("artwork");
if(flag){ if (flag) {
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=="" || content=="null"){ 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");
content = content.replace(regExp, item.name); content = content.replace(regExp, item.name);
var regExp = new RegExp("{album}", "g"); var regExp = new RegExp("{album}", "g");
content = content.replace(regExp, item.album.name); content = content.replace(regExp, item.album.name);
var regExp = new RegExp("{artist}", "g"); var regExp = new RegExp("{artist}", "g");
content = content.replace(regExp, item.artists[0].name); content = content.replace(regExp, item.artists[0].name);
var regExp = new RegExp("{url}", "g"); var regExp = new RegExp("{url}", "g");
content = content.replace(regExp, item.external_urls.spotify); content = content.replace(regExp, item.external_urls.spotify);
var regExp = new RegExp("{composer}", "g"); var regExp = new RegExp("{composer}", "g");
content = content.replace(regExp, ""); content = content.replace(regExp, "");
var regExp = new RegExp("{hz}", "g"); var regExp = new RegExp("{hz}", "g");
content = content.replace(regExp, ""); content = content.replace(regExp, "");
var regExp = new RegExp("{bitRate}", "g"); var regExp = new RegExp("{bitRate}", "g");
content = content.replace(regExp, ""); content = content.replace(regExp, "");
var regExp = new RegExp("{lyricist}", "g"); var regExp = new RegExp("{lyricist}", "g");
content = content.replace(regExp, ""); content = content.replace(regExp, "");
var regExp = new RegExp("{bpm}", "g"); var regExp = new RegExp("{bpm}", "g");
content = content.replace(regExp, ""); content = content.replace(regExp, "");
var regExp = new RegExp("{genre}", "g"); var regExp = new RegExp("{genre}", "g");
content = content.replace(regExp, ""); content = content.replace(regExp, "");
$("#textarea").val(content); $("#textarea").val(content);
}); });
}else{ } else {
alert(lang.lang_spotify_acct); alert(lang.lang_spotify_acct);
} }
}else if(mode=="itunes"){ } else if (mode == "itunes") {
var electron = require("electron"); var electron = require("electron");
var ipc = electron.ipcRenderer; var ipc = electron.ipcRenderer;
if (ipc.listenerCount('itunes-np') > 0) { if (ipc.listenerCount('itunes-np') > 0) {
return false; return false;
} }
ipc.send('itunes', ""); ipc.send('itunes', "");
ipc.once('itunes-np', function (event, arg) { ipc.once('itunes-np', function (event, arg) {
if (arg.cmd) { if (arg.cmd) {
console.error(arg); console.error(arg);
return; return;
} }
console.table(arg); console.table(arg);
var content=localStorage.getItem("np-temp"); var content = localStorage.getItem("np-temp");
if(!content || content=="" || content=="null"){ if (!content || content == "" || content == "null") {
var content="#NowPlaying {song} / {album} / {artist}\n{url}"; var content = "#NowPlaying {song} / {album} / {artist}\n{url}";
} }
var flag=localStorage.getItem("artwork"); var flag = localStorage.getItem("artwork");
var remote=electron.remote; var remote = electron.remote;
var platform=remote.process.platform; var platform = remote.process.platform;
if(platform=="win32"){ if (platform == "win32") {
if(flag && arg.path){ if (flag && arg.path) {
media(arg.path,"image/png","new"); media(arg.path, "image/png", "new");
} }
}else if(platform=="darwin"){ } else if (platform == "darwin") {
if(flag && arg.existsArtwork){ if (flag && arg.existsArtwork) {
media(arg.artworks[0].data,"image/png","new"); media(arg.artworks[0].data, "image/png", "new");
} }
} }
var regExp = new RegExp("{song}", "g"); var regExp = new RegExp("{song}", "g");
@ -161,61 +161,61 @@ function nowplaying(mode){
var regExp = new RegExp("{composer}", "g"); var regExp = new RegExp("{composer}", "g");
content = content.replace(regExp, arg.composer); content = content.replace(regExp, arg.composer);
var regExp = new RegExp("{hz}", "g"); var regExp = new RegExp("{hz}", "g");
content = content.replace(regExp, arg.sampleRate/1000+"kHz"); content = content.replace(regExp, arg.sampleRate / 1000 + "kHz");
var regExp = new RegExp("{lyricist}", "g"); var regExp = new RegExp("{lyricist}", "g");
content = content.replace(regExp, ""); content = content.replace(regExp, "");
var regExp = new RegExp("{bpm}", "g"); var regExp = new RegExp("{bpm}", "g");
content = content.replace(regExp, ""); content = content.replace(regExp, "");
var regExp = new RegExp("{bitRate}", "g"); var regExp = new RegExp("{bitRate}", "g");
content = content.replace(regExp, arg.bitRate+"kbps"); content = content.replace(regExp, arg.bitRate + "kbps");
var regExp = new RegExp("{genre}", "g"); var regExp = new RegExp("{genre}", "g");
content = content.replace(regExp, arg.genre); content = content.replace(regExp, arg.genre);
$("#textarea").val(content); $("#textarea").val(content);
}) })
} }
} }
function spotifySave(){ function spotifySave() {
var temp=$("#np-temp").val(); var temp = $("#np-temp").val();
localStorage.setItem("np-temp", temp); localStorage.setItem("np-temp", temp);
Materialize.toast(lang.lang_spotify_np, 3000); Materialize.toast(lang.lang_spotify_np, 3000);
} }
function npprovider(){ function npprovider() {
var provd = $("[name=npp]:checked").val(); var provd = $("[name=npp]:checked").val();
if(!provd){ if (!provd) {
if (localStorage.getItem("np_provider")) { if (localStorage.getItem("np_provider")) {
$("[value="+localStorage.getItem("np_provider")+"]").prop("checked", true); $("[value=" + localStorage.getItem("np_provider") + "]").prop("checked", true);
}else{ } else {
$("[value=AIMP]").prop("checked", true); $("[value=AIMP]").prop("checked", true);
localStorage.setItem("np_provider", "AIMP"); localStorage.setItem("np_provider", "AIMP");
} }
}else{ } else {
if (provd != localStorage.getItem("np_provider")) { if (provd != localStorage.getItem("np_provider")) {
Materialize.toast(lang.lang_setting_npprovide.replace("{{set}}" ,provd), 3000); Materialize.toast(lang.lang_setting_npprovide.replace("{{set}}", provd), 3000);
} }
localStorage.setItem("np_provider", provd); localStorage.setItem("np_provider", provd);
var electron = require("electron"); var electron = require("electron");
var ipc = electron.ipcRenderer; var ipc = electron.ipcRenderer;
ipc.send('itunes', ["set",provd]); ipc.send('itunes', ["set", provd]);
} }
} }
if(location.search){ if (location.search) {
var m = location.search.match(/\?mode=([a-zA-Z-0-9]+)\&code=(.+)/); var m = location.search.match(/\?mode=([a-zA-Z-0-9]+)\&code=(.+)/);
var mode=m[1]; var mode = m[1];
var codex=m[2]; var codex = m[2];
if(mode=="spotify"){ if (mode == "spotify") {
var coder=codex.split(":"); var coder = codex.split(":");
localStorage.setItem("spotify", coder[0]); localStorage.setItem("spotify", coder[0]);
localStorage.setItem("spotify-refresh", coder[1]); localStorage.setItem("spotify-refresh", coder[1]);
}else{ } else {
} }
} }
$("#npbtn").click(function() { $("#npbtn").click(function () {
nowplaying('spotify'); nowplaying('spotify');
}); });
$("#npbtn").bind('contextmenu', function() { $("#npbtn").bind('contextmenu', function () {
nowplaying('itunes'); nowplaying('itunes');
return false; return false;
}); });

View File

@ -2,9 +2,9 @@
function themes(theme) { function themes(theme) {
if (!theme) { if (!theme) {
var theme = localStorage.getItem("theme"); var theme = localStorage.getItem("theme");
if(!theme){ if (!theme) {
var theme="black"; var theme = "black";
localStorage.setItem("theme","black"); localStorage.setItem("theme", "black");
} }
} }
$("html").removeClass("indigotheme"); $("html").removeClass("indigotheme");
@ -12,15 +12,15 @@ function themes(theme) {
$("html").removeClass("browntheme"); $("html").removeClass("browntheme");
$("html").removeClass("blacktheme"); $("html").removeClass("blacktheme");
$("html").removeClass("customtheme"); $("html").removeClass("customtheme");
$("html").addClass(theme+"theme"); $("html").addClass(theme + "theme");
var font = localStorage.getItem("font"); var font = localStorage.getItem("font");
if(font){ if (font) {
$("html").css("font-family",font); $("html").css("font-family", font);
}else{ } else {
$("html").css("font-family",""); $("html").css("font-family", "");
} }
if(theme=="custom"){ if (theme == "custom") {
if(localStorage.getItem("customtheme-id")){ if (localStorage.getItem("customtheme-id")) {
ipc.send('theme-css-request', localStorage.getItem("customtheme-id")); ipc.send('theme-css-request', localStorage.getItem("customtheme-id"));
} }
} }

View File

@ -1,201 +1,200 @@
//左下のメッセージ //左下のメッセージ
var todcTrigger=null; var todcTrigger = null;
function todo(mes){ function todo(mes) {
clearInterval(todcTrigger); clearInterval(todcTrigger);
$('#message').text(mes); $('#message').text(mes);
$('#message').fadeIn(); $('#message').fadeIn();
todcTrigger=setTimeout(todc, 4000); todcTrigger = setTimeout(todc, 4000);
} }
function todc(){ function todc() {
$('#message').fadeOut(); $('#message').fadeOut();
} }
//reverse //reverse
function bottomReverse(){ function bottomReverse() {
$("#bottom").toggleClass("reverse"); $("#bottom").toggleClass("reverse");
$(".leftside").toggleClass("reverse"); $(".leftside").toggleClass("reverse");
if($("#bottom").hasClass("reverse")){ if ($("#bottom").hasClass("reverse")) {
localStorage.removeItem("reverse") localStorage.removeItem("reverse")
}else{ } else {
localStorage.setItem("reverse","true") localStorage.setItem("reverse", "true")
} }
} }
function tips(mode){ function tips(mode) {
var electron = require("electron"); var electron = require("electron");
var ipc = electron.ipcRenderer; var ipc = electron.ipcRenderer;
ipc.send('endmem', ""); ipc.send('endmem', "");
clearInterval(clockint); clearInterval(clockint);
clearInterval(spotStart); clearInterval(spotStart);
if(mode=="ver"){ if (mode == "ver") {
tipsToggle() tipsToggle()
$("#tips-text").html('<img src="../../img/desk.png" width="20" onclick="todo(\'!TheDesk! It\\\'s a nice client!\')"><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">1+</span>]') $("#tips-text").html('<img src="../../img/desk.png" width="20" onclick="todo(\'!TheDesk! It\\\'s a nice client!\')"><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">1+</span>]')
localStorage.setItem("tips","ver") localStorage.setItem("tips", "ver")
}else if(mode=="clock"){ } else if (mode == "clock") {
tipsToggle() tipsToggle()
localStorage.setItem("tips","clock") localStorage.setItem("tips", "clock")
clock() clock()
}else if(mode=="memory"){ } else if (mode == "memory") {
tipsToggle() tipsToggle()
localStorage.setItem("tips","memory") localStorage.setItem("tips", "memory")
startmem(); startmem();
}else if(mode=="trend"){ } else if (mode == "trend") {
tipsToggle() tipsToggle()
localStorage.setItem("tips","trend") localStorage.setItem("tips", "trend")
trendTagonTip() trendTagonTip()
}else if(mode=="spotify"){ } else if (mode == "spotify") {
tipsToggle() tipsToggle()
localStorage.setItem("tips","spotify") localStorage.setItem("tips", "spotify")
var json=nowplaying("spotifytips") var json = nowplaying("spotifytips")
spotifytips(json) spotifytips(json)
} }
} }
//メモリ //メモリ
function startmem(){ function startmem() {
var electron = require("electron"); var electron = require("electron");
var ipc = electron.ipcRenderer; var ipc = electron.ipcRenderer;
ipc.send('startmem', ""); ipc.send('startmem', "");
ipc.on('memory', function (event, arg) { ipc.on('memory', function (event, arg) {
var use=arg[0]; var use = arg[0];
var cpu=arg[1]; var cpu = arg[1];
var total=arg[2] var total = arg[2]
$("#tips-text").html(escapeHTML(cpu)+"<br>Memory:"+Math.floor(use/1024/1024/102.4)/10+"/"+Math.floor(total/1024/1024/102.4)/10+"GB("+Math.floor(use/total*100)+"%)") $("#tips-text").html(escapeHTML(cpu) + "<br>Memory:" + Math.floor(use / 1024 / 1024 / 102.4) / 10 + "/" + Math.floor(total / 1024 / 1024 / 102.4) / 10 + "GB(" + Math.floor(use / total * 100) + "%)")
}) })
} }
//トレンドタグ //トレンドタグ
function trendTagonTip(){ function trendTagonTip() {
$(".trendtag").remove(); $(".trendtag").remove();
var domain="imastodon.net" var domain = "imastodon.net"
var at = localStorage.getItem("acct_"+ acct_id + "_at"); var at = localStorage.getItem("acct_" + acct_id + "_at");
var start = "https://" + domain + "/api/v1/trend_tags" var start = "https://" + domain + "/api/v1/trend_tags"
fetch(start, { fetch(start, {
method: 'GET', method: 'GET',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
'Authorization': 'Bearer ' + at 'Authorization': 'Bearer ' + at
}, },
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
if (json) { if (json) {
var tags=""; var tags = "";
json=json.score; json = json.score;
Object.keys(json).forEach(function(tag) { Object.keys(json).forEach(function (tag) {
tags = tags + '<a onclick="tagShow(\'' + tag + '\')" class="pointer">#' + escapeHTML(tag) + '</a><span class="hide" data-tag="' + tag + '"> <a onclick="tagTL(\'tag\',\'' + tag + '\',false,\'add\')" class="pointer" title="#' + tag + 'のタイムライン">TL</a> <a onclick="show();brInsert(\'#' + tag + '\')" class="pointer" title="#' + tag + 'でトゥート">Toot</a></span><br>'; tags = tags + '<a onclick="tagShow(\'' + tag + '\')" class="pointer">#' + escapeHTML(tag) + '</a><span class="hide" data-tag="' + tag + '"> <a onclick="tagTL(\'tag\',\'' + tag + '\',false,\'add\')" class="pointer" title="#' + tag + 'のタイムライン">TL</a> <a onclick="show();brInsert(\'#' + tag + '\')" class="pointer" title="#' + tag + 'でトゥート">Toot</a></span><br>';
}); });
$("#tips-text").html('<div class="trendtag">トレンドタグ<i class="material-icons pointer" onclick="trendTagonTip()" style="font-size:12px">refresh</i>:<br>' + tags+'</div>'); $("#tips-text").html('<div class="trendtag">トレンドタグ<i class="material-icons pointer" onclick="trendTagonTip()" style="font-size:12px">refresh</i>:<br>' + tags + '</div>');
trendTagonTipInterval() trendTagonTipInterval()
}else{ } else {
$("#tips-text").html(""); $("#tips-text").html("");
} }
}); });
} }
//Spotify //Spotify
function spotifytips(){ function spotifytips() {
var start = "https://thedesk.top/now-playing?at="+localStorage.getItem("spotify")+"&rt="+localStorage.getItem("spotify-refresh"); var start = "https://thedesk.top/now-playing?at=" + localStorage.getItem("spotify") + "&rt=" + localStorage.getItem("spotify-refresh");
var at = localStorage.getItem("spotify"); var at = localStorage.getItem("spotify");
if(at){ if (at) {
fetch(start, { fetch(start, {
method: 'GET', method: 'GET',
headers: { headers: {
'content-type': 'application/json' 'content-type': 'application/json'
} }
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
var ms=json.progress_ms; var ms = json.progress_ms;
var last=1000-ms%1000; var last = 1000 - ms % 1000;
var item=json.item; var item = json.item;
var img=item.album.images[0].url; var img = item.album.images[0].url;
var artisttxt=""; var artisttxt = "";
for(i=0;i<item.artists.length;i++){ for (i = 0; i < item.artists.length; i++) {
if(i>0){ if (i > 0) {
artisttxt=artisttxt+","+item.artists[i].name; artisttxt = artisttxt + "," + item.artists[i].name;
}else{ } else {
artisttxt=item.artists[0].name; artisttxt = item.artists[0].name;
} }
} }
artisttxt=escapeHTML(artisttxt); 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;
ms=ms/1000; ms = ms / 1000;
tms=tms/1000; tms = tms / 1000;
var s=Math.round(ms)%60; var s = Math.round(ms) % 60;
if(s<10){ if (s < 10) {
s="0"+s; s = "0" + s;
} }
var m=(Math.round(ms)-Math.round(ms)%60)/60; var m = (Math.round(ms) - Math.round(ms) % 60) / 60;
var ts=Math.round(tms)%60; var ts = Math.round(tms) % 60;
if(ts<10){ if (ts < 10) {
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">'+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>'); $("#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 {
alert(lang.lang_spotify_acct); alert(lang.lang_spotify_acct);
}
}
function spotStart(){
var total=$(".spotify-prog").attr("data-total");
var s=$(".spotify-prog").attr("data-s");
var news=s*1+1;
var per=news*100000/total;
var ns=news%60;
var nm=(news-ns)/60;
if(ns<10){
ns="0"+ns;
} }
if(per>=100){ }
function spotStart() {
var total = $(".spotify-prog").attr("data-total");
var s = $(".spotify-prog").attr("data-s");
var news = s * 1 + 1;
var per = news * 100000 / total;
var ns = news % 60;
var nm = (news - ns) / 60;
if (ns < 10) {
ns = "0" + ns;
}
if (per >= 100) {
clearInterval(spotStart); clearInterval(spotStart);
spotifytips() spotifytips()
}else{ } else {
$("#spot-m").text(nm); $("#spot-m").text(nm);
$("#spot-s").text(ns); $("#spot-s").text(ns);
} }
$(".spotify-prog").attr("data-s",news); $(".spotify-prog").attr("data-s", news);
$(".spotify-prog").css("width",per+"%"); $(".spotify-prog").css("width", per + "%");
} }
function trendTagonTipInterval(){ function trendTagonTipInterval() {
setTimeout(trendTagonTip, 6000000); setTimeout(trendTagonTip, 6000000);
} }
//時計 //時計
var clockint; var clockint;
function clock(){ function clock() {
var now=new Date(); var now = new Date();
var last=1000-now.getTime()%1000; var last = 1000 - now.getTime() % 1000;
sleep(last); sleep(last);
clockint=setInterval(clockStart, 1000); clockint = setInterval(clockStart, 1000);
} }
function clockStart(){ function clockStart() {
var nowTime = new Date(); // 現在日時を得る var nowTime = new Date(); // 現在日時を得る
var nowHour = nowTime.getHours(); // 時を抜き出す var nowHour = nowTime.getHours(); // 時を抜き出す
if(nowHour<10){nowHour="0"+nowHour } if (nowHour < 10) { nowHour = "0" + nowHour }
var nowMin = nowTime.getMinutes(); // 分を抜き出す var nowMin = nowTime.getMinutes(); // 分を抜き出す
if(nowMin<10){nowMin="0"+nowMin } if (nowMin < 10) { nowMin = "0" + nowMin }
var nowSec = nowTime.getSeconds(); // 秒を抜き出す var nowSec = nowTime.getSeconds(); // 秒を抜き出す
if(nowSec<10){nowSec="0"+nowSec } if (nowSec < 10) { nowSec = "0" + nowSec }
var msg = nowTime.getFullYear()+"/"+(nowTime.getMonth()+1)+"/"+nowTime.getDate()+'<span style="font-size:20px; font-family:Open Sans">'+nowHour + ":" + nowMin + ":" + nowSec+"</span>"; var msg = nowTime.getFullYear() + "/" + (nowTime.getMonth() + 1) + "/" + nowTime.getDate() + '<span style="font-size:20px; font-family:Open Sans">' + nowHour + ":" + nowMin + ":" + nowSec + "</span>";
$("#tips-text").html(msg); $("#tips-text").html(msg);
} }
function sleep(waitMsec) { function sleep(waitMsec) {
var startMsec = new Date(); var startMsec = new Date();
while (new Date() - startMsec < waitMsec); while (new Date() - startMsec < waitMsec);
} }
function tipsToggle(){ function tipsToggle() {
$("#tips").toggleClass("hide"); $("#tips").toggleClass("hide");
$("#tips-menu").toggleClass("hide"); $("#tips-menu").toggleClass("hide");
} }
if(localStorage.getItem("tips")){ if (localStorage.getItem("tips")) {
tips(localStorage.getItem("tips")); tips(localStorage.getItem("tips"));
} }

View File

@ -5,11 +5,11 @@ function utl(user, more, acct_id) {
var acct_id = $('#his-data').attr("use-acct"); var acct_id = $('#his-data').attr("use-acct");
} }
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 (user == "--now") { if (user == "--now") {
var user = $('#his-data').attr("user-id"); var user = $('#his-data').attr("user-id");
} }
if(localStorage.getItem("mode_" + domain)!="misskey"){ if (localStorage.getItem("mode_" + domain) != "misskey") {
if (more) { if (more) {
var sid = $("#his-tl .cvo").last().attr("toot-id"); var sid = $("#his-tl .cvo").last().attr("toot-id");
var plus = "?max_id=" + sid; var plus = "?max_id=" + sid;
@ -18,49 +18,49 @@ function utl(user, more, acct_id) {
} }
var start = "https://" + domain + "/api/v1/accounts/" + user + "/statuses" + var start = "https://" + domain + "/api/v1/accounts/" + user + "/statuses" +
plus; plus;
var i={ var i = {
method: 'GET', method: 'GET',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
'Authorization': 'Bearer ' + at 'Authorization': 'Bearer ' + at
} }
} }
}else{ } else {
var req={i:at} var req = { i: at }
if (more) { if (more) {
var sid = $("#his-tl .cvo").last().attr("toot-id"); var sid = $("#his-tl .cvo").last().attr("toot-id");
req.maxId=sid; req.maxId = sid;
} }
req.userId=user; req.userId = user;
var start = "https://" + domain + "/api/users/notes" var start = "https://" + domain + "/api/users/notes"
var i={ var i = {
method: 'POST', method: 'POST',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
}, },
body:JSON.stringify(req) body: JSON.stringify(req)
} }
} }
fetch(start, i).then(function(response) { fetch(start, i).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
if(localStorage.getItem("mode_" + domain)=="misskey"){ if (localStorage.getItem("mode_" + domain) == "misskey") {
var templete = misskeyParse(json, '', acct_id, 'user'); var templete = misskeyParse(json, '', acct_id, 'user');
}else{ } else {
var templete = parse(json, '', acct_id, 'user'); var templete = parse(json, '', acct_id, 'user');
} }
if(!json[0]){ if (!json[0]) {
templete=lang.lang_details_nodata+"<br>"; templete = lang.lang_details_nodata + "<br>";
} }
if (more) { if (more) {
$("#his-tl-contents").append(templete); $("#his-tl-contents").append(templete);
} else { } else {
if(localStorage.getItem("mode_" + domain)!="misskey"){ if (localStorage.getItem("mode_" + domain) != "misskey") {
pinutl(templete,user, acct_id) pinutl(templete, user, acct_id)
}else{ } else {
$("#his-tl-contents").html(templete); $("#his-tl-contents").html(templete);
} }
} }
@ -68,16 +68,16 @@ function utl(user, more, acct_id) {
}); });
} }
//ピン留めTL //ピン留めTL
function pinutl(before,user, acct_id) { function pinutl(before, user, acct_id) {
if (!acct_id) { if (!acct_id) {
var acct_id = $('#his-data').attr("use-acct"); var acct_id = $('#his-data').attr("use-acct");
} }
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 (user == "--now") { if (user == "--now") {
var user = $('#his-data').attr("user-id"); var user = $('#his-data').attr("user-id");
} }
var plus = "?pinned=1"; var plus = "?pinned=1";
var start = "https://" + domain + "/api/v1/accounts/" + user + "/statuses" + var start = "https://" + domain + "/api/v1/accounts/" + user + "/statuses" +
plus plus
fetch(start, { fetch(start, {
@ -86,17 +86,17 @@ function pinutl(before,user, acct_id) {
'content-type': 'application/json', 'content-type': 'application/json',
'Authorization': 'Bearer ' + at 'Authorization': 'Bearer ' + at
}, },
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
var templete = parse(json, 'pinned', acct_id,'user'); var templete = parse(json, 'pinned', acct_id, 'user');
if(!json[0]){ if (!json[0]) {
templete=""; templete = "";
} }
$("#his-tl-contents").html(templete+before); $("#his-tl-contents").html(templete + before);
jQuery("time.timeago").timeago(); jQuery("time.timeago").timeago();
}); });
} }
@ -107,26 +107,26 @@ function flw(user, more, acct_id) {
var acct_id = $('#his-data').attr("use-acct"); var acct_id = $('#his-data').attr("use-acct");
} }
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 (user == "--now") { if (user == "--now") {
var user = $('#his-data').attr("user-id"); var user = $('#his-data').attr("user-id");
} }
if(localStorage.getItem("mode_" + domain)=="misskey"){ if (localStorage.getItem("mode_" + domain) == "misskey") {
var req={i:at} var req = { i: at }
if (more) { if (more) {
var sid = $("#his-follow-list .cvo").last().attr("user-id"); var sid = $("#his-follow-list .cvo").last().attr("user-id");
req.maxId=sid; req.maxId = sid;
} }
req.userId=user; req.userId = user;
var start = "https://" + domain + "/api/users/following" var start = "https://" + domain + "/api/users/following"
var i={ var i = {
method: 'POST', method: 'POST',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
}, },
body:JSON.stringify(req) body: JSON.stringify(req)
} }
}else{ } else {
if (more) { if (more) {
var sid = $("#his-follow-list .cvo").last().attr("user-id"); var sid = $("#his-follow-list .cvo").last().attr("user-id");
var plus = "?max_id=" + sid; var plus = "?max_id=" + sid;
@ -135,7 +135,7 @@ function flw(user, more, acct_id) {
} }
var start = "https://" + domain + "/api/v1/accounts/" + user + "/following" + var start = "https://" + domain + "/api/v1/accounts/" + user + "/following" +
plus plus
var i={ var i = {
method: 'GET', method: 'GET',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
@ -143,19 +143,19 @@ function flw(user, more, acct_id) {
} }
} }
} }
fetch(start,i).then(function(response) { fetch(start, i).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
if(localStorage.getItem("mode_" + domain)=="misskey"){ if (localStorage.getItem("mode_" + domain) == "misskey") {
var templete = misskeyUserparse(json,'',acct_id); var templete = misskeyUserparse(json, '', acct_id);
}else{ } else {
var templete = userparse(json,'',acct_id); var templete = userparse(json, '', acct_id);
} }
if(templete==""){ if (templete == "") {
templete=lang.lang_details_nodata+"<br>"; templete = lang.lang_details_nodata + "<br>";
} }
if (more) { if (more) {
$("#his-follow-list-contents").append(templete); $("#his-follow-list-contents").append(templete);
@ -173,26 +173,26 @@ function fer(user, more, acct_id) {
var acct_id = $('#his-data').attr("use-acct"); var acct_id = $('#his-data').attr("use-acct");
} }
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 (user == "--now") { if (user == "--now") {
var user = $('#his-data').attr("user-id"); var user = $('#his-data').attr("user-id");
} }
if(localStorage.getItem("mode_" + domain)=="misskey"){ if (localStorage.getItem("mode_" + domain) == "misskey") {
var req={i:at} var req = { i: at }
if (more) { if (more) {
var sid = $("#his-follower-list .cvo").last().attr("user-id"); var sid = $("#his-follower-list .cvo").last().attr("user-id");
req.maxId=sid; req.maxId = sid;
} }
req.userId=user; req.userId = user;
var start = "https://" + domain + "/api/users/followers" var start = "https://" + domain + "/api/users/followers"
var i={ var i = {
method: 'POST', method: 'POST',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
}, },
body:JSON.stringify(req) body: JSON.stringify(req)
} }
}else{ } else {
if (more) { if (more) {
var sid = $("#his-follower-list .cvo").last().attr("user-id"); var sid = $("#his-follower-list .cvo").last().attr("user-id");
var plus = "?max_id=" + sid; var plus = "?max_id=" + sid;
@ -201,7 +201,7 @@ function fer(user, more, acct_id) {
} }
var start = "https://" + domain + "/api/v1/accounts/" + user + "/followers" + var start = "https://" + domain + "/api/v1/accounts/" + user + "/followers" +
plus plus
var i={ var i = {
method: 'GET', method: 'GET',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
@ -209,19 +209,19 @@ function fer(user, more, acct_id) {
} }
} }
} }
fetch(start, i).then(function(response) { fetch(start, i).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
if(localStorage.getItem("mode_" + domain)=="misskey"){ if (localStorage.getItem("mode_" + domain) == "misskey") {
var templete = misskeyUserparse(json,'',acct_id); var templete = misskeyUserparse(json, '', acct_id);
}else{ } else {
var templete = userparse(json,'',acct_id); var templete = userparse(json, '', acct_id);
} }
if(templete==""){ if (templete == "") {
templete=lang.lang_details_nodata+"<br>"; templete = lang.lang_details_nodata + "<br>";
} }
if (more) { if (more) {
$("#his-follower-list-contents").append(templete); $("#his-follower-list-contents").append(templete);
@ -239,8 +239,8 @@ function showFav(more, acct_id) {
var acct_id = $('#his-data').attr("use-acct"); var acct_id = $('#his-data').attr("use-acct");
} }
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"){ if (localStorage.getItem("mode_" + domain) != "misskey") {
if (more) { if (more) {
var sid = $("#his-fav-list .cvo").last().attr("toot-id"); var sid = $("#his-fav-list .cvo").last().attr("toot-id");
var plus = "?max_id=" + sid; var plus = "?max_id=" + sid;
@ -248,42 +248,42 @@ function showFav(more, acct_id) {
var plus = ""; var plus = "";
} }
var start = "https://" + domain + "/api/v1/favourites" + plus var start = "https://" + domain + "/api/v1/favourites" + plus
var i={ var i = {
method: 'GET', method: 'GET',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
'Authorization': 'Bearer ' + at 'Authorization': 'Bearer ' + at
} }
} }
}else{ } else {
var req={i:at} var req = { i: at }
if (more) { if (more) {
var sid = $("#his-fav-list .cvo").last().attr("toot-id"); var sid = $("#his-fav-list .cvo").last().attr("toot-id");
req.maxId=sid; req.maxId = sid;
} }
var start = "https://" + domain + "/api/i/favorites" var start = "https://" + domain + "/api/i/favorites"
var i={ var i = {
method: 'POST', method: 'POST',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
}, },
body:JSON.stringify(req) body: JSON.stringify(req)
} }
} }
fetch(start, i).then(function(response) { fetch(start, i).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
if(localStorage.getItem("mode_" + domain)!="misskey"){ if (localStorage.getItem("mode_" + domain) != "misskey") {
var templete = parse(json, '', acct_id,'user'); var templete = parse(json, '', acct_id, 'user');
}else{ } else {
var templete = misskeyParse(json, '', acct_id,'user'); var templete = misskeyParse(json, '', acct_id, 'user');
} }
if(!json[0]){ if (!json[0]) {
templete=lang.lang_details_nodata+"<br>"; templete = lang.lang_details_nodata + "<br>";
} }
if (more) { if (more) {
$("#his-fav-list-contents").append(templete); $("#his-fav-list-contents").append(templete);
@ -300,22 +300,22 @@ function showMut(more, acct_id) {
var acct_id = $('#his-data').attr("use-acct"); var acct_id = $('#his-data').attr("use-acct");
} }
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"){ if (localStorage.getItem("mode_" + domain) == "misskey") {
var req={i:at} var req = { i: at }
if (more) { if (more) {
var sid = $("#his-muting-list .cvo").last().attr("user-id"); var sid = $("#his-muting-list .cvo").last().attr("user-id");
req.maxId=sid; req.maxId = sid;
} }
var start = "https://" + domain + "/api/mute/list" var start = "https://" + domain + "/api/mute/list"
var i={ var i = {
method: 'POST', method: 'POST',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
}, },
body:JSON.stringify(req) body: JSON.stringify(req)
} }
}else{ } else {
if (more) { if (more) {
var sid = $("#his-muting-list .cvo").last().attr("user-id"); var sid = $("#his-muting-list .cvo").last().attr("user-id");
var plus = "?max_id=" + sid; var plus = "?max_id=" + sid;
@ -323,7 +323,7 @@ function showMut(more, acct_id) {
var plus = ""; var plus = "";
} }
var start = "https://" + domain + "/api/v1/mutes" + plus var start = "https://" + domain + "/api/v1/mutes" + plus
var i={ var i = {
method: 'GET', method: 'GET',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
@ -331,17 +331,17 @@ function showMut(more, acct_id) {
} }
} }
} }
fetch(start,i).then(function(response) { fetch(start, i).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
if(!json[0]){ if (!json[0]) {
templete=lang.lang_details_nodata+"<br>"; templete = lang.lang_details_nodata + "<br>";
} }
var templete = userparse(json,'',acct_id); var templete = userparse(json, '', acct_id);
if (more) { if (more) {
$("#his-muting-list-contents").append(templete); $("#his-muting-list-contents").append(templete);
} else { } else {
@ -357,11 +357,11 @@ function showBlo(more, acct_id) {
var acct_id = $('#his-data').attr("use-acct"); var acct_id = $('#his-data').attr("use-acct");
} }
var domain = localStorage.getItem("domain_" + acct_id); var domain = localStorage.getItem("domain_" + acct_id);
if(localStorage.getItem("mode_" + domain)=="misskey"){ if (localStorage.getItem("mode_" + domain) == "misskey") {
$("#his-blocking-list-contents").html(lang.lang_hisdata_notonmisskey+"<br>"); $("#his-blocking-list-contents").html(lang.lang_hisdata_notonmisskey + "<br>");
return false; return false;
} }
var at = localStorage.getItem("acct_"+ acct_id + "_at"); var at = localStorage.getItem("acct_" + acct_id + "_at");
if (more) { if (more) {
var sid = $("#his-blocking-list .cvo").last().attr("user-id"); var sid = $("#his-blocking-list .cvo").last().attr("user-id");
var plus = "?max_id=" + sid; var plus = "?max_id=" + sid;
@ -375,16 +375,16 @@ function showBlo(more, acct_id) {
'content-type': 'application/json', 'content-type': 'application/json',
'Authorization': 'Bearer ' + at 'Authorization': 'Bearer ' + at
}, },
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
if(!json[0]){ if (!json[0]) {
templete=lang.lang_details_nodata+"<br>"; templete = lang.lang_details_nodata + "<br>";
} }
var templete = userparse(json,'',acct_id); var templete = userparse(json, '', acct_id);
if (more) { if (more) {
$("#his-blocking-list-contents").append(templete); $("#his-blocking-list-contents").append(templete);
} else { } else {
@ -396,27 +396,27 @@ function showBlo(more, acct_id) {
//フォロリクリスト //フォロリクリスト
function showReq(more, acct_id) { function showReq(more, acct_id) {
if (!acct_id) { if (!acct_id) {
var acct_id = $('#his-data').attr("use-acct"); var acct_id = $('#his-data').attr("use-acct");
} }
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"){ if (localStorage.getItem("mode_" + domain) == "misskey") {
var req={i:at} var req = { i: at }
if (more) { if (more) {
var sid = $("#his-request-list .cvo").last().attr("user-id"); var sid = $("#his-request-list .cvo").last().attr("user-id");
req.maxId=sid; req.maxId = sid;
} }
var start = "https://" + domain + "/following/requests/list" var start = "https://" + domain + "/following/requests/list"
var i={ var i = {
method: 'POST', method: 'POST',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
}, },
body:JSON.stringify(req) body: JSON.stringify(req)
} }
}else{ } else {
if (more) { if (more) {
var sid = $("#his-request-list .cvo").last().attr("user-id"); var sid = $("#his-request-list .cvo").last().attr("user-id");
var plus = "?max_id=" + sid; var plus = "?max_id=" + sid;
@ -424,7 +424,7 @@ function showReq(more, acct_id) {
var plus = ""; var plus = "";
} }
var start = "https://" + domain + "/api/v1/follow_requests" + plus var start = "https://" + domain + "/api/v1/follow_requests" + plus
var i={ var i = {
method: 'GET', method: 'GET',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
@ -432,21 +432,21 @@ function showReq(more, acct_id) {
} }
} }
} }
fetch(start,i).then(function(response) { fetch(start, i).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
if(localStorage.getItem("mode_" + domain)!="misskey"){ if (localStorage.getItem("mode_" + domain) != "misskey") {
var templete = userparse(json, "request",acct_id); var templete = userparse(json, "request", acct_id);
}else{ } else {
var templete = misskeyUserparse(json, true,acct_id); var templete = misskeyUserparse(json, true, acct_id);
} }
if(!json[0]){ if (!json[0]) {
templete=lang.lang_details_nodata+"<br>"; templete = lang.lang_details_nodata + "<br>";
} }
if (more) { if (more) {
$("#his-request-list-contents").append(templete); $("#his-request-list-contents").append(templete);
@ -463,11 +463,11 @@ function showDom(more, acct_id) {
var acct_id = $('#his-data').attr("use-acct"); var acct_id = $('#his-data').attr("use-acct");
} }
var domain = localStorage.getItem("domain_" + acct_id); var domain = localStorage.getItem("domain_" + acct_id);
if(localStorage.getItem("mode_" + domain)=="misskey"){ if (localStorage.getItem("mode_" + domain) == "misskey") {
$("#his-domain-list-contents").html(lang.lang_hisdata_notonmisskey+"<br>"); $("#his-domain-list-contents").html(lang.lang_hisdata_notonmisskey + "<br>");
return false; return false;
} }
var at = localStorage.getItem("acct_"+ acct_id + "_at"); var at = localStorage.getItem("acct_" + acct_id + "_at");
if (more) { if (more) {
var sid = $("#his-domain-list .cvo").last().attr("user-id"); var sid = $("#his-domain-list .cvo").last().attr("user-id");
var plus = "?max_id=" + sid; var plus = "?max_id=" + sid;
@ -482,17 +482,17 @@ function showDom(more, acct_id) {
'Authorization': 'Bearer ' + at 'Authorization': 'Bearer ' + at
}, },
//body: JSON.stringify({}) //body: JSON.stringify({})
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
var templete = ""; var templete = "";
if(!json[0]){ if (!json[0]) {
templete=lang.lang_details_nodata+"<br>"; templete = lang.lang_details_nodata + "<br>";
} }
Object.keys(json).forEach(function(key) { Object.keys(json).forEach(function (key) {
var domain = json[key]; var domain = json[key];
templete = templete + domain + templete = templete + domain +
'<i class="material-icons gray pointer" onclick="domainblock(\'' + '<i class="material-icons gray pointer" onclick="domainblock(\'' +
@ -514,11 +514,11 @@ function showFrl(more, acct_id) {
var acct_id = $('#his-data').attr("use-acct"); var acct_id = $('#his-data').attr("use-acct");
} }
var domain = localStorage.getItem("domain_" + acct_id); var domain = localStorage.getItem("domain_" + acct_id);
if(localStorage.getItem("mode_" + domain)=="misskey"){ if (localStorage.getItem("mode_" + domain) == "misskey") {
$("#his-follow-recom-contents").html(lang.lang_hisdata_notonmisskey+"<br>"); $("#his-follow-recom-contents").html(lang.lang_hisdata_notonmisskey + "<br>");
return false; return false;
} }
var at = localStorage.getItem("acct_"+ acct_id + "_at"); var at = localStorage.getItem("acct_" + acct_id + "_at");
if (more) { if (more) {
var sid = $("#his-follow-recom-list .cvo").last().attr("user-id"); var sid = $("#his-follow-recom-list .cvo").last().attr("user-id");
var plus = "?max_id=" + sid; var plus = "?max_id=" + sid;
@ -532,19 +532,19 @@ function showFrl(more, acct_id) {
'content-type': 'application/json', 'content-type': 'application/json',
'Authorization': 'Bearer ' + at 'Authorization': 'Bearer ' + at
}, },
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
$("#his-follow-recom-contents").html(lang.lang_details_nodata+"("+lang.lang_hisdata_frcreq+")<br>"); $("#his-follow-recom-contents").html(lang.lang_details_nodata + "(" + lang.lang_hisdata_frcreq + ")<br>");
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
if(!json[0]){ if (!json[0]) {
console.warn("No suggestions(recommend) data"); console.warn("No suggestions(recommend) data");
templete=lang.lang_details_nodata+"("+lang.lang_hisdata_frcwarn+")<br>"; templete = lang.lang_details_nodata + "(" + lang.lang_hisdata_frcwarn + ")<br>";
}else{ } else {
var templete = userparse(json,'',acct_id); var templete = userparse(json, '', acct_id);
} }
if (more) { if (more) {
$("#his-follow-recom-contents").append(templete); $("#his-follow-recom-contents").append(templete);
} else { } else {
@ -561,37 +561,37 @@ function udAdd(start) {
'Accept': 'application/json' 'Accept': 'application/json'
}, },
//body: JSON.stringify({}) //body: JSON.stringify({})
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
var fields=json.attachment; var fields = json.attachment;
for(var i=0;i<fields.length;i++){ for (var i = 0; i < fields.length; i++) {
if(fields[i].type=="IdentityProof"){ if (fields[i].type == "IdentityProof") {
if(fields[i].signatureAlgorithm=="keybase"){ if (fields[i].signatureAlgorithm == "keybase") {
var html='<a href="https://keybase.io/'+fields[i].name+'" target="_blank" class="cbadge teal waves-effect" style="max-width:200px;" title="'+lang.lang_hisdata_key.replace("{{set}}",escapeHTML(fields[i].signatureAlgorithm))+'"><i class="fas fa-key" aria-hidden="true"></i>'+escapeHTML(fields[i].signatureAlgorithm)+':'+escapeHTML(fields[i].name)+'</a>'; var html = '<a href="https://keybase.io/' + fields[i].name + '" target="_blank" class="cbadge teal waves-effect" style="max-width:200px;" title="' + lang.lang_hisdata_key.replace("{{set}}", escapeHTML(fields[i].signatureAlgorithm)) + '"><i class="fas fa-key" aria-hidden="true"></i>' + escapeHTML(fields[i].signatureAlgorithm) + ':' + escapeHTML(fields[i].name) + '</a>';
}else{ } else {
var html='<span class="cbadge teal" style="max-width:200px;" title="'+lang.lang_hisdata_key.replace("{{set}}",escapeHTML(fields[i].signatureAlgorithm))+'"><i class="fas fa-key" aria-hidden="true"></i>'+escapeHTML(fields[i].signatureAlgorithm)+':'+escapeHTML(fields[i].name)+'</span>'; var html = '<span class="cbadge teal" style="max-width:200px;" title="' + lang.lang_hisdata_key.replace("{{set}}", escapeHTML(fields[i].signatureAlgorithm)) + '"><i class="fas fa-key" aria-hidden="true"></i>' + escapeHTML(fields[i].signatureAlgorithm) + ':' + escapeHTML(fields[i].name) + '</span>';
} }
$("#his-proof-prof").append(html) $("#his-proof-prof").append(html)
} }
} }
}); });
fetch("https://notestock.osa-p.net/api/v1/isstock.json?id="+start.replace("@","users/"), { fetch("https://notestock.osa-p.net/api/v1/isstock.json?id=" + start.replace("@", "users/"), {
method: 'GET', method: 'GET',
headers: { headers: {
'Accept': 'application/json' 'Accept': 'application/json'
}, },
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
if(json.user.public_view){ if (json.user.public_view) {
var html='<a href="'+json.user.url+'" target="_blank" class="cbadge purple waves-effect" style="max-width:200px;" title="Notestock">Notestock</a>'; var html = '<a href="' + json.user.url + '" target="_blank" class="cbadge purple waves-effect" style="max-width:200px;" title="Notestock">Notestock</a>';
$("#his-proof-prof").append(html) $("#his-proof-prof").append(html)
} }
}); });
@ -601,43 +601,43 @@ function udAdd(start) {
//ユーザーマッチングリスト //ユーザーマッチングリスト
function showMat() { function showMat() {
$("#his-matching-list-contents").html(lang.lang_hisdata_taketime); $("#his-matching-list-contents").html(lang.lang_hisdata_taketime);
var full=$("#his-acct").attr("fullname"); var full = $("#his-acct").attr("fullname");
var acct_id=$("#his-data").attr("use-acct"); var acct_id = $("#his-data").attr("use-acct");
full=full.split("@"); full = full.split("@");
var start = "https://vinayaka.distsn.org/cgi-bin/vinayaka-user-match-filtered-api.cgi?"+full[1]+"+" + full[0]; var start = "https://vinayaka.distsn.org/cgi-bin/vinayaka-user-match-filtered-api.cgi?" + full[1] + "+" + full[0];
fetch(start, { fetch(start, {
method: 'GET', method: 'GET',
headers: { headers: {
'content-type': 'application/json' 'content-type': 'application/json'
}, },
//body: JSON.stringify({}) //body: JSON.stringify({})
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
var templete=""; var templete = "";
Object.keys(json).forEach(function(key) { Object.keys(json).forEach(function (key) {
var user = json[key]; var user = json[key];
templete = templete + templete = templete +
'<div class="" style="padding-top:5px;">' + '<div class="" style="padding-top:5px;">' +
'<div style="padding:0; margin:0; width:400px; max-width:100%; display:flex; align-items:flex-end;">' + '<div style="padding:0; margin:0; width:400px; max-width:100%; display:flex; align-items:flex-end;">' +
'<div style="flex-basis:40px;"><a onclick="udgEx(\'' + user.user + '\',' + '<div style="flex-basis:40px;"><a onclick="udgEx(\'' + user.user + '\',' +
acct_id + ');" user="' + user.user + '" class="udg">' + acct_id + ');" user="' + user.user + '" class="udg">' +
'<img src="' + user.avatar + '" width="40" class="prof-img" user="' + user.user + '"></a></div>' + '<img src="' + user.avatar + '" width="40" class="prof-img" user="' + user.user + '"></a></div>' +
'<div style="flex-grow:3; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;user-select:auto; cursor:text;"><big>' + '<div style="flex-grow:3; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;user-select:auto; cursor:text;"><big>' +
escapeHTML(user.screen_name) + '</big></div>' + escapeHTML(user.screen_name) + '</big></div>' +
'<div class="sml gray" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;user-select:auto; cursor:text;"> @' + '<div class="sml gray" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;user-select:auto; cursor:text;"> @' +
user.user + '@'+user.host+'</div>' + user.user + '@' + user.host + '</div>' +
'</div>' + '</div>' +
'<div class="divider"></div>' + '<div class="divider"></div>' +
'</div>' + '</div>' +
'</div>'; '</div>';
}); });
$("#his-matching-list").css("height",$("#his-float-data").height()-$("#his-basic-prof").height()-$("#his-des").height()-$("#his-plus-action").height()+"px"); $("#his-matching-list").css("height", $("#his-float-data").height() - $("#his-basic-prof").height() - $("#his-des").height() - $("#his-plus-action").height() + "px");
$("#his-matching-list-contents").html(templete); $("#his-matching-list-contents").html(templete);
}); });
} }

View File

@ -4,7 +4,7 @@ function profedit() {
var acct_id = $('#his-data').attr("use-acct"); var acct_id = $('#his-data').attr("use-acct");
todo("Updating..."); todo("Updating...");
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");
var start = "https://" + domain + "/api/v1/accounts/update_credentials"; var start = "https://" + domain + "/api/v1/accounts/update_credentials";
var name = $("#his-name-val").val(); var name = $("#his-name-val").val();
var des = $("#his-des-val").val(); var des = $("#his-des-val").val();
@ -17,7 +17,7 @@ function profedit() {
display_name: name, display_name: name,
note: des, note: des,
})); }));
httpreq.onreadystatechange = function() { httpreq.onreadystatechange = function () {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
$('#his-data').modal('close'); $('#his-data').modal('close');
todc(); todc();
@ -35,13 +35,13 @@ function imgChange(imgfile, target) {
} }
var file = imgfile.files[0]; var file = imgfile.files[0];
var fr = new FileReader(); var fr = new FileReader();
fr.onload = function(evt) { fr.onload = function (evt) {
var b64 = this.result; var b64 = this.result;
var blob = toBlob(b64, 'image/png'); var blob = toBlob(b64, 'image/png');
var fd = new FormData(); var fd = new FormData();
fd.append(target, blob); fd.append(target, blob);
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");
var start = "https://" + domain + "/api/v1/accounts/update_credentials"; var start = "https://" + domain + "/api/v1/accounts/update_credentials";
var httpreq = new XMLHttpRequest(); var httpreq = new XMLHttpRequest();
httpreq.open('PATCH', start, true); httpreq.open('PATCH', start, true);
@ -49,7 +49,7 @@ function imgChange(imgfile, target) {
httpreq.setRequestHeader('Authorization', 'Bearer ' + at); httpreq.setRequestHeader('Authorization', 'Bearer ' + at);
httpreq.responseType = "json"; httpreq.responseType = "json";
httpreq.send(fd); httpreq.send(fd);
httpreq.onreadystatechange = function() { httpreq.onreadystatechange = function () {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
var json = httpreq.response; var json = httpreq.response;
$('#his-data').modal('close'); $('#his-data').modal('close');

View File

@ -1,47 +1,47 @@
//ユーザーデータ表示 //ユーザーデータ表示
localStorage.removeItem("history"); localStorage.removeItem("history");
//コード受信 //コード受信
if(location.search){ if (location.search) {
var m = location.search.match(/\?mode=([a-zA-Z-0-9]+)\&code=(.+)/); var m = location.search.match(/\?mode=([a-zA-Z-0-9]+)\&code=(.+)/);
var mode=m[1]; var mode = m[1];
var codex=m[2]; var codex = m[2];
if(mode=="user"){ if (mode == "user") {
udgEx(codex,'main'); udgEx(codex, 'main');
} }
} }
function udgEx(user,acct_id){ function udgEx(user, acct_id) {
if(user=="selector"){ if (user == "selector") {
user = $("#his-acct").attr('fullname'); user = $("#his-acct").attr('fullname');
} }
if(acct_id=="selector"){ if (acct_id == "selector") {
acct_id = $("#user-acct-sel").val(); acct_id = $("#user-acct-sel").val();
} }
if(acct_id=="main"){ if (acct_id == "main") {
acct_id = localStorage.getItem("main"); acct_id = localStorage.getItem("main");
} }
console.log("Get user data of "+user); console.log("Get user data of " + user);
var domain = localStorage.getItem("domain_" + acct_id); var domain = localStorage.getItem("domain_" + acct_id);
if(localStorage.getItem("mode_" + domain)=="misskey"){ return false; } if (localStorage.getItem("mode_" + domain) == "misskey") { return false; }
var at = localStorage.getItem("acct_"+ acct_id + "_at"); var at = localStorage.getItem("acct_" + acct_id + "_at");
var start = "https://" + domain + "/api/v1/search?resolve=true&q="+user var start = "https://" + domain + "/api/v1/search?resolve=true&q=" + user
fetch(start, { fetch(start, {
method: 'GET', method: 'GET',
headers: { headers: {
'content-type': 'application/json', 'content-type': 'application/json',
'Authorization': 'Bearer ' + at 'Authorization': 'Bearer ' + at
} }
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
if(json.accounts){ if (json.accounts) {
var id=json.accounts[0].id; var id = json.accounts[0].id;
udg(id,acct_id); udg(id, acct_id);
}else{ } else {
var url="https://"+user.split('@')[1]+"/@"+user.split('@')[0]; var url = "https://" + user.split('@')[1] + "/@" + user.split('@')[0];
const {shell} = require('electron'); const { shell } = require('electron');
shell.openExternal(url); shell.openExternal(url);
} }
}); });
@ -50,15 +50,15 @@ function udgEx(user,acct_id){
function udg(user, acct_id) { function udg(user, acct_id) {
reset(); reset();
if (!user) { if (!user) {
user = localStorage.getItem("user-id_"+acct_id); user = localStorage.getItem("user-id_" + acct_id);
} }
todo("User Data Loading..."); todo("User Data Loading...");
var domain = localStorage.getItem("domain_" + acct_id); var domain = localStorage.getItem("domain_" + acct_id);
if(localStorage.getItem("mode_" + domain)=="misskey"){ if (localStorage.getItem("mode_" + domain) == "misskey") {
misskeyUdg(user, acct_id) misskeyUdg(user, acct_id)
return; return;
} }
var at = localStorage.getItem("acct_"+ acct_id + "_at"); var at = localStorage.getItem("acct_" + acct_id + "_at");
var start = "https://" + domain + "/api/v1/accounts/" + user; var start = "https://" + domain + "/api/v1/accounts/" + user;
fetch(start, { fetch(start, {
method: 'GET', method: 'GET',
@ -66,141 +66,141 @@ function udg(user, acct_id) {
'content-type': 'application/json', 'content-type': 'application/json',
'Authorization': 'Bearer ' + at 'Authorization': 'Bearer ' + at
}, },
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
//一つ前のユーザーデータ //一つ前のユーザーデータ
if (!localStorage.getItem("history")){ if (!localStorage.getItem("history")) {
$("#his-history-btn").prop("disabled",true); $("#his-history-btn").prop("disabled", true);
}else{ } else {
$("#his-history-btn").prop("disabled",false); $("#his-history-btn").prop("disabled", false);
$('#his-data').attr("history", localStorage.getItem("history")); $('#his-data').attr("history", localStorage.getItem("history"));
} }
//moved設定時 //moved設定時
if (json.moved) { if (json.moved) {
Materialize.toast( Materialize.toast(
lang.lang_showontl_movetxt+'<button class="btn-flat toast-action" onclick="udg(\'' + lang.lang_showontl_movetxt + '<button class="btn-flat toast-action" onclick="udg(\'' +
json.moved.id + '\',\''+acct_id+'\')">'+lang.lang_showontl_movebtn+'</button>', 4000) json.moved.id + '\',\'' + acct_id + '\')">' + lang.lang_showontl_movebtn + '</button>', 4000)
} }
$('#his-data').modal('open'); $('#his-data').modal('open');
$('#his-data').attr("user-id", user); $('#his-data').attr("user-id", user);
$('#his-data').attr("use-acct", acct_id); $('#his-data').attr("use-acct", acct_id);
if(json.username!=json.acct){ if (json.username != json.acct) {
//Remote //Remote
$('#his-data').attr("remote", "true"); $('#his-data').attr("remote", "true");
var fullname=json.acct; var fullname = json.acct;
}else{ } else {
$('#his-data').attr("remote", "false"); $('#his-data').attr("remote", "false");
var fullname=json.acct+"@"+domain; var fullname = json.acct + "@" + domain;
} }
utl(json.id, '', acct_id); utl(json.id, '', acct_id);
flw(json.id, '', acct_id); flw(json.id, '', acct_id);
fer(json.id, '', acct_id); fer(json.id, '', acct_id);
var dis_name=escapeHTML(json.display_name); var dis_name = escapeHTML(json.display_name);
dis_name=twemoji.parse(dis_name); dis_name = twemoji.parse(dis_name);
var note=json.note; var note = json.note;
if(json.emojis){ if (json.emojis) {
var actemojick = json.emojis[0]; var actemojick = json.emojis[0];
}else{ } else {
var actemojick=false; var actemojick = false;
} }
//絵文字があれば //絵文字があれば
if (actemojick) { if (actemojick) {
Object.keys(json.emojis).forEach(function(key5) { Object.keys(json.emojis).forEach(function (key5) {
var emoji = json.emojis[key5]; var emoji = json.emojis[key5];
var shortcode = emoji.shortcode; var shortcode = emoji.shortcode;
var emoji_url = '<img src="' + emoji.url + var emoji_url = '<img src="' + emoji.url +
'" class="emoji-img" data-emoji="'+shortcode+'" draggable="false">'; '" class="emoji-img" data-emoji="' + shortcode + '" draggable="false">';
var regExp = new RegExp(":" + shortcode + ":", "g"); var regExp = new RegExp(":" + shortcode + ":", "g");
dis_name = dis_name.replace(regExp, emoji_url); dis_name = dis_name.replace(regExp, emoji_url);
note = note.replace(regExp, emoji_url); note = note.replace(regExp, emoji_url);
}); });
} }
//noteの解析 //noteの解析
//var tags = '<a onclick="tl(\'tag\',\'$1\',' + acct_id +',\'add\')" class="pointer parsed">#$1</a>'; //var tags = '<a onclick="tl(\'tag\',\'$1\',' + acct_id +',\'add\')" class="pointer parsed">#$1</a>';
//var mens = '<a onclick="udgEx(\'$1\',' + acct_id +')" class="pointer parsed">@$1</a>'; //var mens = '<a onclick="udgEx(\'$1\',' + acct_id +')" class="pointer parsed">@$1</a>';
//note=note.replace(/#(\S+)/gi, tags) //note=note.replace(/#(\S+)/gi, tags)
//note=note.replace(/\s@([a-zA-Z_0-9@.-]+)/gi, mens) //note=note.replace(/\s@([a-zA-Z_0-9@.-]+)/gi, mens)
$("#his-name").html(dis_name); $("#his-name").html(dis_name);
$("#his-acct").text(json.acct); $("#his-acct").text(json.acct);
$("#his-acct").attr("fullname",fullname); $("#his-acct").attr("fullname", fullname);
$("#his-prof").attr("src", json.avatar); $("#his-prof").attr("src", json.avatar);
$('#his-data').css('background-image', 'url(' + json.header + ')'); $('#his-data').css('background-image', 'url(' + json.header + ')');
$("#his-sta").text(json.statuses_count); $("#his-sta").text(json.statuses_count);
$("#his-follow").text(json.following_count); $("#his-follow").text(json.following_count);
var flerc=json.followers_count; var flerc = json.followers_count;
if(flerc<0){ if (flerc < 0) {
flerc="-"; flerc = "-";
} }
$("#his-follower").text(flerc); $("#his-follower").text(flerc);
$("#his-since").text(crat(json.created_at)); $("#his-since").text(crat(json.created_at));
$("#his-openin").attr("data-href", json.url); $("#his-openin").attr("data-href", json.url);
if(json.fields){ if (json.fields) {
if(json.fields.length>0){ if (json.fields.length > 0) {
note=note+'<table id="his-field">' note = note + '<table id="his-field">'
for(var i=0;i<json.fields.length;i++){ for (var i = 0; i < json.fields.length; i++) {
var fname=json.fields[i].name; var fname = json.fields[i].name;
var fval=json.fields[i].value; var fval = json.fields[i].value;
if(json.fields[i].verified_at){ if (json.fields[i].verified_at) {
var when=lang.lang_showontl_verified+":"+crat(json.fields[i].verified_at); var when = lang.lang_showontl_verified + ":" + crat(json.fields[i].verified_at);
var color="rgba(121,189,154,.25);" var color = "rgba(121,189,154,.25);"
}else{ } else {
var when=""; var when = "";
var color="inherit" var color = "inherit"
}
note=note+'<tr><td class="his-field-title">'+twemoji.parse(escapeHTML(fname))+'</td><td class="his-field-content" title="'+when+'" style="background-color:'+color+'">'+twemoji.parse(fval)+'</td></tr>';
} }
note=note+'</table>' note = note + '<tr><td class="his-field-title">' + twemoji.parse(escapeHTML(fname)) + '</td><td class="his-field-content" title="' + when + '" style="background-color:' + color + '">' + twemoji.parse(fval) + '</td></tr>';
$("#his-des").html(twemoji.parse(note));
}else{
$("#his-des").html(twemoji.parse(note));
} }
}else{ note = note + '</table>'
$("#his-des").html(twemoji.parse(note));
} else {
$("#his-des").html(twemoji.parse(note)); $("#his-des").html(twemoji.parse(note));
} }
if(json.bot){ } else {
$("#his-bot").html(lang.lang_showontl_botacct); $("#his-des").html(twemoji.parse(note));
} }
$("#his-des").attr("data-acct",acct_id); if (json.bot) {
$('#his-data').css('background-size', 'cover'); $("#his-bot").html(lang.lang_showontl_botacct);
$("#his-data .tab-content").css("height",$("#his-float-timeline").height()-70+"px") }
localStorage.setItem("history" , user); $("#his-des").attr("data-acct", acct_id);
//自分の時 $('#his-data').css('background-size', 'cover');
if (json.acct == localStorage.getItem("user_"+acct_id)) { $("#his-data .tab-content").css("height", $("#his-float-timeline").height() - 70 + "px")
showFav('', acct_id); localStorage.setItem("history", user);
showBlo('', acct_id); //自分の時
showMut('', acct_id); if (json.acct == localStorage.getItem("user_" + acct_id)) {
showDom('', acct_id); showFav('', acct_id);
showReq('', acct_id); showBlo('', acct_id);
showFrl('', acct_id); showMut('', acct_id);
$("#his-name-val").val(json.display_name); showDom('', acct_id);
if(json.fields.length>0){ showReq('', acct_id);
if(json.fields[0]){$("#his-f1-name").val(json.fields[0].name); $("#his-f1-val").val($.strip_tags(json.fields[0].value));} showFrl('', acct_id);
if(json.fields[1]){$("#his-f2-name").val(json.fields[1].name); $("#his-f2-val").val($.strip_tags(json.fields[1].value));} $("#his-name-val").val(json.display_name);
if(json.fields[2]){$("#his-f3-name").val(json.fields[2].name); $("#his-f3-val").val($.strip_tags(json.fields[2].value));} if (json.fields.length > 0) {
if(json.fields[3]){$("#his-f4-name").val(json.fields[3].name); $("#his-f4-val").val($.strip_tags(json.fields[3].value));} if (json.fields[0]) { $("#his-f1-name").val(json.fields[0].name); $("#his-f1-val").val($.strip_tags(json.fields[0].value)); }
} if (json.fields[1]) { $("#his-f2-name").val(json.fields[1].name); $("#his-f2-val").val($.strip_tags(json.fields[1].value)); }
var des = json.note; if (json.fields[2]) { $("#his-f3-name").val(json.fields[2].name); $("#his-f3-val").val($.strip_tags(json.fields[2].value)); }
des = des.replace(/<br \/>/g, "\n") if (json.fields[3]) { $("#his-f4-name").val(json.fields[3].name); $("#his-f4-val").val($.strip_tags(json.fields[3].value)); }
des = $.strip_tags(des);
$("#his-des-val").val(des);
$("#his-follow-btn").hide();
$("#his-block-btn").hide();
$("#his-mute-btn").hide();
$("#his-notf-btn").hide();
$("#his-domain-btn").hide();
$("#his-emp-btn").hide();
$(".only-my-data").show();
$(".only-his-data").hide();
} else {
relations(user, acct_id);
$(".only-my-data").hide();
$(".only-his-data").show();
} }
var des = json.note;
des = des.replace(/<br \/>/g, "\n")
des = $.strip_tags(des);
$("#his-des-val").val(des);
$("#his-follow-btn").hide();
$("#his-block-btn").hide();
$("#his-mute-btn").hide();
$("#his-notf-btn").hide();
$("#his-domain-btn").hide();
$("#his-emp-btn").hide();
$(".only-my-data").show();
$(".only-his-data").hide();
} else {
relations(user, acct_id);
$(".only-my-data").hide();
$(".only-his-data").show();
}
todc(); todc();
//外部データ取得(死かもしれないので) //外部データ取得(死かもしれないので)
udAdd(json.url); udAdd(json.url);
@ -209,15 +209,15 @@ function udg(user, acct_id) {
function misskeyUdg(user, acct_id) { function misskeyUdg(user, acct_id) {
reset(); reset();
if (!user) { if (!user) {
user = localStorage.getItem("user-id_"+acct_id); user = localStorage.getItem("user-id_" + acct_id);
} }
todo("User Data Loading..."); todo("User Data Loading...");
var domain = localStorage.getItem("domain_" + acct_id); var domain = localStorage.getItem("domain_" + acct_id);
if(localStorage.getItem("mode_" + domain)!="misskey"){ if (localStorage.getItem("mode_" + domain) != "misskey") {
udg(user, acct_id) udg(user, acct_id)
return; return;
} }
var at = localStorage.getItem("acct_"+ acct_id + "_at"); var at = localStorage.getItem("acct_" + acct_id + "_at");
var start = "https://" + domain + "/api/users/show"; var start = "https://" + domain + "/api/users/show";
fetch(start, { fetch(start, {
method: 'POST', method: 'POST',
@ -225,113 +225,113 @@ function misskeyUdg(user, acct_id) {
'content-type': 'application/json', 'content-type': 'application/json',
}, },
body: JSON.stringify({ body: JSON.stringify({
i:at, i: at,
userId:user userId: user
}) })
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
//一つ前のユーザーデータ //一つ前のユーザーデータ
if (!localStorage.getItem("history")){ if (!localStorage.getItem("history")) {
$("#his-history-btn").prop("disabled",true); $("#his-history-btn").prop("disabled", true);
}else{ } else {
$("#his-history-btn").prop("disabled",false); $("#his-history-btn").prop("disabled", false);
$('#his-data').attr("history", localStorage.getItem("history")); $('#his-data').attr("history", localStorage.getItem("history"));
} }
$('#his-data').modal('open'); $('#his-data').modal('open');
$('#his-data').attr("user-id", user); $('#his-data').attr("user-id", user);
$('#his-data').attr("use-acct", acct_id); $('#his-data').attr("use-acct", acct_id);
if(json.host){ if (json.host) {
//Remote //Remote
$('#his-data').attr("remote", "false"); $('#his-data').attr("remote", "false");
var fullname=json.username+"@"+json.host; var fullname = json.username + "@" + json.host;
}else{ } else {
$('#his-data').attr("remote", "false"); $('#his-data').attr("remote", "false");
var fullname=json.acct+"@"+domain; var fullname = json.acct + "@" + domain;
} }
utl(json.id, '', acct_id); utl(json.id, '', acct_id);
flw(json.id, '', acct_id); flw(json.id, '', acct_id);
fer(json.id, '', acct_id); fer(json.id, '', acct_id);
if(json.name){ if (json.name) {
var dis_name=escapeHTML(json.name); var dis_name = escapeHTML(json.name);
dis_name=twemoji.parse(dis_name); dis_name = twemoji.parse(dis_name);
}else{ } else {
var dis_name=json.name var dis_name = json.name
} }
$("#his-name").html(dis_name); $("#his-name").html(dis_name);
$("#his-acct").text(json.username); $("#his-acct").text(json.username);
$("#his-acct").attr("fullname",fullname); $("#his-acct").attr("fullname", fullname);
$("#his-prof").attr("src", json.avatarUrl); $("#his-prof").attr("src", json.avatarUrl);
$('#his-data').css('background-image', 'url(' + json.bannerUrl + ')'); $('#his-data').css('background-image', 'url(' + json.bannerUrl + ')');
$("#his-sta").text(json.notesCount); $("#his-sta").text(json.notesCount);
$("#his-follow").text(json.followingCount); $("#his-follow").text(json.followingCount);
$("#his-follower").text(json.followersCount); $("#his-follower").text(json.followersCount);
$("#his-since").text(crat(json.createdAt)); $("#his-since").text(crat(json.createdAt));
var note=escapeHTML(json.description); var note = escapeHTML(json.description);
$("#his-des").html(twemoji.parse(note)); $("#his-des").html(twemoji.parse(note));
if(json.isCat){ if (json.isCat) {
$("#his-bot").html("Cat"+twemoji.parse("😺")); $("#his-bot").html("Cat" + twemoji.parse("😺"));
} }
$('#his-data').css('background-size', 'cover'); $('#his-data').css('background-size', 'cover');
localStorage.setItem("history" , user); localStorage.setItem("history", user);
//自分の時 //自分の時
if (json.username == localStorage.getItem("user_"+acct_id) && !json.host) { if (json.username == localStorage.getItem("user_" + acct_id) && !json.host) {
//showFav('', acct_id); //showFav('', acct_id);
//showMut('', acct_id); //showMut('', acct_id);
//showReq('', acct_id); //showReq('', acct_id);
showFrl('', acct_id); showFrl('', acct_id);
$("#his-name-val").val(json.name); $("#his-name-val").val(json.name);
var des = json.note; var des = json.note;
des = nl2br(des) des = nl2br(des)
des = $.strip_tags(des); des = $.strip_tags(des);
$("#his-des-val").val(des); $("#his-des-val").val(des);
$("#his-follow-btn").hide(); $("#his-follow-btn").hide();
$("#his-block-btn").hide(); $("#his-block-btn").hide();
$("#his-mute-btn").hide(); $("#his-mute-btn").hide();
$("#his-notf-btn").hide(); $("#his-notf-btn").hide();
$("#his-domain-btn").hide(); $("#his-domain-btn").hide();
$("#his-emp-btn").hide(); $("#his-emp-btn").hide();
$(".only-my-data").show(); $(".only-my-data").show();
$(".only-his-data").hide(); $(".only-his-data").hide();
} else {
if (json.isFollowing) {
//自分がフォローしている
$("#his-data").addClass("following");
$("#his-follow-btn").text(lang.lang_status_unfollow);
hisList(user, acct_id);
} else { } else {
if (json.isFollowing) { $("#his-follow-btn").text(lang.lang_status_follow);
//自分がフォローしている
$("#his-data").addClass("following");
$("#his-follow-btn").text(lang.lang_status_unfollow);
hisList(user,acct_id);
}else{
$("#his-follow-btn").text(lang.lang_status_follow);
}
if (json.isFollowed) {
//フォローされてる
$("#his-relation").text(lang.lang_showontl_followed);
}
$("#his-block-btn").hide();
if (json.isMuted) {
$("#his-data").addClass("muting");
$("#his-mute-btn").text(lang.lang_status_unmute);
}else{
$("#his-mute-btn").text(lang.lang_status_mute);
}
$(".only-my-data").hide();
$(".only-his-data").show();
} }
if (json.isFollowed) {
//フォローされてる
$("#his-relation").text(lang.lang_showontl_followed);
}
$("#his-block-btn").hide();
if (json.isMuted) {
$("#his-data").addClass("muting");
$("#his-mute-btn").text(lang.lang_status_unmute);
} else {
$("#his-mute-btn").text(lang.lang_status_mute);
}
$(".only-my-data").hide();
$(".only-his-data").show();
}
todc(); todc();
}); });
} }
//一つ前のユーザーデータ表示 //一つ前のユーザーデータ表示
function historyShow(){ function historyShow() {
var acct_id=$('#his-data').attr("use-acct"); var acct_id = $('#his-data').attr("use-acct");
var user=$('#his-data').attr("history"); var user = $('#his-data').attr("history");
udg(user, acct_id, "true") udg(user, acct_id, "true")
} }
//選択アカウントのプロフ //選択アカウントのプロフ
function profShow(){ function profShow() {
var acct_id = $("#post-acct-sel").val(); var acct_id = $("#post-acct-sel").val();
var user = localStorage.getItem("user-id_"+acct_id); var user = localStorage.getItem("user-id_" + acct_id);
udg(user, acct_id) udg(user, acct_id)
hide(); hide();
} }
@ -339,7 +339,7 @@ function profShow(){
//FF関係取得 //FF関係取得
function relations(user, acct_id) { function relations(user, 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");
var start = "https://" + domain + "/api/v1/accounts/relationships?id=" + user; var start = "https://" + domain + "/api/v1/accounts/relationships?id=" + user;
fetch(start, { fetch(start, {
method: 'GET', method: 'GET',
@ -347,20 +347,20 @@ function relations(user, acct_id) {
'content-type': 'application/json', 'content-type': 'application/json',
'Authorization': 'Bearer ' + at 'Authorization': 'Bearer ' + at
}, },
}).then(function(response) { }).then(function (response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function (error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function(json) { }).then(function (json) {
var json = json[0]; var json = json[0];
console.log(json); console.log(json);
if (json.following) { if (json.following) {
//自分がフォローしている //自分がフォローしている
$("#his-data").addClass("following"); $("#his-data").addClass("following");
$("#his-follow-btn").text(lang.lang_status_unfollow); $("#his-follow-btn").text(lang.lang_status_unfollow);
hisList(user,acct_id); hisList(user, acct_id);
}else{ } else {
$("#his-follow-btn").text(lang.lang_status_follow); $("#his-follow-btn").text(lang.lang_status_follow);
} }
if (json.followed_by) { if (json.followed_by) {
@ -370,37 +370,37 @@ function relations(user, acct_id) {
if (json.blocking) { if (json.blocking) {
$("#his-data").addClass("blocking"); $("#his-data").addClass("blocking");
$("#his-block-btn").text(lang.lang_status_unblock); $("#his-block-btn").text(lang.lang_status_unblock);
}else{ } else {
$("#his-block-btn").text(lang.lang_status_block); $("#his-block-btn").text(lang.lang_status_block);
} }
if (json.muting) { if (json.muting) {
$("#his-data").addClass("muting"); $("#his-data").addClass("muting");
$("#his-mute-btn").text(lang.lang_status_unmute); $("#his-mute-btn").text(lang.lang_status_unmute);
}else{ } else {
$("#his-mute-btn").text(lang.lang_status_mute); $("#his-mute-btn").text(lang.lang_status_mute);
} }
if (json.muting_notifications) { if (json.muting_notifications) {
$("#his-data").addClass("mutingNotf"); $("#his-data").addClass("mutingNotf");
$("#his-notf-btn").text(lang.lang_showontl_notf+lang.lang_status_unmute); $("#his-notf-btn").text(lang.lang_showontl_notf + lang.lang_status_unmute);
}else{ } else {
$("#his-notf-btn").text(lang.lang_showontl_notf+lang.lang_status_mute); $("#his-notf-btn").text(lang.lang_showontl_notf + lang.lang_status_mute);
} }
if (json.domain_blocking) { if (json.domain_blocking) {
$("#his-data").addClass("blockingDom"); $("#his-data").addClass("blockingDom");
$("#his-domain-btn").text(lang.lang_showontl_domain+lang.lang_status_unblock); $("#his-domain-btn").text(lang.lang_showontl_domain + lang.lang_status_unblock);
}else{ } else {
$("#his-domain-btn").text(lang.lang_showontl_domain+lang.lang_status_block); $("#his-domain-btn").text(lang.lang_showontl_domain + lang.lang_status_block);
} }
//Endorsed //Endorsed
if(json.endorsed){ if (json.endorsed) {
$("#his-end-btn").addClass("endorsed"); $("#his-end-btn").addClass("endorsed");
$("#his-end-btn").text(lang.lang_status_unendorse) $("#his-end-btn").text(lang.lang_status_unendorse)
}else{ } else {
$("#his-end-btn").removeClass("endorsed"); $("#his-end-btn").removeClass("endorsed");
$("#his-end-btn").text(lang.lang_status_endorse) $("#his-end-btn").text(lang.lang_status_endorse)
} }
//Blocked //Blocked
if(json.blocked_by){ if (json.blocked_by) {
$("#his-float-timeline").hide(); $("#his-float-timeline").hide();
$("#his-float-blocked").show(); $("#his-float-blocked").show();
$("#his-follow-btn").hide() $("#his-follow-btn").hide()
@ -408,9 +408,9 @@ function relations(user, acct_id) {
}); });
} }
function profbrws(){ function profbrws() {
const {shell} = require('electron'); const { shell } = require('electron');
var url=$("#his-openin").attr("data-href") var url = $("#his-openin").attr("data-href")
shell.openExternal(url); shell.openExternal(url);
} }
//オールリセット //オールリセット
@ -420,7 +420,7 @@ function hisclose() {
$('#his-data').attr("history", ""); $('#his-data').attr("history", "");
localStorage.removeItem("history"); localStorage.removeItem("history");
} }
function reset(){ function reset() {
$(".tab-content:eq(0)").show(); $(".tab-content:eq(0)").show();
$(".tab-content:gt(0)").hide(); $(".tab-content:gt(0)").hide();
$(".active-back").removeClass("active-back"); $(".active-back").removeClass("active-back");
@ -451,8 +451,8 @@ function reset(){
$("#his-follow-btn").text(lang.lang_status_follow); $("#his-follow-btn").text(lang.lang_status_follow);
$("#his-mute-btn").text(lang.lang_status_mute); $("#his-mute-btn").text(lang.lang_status_mute);
$("#his-block-btn").text(lang.lang_status_block); $("#his-block-btn").text(lang.lang_status_block);
$("#his-notf-btn").text(lang.lang_showontl_notf+lang.lang_status_mute); $("#his-notf-btn").text(lang.lang_showontl_notf + lang.lang_status_mute);
$("#his-domain-btn").text(lang.lang_showontl_domain+lang.lang_status_block); $("#his-domain-btn").text(lang.lang_showontl_domain + lang.lang_status_block);
$("#his-relation").text(""); $("#his-relation").text("");
$(".cont-series").html(""); $(".cont-series").html("");
$("#domainblock").val(""); $("#domainblock").val("");
@ -470,10 +470,10 @@ function reset(){
$("#his-float-blocked").hide(); $("#his-float-blocked").hide();
$("#his-proof-prof").html("") $("#his-proof-prof").html("")
} }
$('#my-data-nav .custom-tab').on('click',function(){ $('#my-data-nav .custom-tab').on('click', function () {
var target=$(this).find("a").attr("go"); var target = $(this).find("a").attr("go");
$("#my-data-nav .custom-tab").removeClass("active-back"); $("#my-data-nav .custom-tab").removeClass("active-back");
$(this).addClass("active-back"); $(this).addClass("active-back");
$(target).show(); $(target).show();
$(".tab-content:not("+target+")").hide(); $(".tab-content:not(" + target + ")").hide();
}); });

View File

@ -1,6 +1,6 @@
var dir='file://' + __dirname; var dir = 'file://' + __dirname;
var base=dir + '/view/'; var base = dir + '/view/';
// Electronのモジュール // Electronのモジュール
const electron = require("electron"); const electron = require("electron");
const fs = require("fs"); const fs = require("fs");
@ -10,7 +10,7 @@ const dl = require('./main/dl.js');
const img = require('./main/img.js'); const img = require('./main/img.js');
const np = require('./main/np.js'); const np = require('./main/np.js');
const systemFunc = require('./main/system.js'); const systemFunc = require('./main/system.js');
const Menu=electron.Menu const Menu = electron.Menu
const join = require('path').join; const join = require('path').join;
// アプリケーションをコントロールするモジュール // アプリケーションをコントロールするモジュール
const app = electron.app; const app = electron.app;
@ -20,13 +20,13 @@ const BrowserWindow = electron.BrowserWindow;
let mainWindow; let mainWindow;
var info_path = join(app.getPath("userData"), "window-size.json"); var info_path = join(app.getPath("userData"), "window-size.json");
var max_info_path = join(app.getPath("userData"), "max-window-size.json"); var max_info_path = join(app.getPath("userData"), "max-window-size.json");
var lang_path=join(app.getPath("userData"), "language"); var lang_path = join(app.getPath("userData"), "language");
var ha_path=join(app.getPath("userData"), "hardwareAcceleration"); var ha_path = join(app.getPath("userData"), "hardwareAcceleration");
try{ try {
fs.readFileSync(ha_path, 'utf8'); fs.readFileSync(ha_path, 'utf8');
app.disableHardwareAcceleration() app.disableHardwareAcceleration()
console.log("disabled: HA"); console.log("disabled: HA");
}catch{ } catch{
console.log("enabled: HA"); console.log("enabled: HA");
} }
var window_size; var window_size;
@ -50,7 +50,7 @@ try {
}; // デフォルトバリュー }; // デフォルトバリュー
} }
function isFile(file){ function isFile(file) {
try { try {
fs.statSync(file); fs.statSync(file);
return true return true
@ -59,114 +59,114 @@ function isFile(file){
} }
} }
// 全てのウィンドウが閉じたら終了 // 全てのウィンドウが閉じたら終了
app.on('window-all-closed', function() { app.on('window-all-closed', function () {
if (process.platform != 'darwin') { if (process.platform != 'darwin') {
electron.session.defaultSession.clearCache(() => {}) electron.session.defaultSession.clearCache(() => { })
app.quit(); app.quit();
} }
}); });
// macOSでウィンドウを閉じた後に再度開けるようにする // macOSでウィンドウを閉じた後に再度開けるようにする
app.on('activate', function() { app.on('activate', function () {
if (mainWindow == null) { if (mainWindow == null) {
createWindow(); createWindow();
} }
}); });
function createWindow() { function createWindow() {
if(isFile(lang_path)) { if (isFile(lang_path)) {
console.log("exist"); console.log("exist");
var lang = fs.readFileSync(lang_path, 'utf8'); var lang = fs.readFileSync(lang_path, 'utf8');
} else { } else {
var langs=app.getLocale(); var langs = app.getLocale();
console.log(langs); console.log(langs);
if(~langs.indexOf("ja")){ if (~langs.indexOf("ja")) {
lang="ja"; lang = "ja";
}else{ } else {
lang="en"; lang = "en";
} }
fs.mkdir(app.getPath("userData"), function (err) { fs.mkdir(app.getPath("userData"), function (err) {
fs.writeFileSync(lang_path,lang); fs.writeFileSync(lang_path, lang);
}); });
} }
console.log(app.getLocale()); console.log(app.getLocale());
console.log("launch:"+lang); console.log("launch:" + lang);
// メイン画面の表示。ウィンドウの幅、高さを指定できる // メイン画面の表示。ウィンドウの幅、高さを指定できる
var platform=process.platform; var platform = process.platform;
var bit=process.arch; var bit = process.arch;
if(platform=="linux"){ if (platform == "linux") {
var arg={width:window_size.width,height:window_size.height,x:window_size.x,y:window_size.y,icon: __dirname + '/desk.png'} var arg = { width: window_size.width, height: window_size.height, x: window_size.x, y: window_size.y, icon: __dirname + '/desk.png' }
}else if(platform=="win32"){ } else if (platform == "win32") {
var arg={width:window_size.width,height:window_size.height,x:window_size.x,y:window_size.y,simpleFullscreen:true} var arg = { width: window_size.width, height: window_size.height, x: window_size.x, y: window_size.y, simpleFullscreen: true }
}else if(platform=="darwin"){ } else if (platform == "darwin") {
var arg={width:window_size.width,height:window_size.height,x:window_size.x,y:window_size.y,simpleFullscreen:true} var arg = { width: window_size.width, height: window_size.height, x: window_size.x, y: window_size.y, simpleFullscreen: true }
} }
mainWindow = new BrowserWindow(arg); mainWindow = new BrowserWindow(arg);
electron.session.defaultSession.clearCache(() => {}) electron.session.defaultSession.clearCache(() => { })
if(process.argv){ if (process.argv) {
if(process.argv[1]){ if (process.argv[1]) {
var m = process.argv[1].match(/([a-zA-Z0-9]+)\/\?[a-zA-Z-0-9]+=(.+)/); var m = process.argv[1].match(/([a-zA-Z0-9]+)\/\?[a-zA-Z-0-9]+=(.+)/);
if(m){ if (m) {
var mode=m[1]; var mode = m[1];
var code=m[2]; var code = m[2];
var plus='?mode='+mode+'&code='+code; var plus = '?mode=' + mode + '&code=' + code;
}else{ } else {
var plus=""; var plus = "";
} }
}else{ } else {
var plus=""; var plus = "";
} }
}else{ } else {
var plus=""; var plus = "";
} }
mainWindow.loadURL(base+lang+'/index.html'+plus); mainWindow.loadURL(base + lang + '/index.html' + plus);
if(!window_size.x && !window_size.y){ if (!window_size.x && !window_size.y) {
mainWindow.center(); mainWindow.center();
} }
if(window_size.max){ if (window_size.max) {
mainWindow.maximize(); mainWindow.maximize();
} }
// ウィンドウが閉じられたらアプリも終了 // ウィンドウが閉じられたらアプリも終了
mainWindow.on('closed', function() { mainWindow.on('closed', function () {
electron.ipcMain.removeAllListeners(); electron.ipcMain.removeAllListeners();
mainWindow = null; mainWindow = null;
}); });
mainWindow.on('close', function() { mainWindow.on('close', function () {
if( if (
max_window_size.width==mainWindow.getBounds().width && max_window_size.width == mainWindow.getBounds().width &&
max_window_size.height==mainWindow.getBounds().height && max_window_size.height == mainWindow.getBounds().height &&
max_window_size.x==mainWindow.getBounds().x && max_window_size.x == mainWindow.getBounds().x &&
max_window_size.y==mainWindow.getBounds().y max_window_size.y == mainWindow.getBounds().y
){ ) {
var size={width:mainWindow.getBounds().width,height:mainWindow.getBounds().height,x:mainWindow.getBounds().x,y:mainWindow.getBounds().y,max:true} var size = { width: mainWindow.getBounds().width, height: mainWindow.getBounds().height, x: mainWindow.getBounds().x, y: mainWindow.getBounds().y, max: true }
}else{ } else {
var size={width:mainWindow.getBounds().width,height:mainWindow.getBounds().height,x:mainWindow.getBounds().x,y:mainWindow.getBounds().y} var size = { width: mainWindow.getBounds().width, height: mainWindow.getBounds().height, x: mainWindow.getBounds().x, y: mainWindow.getBounds().y }
} }
fs.writeFileSync(info_path, JSON.stringify(size)); fs.writeFileSync(info_path, JSON.stringify(size));
}); });
mainWindow.on('maximize', function() { mainWindow.on('maximize', function () {
fs.writeFileSync(max_info_path, JSON.stringify(mainWindow.getBounds())); fs.writeFileSync(max_info_path, JSON.stringify(mainWindow.getBounds()));
}); });
var platform=process.platform; var platform = process.platform;
var bit=process.arch; var bit = process.arch;
if(platform=="darwin"){ if (platform == "darwin") {
Menu.setApplicationMenu(Menu.buildFromTemplate(language.template(lang,mainWindow,false,dir))); Menu.setApplicationMenu(Menu.buildFromTemplate(language.template(lang, mainWindow, false, dir)));
} }
//CSS //CSS
css.css(mainWindow); css.css(mainWindow);
//アップデータとダウンロード //アップデータとダウンロード
dl.dl(mainWindow,lang_path,base); dl.dl(mainWindow, lang_path, base);
//画像選択と画像処理 //画像選択と画像処理
img.img(mainWindow,dir); img.img(mainWindow, dir);
//NowPlaying //NowPlaying
np.TheDeskNowPlaying(mainWindow); np.TheDeskNowPlaying(mainWindow);
//その他system //その他system
systemFunc.system(mainWindow,dir,lang); systemFunc.system(mainWindow, dir, lang);
} }
// Electronの初期化完了後に実行 // Electronの初期化完了後に実行
app.on('ready', createWindow); app.on('ready', createWindow);
var onError = function(err,response){ var onError = function (err, response) {
console.error(err,response); console.error(err, response);
}; };
app.setAsDefaultProtocolClient('thedesk') app.setAsDefaultProtocolClient('thedesk')

View File

@ -8,11 +8,11 @@ function css(mainWindow) {
const join = require('path').join; const join = require('path').join;
var customcss = join(app.getPath("userData"), "custom.css"); var customcss = join(app.getPath("userData"), "custom.css");
ipc.on('custom-css-create', function(e, arg) { ipc.on('custom-css-create', function (e, arg) {
fs.writeFileSync(customcss, arg); fs.writeFileSync(customcss, arg);
mainWindow.webContents.send('custom-css-create-complete', ""); mainWindow.webContents.send('custom-css-create-complete', "");
}) })
ipc.on('custom-css-request', function(e, arg) { ipc.on('custom-css-request', function (e, arg) {
try { try {
var css = fs.readFileSync(customcss, 'utf8'); var css = fs.readFileSync(customcss, 'utf8');
} catch (e) { } catch (e) {
@ -20,7 +20,7 @@ function css(mainWindow) {
} }
mainWindow.webContents.send('custom-css-response', css); mainWindow.webContents.send('custom-css-response', css);
}) })
ipc.on('theme-json-create', function(e, arg) { ipc.on('theme-json-create', function (e, arg) {
var themecss = join(app.getPath("userData"), JSON5.parse(arg)["id"] + var themecss = join(app.getPath("userData"), JSON5.parse(arg)["id"] +
".thedesktheme"); ".thedesktheme");
fs.writeFileSync(themecss, JSON.stringify(JSON5.parse(arg))); fs.writeFileSync(themecss, JSON.stringify(JSON5.parse(arg)));
@ -30,19 +30,19 @@ function css(mainWindow) {
mainWindow.webContents.send('theme-json-create-complete', "error"); mainWindow.webContents.send('theme-json-create-complete', "error");
} }
}) })
ipc.on('theme-json-delete', function(e, arg) { ipc.on('theme-json-delete', function (e, arg) {
var themecss = join(app.getPath("userData"), arg + ".thedesktheme"); var themecss = join(app.getPath("userData"), arg + ".thedesktheme");
console.log(themecss); console.log(themecss);
fs.unlink(themecss, function(err) { fs.unlink(themecss, function (err) {
mainWindow.webContents.send('theme-json-delete-complete', ""); mainWindow.webContents.send('theme-json-delete-complete', "");
}); });
}) })
ipc.on('theme-json-request', function(e, arg) { ipc.on('theme-json-request', function (e, arg) {
var themecss = join(app.getPath("userData"), arg + ".thedesktheme"); var themecss = join(app.getPath("userData"), arg + ".thedesktheme");
var json = JSON.parse(fs.readFileSync(themecss, 'utf8')); var json = JSON.parse(fs.readFileSync(themecss, 'utf8'));
mainWindow.webContents.send('theme-json-response', json); mainWindow.webContents.send('theme-json-response', json);
}) })
ipc.on('theme-css-request', function(e, arg) { ipc.on('theme-css-request', function (e, arg) {
var themecss = join(app.getPath("userData"), arg + ".thedesktheme"); var themecss = join(app.getPath("userData"), arg + ".thedesktheme");
try { try {
var json = JSON.parse(fs.readFileSync(themecss, 'utf8')); var json = JSON.parse(fs.readFileSync(themecss, 'utf8'));
@ -82,10 +82,10 @@ function css(mainWindow) {
} }
}) })
ipc.on('theme-json-list', function(e, arg) { ipc.on('theme-json-list', function (e, arg) {
fs.readdir(app.getPath("userData"), function(err, files) { fs.readdir(app.getPath("userData"), function (err, files) {
if (err) throw err; if (err) throw err;
var fileList = files.filter(function(file) { var fileList = files.filter(function (file) {
var tfile = join(app.getPath("userData"), file); var tfile = join(app.getPath("userData"), file);
return fs.statSync(tfile).isFile() && /.*\.thedesktheme$/.test(tfile); //絞り込み return fs.statSync(tfile).isFile() && /.*\.thedesktheme$/.test(tfile); //絞り込み
}) })

View File

@ -1,38 +1,38 @@
function dl(mainWindow,lang_path,base) { function dl(mainWindow, lang_path, base) {
const electron = require("electron"); const electron = require("electron");
const shell=electron.shell; const shell = electron.shell;
const fs = require("fs"); const fs = require("fs");
const {download} = require('electron-dl'); const { download } = require('electron-dl');
const BrowserWindow = electron.BrowserWindow; const BrowserWindow = electron.BrowserWindow;
const dialog = electron.dialog; const dialog = electron.dialog;
var updatewin = null; var updatewin = null;
var ipc = electron.ipcMain; var ipc = electron.ipcMain;
const app = electron.app; const app = electron.app;
const join = require('path').join; const join = require('path').join;
ipc.on('update', function(e, x, y) { ipc.on('update', function (e, x, y) {
var platform = process.platform;
var bit = process.arch;
if (platform != "others") {
updatewin = new BrowserWindow({
width: 600,
height: 400,
"transparent": false, // ウィンドウの背景を透過
"frame": false, // 枠の無いウィンドウ
"resizable": false,
"modal": true
});
var lang = fs.readFileSync(lang_path, 'utf8');
updatewin.loadURL(base + lang + '/update.html');
return "true" var platform = process.platform;
} else { var bit = process.arch;
return false; if (platform != "others") {
} updatewin = new BrowserWindow({
}) width: 600,
//アプデDL height: 400,
"transparent": false, // ウィンドウの背景を透過
"frame": false, // 枠の無いウィンドウ
"resizable": false,
"modal": true
});
var lang = fs.readFileSync(lang_path, 'utf8');
updatewin.loadURL(base + lang + '/update.html');
return "true"
} else {
return false;
}
})
//アプデDL
ipc.on('download-btn', (e, args) => { ipc.on('download-btn', (e, args) => {
var platform = process.platform; var platform = process.platform;
var bit = process.arch; var bit = process.arch;
dialog.showSaveDialog(null, { dialog.showSaveDialog(null, {
@ -66,18 +66,18 @@ function dl(mainWindow,lang_path,base) {
} }
function dl(url, file, dir) { function dl(url, file, dir) {
updatewin.webContents.send('mess', "ダウンロードを開始します。"); updatewin.webContents.send('mess', "ダウンロードを開始します。");
const opts = { const opts = {
directory: dir, directory: dir,
openFolderWhenDone: true, openFolderWhenDone: true,
onProgress: function(e) { onProgress: function (e) {
updatewin.webContents.send('prog', e); updatewin.webContents.send('prog', e);
}, },
saveAs: false saveAs: false
}; };
download(BrowserWindow.getFocusedWindow(), download(BrowserWindow.getFocusedWindow(),
url, opts) url, opts)
.then(dl => { .then(dl => {
updatewin.webContents.send('mess', "ダウンロードが完了しました。"); updatewin.webContents.send('mess', "ダウンロードが完了しました。");
app.quit(); app.quit();
@ -86,7 +86,7 @@ function dl(mainWindow,lang_path,base) {
.catch(console.error); .catch(console.error);
} }
ipc.on('general-dl', (e, args) => { ipc.on('general-dl', (e, args) => {
var name = ""; var name = "";
var platform = process.platform; var platform = process.platform;
var bit = process.arch; var bit = process.arch;
@ -103,21 +103,21 @@ function dl(mainWindow,lang_path,base) {
directory: dir, directory: dir,
filename: name, filename: name,
openFolderWhenDone: false, openFolderWhenDone: false,
onProgress: function(e) { onProgress: function (e) {
mainWindow.webContents.send('general-dl-prog', e); mainWindow.webContents.send('general-dl-prog', e);
}, },
saveAs: false saveAs: false
}; };
download(BrowserWindow.getFocusedWindow(), download(BrowserWindow.getFocusedWindow(),
args[0], opts) args[0], opts)
.then(dl => { .then(dl => {
mainWindow.webContents.send('general-dl-message', dir); mainWindow.webContents.send('general-dl-message', dir);
}) })
.catch(console.error); .catch(console.error);
}); });
ipc.on('open-finder', (e, folder) => { ipc.on('open-finder', (e, folder) => {
shell.showItemInFolder(folder) shell.showItemInFolder(folder)
}); });
} }
exports.dl = dl; exports.dl = dl;

View File

@ -1,4 +1,4 @@
function img(mainWindow,dir){ function img(mainWindow, dir) {
const electron = require("electron"); const electron = require("electron");
const dialog = electron.dialog; const dialog = electron.dialog;
const fs = require("fs"); const fs = require("fs");
@ -6,66 +6,66 @@ function img(mainWindow,dir){
var ipc = electron.ipcMain; var ipc = electron.ipcMain;
const BrowserWindow = electron.BrowserWindow; const BrowserWindow = electron.BrowserWindow;
ipc.on('file-select', (e, args) => { ipc.on('file-select', (e, args) => {
dialog.showOpenDialog(null, { dialog.showOpenDialog(null, {
properties: ['openFile', 'multiSelections'], properties: ['openFile', 'multiSelections'],
title: '添付ファイルを選択', title: '添付ファイルを選択',
defaultPath: '.', defaultPath: '.',
filters: [ filters: [
{name: 'メディアファイル', extensions: ['jpg', 'png', 'gif', 'bmp', 'jpeg','mp4','webm']}, { name: 'メディアファイル', extensions: ['jpg', 'png', 'gif', 'bmp', 'jpeg', 'mp4', 'webm'] },
{name: '画像', extensions: ['jpg', 'png', 'gif', 'bmp', 'jpeg']}, { name: '画像', extensions: ['jpg', 'png', 'gif', 'bmp', 'jpeg'] },
{name: '動画', extensions: ['mp4','webm']}, { name: '動画', extensions: ['mp4', 'webm'] },
{name: '全てのファイル', extensions: ['*']} { name: '全てのファイル', extensions: ['*'] }
] ]
}, (fileNames) => { }, (fileNames) => {
if(!fileNames){ if (!fileNames) {
return false; return false;
} }
for(var i=0;i<fileNames.length;i++){ for (var i = 0; i < fileNames.length; i++) {
var path=fileNames[i]; var path = fileNames[i];
var bin = fs.readFileSync(path, 'base64'); var bin = fs.readFileSync(path, 'base64');
mainWindow.webContents.send('bmp-img-comp', [bin,'new']); mainWindow.webContents.send('bmp-img-comp', [bin, 'new']);
} }
}); });
}); });
ipc.on('adobe', (e, arg) => { ipc.on('adobe', (e, arg) => {
if(!arg){ if (!arg) {
const options = { const options = {
type: 'info', type: 'info',
title: 'Adobeフォトエディタ', title: 'Adobeフォトエディタ',
message: "「許可」または「永続的に許可」をクリックするとTheDeskとAdobeで情報を共有します。\n次のウィンドウを開いている時以外は一切提供しません。", message: "「許可」または「永続的に許可」をクリックするとTheDeskとAdobeで情報を共有します。\n次のウィンドウを開いている時以外は一切提供しません。",
buttons: ['拒否', '許可','永続的に許可'] buttons: ['拒否', '許可', '永続的に許可']
} }
dialog.showMessageBox(options, function(index) { dialog.showMessageBox(options, function (index) {
if(index===2){ if (index === 2) {
mainWindow.webContents.send('adobeagree', "true"); mainWindow.webContents.send('adobeagree', "true");
} }
if(index>0){ if (index > 0) {
adobeWindow(); adobeWindow();
} }
}) })
}else{ } else {
adobeWindow(); adobeWindow();
} }
}); });
function adobeWindow(){ function adobeWindow() {
var window = new BrowserWindow({ var window = new BrowserWindow({
width: 1000, width: 1000,
height: 750 height: 750
}); });
window.loadURL(dir + '/adobe.html'); window.loadURL(dir + '/adobe.html');
} }
ipc.on('bmp-image', (e, args) => { ipc.on('bmp-image', (e, args) => {
var m = args[0].match(/(.+)\\(.+)\.(.+)$/); var m = args[0].match(/(.+)\\(.+)\.(.+)$/);
Jimp.read(args[0], function (err, lenna) { Jimp.read(args[0], function (err, lenna) {
if (err) throw err; if (err) throw err;
lenna.getBase64(Jimp.MIME_PNG, function (err, src) { lenna.getBase64(Jimp.MIME_PNG, function (err, src) {
mainWindow.webContents.send('bmp-img-comp', [src,args[1]]); mainWindow.webContents.send('bmp-img-comp', [src, args[1]]);
}); });
}); });
}); });
} }
exports.img = img; exports.img = img;

View File

@ -1,85 +1,90 @@
// Create the Application's main menu // Create the Application's main menu
function templete(lang,mainWindow,packaged,dir){ function templete(lang, mainWindow, packaged, dir) {
const electron = require("electron"); const electron = require("electron");
const app = electron.app; const app = electron.app;
const BrowserWindow = electron.BrowserWindow; const BrowserWindow = electron.BrowserWindow;
const dict={ const dict = {
"application":{ "application": {
"ja":"アプリケーション", "ja": "アプリケーション",
"en":"Application" "en": "Application"
}, },
"about":{ "about": {
"ja":"TheDeskについて", "ja": "TheDeskについて",
"en":"About TheDesk" "en": "About TheDesk"
}, },
"quit":{ "quit": {
"ja":"終了", "ja": "終了",
"en":"Quit" "en": "Quit"
}, },
"edit":{ "edit": {
"ja":"編集", "ja": "編集",
"en":"Edit" "en": "Edit"
}, },
"undo":{ "undo": {
"ja":"元に戻す", "ja": "元に戻す",
"en":"Undo" "en": "Undo"
}, },
"redo":{ "redo": {
"ja":"やり直す", "ja": "やり直す",
"en":"Redo" "en": "Redo"
}, },
"cut":{ "cut": {
"ja":"切り取り", "ja": "切り取り",
"en":"Cut" "en": "Cut"
}, },
"copy":{ "copy": {
"ja":"コピー", "ja": "コピー",
"en":"Copy" "en": "Copy"
}, },
"paste":{ "paste": {
"ja":"貼り付け", "ja": "貼り付け",
"en":"Paste" "en": "Paste"
}, },
"selall":{ "selall": {
"ja":"すべて選択", "ja": "すべて選択",
"en":"Select All" "en": "Select All"
}, },
"view":{ "view": {
"ja":"表示", "ja": "表示",
"en":"View" "en": "View"
}, },
"reload":{ "reload": {
"ja":"再読み込み", "ja": "再読み込み",
"en":"Reload" "en": "Reload"
}, },
"window":{ "window": {
"ja":"ウィンドウ", "ja": "ウィンドウ",
"en":"Window" "en": "Window"
}, },
"minimun":{ "minimun": {
"ja":"最小化", "ja": "最小化",
"en":"Minimarize" "en": "Minimarize"
}, },
"close":{ "close": {
"ja":"閉じる", "ja": "閉じる",
"en":"Close" "en": "Close"
} }
} }
const menu = [{ const menu = [{
label: dict.application[lang], label: dict.application[lang],
submenu: [ submenu: [
{ label: dict.about[lang], click: function() { {
var ver=app.getVersion() label: dict.about[lang], click: function () {
var window = new BrowserWindow({width: 300, height: 460, var ver = app.getVersion()
"transparent": false, // ウィンドウの背景を透過 var window = new BrowserWindow({
"frame": false, // 枠の無いウィンドウ width: 300, height: 460,
"resizable": false }); "transparent": false, // ウィンドウの背景を透過
window.loadURL(dir + '/about.html?ver='+ver); "frame": false, // 枠の無いウィンドウ
} }, "resizable": false
});
window.loadURL(dir + '/about.html?ver=' + ver);
}
},
{ type: "separator" }, { type: "separator" },
{ label: dict.quit[lang], accelerator: "Command+Q", click: function() { app.quit(); }} { label: dict.quit[lang], accelerator: "Command+Q", click: function () { app.quit(); } }
]}, { ]
}, {
label: dict.edit[lang], label: dict.edit[lang],
submenu: [ submenu: [
{ label: dict.undo[lang], accelerator: "CmdOrCtrl+Z", selector: "undo:" }, { label: dict.undo[lang], accelerator: "CmdOrCtrl+Z", selector: "undo:" },
@ -89,57 +94,58 @@ function templete(lang,mainWindow,packaged,dir){
{ label: dict.copy[lang], accelerator: "CmdOrCtrl+C", selector: "copy:" }, { label: dict.copy[lang], accelerator: "CmdOrCtrl+C", selector: "copy:" },
{ label: dict.paste[lang], accelerator: "CmdOrCtrl+V", selector: "paste:" }, { label: dict.paste[lang], accelerator: "CmdOrCtrl+V", selector: "paste:" },
{ label: dict.selall[lang], accelerator: "CmdOrCtrl+A", selector: "selectAll:" } { label: dict.selall[lang], accelerator: "CmdOrCtrl+A", selector: "selectAll:" }
]},{ ]
}, {
label: dict.view[lang], label: dict.view[lang],
submenu: [ submenu: [
{ {
label: 'Toggle Developer Tools', label: 'Toggle Developer Tools',
accelerator: 'Alt+Command+I', accelerator: 'Alt+Command+I',
click: function() { if(!packaged){mainWindow.toggleDevTools();} } click: function () { if (!packaged) { mainWindow.toggleDevTools(); } }
}, },
{ {
label: dict.reload[lang], label: dict.reload[lang],
accelerator: 'CmdOrCtrl+R', accelerator: 'CmdOrCtrl+R',
click: function() { mainWindow.webContents.send('reload', " "); } click: function () { mainWindow.webContents.send('reload', " "); }
} }
] ]
}, },
{ {
label: dict.window[lang], label: dict.window[lang],
role: 'window', role: 'window',
submenu: [ submenu: [
{ {
label: dict.minimun[lang], label: dict.minimun[lang],
accelerator: 'CmdOrCtrl+M', accelerator: 'CmdOrCtrl+M',
role: 'minimize' role: 'minimize'
}, },
{ {
label: dict.close[lang], label: dict.close[lang],
accelerator: 'CmdOrCtrl+W', accelerator: 'CmdOrCtrl+W',
role: 'close' role: 'close'
}, },
] ]
} }
]; ];
return menu; return menu;
} }
function delsel(lang){ function delsel(lang) {
const dict={ const dict = {
"delete":{ "delete": {
"ja":"カラム削除", "ja": "カラム削除",
"en":"Delete this column" "en": "Delete this column"
}, },
"mess":{ "mess": {
"ja":"カラムを削除しますか?(すべてのカラムのリンク解析がOFFになります。)", "ja": "カラムを削除しますか?(すべてのカラムのリンク解析がOFFになります。)",
"en":"Delete this column(URL analyzes of all windows will be disabled.)" "en": "Delete this column(URL analyzes of all windows will be disabled.)"
}, },
"yes":{ "yes": {
"ja":"はい", "ja": "はい",
"en":"Yes" "en": "Yes"
}, },
"no":{ "no": {
"ja":"いいえ", "ja": "いいえ",
"en":"No" "en": "No"
} }
} }
const options = { const options = {
@ -147,8 +153,8 @@ function delsel(lang){
title: dict.delete[lang], title: dict.delete[lang],
message: dict.mess[lang], message: dict.mess[lang],
buttons: [dict.no[lang], dict.yes[lang]] buttons: [dict.no[lang], dict.yes[lang]]
} }
return options; return options;
} }
exports.template = templete; exports.template = templete;

View File

@ -1,4 +1,4 @@
function np(mainWindow){ function np(mainWindow) {
const electron = require("electron"); const electron = require("electron");
const join = require('path').join; const join = require('path').join;
const app = electron.app; const app = electron.app;
@ -7,65 +7,65 @@ function np(mainWindow){
ipc.on('itunes', async (e, args) => { ipc.on('itunes', async (e, args) => {
//Verified on Windows //Verified on Windows
console.log("Access"); console.log("Access");
if(args[0]=="set"){ if (args[0] == "set") {
var {NowPlaying,PlayerName} = require("nowplaying-node"); var { NowPlaying, PlayerName } = require("nowplaying-node");
var nppath=join(app.getPath("userData"), "nowplaying"); var nppath = join(app.getPath("userData"), "nowplaying");
var npProvider; var npProvider;
try { try {
npProvider = args[1]; npProvider = args[1];
} catch (e) { } catch (e) {
npProvider="AIMP"; npProvider = "AIMP";
} }
var myAIMP = new NowPlaying({ var myAIMP = new NowPlaying({
fetchCover: true, fetchCover: true,
player: PlayerName[npProvider], player: PlayerName[npProvider],
}); });
fs.writeFileSync(nppath, npProvider); fs.writeFileSync(nppath, npProvider);
}else{ } else {
var platform=process.platform; var platform = process.platform;
var bit=process.arch; var bit = process.arch;
if(platform=="darwin"){ if (platform == "darwin") {
try { try {
const nowplaying = require("itunes-nowplaying-mac"); const nowplaying = require("itunes-nowplaying-mac");
const value = await nowplaying.getRawData(); const value = await nowplaying.getRawData();
mainWindow.webContents.send('itunes-np', value); mainWindow.webContents.send('itunes-np', value);
} catch (error) { } catch (error) {
// エラーを返す // エラーを返す
console.error(error); console.error(error);
mainWindow.webContents.send('itunes-np', error); mainWindow.webContents.send('itunes-np', error);
} }
}else{ } else {
var {NowPlaying,PlayerName} = require("nowplaying-node"); var { NowPlaying, PlayerName } = require("nowplaying-node");
var nppath=join(app.getPath("userData"), "nowplaying"); var nppath = join(app.getPath("userData"), "nowplaying");
var npProvider; var npProvider;
try { try {
npProvider = fs.readFileSync(nppath, 'utf8'); npProvider = fs.readFileSync(nppath, 'utf8');
} catch (e) { } catch (e) {
npProvider="AIMP"; npProvider = "AIMP";
} }
var myAIMP = new NowPlaying({ var myAIMP = new NowPlaying({
fetchCover: true, fetchCover: true,
player: PlayerName[npProvider], player: PlayerName[npProvider],
}); });
myAIMP.update(); myAIMP.update();
var path=myAIMP.getCoverPath(); var path = myAIMP.getCoverPath();
if(path){ if (path) {
var bin = fs.readFileSync(path, 'base64'); var bin = fs.readFileSync(path, 'base64');
}else{ } else {
var bin=false; var bin = false;
} }
var value={ var value = {
win:true, win: true,
name:myAIMP.getTitle(), name: myAIMP.getTitle(),
artist:myAIMP.getArtist(), artist: myAIMP.getArtist(),
album:myAIMP.getAlbum(), album: myAIMP.getAlbum(),
path:bin path: bin
} }
mainWindow.webContents.send('itunes-np', value); mainWindow.webContents.send('itunes-np', value);
} }
} }
}); });
} }
exports.TheDeskNowPlaying = np; exports.TheDeskNowPlaying = np;

View File

@ -1,6 +1,6 @@
function system(mainWindow, dir, lang) { function system(mainWindow, dir, lang) {
const electron = require("electron"); const electron = require("electron");
const app = electron.app; const app = electron.app;
const join = require('path').join; const join = require('path').join;
var Jimp = require("jimp"); var Jimp = require("jimp");
const fs = require("fs"); const fs = require("fs");
@ -11,15 +11,15 @@ function system(mainWindow, dir, lang) {
const BrowserWindow = electron.BrowserWindow; const BrowserWindow = electron.BrowserWindow;
const dialog = electron.dialog; const dialog = electron.dialog;
const os = require('os') const os = require('os')
const language=require("../main/language.js"); const language = require("../main/language.js");
ipc.on('native-notf', function(e, args) { ipc.on('native-notf', function (e, args) {
var platform = process.platform; var platform = process.platform;
var bit = process.arch; var bit = process.arch;
if (platform == "win32") { if (platform == "win32") {
const notifier = require('node-notifier') const notifier = require('node-notifier')
var tmp_imge = tmp_img; var tmp_imge = tmp_img;
Jimp.read(args[2], function(err, lenna) { Jimp.read(args[2], function (err, lenna) {
if (!err && lenna) { if (!err && lenna) {
lenna.write(tmp_img); lenna.write(tmp_img);
var tmp_imge = tmp_img; var tmp_imge = tmp_img;
@ -27,49 +27,49 @@ function system(mainWindow, dir, lang) {
var tmp_imge = ""; var tmp_imge = "";
} }
notifier.notify({ notifier.notify({
appID: "top.thedesk", appID: "top.thedesk",
message: args[1], message: args[1],
title: args[0], title: args[0],
icon: tmp_imge, icon: tmp_imge,
sound: false, sound: false,
wait: true, wait: true,
}, },
function(err, response) { function (err, response) {
console.log(err, response) console.log(err, response)
}); });
}); });
} }
}); });
//言語 //言語
ipc.on('lang', function(e, arg) { ipc.on('lang', function (e, arg) {
console.log("set:" + arg); console.log("set:" + arg);
fs.writeFileSync(lang_path, arg); fs.writeFileSync(lang_path, arg);
mainWindow.webContents.send('langres', ""); mainWindow.webContents.send('langres', "");
}) })
//ハードウェアアクセラレーションの無効化 //ハードウェアアクセラレーションの無効化
ipc.on('ha', function(e, arg) { ipc.on('ha', function (e, arg) {
if (arg == "true") { if (arg == "true") {
fs.writeFileSync(ha_path, arg); fs.writeFileSync(ha_path, arg);
} else { } else {
fs.unlink(ha_path, function(err) {}); fs.unlink(ha_path, function (err) { });
} }
app.relaunch() app.relaunch()
app.exit() app.exit()
}) })
ipc.on('quit', (e, args) => { ipc.on('quit', (e, args) => {
app.quit(); app.quit();
}); });
ipc.on('about', (e, args) => { ipc.on('about', (e, args) => {
about(); about();
}); });
function about() { function about() {
var ver = app.getVersion() var ver = app.getVersion()
var window = new BrowserWindow({ var window = new BrowserWindow({
width: 300, width: 300,
@ -82,15 +82,15 @@ function system(mainWindow, dir, lang) {
return "true" return "true"
} }
ipc.on('column-del', (e, args) => { ipc.on('column-del', (e, args) => {
console.log(lang); console.log(lang);
var options = language.delsel(lang) var options = language.delsel(lang)
dialog.showMessageBox(options, function(index) { dialog.showMessageBox(options, function (index) {
mainWindow.webContents.send('column-del-reply', index); mainWindow.webContents.send('column-del-reply', index);
}) })
}); });
ipc.on('nano', function(e, x, y) { ipc.on('nano', function (e, x, y) {
var nano_info_path = join(app.getPath("userData"), var nano_info_path = join(app.getPath("userData"),
"nano-window-position.json"); "nano-window-position.json");
var window_pos; var window_pos;
@ -110,7 +110,7 @@ function system(mainWindow, dir, lang) {
nanowindow.setAlwaysOnTop(true); nanowindow.setAlwaysOnTop(true);
nanowindow.setPosition(window_pos[0], window_pos[1]); nanowindow.setPosition(window_pos[0], window_pos[1]);
nanowindow.on('close', function() { nanowindow.on('close', function () {
fs.writeFileSync(nano_info_path, JSON.stringify(nanowindow.getPosition())); fs.writeFileSync(nano_info_path, JSON.stringify(nanowindow.getPosition()));
}); });
return true; return true;
@ -149,7 +149,7 @@ function system(mainWindow, dir, lang) {
num_b = -1; num_b = -1;
} }
data = data.sort(function(a, b) { data = data.sort(function (a, b) {
var x = a[key]; var x = a[key];
var y = b[key]; var y = b[key];
if (x > y) return num_a; if (x > y) return num_a;
@ -173,7 +173,7 @@ function system(mainWindow, dir, lang) {
ipc.on('fonts', (e, arg) => { ipc.on('fonts', (e, arg) => {
const fm = require('font-manager'); const fm = require('font-manager');
var fonts = fm.getAvailableFontsSync(); var fonts = fm.getAvailableFontsSync();
object_array_sort(fonts, 'family', 'asc', function(fonts_sorted) { object_array_sort(fonts, 'family', 'asc', function (fonts_sorted) {
mainWindow.webContents.send('font-list', fonts_sorted); mainWindow.webContents.send('font-list', fonts_sorted);
}); });
}); });

View File

@ -1,214 +1,242 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link href="./css/themes.css" type="text/css" rel="stylesheet"> <link href="./css/themes.css" type="text/css" rel="stylesheet">
<link href="./css/tl.css" type="text/css" rel="stylesheet"> <link href="./css/tl.css" type="text/css" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<title>TheDesk Nano</title> <title>TheDesk Nano</title>
<style> <style>
html{ html {
-webkit-app-region: drag !important; -webkit-app-region: drag !important;
cursor: move !important; cursor: move !important;
width:100vw; width: 100vw;
height:100vh; height: 100vh;
overflow:hidden; overflow: hidden;
font-family:sans-serif; font-family: sans-serif;
} }
body {
background-color: rgba(0, 0, 0, 0.1); body {
font-size:11px; background-color: rgba(0, 0, 0, 0.1);
} font-size: 11px;
#timeline_nano{ }
overflow-y:scroll;
overflow-x:hidden; #timeline_nano {
-webkit-app-region: no-drag; overflow-y: scroll;
max-height:100px; overflow-x: hidden;
} -webkit-app-region: no-drag;
.user{font-size:12px;} max-height: 100px;
select { }
-webkit-app-region: no-drag;
} .user {
button { font-size: 12px;
-webkit-app-region: no-drag; }
}
textarea { select {
-webkit-app-region: no-drag; -webkit-app-region: no-drag;
} }
::-webkit-scrollbar {
width: 5px; button {
height:10px; -webkit-app-region: no-drag;
background: rgba(0,0,0,0.05); }
}
::-webkit-scrollbar-track { textarea {
-webkit-border-radius: 5px; -webkit-app-region: no-drag;
border-radius: 5px; }
}
.area-actions{display:none !important;} ::-webkit-scrollbar {
.area-date_via{display:none !important;} width: 5px;
.area-side{display:none !important;} height: 10px;
/* Handle */ background: rgba(0, 0, 0, 0.05);
::-webkit-scrollbar-thumb { }
-webkit-border-radius: 5px;
border-radius: 5px; ::-webkit-scrollbar-track {
background: rgba(0,0,0,0.8); -webkit-border-radius: 5px;
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5); border-radius: 5px;
} }
.blacktheme body {
color: white; .area-actions {
background-color: #212121; display: none !important;
} }
.blacktheme button {
background-color:black; .area-date_via {
color:white; display: none !important;
} }
.blacktheme textarea, .blacktheme select{
color:white; .area-side {
} display: none !important;
.blacktheme select,.blacktheme option{ }
background-color:black;
} /* Handle */
</style> ::-webkit-scrollbar-thumb {
-webkit-border-radius: 5px;
border-radius: 5px;
background: rgba(0, 0, 0, 0.8);
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.5);
}
.blacktheme body {
color: white;
background-color: #212121;
}
.blacktheme button {
background-color: black;
color: white;
}
.blacktheme textarea,
.blacktheme select {
color: white;
}
.blacktheme select,
.blacktheme option {
background-color: black;
}
</style>
</head> </head>
<body> <body>
<script> <script>
//jQuery読む //jQuery読む
window.jQuery = window.$ = require('./js/common/jquery.js'); window.jQuery = window.$ = require('./js/common/jquery.js');
var Hammer = require('./js/common/hammer.min.js'); var Hammer = require('./js/common/hammer.min.js');
$.strip_tags = function(str, allowed) { $.strip_tags = function (str, allowed) {
if(!str){ if (!str) {
return ""; return "";
} }
allowed = (((allowed || '') + '').toLowerCase().match(/<[a-z][a-z0-9]*>/g) || []) allowed = (((allowed || '') + '').toLowerCase().match(/<[a-z][a-z0-9]*>/g) || [])
.join(''); .join('');
var tags = /<\/?([a-z][a-z0-9]*)\b[^>]*>?/gi, var tags = /<\/?([a-z][a-z0-9]*)\b[^>]*>?/gi,
commentsAndPhpTags = /<!--[\s\S]*?-->|<\?(?:php)?[\s\S]*?\?>/gi; commentsAndPhpTags = /<!--[\s\S]*?-->|<\?(?:php)?[\s\S]*?\?>/gi;
return str.replace(commentsAndPhpTags, '').replace(tags, function($0, $1) { return str.replace(commentsAndPhpTags, '').replace(tags, function ($0, $1) {
return allowed.indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : ''; return allowed.indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : '';
}); });
}; };
function escapeHTML(str) { function escapeHTML(str) {
if(!str){ if (!str) {
return ""; return "";
} }
return str.replace(/&/g, '&amp;') return str.replace(/&/g, '&amp;')
.replace(/</g, '&lt;') .replace(/</g, '&lt;')
.replace(/>/g, '&gt;') .replace(/>/g, '&gt;')
.replace(/"/g, '&quot;') .replace(/"/g, '&quot;')
.replace(/'/g, '&#039;'); .replace(/'/g, '&#039;');
} }
</script> </script>
<script type="text/javascript" src="./js/platform/first-not-view.js"></script> <script type="text/javascript" src="./js/platform/first-not-view.js"></script>
<select id="post-acct-sel" style="max-width:150px"> <select id="post-acct-sel" style="max-width:150px">
</select> </select>
<select id="type-sel" style="max-width:60px"> <select id="type-sel" style="max-width:60px">
<option value="local">Local</option> <option value="local">Local</option>
<option value="home">Home</option> <option value="home">Home</option>
</select><button onclick="tl()">Show</button><button onclick="window.close()">x</button><br> </select><button onclick="tl()">Show</button><button onclick="window.close()">x</button><br>
<div id="timeline_nano"> <div id="timeline_nano">
</div> </div>
<br> <br>
<textarea id="textarea" style="width:80%; background-color:transparent"></textarea> <textarea id="textarea" style="width:80%; background-color:transparent"></textarea>
<button class="btn" onclick="post()">Post</button> <button class="btn" onclick="post()">Post</button>
<script> <script>
if(localStorage.getItem("lang")){ if (localStorage.getItem("lang")) {
var lang=localStorage.getItem("lang"); var lang = localStorage.getItem("lang");
}else{ } else {
var lang="ja"; var lang = "ja";
} }
</script> </script>
<script src="https://twemoji.maxcdn.com/2/twemoji.min.js?2.7"></script> <script src="https://twemoji.maxcdn.com/2/twemoji.min.js?2.7"></script>
<script type="text/javascript" src="./js/post/post.js"></script> <script type="text/javascript" src="./js/post/post.js"></script>
<script type="text/javascript" src="./js/post/use-txtbox.js"></script> <script type="text/javascript" src="./js/post/use-txtbox.js"></script>
<script type="text/javascript" src="./js/tl/parse.js"></script> <script type="text/javascript" src="./js/tl/parse.js"></script>
<script type="text/javascript" src="./js/ui/theme.js"></script> <script type="text/javascript" src="./js/ui/theme.js"></script>
<script type="text/javascript" src="./js/tl/date.js"></script> <script type="text/javascript" src="./js/tl/date.js"></script>
<script type="text/javascript" src="./js/common/time.js"></script> <script type="text/javascript" src="./js/common/time.js"></script>
<script type="text/javascript" src="./js/platform/nano.js"></script> <script type="text/javascript" src="./js/platform/nano.js"></script>
<script type="text/javascript" src="./js/platform/end.js"></script> <script type="text/javascript" src="./js/platform/end.js"></script>
<script> <script>
var multi = localStorage.getItem("multi"); var multi = localStorage.getItem("multi");
if (!multi) { if (!multi) {
var obj = [{ var obj = [{
at: localStorage.getItem(localStorage.getItem("domain_" + acct_id) + "_at"), at: localStorage.getItem(localStorage.getItem("domain_" + acct_id) + "_at"),
name: localStorage.getItem("name_" + acct_id), name: localStorage.getItem("name_" + acct_id),
domain: localStorage.getItem("domain_" + acct_id), domain: localStorage.getItem("domain_" + acct_id),
user: localStorage.getItem("user_" + acct_id), user: localStorage.getItem("user_" + acct_id),
prof: localStorage.getItem("prof_" + acct_id) prof: localStorage.getItem("prof_" + acct_id)
}]; }];
var json = JSON.stringify(obj); var json = JSON.stringify(obj);
localStorage.setItem("multi", json); localStorage.setItem("multi", json);
} else {
var obj = JSON.parse(multi);
}
var templete;
var last = localStorage.getItem("last-use");
var sel;
Object.keys(obj).forEach(function(key) {
var acct = obj[key];
var list = key * 1 + 1;
if (key == last) {
sel = "selected";
} else { } else {
sel = ""; var obj = JSON.parse(multi);
} }
templete = '<option value="' + key + '" ' + sel + '>' + acct.user + '@' + acct.domain + var templete;
'</option>'; var last = localStorage.getItem("last-use");
$("#post-acct-sel").append(templete); var sel;
}); Object.keys(obj).forEach(function (key) {
function mov(){ var acct = obj[key];
return false; var list = key * 1 + 1;
} if (key == last) {
function resetmv(){ sel = "selected";
return false;
}
function post(){
var acct_id=$("#post-acct-sel").val();
var domain = localStorage.getItem("domain_" + acct_id);
var at = localStorage.getItem("acct_"+ acct_id + "_at");
var start = "https://" + domain + "/api/v1/statuses";
var str=$("#textarea").val();
var toot={
status: str
}
var vis = loadVis(acct_id)
toot.visibility=vis;
var httpreq = new XMLHttpRequest();
httpreq.open('POST', start, true);
httpreq.setRequestHeader('Content-Type', 'application/json');
httpreq.setRequestHeader('Authorization', 'Bearer ' + at);
httpreq.responseType = "json";
httpreq.send(JSON.stringify(toot));
httpreq.onreadystatechange = function() {
if (httpreq.readyState === 4) {
$("#textarea").val("");
}
}
}
function loadVis(acct_id){
var vist = localStorage.getItem("vis");
console.log(vist);
if (!vist) {
return "public";
} else {
if (vist == "memory") {
var memory = localStorage.getItem("vis-memory-"+acct_id);
if (!memory) {
memory = "public";
}
return memory;
} else if(vist == "server") {
var multi = localStorage.getItem("multi");
var obj = JSON.parse(multi);
var memory = obj[acct_id]["vis"];
if (!memory) {
memory = "public";
}
return memory;
} else { } else {
return vist; sel = "";
} }
} templete = '<option value="' + key + '" ' + sel + '>' + acct.user + '@' + acct.domain +
} '</option>';
</script> $("#post-acct-sel").append(templete);
});
function mov() {
return false;
}
function resetmv() {
return false;
}
function post() {
var acct_id = $("#post-acct-sel").val();
var domain = localStorage.getItem("domain_" + acct_id);
var at = localStorage.getItem("acct_" + acct_id + "_at");
var start = "https://" + domain + "/api/v1/statuses";
var str = $("#textarea").val();
var toot = {
status: str
}
var vis = loadVis(acct_id)
toot.visibility = vis;
var httpreq = new XMLHttpRequest();
httpreq.open('POST', start, true);
httpreq.setRequestHeader('Content-Type', 'application/json');
httpreq.setRequestHeader('Authorization', 'Bearer ' + at);
httpreq.responseType = "json";
httpreq.send(JSON.stringify(toot));
httpreq.onreadystatechange = function () {
if (httpreq.readyState === 4) {
$("#textarea").val("");
}
}
}
function loadVis(acct_id) {
var vist = localStorage.getItem("vis");
console.log(vist);
if (!vist) {
return "public";
} else {
if (vist == "memory") {
var memory = localStorage.getItem("vis-memory-" + acct_id);
if (!memory) {
memory = "public";
}
return memory;
} else if (vist == "server") {
var multi = localStorage.getItem("multi");
var obj = JSON.parse(multi);
var memory = obj[acct_id]["vis"];
if (!memory) {
memory = "public";
}
return memory;
} else {
return vist;
}
}
}
</script>

View File

@ -1,83 +1,122 @@
<!doctype html> <!doctype html>
<html lang="en"> <html lang="en">
<head> <head>
<title>Account Manager - TheDesk</title> <title>Account Manager - TheDesk</title>
<meta content="width=device-width,initial-scale=1.0" name="viewport"> <meta content="width=device-width,initial-scale=1.0" name="viewport">
<link href="../../css/materialize.css" type="text/css" rel="stylesheet"> <link href="../../css/materialize.css" type="text/css" rel="stylesheet">
<link href="../../css/themes.css" type="text/css" rel="stylesheet"> <link href="../../css/themes.css" type="text/css" rel="stylesheet">
<link href="../../css/master.css" type="text/css" rel="stylesheet"> <link href="../../css/master.css" type="text/css" rel="stylesheet">
<link href='../../css/font-awesome.css' rel='stylesheet' type='text/css'> <link href='../../css/font-awesome.css' rel='stylesheet' type='text/css'>
<link href='../../css/tl.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/userdata.css' rel='stylesheet' type='text/css'>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons|Open+Sans:300" rel="stylesheet"> <link href="https://fonts.googleapis.com/icon?family=Material+Icons|Open+Sans:300" rel="stylesheet">
<style>.acct{display:flex; justify-content:space-around;} <style>
.card{width:400px; background-color: #9e9e9e; margin:10px; } .acct {
body,html{overflow-y: scroll;} display: flex;
#acct-list{display:flex; flex-wrap:wrap; color:white; align-items: flex-start} justify-content: space-around;
.lts{font-size:150%} }
.colorsel{ display:flex; }
.card .colorsel div:not(.exc){width:20px;height:20px;} .card {
.card .colorsel div.exc{width:40px;height:20px;} width: 400px;
.first{ background-color: #9e9e9e;
display:flex; margin: 10px;
justify-content: center; }
align-items:center
} body,
.first .hide-first{ html {
display:none; overflow-y: scroll;
} }
</style>
<meta charset="utf-8"> #acct-list {
<!-- display: flex;
<script type="text/javascript"> flex-wrap: wrap;
var _jipt = []; color: white;
_jipt.push(['project', 'thedesk']); align-items: flex-start
</script> }
<script type="text/javascript" src="https://cdn.crowdin.com/jipt/jipt.js"></script>
--> .lts {
font-size: 150%
}
.colorsel {
display: flex;
}
.card .colorsel div:not(.exc) {
width: 20px;
height: 20px;
}
.card .colorsel div.exc {
width: 40px;
height: 20px;
}
.first {
display: flex;
justify-content: center;
align-items: center
}
.first .hide-first {
display: none;
}
</style>
<meta charset="utf-8">
<!--
<script type="text/javascript">
var _jipt = [];
_jipt.push(['project', 'thedesk']);
</script>
<script type="text/javascript" src="https://cdn.crowdin.com/jipt/jipt.js"></script>
-->
</head> </head>
<body id="mainView"> <body id="mainView">
<script type="text/javascript" src="../../js/common/jquery.js"></script> <script type="text/javascript" src="../../js/common/jquery.js"></script>
<script type="text/javascript" src="../../js/platform/first.js"></script> <script type="text/javascript" src="../../js/platform/first.js"></script>
<script type="text/javascript" src="../../js/common/materialize.js"></script> <script type="text/javascript" src="../../js/common/materialize.js"></script>
<script type="text/javascript" src="../../js/lang/lang.en.js"></script> <script type="text/javascript" src="../../js/lang/lang.en.js"></script>
<script> <script>
var misskeytoken=false; var misskeytoken = false;
</script> </script>
<script type="text/javascript" src="../../js/ui/tips.js"></script> <script type="text/javascript" src="../../js/ui/tips.js"></script>
<script type="text/javascript" src="../../js/common/time.js"></script> <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/common/modal.js"></script>
<div class="hide-first"> <div class="hide-first">
<a href="index.html" class="btn waves-effect orange nex" style="width:100%; max-width:200px;">Back</a><br> <a href="index.html" class="btn waves-effect orange nex"
<h5>List of accounts</h5> style="width:100%; max-width:200px;">Back</a><br>
<div id="acct-list"></div> <h5>List of accounts</h5>
<div class="divider"></div> <div id="acct-list"></div>
</div> <div class="divider"></div>
<div>
<h5>Add an account</h5><br>
<div id="add">
<div class="row">
<div class="col s8">
<input type="text" id="url" style="width:70%" placeholder="ex)mstdn.jp">
<div id="ins-suggest"></div>
Uncheck it to skip pasiting code.(login to Mastodon on Windows or macOS) (Recommended: pcheck)<br>
<input type="checkbox" class="filled-in" id="linux" />
<label for="linux">Code setup</label><br>
<input type="checkbox" class="filled-in" id="misskey" />
<label for="misskey">Login as Misskey</label><br>
<button class="btn waves-effect" onclick="instance()">Login</button><br>
</div> </div>
<div class="col s4"> <div>
<span style="font-family:Open Sans;">Supports</span> <h5>Add an account</h5><br>
<div id="support" class="collection transparent"></div> <div id="add">
</div> <div class="row">
</div></div> <div class="col s8">
<div id="auth" style="display:none"> <input type="text" id="url" style="width:70%" placeholder="ex)mstdn.jp">
Paste the code and close browser.<br> <div id="ins-suggest"></div>
<input type="text" id="code" placeholder="Code"> Uncheck it to skip pasiting code.(login to Mastodon on Windows or macOS) (Recommended: pcheck)<br>
<button class="btn waves-effect" onclick="code()">Auth</button><br> <input type="checkbox" class="filled-in" id="linux" />
</div> <label for="linux">Code setup</label><br>
<div id="misskeylogin" style="display:none"> <input type="checkbox" class="filled-in" id="misskey" />
<label for="misskey">Login as Misskey</label><br>
<button class="btn waves-effect" onclick="instance()">Login</button><br>
</div>
<div class="col s4">
<span style="font-family:Open Sans;">Supports</span>
<div id="support" class="collection transparent"></div>
</div>
</div>
</div>
<div id="auth" style="display:none">
Paste the code and close browser.<br>
<input type="text" id="code" placeholder="Code">
<button class="btn waves-effect" onclick="code()">Auth</button><br>
</div>
<div id="misskeylogin" style="display:none">
<h5>AppSecret</h5> <h5>AppSecret</h5>
Read <a href="https://thedesk.top/how-to-misskey-login.html">Docs(ja)</a> to login Misskey.<br> Read <a href="https://thedesk.top/how-to-misskey-login.html">Docs(ja)</a> to login Misskey.<br>
<input type="hidden" id="misskey-url"> <input type="hidden" id="misskey-url">
@ -85,30 +124,30 @@ body,html{overflow-y: scroll;}
<button class="btn waves-effect" onclick="misskeyLogin()">Auth</button><br> <button class="btn waves-effect" onclick="misskeyLogin()">Auth</button><br>
</div> </div>
</div> </div>
<div class="hide-first"> <div class="hide-first">
<h5>Main an account</h5> <h5>Main an account</h5>
<div class="input-field" style="width:300px"><span data-trans="your_acct">Select an account</span> <div class="input-field" style="width:300px"><span data-trans="your_acct">Select an account</span>
<br> <br>
<select id="main-acct-sel" class="acct-sel" style="color:black" onchange="mainacct()"></select> <select id="main-acct-sel" class="acct-sel" style="color:black" onchange="mainacct()"></select>
<label></label> <label></label>
</div> </div>
Some instance data by <a href="https://instances.social" target="_blank">instances.social API</a><br> Some instance data by <a href="https://instances.social" target="_blank">instances.social API</a><br>
<h5 id="ins-title"></h5> <h5 id="ins-title"></h5>
Administered by:<a id="ins-admin"></a><br> Administered by:<a id="ins-admin"></a><br>
<span id="ins-desc"></span><br> <span id="ins-desc"></span><br>
<img src="../../img/loading.svg" id="ins-prof" width="200"><br> <img src="../../img/loading.svg" id="ins-prof" width="200"><br>
<br> <br>
Domain:<span id="ins-name"></span><br> Domain:<span id="ins-name"></span><br>
Federated servers:<span id="ins-connect"></span><br> Federated servers:<span id="ins-connect"></span><br>
Toots:<span id="ins-toot"></span><br> Toots:<span id="ins-toot"></span><br>
Users:<span id="ins-user"></span>Users<br> Users:<span id="ins-user"></span>Users<br>
Connection:<span id="ins-per"></span>%<br> Connection:<span id="ins-per"></span>%<br>
Mastodon version:<span id="ins-ver"></span>@<span id="ins-upd"></span><br> Mastodon version:<span id="ins-ver"></span>@<span id="ins-upd"></span><br>
</div> </div>
<script type="text/javascript" src="../../js/ui/theme.js"></script> <script type="text/javascript" src="../../js/ui/theme.js"></script>
<script type="text/javascript" src="../../js/platform/end.js"></script> <script type="text/javascript" src="../../js/platform/end.js"></script>
<script type="text/javascript" src="../../js/common/sha256.js"></script> <script type="text/javascript" src="../../js/common/sha256.js"></script>
<script type="text/javascript" src="../../js/login/tkn.js"></script> <script type="text/javascript" src="../../js/login/tkn.js"></script>
<script type="text/javascript" src="../../js/login/instance.js"></script> <script type="text/javascript" src="../../js/login/instance.js"></script>
<script type="text/javascript" src="../../js/login/manager.js"></script> <script type="text/javascript" src="../../js/login/manager.js"></script>
<script type="text/javascript" src="../../js/tl/date.js"></script> <script type="text/javascript" src="../../js/tl/date.js"></script>

View File

@ -98,10 +98,12 @@
title="箇条書きリスト">format_list_bulleted</i> title="箇条書きリスト">format_list_bulleted</i>
<i class="material-icons pointer setting waves-effect" onclick="markdown('1. ','yes','yes')" <i class="material-icons pointer setting waves-effect" onclick="markdown('1. ','yes','yes')"
title="番号付きリスト">format_list_numbered</i> title="番号付きリスト">format_list_numbered</i>
<i class="pointer setting fa fa-subscript waves-effect" onclick="markdown('__','yes','no','before')" <i class="pointer setting fa fa-subscript waves-effect"
title="下付き文字 テキストボックス内を選択してから押すと囲みます。" style="font-size:1.5rem"></i> onclick="markdown('__','yes','no','before')" title="下付き文字 テキストボックス内を選択してから押すと囲みます。"
<i class="pointer setting fa fa-superscript waves-effect" onclick="markdown('_','yes','no','before')" style="font-size:1.5rem"></i>
title="上付き文字 テキストボックス内を選択してから押すと囲みます。" style="font-size:1.5rem"></i> <i class="pointer setting fa fa-superscript waves-effect"
onclick="markdown('_','yes','no','before')" title="上付き文字 テキストボックス内を選択してから押すと囲みます。"
style="font-size:1.5rem"></i>
<i class="material-icons pointer setting waves-effect" onclick="tagsel('spin')" <i class="material-icons pointer setting waves-effect" onclick="tagsel('spin')"
title="回転 テキストボックス内を選択してから押すと囲みます。">autorenew</i> title="回転 テキストボックス内を選択してから押すと囲みます。">autorenew</i>
<i class="material-icons pointer setting waves-effect" onclick="tagsel('pulse')" <i class="material-icons pointer setting waves-effect" onclick="tagsel('pulse')"
@ -121,14 +123,19 @@
title="文字色変更 テキストボックス内を選択してから押すと囲みます。">color_lens</i> title="文字色変更 テキストボックス内を選択してから押すと囲みます。">color_lens</i>
<input id="colorhex" style="width: calc(50% - 50px); margin: 0; height: 24px;" type="color"> <input id="colorhex" style="width: calc(50% - 50px); margin: 0; height: 24px;" type="color">
<br> <br>
<i class="material-icons pointer setting waves-effect" onclick="markdownLink()" title="リンク挿入">link</i> <i class="material-icons pointer setting waves-effect" onclick="markdownLink()"
<input id="linkt" style="width: calc(50% - 20px); margin: 0; height: 24px;" placeholder="リンクテキスト">&nbsp; title="リンク挿入">link</i>
<input id="link2" style="width: calc(50% - 20px); margin: 0; height: 24px;" placeholder="リンクアドレス"> <input id="linkt" style="width: calc(50% - 20px); margin: 0; height: 24px;"
placeholder="リンクテキスト">&nbsp;
<input id="link2" style="width: calc(50% - 20px); margin: 0; height: 24px;"
placeholder="リンクアドレス">
<br> <br>
<i class="material-icons pointer setting waves-effect" onclick="markdownImage()" <i class="material-icons pointer setting waves-effect" onclick="markdownImage()"
title="インライン画像挿入">image</i> title="インライン画像挿入">image</i>
<input id="image" style="width: calc(50% - 20px); margin: 0; height: 24px;" placeholder="代替テキスト">&nbsp; <input id="image" style="width: calc(50% - 20px); margin: 0; height: 24px;"
<input id="image2" style="width: calc(50% - 20px); margin: 0; height: 24px;" placeholder="画像アドレス"> placeholder="代替テキスト">&nbsp;
<input id="image2" style="width: calc(50% - 20px); margin: 0; height: 24px;"
placeholder="画像アドレス">
</div> </div>
</div> </div>
<div class="input-field col s12" id="preview-field" style="margin-top: 0;"> <div class="input-field col s12" id="preview-field" style="margin-top: 0;">
@ -154,14 +161,15 @@
<div class="col s12 mize" style="margin-top: 0; display:flex; justify-content: space-between"> <div class="col s12 mize" style="margin-top: 0; display:flex; justify-content: space-between">
<i class="waves-effect gray material-icons" id="nsfw" title="Mark media as sensitive" <i class="waves-effect gray material-icons" id="nsfw" title="Mark media as sensitive"
onclick="nsfw()">visibility_off</i> onclick="nsfw()">visibility_off</i>
<i class="waves-effect gray material-icons purple-text dropdown-button" data-activates='dropdown1' <i class="waves-effect gray material-icons purple-text dropdown-button"
id="vis-icon">public</i> data-activates='dropdown1' id="vis-icon">public</i>
<a class="waves-effect gray" id="cw" onclick="cw()" title="Hide text behind warning">CW</a> <a class="waves-effect gray" id="cw" onclick="cw()" title="Hide text behind warning">CW</a>
<span><span id="imgup"></span><span id="imgsel"><i class="waves-effect material-icons gray" <span><span id="imgup"></span><span id="imgsel"><i class="waves-effect material-icons gray"
onclick="fileselect()" title="Attach..">photo_library</i></span></span> onclick="fileselect()" title="Attach..">photo_library</i></span></span>
<i class="waves-effect gray material-icons" onclick="emojiToggle()" id="emojibtn" <i class="waves-effect gray material-icons" onclick="emojiToggle()" id="emojibtn"
title="Emojis">tag_faces</i> title="Emojis">tag_faces</i>
<i class="waves-effect gray material-icons dropdown-button" data-activates='dropdown2'>more_vert</i> <i class="waves-effect gray material-icons dropdown-button"
data-activates='dropdown2'>more_vert</i>
<i class="material-icons nex gray waves-effect" title="Clear toot box(Ctrl+Shit+C)" <i class="material-icons nex gray waves-effect" title="Clear toot box(Ctrl+Shit+C)"
data-trans-title="post_box_clear" id="clear">clear</i> data-trans-title="post_box_clear" id="clear">clear</i>
</div> </div>
@ -176,13 +184,15 @@
<br> <br>
<input type="text" id="cw-text" placeholder="Warning text" class="mize" style="margin:0"> <input type="text" id="cw-text" placeholder="Warning text" class="mize" style="margin:0">
<div id="sch-box">Post at<br><span class="sml">2.7.0~ Minimum time gap:5min(clock on the server may not be accurate.)</span><br> <div id="sch-box">Post at<br><span class="sml">2.7.0~ Minimum time gap:5min(clock on the server may not be accurate.)</span><br>
<input type="datetime-local" id="sch-date" placeholder="Scheduled toot" class="datepicker" style="margin:0"> <input type="datetime-local" id="sch-date" placeholder="Scheduled toot" class="datepicker"
style="margin:0">
</div> </div>
</div> </div>
</div> </div>
<!-- 公開範囲 Dropdown Structure --> <!-- 公開範囲 Dropdown Structure -->
<ul id='dropdown1' class='dropdown-content'> <ul id='dropdown1' class='dropdown-content'>
<li style="font-size: 16px; display: block; line-height: 22px; padding: 14px 16px;">Adjust status privacy</li> <li style="font-size: 16px; display: block; line-height: 22px; padding: 14px 16px;">Adjust status privacy
</li>
<li> <li>
<a onclick="vis('public')">(Public)</a> <a onclick="vis('public')">(Public)</a>
</li> </li>
@ -228,8 +238,9 @@
<div id="toot-btn-field"> <div id="toot-btn-field">
<button class="btn waves-effect indigo unmize toot-btn-group" onclick="post()" <button class="btn waves-effect indigo unmize toot-btn-group" onclick="post()"
id="toot-post-btn">Toot</button> id="toot-post-btn">Toot</button>
<button class="btn waves-effect indigo darken-3 unmize hide toot-btn-group" onclick="sec()" id="toot-sec-btn"><i <button class="btn waves-effect indigo darken-3 unmize hide toot-btn-group" onclick="sec()"
class="material-icons" id="toot-sec-icon" title="Secondary Toot">lock_open</i></button> id="toot-sec-btn"><i class="material-icons" id="toot-sec-icon"
title="Secondary Toot">lock_open</i></button>
</div> </div>
</div> </div>
<div id="right-side"> <div id="right-side">
@ -398,12 +409,12 @@
class="fas fa-share"></i></button> class="fas fa-share"></i></button>
</div> </div>
<div class="col s2"> <div class="col s2">
<button class="dropdown-button btn waves-effect indigo" style="width:100%;" onclick="staEx('rt')"><i <button class="dropdown-button btn waves-effect indigo" style="width:100%;"
class="fas fa-retweet"></i></button> onclick="staEx('rt')"><i class="fas fa-retweet"></i></button>
</div> </div>
<div class="col s2"> <div class="col s2">
<button class="dropdown-button btn waves-effect orange" style="width:100%;" onclick="staEx('fav')"><i <button class="dropdown-button btn waves-effect orange" style="width:100%;"
class="fas fa-star"></i></button> onclick="staEx('fav')"><i class="fas fa-star"></i></button>
</div> </div>
</div> </div>
<div id="toot-tools"> <div id="toot-tools">
@ -449,8 +460,8 @@
<div id="his-plus-action"> <div id="his-plus-action">
<a href="#!" class="btn waves-effect waves-effect blue-grey btn-flat" id="his-emp-btn" <a href="#!" class="btn waves-effect waves-effect blue-grey btn-flat" id="his-emp-btn"
onclick="empUser()">Emphasize this user</a> onclick="empUser()">Emphasize this user</a>
<a href="#!" class="btn waves-effect waves-effect blue-grey btn-flat only-his-data" id="his-end-btn" <a href="#!" class="btn waves-effect waves-effect blue-grey btn-flat only-his-data"
onclick="pinUser()">Feature on profile</a><br> id="his-end-btn" onclick="pinUser()">Feature on profile</a><br>
<a href="#!" class="btn waves-effect waves-effect blue-grey btn-flat" id="his-openin" <a href="#!" class="btn waves-effect waves-effect blue-grey btn-flat" id="his-openin"
onclick="profbrws()">Open in browser</a><br> onclick="profbrws()">Open in browser</a><br>
</div><br> </div><br>
@ -471,10 +482,12 @@
<a go="#his-follow-list" title="Follow"><i class="material-icons">people</i></a> <a go="#his-follow-list" title="Follow"><i class="material-icons">people</i></a>
</li> </li>
<li class="custom-tab col my-data-width"> <li class="custom-tab col my-data-width">
<a go="#his-follower-list" title="Follower"><i class="material-icons">people</i></a> <a go="#his-follower-list" title="Follower"><i
class="material-icons">people</i></a>
</li> </li>
<li class="custom-tab col my-data-width only-his-data"> <li class="custom-tab col my-data-width only-his-data">
<a go="#his-action" title="Cross-account"><i class="material-icons">account_box</i></a> <a go="#his-action" title="Cross-account"><i
class="material-icons">account_box</i></a>
</li> </li>
<li class="custom-tab col my-data-width only-his-data"> <li class="custom-tab col my-data-width only-his-data">
<a go="#his-list" title="List"><i class="material-icons">list</i></a> <a go="#his-list" title="List"><i class="material-icons">list</i></a>
@ -486,20 +499,23 @@
<a go="#his-blocking-list" title="Blocks"><i class="material-icons">block</i></a> <a go="#his-blocking-list" title="Blocks"><i class="material-icons">block</i></a>
</li> </li>
<li class="custom-tab col my-data-width only-my-data"> <li class="custom-tab col my-data-width only-my-data">
<a go="#his-blocking-list" title="Blocks"><i class="material-icons">voice_over_off</i></a> <a go="#his-blocking-list" title="Blocks"><i
class="material-icons">voice_over_off</i></a>
</li> </li>
<li class="custom-tab col my-data-width only-my-data"> <li class="custom-tab col my-data-width only-my-data">
<a go="#his-domain-list" title="Domain block"><i class="material-icons">language</i><i <a go="#his-domain-list" title="Domain block"><i
class="material-icons">block</i></a> class="material-icons">language</i><i class="material-icons">block</i></a>
</li> </li>
<li class="custom-tab col my-data-width only-my-data"> <li class="custom-tab col my-data-width only-my-data">
<a go="#his-prof-list" title="Edit profile"><i class="material-icons">create</i></a> <a go="#his-prof-list" title="Edit profile"><i class="material-icons">create</i></a>
</li> </li>
<li class="custom-tab col my-data-width only-my-data"> <li class="custom-tab col my-data-width only-my-data">
<a go="#his-request-list" title="Follow requests"><i class="material-icons">how_to_reg</i></a> <a go="#his-request-list" title="Follow requests"><i
class="material-icons">how_to_reg</i></a>
</li> </li>
<li class="custom-tab col my-data-width only-my-data"> <li class="custom-tab col my-data-width only-my-data">
<a go="#his-follow-recom-list" title="Suggest"><i class="material-icons">recent_actors</i></a> <a go="#his-follow-recom-list" title="Suggest"><i
class="material-icons">recent_actors</i></a>
</li> </li>
</ul> </ul>
</div> </div>
@ -524,9 +540,11 @@
<div id="his-action" class="tab-content"> <div id="his-action" class="tab-content">
Use other account to Follow((Unable to unfollow))<br> Use other account to Follow((Unable to unfollow))<br>
<div style="max-width:500px;"><select id="user-acct-sel" class="acct-sel"></select></div> <div style="max-width:500px;"><select id="user-acct-sel" class="acct-sel"></select></div>
<a href="#!" class="waves-effect btn" onclick="follow('selector','true')">Follow</a><br> <a href="#!" class="waves-effect btn" onclick="follow('selector','true')">Follow</a><br>
or<br> or<br>
<a href="#!" class="waves-effect btn" onclick="udgEx('selector', 'selector')">Show profile</a><br> <a href="#!" class="waves-effect btn"
onclick="udgEx('selector', 'selector')">Show profile</a><br>
</div> </div>
<div id="his-list" class="tab-content"> <div id="his-list" class="tab-content">
<div id="his-lists-a">Follow to add this user to lists.</div> <div id="his-lists-a">Follow to add this user to lists.</div>
@ -536,17 +554,20 @@
<div id="his-fav-list" class="tab-content"> <div id="his-fav-list" class="tab-content">
<div id="his-fav-list-contents" class="cont-series"> <div id="his-fav-list-contents" class="cont-series">
</div> </div>
<button class="btn waves-effect" style="width:100%; padding:0;" onclick="showFav('more')">More</button> <button class="btn waves-effect" style="width:100%; padding:0;"
onclick="showFav('more')">More</button>
</div> </div>
<div id="his-blocking-list" class="tab-content"> <div id="his-blocking-list" class="tab-content">
<div id="his-blocking-list-contents" class="cont-series"> <div id="his-blocking-list-contents" class="cont-series">
</div> </div>
<button class="btn waves-effect " style="width:100%; padding:0;" onclick="showBlo('more')">More</button> <button class="btn waves-effect " style="width:100%; padding:0;"
onclick="showBlo('more')">More</button>
</div> </div>
<div id="his-muting-list" class="tab-content"> <div id="his-muting-list" class="tab-content">
<div id="his-muting-list-contents" class="cont-series"> <div id="his-muting-list-contents" class="cont-series">
</div> </div>
<button class="btn waves-effect " style="width:100%; padding:0;" onclick="showMut('more')">More</button> <button class="btn waves-effect " style="width:100%; padding:0;"
onclick="showMut('more')">More</button>
</div> </div>
<div id="his-domain-list" class="tab-content"> <div id="his-domain-list" class="tab-content">
<div id="his-domain-list-contents" class="cont-series"> <div id="his-domain-list-contents" class="cont-series">
@ -567,7 +588,8 @@
<textarea placeholder="Note" id="his-des-val" class="materialize-textarea"></textarea> <textarea placeholder="Note" id="his-des-val" class="materialize-textarea"></textarea>
<label for="his-des-val">Note</label> <label for="his-des-val">Note</label>
</div> </div>
<button class="btn waves-effect" style="width:100%; padding:0;" onclick="profedit()">Save</button> <button class="btn waves-effect" style="width:100%; padding:0;"
onclick="profedit()">Save</button>
<br>Change avataor: <br>Change avataor:
<span id="prof-change"> <span id="prof-change">
<input type="file" onchange="imgChange(this,'avatar')"> <input type="file" onchange="imgChange(this,'avatar')">
@ -580,7 +602,8 @@
<div id="his-request-list" class="tab-content"> <div id="his-request-list" class="tab-content">
<div id="his-request-list-contents" class="cont-series"> <div id="his-request-list-contents" class="cont-series">
</div> </div>
<button class="btn waves-effect " style="width:100%; padding:0;" onclick="showReq('more')">More</button> <button class="btn waves-effect " style="width:100%; padding:0;"
onclick="showReq('more')">More</button>
</div> </div>
<div id="his-follow-recom-list" class="tab-content"> <div id="his-follow-recom-list" class="tab-content">
<div id="his-follow-recom-contents" class="cont-series"> <div id="his-follow-recom-contents" class="cont-series">
@ -686,7 +709,8 @@
Amazon Wish List Amazon Wish List
</a> </a>
<br> <br>
Give me Amazon Gift Card:<a href="mailto:web-pro@cutls.com" target="_blank">web-pro@cutls.com</a><br> Give me Amazon Gift Card:<a href="mailto:web-pro@cutls.com"
target="_blank">web-pro@cutls.com</a><br>
Kyash<br> Kyash<br>
<img src="../../img/kyash.png" width="100"><br> <img src="../../img/kyash.png" width="100"><br>
</div> </div>
@ -720,7 +744,8 @@
class="material-icons">view_headline</i><span>List</span></div> class="material-icons">view_headline</i><span>List</span></div>
<div class="waves-effect" onclick="filterMenu()" id="filterMenu"><i <div class="waves-effect" onclick="filterMenu()" id="filterMenu"><i
class="material-icons">filter_list</i><span>Filter</span></div> class="material-icons">filter_list</i><span>Filter</span></div>
<div class="waves-effect" onclick="help()"><i class="material-icons">help_outline</i><span>Help</span></div> <div class="waves-effect" onclick="help()"><i
class="material-icons">help_outline</i><span>Help</span></div>
<div class="waves-effect" onclick="location.href='index.html'"><i <div class="waves-effect" onclick="location.href='index.html'"><i
class="material-icons">refresh</i><span>Reload TL</span></div> class="material-icons">refresh</i><span>Reload TL</span></div>
</div> </div>
@ -741,7 +766,8 @@
<div><i class="material-icons">people_outline</i></div><span>Local</span> <div><i class="material-icons">people_outline</i></div><span>Local</span>
</div> </div>
<div class="type waves-effect" data-type="local-media"> <div class="type waves-effect" data-type="local-media">
<div><i class="material-icons">people_outline</i><i class="material-icons sub-icon">perm_media</i> <div><i class="material-icons">people_outline</i><i
class="material-icons sub-icon">perm_media</i>
</div><span>Local(Media)</span> </div><span>Local(Media)</span>
</div> </div>
<div class="type waves-effect" data-type="home"> <div class="type waves-effect" data-type="home">
@ -751,7 +777,8 @@
<div><i class="material-icons">language</i></div><span>Federated</span> <div><i class="material-icons">language</i></div><span>Federated</span>
</div> </div>
<div class="type waves-effect" data-type="pub-media"> <div class="type waves-effect" data-type="pub-media">
<div><i class="material-icons">language</i><i class="material-icons sub-icon">perm_media</i></div> <div><i class="material-icons">language</i><i
class="material-icons sub-icon">perm_media</i></div>
<span>Federated(Media)</span> <span>Federated(Media)</span>
</div> </div>
<div class="type waves-effect" data-type="dm"> <div class="type waves-effect" data-type="dm">
@ -761,7 +788,8 @@
<div><i class="material-icons">merge_type</i></div><span>Integrated(Local/Home)</span> <div><i class="material-icons">merge_type</i></div><span>Integrated(Local/Home)</span>
</div> </div>
<div class="type waves-effect" data-type="plus"> <div class="type waves-effect" data-type="plus">
<div><i class="material-icons">merge_type</i><i class="material-icons sub-icon">reply</i></div> <div><i class="material-icons">merge_type</i><i
class="material-icons sub-icon">reply</i></div>
<span>LTL+Reply+BT</span> <span>LTL+Reply+BT</span>
</div> </div>
<div class="type waves-effect" data-type="notf"> <div class="type waves-effect" data-type="notf">
@ -791,8 +819,8 @@
<div class="input-field"> <div class="input-field">
<input id="src" type="text" class="validate" style="width:60%"> <input id="src" type="text" class="validate" style="width:60%">
<label for="src" data-trans="src">Search</label> <label for="src" data-trans="src">Search</label>
<button class="btn waves-effect indigo" style="width: 36%;padding: 0;padding-left: 15px;" onclick="src()" <button class="btn waves-effect indigo" style="width: 36%;padding: 0;padding-left: 15px;"
data-trans-i="src"> onclick="src()" data-trans-i="src">
<i class="material-icons left" style="margin:0">search</i>Search <i class="material-icons left" style="margin:0">search</i>Search
</button> </button>
<br> <br>
@ -819,7 +847,8 @@
<label>Account(Scroll to show all)</label> <label>Account(Scroll to show all)</label>
</div> </div>
<div style="float:left; padding-top:8px; padding-bottom:28px;"> <div style="float:left; padding-top:8px; padding-bottom:28px;">
<button class="btn waves-effect indigo" style="width:80px;" onclick="list()" data-trans-i="lists"> <button class="btn waves-effect indigo" style="width:80px;" onclick="list()"
data-trans-i="lists">
List List
</button> </button>
</div> </div>
@ -836,7 +865,8 @@
<label>Account(Scroll to show all)</label> <label>Account(Scroll to show all)</label>
</div> </div>
<div style="float:left; padding-top:8px; padding-bottom:28px;"> <div style="float:left; padding-top:8px; padding-bottom:28px;">
<button class="btn waves-effect indigo" style="width:80px;" onclick="filter()" data-trans-i="filters"> <button class="btn waves-effect indigo" style="width:80px;" onclick="filter()"
data-trans-i="filters">
List List
</button> </button>
</div> </div>
@ -915,7 +945,8 @@
<i class="material-icons nex" title="Preferences(Ctrl+Shift+S)">settings</i> <i class="material-icons nex" title="Preferences(Ctrl+Shift+S)">settings</i>
</a> </a>
<a onclick="nano()" class="nex waves-effect"> <a onclick="nano()" class="nex waves-effect">
<i class="material-icons" title="The smallest Mastodon,TheDesk Nano" data-trans-title="nano_desp">remove_from_queue</i> <i class="material-icons" title="The smallest Mastodon,TheDesk Nano"
data-trans-title="nano_desp">remove_from_queue</i>
</a> </a>
<a onclick="menu()" class="nex waves-effect" id="list-tgl"> <a onclick="menu()" class="nex waves-effect" id="list-tgl">
<i class="material-icons" title="List">apps</i> <i class="material-icons" title="List">apps</i>

View File

@ -22,6 +22,7 @@
input { input {
max-height: 50px !important max-height: 50px !important
} }
.pcr-result { .pcr-result {
height: 1rem !important; height: 1rem !important;
} }
@ -157,11 +158,11 @@
<input type="hidden" id="color-picker2_value"> <input type="hidden" id="color-picker2_value">
</div> </div>
<div> <div>
<h5>Accent</h5>Background of boosts <h5>Accent</h5>Background of boosts
<div id="color-picker3-wrap"> <div id="color-picker3-wrap">
<div class="color-picker" id="color-picker3"></div> <div class="color-picker" id="color-picker3"></div>
</div> </div>
<input type="hidden" id="color-picker3_value"> <input type="hidden" id="color-picker3_value">
</div> </div>
</div> </div>
<button class="btn-large waves-effect" onclick="customComp()">Change</button>&nbsp;<button <button class="btn-large waves-effect" onclick="customComp()">Change</button>&nbsp;<button
@ -210,10 +211,14 @@
</template> </template>
</div> </div>
<h5>Custom sound</h5> <h5>Custom sound</h5>
<button class="btn waves-effect" style="width:120px;" onclick="customSound(1)">Custom 1</button><span id="c1-file"></span><br> <button class="btn waves-effect" style="width:120px;" onclick="customSound(1)">Custom 1</button><span
<button class="btn waves-effect" style="width:120px;" onclick="customSound(2)">Custom 2</button><span id="c2-file"></span><br> id="c1-file"></span><br>
<button class="btn waves-effect" style="width:120px;" onclick="customSound(3)">Custom 3</button><span id="c3-file"></span><br> <button class="btn waves-effect" style="width:120px;" onclick="customSound(2)">Custom 2</button><span
<button class="btn waves-effect" style="width:120px;" onclick="customSound(4)">Custom 4</button><span id="c4-file"></span><br> id="c2-file"></span><br>
<button class="btn waves-effect" style="width:120px;" onclick="customSound(3)">Custom 3</button><span
id="c3-file"></span><br>
<button class="btn waves-effect" style="width:120px;" onclick="customSound(4)">Custom 4</button><span
id="c4-file"></span><br>
</div> </div>
</li> </li>
<li> <li>

File diff suppressed because it is too large Load Diff

View File

@ -1,235 +1,256 @@
<!doctype html> <!doctype html>
<html lang="en"> <html lang="en">
<head> <head>
<title>Update - TheDesk</title> <title>Update - TheDesk</title>
<link href="../../css/materialize.css" type="text/css" rel="stylesheet"> <link href="../../css/materialize.css" type="text/css" rel="stylesheet">
<link href="../../css/master.css" type="text/css" rel="stylesheet"> <link href="../../css/master.css" type="text/css" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons|Open+Sans:300" rel="stylesheet"> <link href="https://fonts.googleapis.com/icon?family=Material+Icons|Open+Sans:300" rel="stylesheet">
<meta charset="utf-8"> <meta charset="utf-8">
<!-- <!--
<script type="text/javascript"> <script type="text/javascript">
var _jipt = []; var _jipt = [];
_jipt.push(['project', 'thedesk']); _jipt.push(['project', 'thedesk']);
</script> </script>
<script type="text/javascript" src="https://cdn.crowdin.com/jipt/jipt.js"></script> <script type="text/javascript" src="https://cdn.crowdin.com/jipt/jipt.js"></script>
--> -->
</head> </head>
<body> <body>
<style> <style>
body{ body {
font-family:'Open Sans'; font-family: 'Open Sans';
-webkit-app-region: drag; -webkit-app-region: drag;
cursor: move; cursor: move;
padding:10px; padding: 10px;
text-align:right; text-align: right;
}
#start{
display: flex;
justify-content: center;
align-items: center;
width:100vw;
height: calc(100vh - 2.5rem);
text-align:center;
}
#checkbox{
text-align:left;
}
a,button,input,label,i{
-webkit-app-region: no-drag;
}
#updskip{
display: flex;
justify-content: center;
align-items: center;
}
.skipbtn{
display:block;
float:left;
width:200px;
height:200px;
border:1px solid;
margin-left:5px;
display: flex;
justify-content: center;
align-items: center;
border: 1px solid;
overflow: hidden;
}
.skipbtn:hover{
background-color: #b3e5fc;
transition: all 0.3s ease-in-out;
}
#prog{
font-size:200%;
}
</style>
<script type="text/javascript" src="../../js/common/jquery.js"></script>
<script type="text/javascript" src="../../js/platform/first.js"></script>
<script type="text/javascript" src="../../js/common/materialize.js"></script>
<i class="material-icons pointer waves-effect" onclick="about();">info</i>
<i class="material-icons pointer waves-effect" onclick="skipper();">clear</i>
<!--a href="update.html">Reload</a-->
<div id="start">
<div id="box" class="show">
<h2>TheDesk</h2>
<p>Get latest TheDesk</p>
<span id="now"></span><b id="ver"></b><br>
<span id="det"></span><br>
<button class="waves-effect btn windows hide" onclick="update('install')" style="margin-left:15px;">Installer ver.</button>
<button class="waves-effect btn windows hide" onclick="update('portable')" style="margin-left:15px;">Portable ver.</button>
<button class="waves-effect btn linux hide" onclick="update('linux')" style="margin-left:15px;">Start</button>
<button class="waves-effect btn mac hide" onclick="update('mac')" style="margin-left:15px;">Start</button>
<br>
Some problems?<br>Please download on <a href="https://thedesk.top">Oficial HP</a>.
</div>
<div id="skipper" class="hide">
<h4>You may lose a cool experience!</h4>
Skip this update<br>
<div id="updskip">
<a onclick="window.close();" class="pointer skipbtn waves-effect waves-light"><div>Until next TL loading</div></a>
<a onclick="nextv();" class="pointer skipbtn waves-effect waves-light"><div>Until next version</div></a>
</div>
<a class="pointer waves-effect" onclick="skipper();" style="margin-top:5px">Continue updating</a>
</div>
<div id="dlnow" class="hide">
<h4>Downloading...</h4>
<h4 id="prog"></h4>
</div>
</div>
<script type="text/javascript" src="../../js/common/about.js"></script>
<script type="text/javascript" src="../../js/platform/end.js"></script>
<script>
function skipper(){
$("#dlnow").addClass("hide");
$("#box").toggleClass("show");
if($("#box").hasClass("hide") && $("#skipper").hasClass("hide")){
$("#skipper").removeClass("hide");
$("#skipper").addClass("show");
}else{
$("#box").toggleClass("hide");
$("#skipper").toggleClass("hide");
$("#skipper").toggleClass("show");
}
}
var electron = require("electron");
var ipc = electron.ipcRenderer;
const shell=electron.shell;
verck();
function update(sel){
$("#box").toggleClass("show");
$("#box").toggleClass("hide");
$("#dlnow").toggleClass("hide");
$("#dlnow").toggleClass("show");
$("#prog").text("");
var remote=electron.remote;
var bit=process.arch;
var start="https://thedesk.top/ver.json";
fetch(start, {
method: 'GET',
headers: {'content-type': 'application/json'},
}).then(function(response) {
return response.json();
}).catch(function(error) {
todo(error);
console.error(error);
}).then(function(json) {
if(sel=="install"){
if(bit=="x64"){
var url=json["winx64"];
var file="TheDesk-setup.exe";
}else if(bit=="ia32"){
var url=json["winia32"];
var file="TheDesk-setup-ia32.exe";
}
}else if(sel=="portable"){
if(bit=="x64"){
var url=json["winx64p"];
var file="TheDesk.exe";
}else if(bit=="ia32"){
var url=json["winia32p"];
var file="TheDesk-ia32.exe";
}
}else if(sel=="linux"){
if(bit=="x64"){
var url=json["linuxx64"];
var file="TheDesk-linux-x64.zip";
}else if(bit=="ia32"){
var url=json["linuxia64"];
var file="TheDesk-linux-ia32.zip";
}
}else if(sel=="mac"){
var url=json["mac"];
shell.openExternal(url);
} }
ipc.send('download-btn', [url,file]);
}); #start {
display: flex;
} justify-content: center;
function quit(){ align-items: center;
ipc.send('quit', 'go'); width: 100vw;
} height: calc(100vh - 2.5rem);
ipc.on('prog', function (event, arg) { text-align: center;
console.log(arg); }
$("body").css('background','linear-gradient(#fff 0%,#fff '+(1-arg)*100+'%, #d7ccc8 '+(1-arg)*100+'%, #d7ccc8 100%)');
$("#prog").text(Math.floor(arg*100)+"%"); #checkbox {
}) text-align: left;
ipc.on('mess', function (event, arg) { }
console.log(arg);
$("#prog").text(arg); a,
}) button,
function verck(){ input,
var remote=electron.remote; label,
var platform=remote.process.platform; i {
var bit=process.arch; -webkit-app-region: no-drag;
if(platform=="win32"){ }
$('.windows').removeClass("hide")
}else if(platform=="linux"){ #updskip {
$('.linux').removeClass("hide") display: flex;
}else if(platform=="darwin"){ justify-content: center;
$('.mac').removeClass("hide") align-items: center;
} }
var start="https://thedesk.top/ver.json";
fetch(start, { .skipbtn {
method: 'GET', display: block;
headers: {'content-type': 'application/json'}, float: left;
}).then(function(response) { width: 200px;
return response.json(); height: 200px;
}).catch(function(error) { border: 1px solid;
todo(error); margin-left: 5px;
console.error(error); display: flex;
}).then(function(json) { justify-content: center;
console.log(json); align-items: center;
if(platform=="win32"){ border: 1px solid;
$("#ver").text(json.desk); overflow: hidden;
localStorage.setItem("next-ver",json.desk); }
}else if(platform=="linux"){
$("#ver").text(json.desk_linux); .skipbtn:hover {
localStorage.setItem("next-ver",json.desk_linux); background-color: #b3e5fc;
}else if(platform=="darwin"){ transition: all 0.3s ease-in-out;
$("#ver").text(json.desk_mac); }
localStorage.setItem("next-ver",json.desk_mac);
#prog {
font-size: 200%;
}
</style>
<script type="text/javascript" src="../../js/common/jquery.js"></script>
<script type="text/javascript" src="../../js/platform/first.js"></script>
<script type="text/javascript" src="../../js/common/materialize.js"></script>
<i class="material-icons pointer waves-effect" onclick="about();">info</i>
<i class="material-icons pointer waves-effect" onclick="skipper();">clear</i>
<!--a href="update.html">Reload</a-->
<div id="start">
<div id="box" class="show">
<h2>TheDesk</h2>
<p>Get latest TheDesk</p>
<span id="now"></span><b id="ver"></b><br>
<span id="det"></span><br>
<button class="waves-effect btn windows hide" onclick="update('install')"
style="margin-left:15px;">Installer ver.</button>
<button class="waves-effect btn windows hide" onclick="update('portable')"
style="margin-left:15px;">Portable ver.</button>
<button class="waves-effect btn linux hide" onclick="update('linux')"
style="margin-left:15px;">Start</button>
<button class="waves-effect btn mac hide" onclick="update('mac')"
style="margin-left:15px;">Start</button>
<br>
Some problems?<br>Please download on <a href="https://thedesk.top">Oficial HP</a>.
</div>
<div id="skipper" class="hide">
<h4>You may lose a cool experience!</h4>
Skip this update<br>
<div id="updskip">
<a onclick="window.close();" class="pointer skipbtn waves-effect waves-light">
<div>Until next TL loading</div>
</a>
<a onclick="nextv();" class="pointer skipbtn waves-effect waves-light">
<div>Until next version</div>
</a>
</div>
<a class="pointer waves-effect" onclick="skipper();" style="margin-top:5px">Continue updating</a>
</div>
<div id="dlnow" class="hide">
<h4>Downloading...</h4>
<h4 id="prog"></h4>
</div>
</div>
<script type="text/javascript" src="../../js/common/about.js"></script>
<script type="text/javascript" src="../../js/platform/end.js"></script>
<script>
function skipper() {
$("#dlnow").addClass("hide");
$("#box").toggleClass("show");
if ($("#box").hasClass("hide") && $("#skipper").hasClass("hide")) {
$("#skipper").removeClass("hide");
$("#skipper").addClass("show");
} else {
$("#box").toggleClass("hide");
$("#skipper").toggleClass("hide");
$("#skipper").toggleClass("show");
} }
var lang="en"; }
if(lang=="ja"){ var electron = require("electron");
$("#det").html(json.detail); var ipc = electron.ipcRenderer;
}else{ const shell = electron.shell;
$("#det").html(json.detail_en); verck();
function update(sel) {
$("#box").toggleClass("show");
$("#box").toggleClass("hide");
$("#dlnow").toggleClass("hide");
$("#dlnow").toggleClass("show");
$("#prog").text("");
var remote = electron.remote;
var bit = process.arch;
var start = "https://thedesk.top/ver.json";
fetch(start, {
method: 'GET',
headers: { 'content-type': 'application/json' },
}).then(function (response) {
return response.json();
}).catch(function (error) {
todo(error);
console.error(error);
}).then(function (json) {
if (sel == "install") {
if (bit == "x64") {
var url = json["winx64"];
var file = "TheDesk-setup.exe";
} else if (bit == "ia32") {
var url = json["winia32"];
var file = "TheDesk-setup-ia32.exe";
}
} else if (sel == "portable") {
if (bit == "x64") {
var url = json["winx64p"];
var file = "TheDesk.exe";
} else if (bit == "ia32") {
var url = json["winia32p"];
var file = "TheDesk-ia32.exe";
}
} else if (sel == "linux") {
if (bit == "x64") {
var url = json["linuxx64"];
var file = "TheDesk-linux-x64.zip";
} else if (bit == "ia32") {
var url = json["linuxia64"];
var file = "TheDesk-linux-ia32.zip";
}
} else if (sel == "mac") {
var url = json["mac"];
shell.openExternal(url);
}
ipc.send('download-btn', [url, file]);
});
}
function quit() {
ipc.send('quit', 'go');
}
ipc.on('prog', function (event, arg) {
console.log(arg);
$("body").css('background', 'linear-gradient(#fff 0%,#fff ' + (1 - arg) * 100 + '%, #d7ccc8 ' + (1 - arg) * 100 + '%, #d7ccc8 100%)');
$("#prog").text(Math.floor(arg * 100) + "%");
})
ipc.on('mess', function (event, arg) {
console.log(arg);
$("#prog").text(arg);
})
function verck() {
var remote = electron.remote;
var platform = remote.process.platform;
var bit = process.arch;
if (platform == "win32") {
$('.windows').removeClass("hide")
} else if (platform == "linux") {
$('.linux').removeClass("hide")
} else if (platform == "darwin") {
$('.mac').removeClass("hide")
} }
var start = "https://thedesk.top/ver.json";
$("#now").text(localStorage.getItem("ver")); fetch(start, {
method: 'GET',
}); headers: { 'content-type': 'application/json' },
} }).then(function (response) {
function nextv(){ return response.json();
localStorage.setItem("new-ver-skip","true"); }).catch(function (error) {
window.close(); todo(error);
} console.error(error);
function enc(ver){ }).then(function (json) {
var ver = ver.replace( /\s/g , "" ); console.log(json);
var ver = ver.replace( /\(/g , "-" ); if (platform == "win32") {
var ver = ver.replace( /\)/g , "" ); $("#ver").text(json.desk);
var ver = ver.replace( /\[/g , "_" ); localStorage.setItem("next-ver", json.desk);
var ver = ver.replace( /\]/g , "" ); } else if (platform == "linux") {
return ver; $("#ver").text(json.desk_linux);
} localStorage.setItem("next-ver", json.desk_linux);
</script> } else if (platform == "darwin") {
$("#ver").text(json.desk_mac);
localStorage.setItem("next-ver", json.desk_mac);
}
var lang = "en";
if (lang == "ja") {
$("#det").html(json.detail);
} else {
$("#det").html(json.detail_en);
}
$("#now").text(localStorage.getItem("ver"));
});
}
function nextv() {
localStorage.setItem("new-ver-skip", "true");
window.close();
}
function enc(ver) {
var ver = ver.replace(/\s/g, "");
var ver = ver.replace(/\(/g, "-");
var ver = ver.replace(/\)/g, "");
var ver = ver.replace(/\[/g, "_");
var ver = ver.replace(/\]/g, "");
return ver;
}
</script>

View File

@ -1,83 +1,122 @@
<!doctype html> <!doctype html>
<html lang="ja"> <html lang="ja">
<head> <head>
<title>Account Manager - TheDesk</title> <title>Account Manager - TheDesk</title>
<meta content="width=device-width,initial-scale=1.0" name="viewport"> <meta content="width=device-width,initial-scale=1.0" name="viewport">
<link href="../../css/materialize.css" type="text/css" rel="stylesheet"> <link href="../../css/materialize.css" type="text/css" rel="stylesheet">
<link href="../../css/themes.css" type="text/css" rel="stylesheet"> <link href="../../css/themes.css" type="text/css" rel="stylesheet">
<link href="../../css/master.css" type="text/css" rel="stylesheet"> <link href="../../css/master.css" type="text/css" rel="stylesheet">
<link href='../../css/font-awesome.css' rel='stylesheet' type='text/css'> <link href='../../css/font-awesome.css' rel='stylesheet' type='text/css'>
<link href='../../css/tl.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/userdata.css' rel='stylesheet' type='text/css'>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons|Open+Sans:300" rel="stylesheet"> <link href="https://fonts.googleapis.com/icon?family=Material+Icons|Open+Sans:300" rel="stylesheet">
<style>.acct{display:flex; justify-content:space-around;} <style>
.card{width:400px; background-color: #9e9e9e; margin:10px; } .acct {
body,html{overflow-y: scroll;} display: flex;
#acct-list{display:flex; flex-wrap:wrap; color:white; align-items: flex-start} justify-content: space-around;
.lts{font-size:150%} }
.colorsel{ display:flex; }
.card .colorsel div:not(.exc){width:20px;height:20px;} .card {
.card .colorsel div.exc{width:40px;height:20px;} width: 400px;
.first{ background-color: #9e9e9e;
display:flex; margin: 10px;
justify-content: center; }
align-items:center
} body,
.first .hide-first{ html {
display:none; overflow-y: scroll;
} }
</style>
<meta charset="utf-8"> #acct-list {
<!-- display: flex;
<script type="text/javascript"> flex-wrap: wrap;
var _jipt = []; color: white;
_jipt.push(['project', 'thedesk']); align-items: flex-start
</script> }
<script type="text/javascript" src="https://cdn.crowdin.com/jipt/jipt.js"></script>
--> .lts {
font-size: 150%
}
.colorsel {
display: flex;
}
.card .colorsel div:not(.exc) {
width: 20px;
height: 20px;
}
.card .colorsel div.exc {
width: 40px;
height: 20px;
}
.first {
display: flex;
justify-content: center;
align-items: center
}
.first .hide-first {
display: none;
}
</style>
<meta charset="utf-8">
<!--
<script type="text/javascript">
var _jipt = [];
_jipt.push(['project', 'thedesk']);
</script>
<script type="text/javascript" src="https://cdn.crowdin.com/jipt/jipt.js"></script>
-->
</head> </head>
<body id="mainView"> <body id="mainView">
<script type="text/javascript" src="../../js/common/jquery.js"></script> <script type="text/javascript" src="../../js/common/jquery.js"></script>
<script type="text/javascript" src="../../js/platform/first.js"></script> <script type="text/javascript" src="../../js/platform/first.js"></script>
<script type="text/javascript" src="../../js/common/materialize.js"></script> <script type="text/javascript" src="../../js/common/materialize.js"></script>
<script type="text/javascript" src="../../js/lang/lang.ja.js"></script> <script type="text/javascript" src="../../js/lang/lang.ja.js"></script>
<script> <script>
var misskeytoken=false; var misskeytoken = false;
</script> </script>
<script type="text/javascript" src="../../js/ui/tips.js"></script> <script type="text/javascript" src="../../js/ui/tips.js"></script>
<script type="text/javascript" src="../../js/common/time.js"></script> <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/common/modal.js"></script>
<div class="hide-first"> <div class="hide-first">
<a href="index.html" class="btn waves-effect orange nex" style="width:100%; max-width:200px;">戻る</a><br> <a href="index.html" class="btn waves-effect orange nex"
<h5>アカウント一覧</h5> style="width:100%; max-width:200px;">戻る</a><br>
<div id="acct-list"></div> <h5>アカウント一覧</h5>
<div class="divider"></div> <div id="acct-list"></div>
</div> <div class="divider"></div>
<div>
<h5>アカウントを追加</h5><br>
<div id="add">
<div class="row">
<div class="col s8">
<input type="text" id="url" style="width:70%" placeholder="ex)mstdn.jp">
<div id="ins-suggest"></div>
チェックを外すとコード貼り付けをスキップできます。(<u>Mastodon</u>にWindowsやmacOSからログインする場合)失敗する場合はチェックを入れてください。<br>
<input type="checkbox" class="filled-in" id="linux" />
<label for="linux">コードセットアップ</label><br>
<input type="checkbox" class="filled-in" id="misskey" />
<label for="misskey">Misskeyとしてログイン</label><br>
<button class="btn waves-effect" onclick="instance()">Login</button><br>
</div> </div>
<div class="col s4"> <div>
<span style="font-family:Open Sans;">Supports</span> <h5>アカウントを追加</h5><br>
<div id="support" class="collection transparent"></div> <div id="add">
</div> <div class="row">
</div></div> <div class="col s8">
<div id="auth" style="display:none"> <input type="text" id="url" style="width:70%" placeholder="ex)mstdn.jp">
指定されたコードを貼り付けてください。ログインウィンドウは閉じていただいて構いません。<br> <div id="ins-suggest"></div>
<input type="text" id="code" placeholder="コードを入力"> チェックを外すとコード貼り付けをスキップできます。(<u>Mastodon</u>にWindowsやmacOSからログインする場合)失敗する場合はチェックを入れてください。<br>
<button class="btn waves-effect" onclick="code()">Auth</button><br> <input type="checkbox" class="filled-in" id="linux" />
</div> <label for="linux">コードセットアップ</label><br>
<div id="misskeylogin" style="display:none"> <input type="checkbox" class="filled-in" id="misskey" />
<label for="misskey">Misskeyとしてログイン</label><br>
<button class="btn waves-effect" onclick="instance()">Login</button><br>
</div>
<div class="col s4">
<span style="font-family:Open Sans;">Supports</span>
<div id="support" class="collection transparent"></div>
</div>
</div>
</div>
<div id="auth" style="display:none">
指定されたコードを貼り付けてください。ログインウィンドウは閉じていただいて構いません。<br>
<input type="text" id="code" placeholder="コードを入力">
<button class="btn waves-effect" onclick="code()">Auth</button><br>
</div>
<div id="misskeylogin" style="display:none">
<h5>AppSecret</h5> <h5>AppSecret</h5>
<a href="https://thedesk.top/how-to-misskey-login.html">ドキュメント</a>を参照して正しいコードを入れてください。<br> <a href="https://thedesk.top/how-to-misskey-login.html">ドキュメント</a>を参照して正しいコードを入れてください。<br>
<input type="hidden" id="misskey-url"> <input type="hidden" id="misskey-url">
@ -85,30 +124,30 @@ body,html{overflow-y: scroll;}
<button class="btn waves-effect" onclick="misskeyLogin()">Auth</button><br> <button class="btn waves-effect" onclick="misskeyLogin()">Auth</button><br>
</div> </div>
</div> </div>
<div class="hide-first"> <div class="hide-first">
<h5>メインアカウント</h5> <h5>メインアカウント</h5>
<div class="input-field" style="width:300px"><span data-trans="your_acct">アカウントを選択</span> <div class="input-field" style="width:300px"><span data-trans="your_acct">アカウントを選択</span>
<br> <br>
<select id="main-acct-sel" class="acct-sel" style="color:black" onchange="mainacct()"></select> <select id="main-acct-sel" class="acct-sel" style="color:black" onchange="mainacct()"></select>
<label></label> <label></label>
</div> </div>
Some instance data by <a href="https://instances.social" target="_blank">instances.social API</a><br> Some instance data by <a href="https://instances.social" target="_blank">instances.social API</a><br>
<h5 id="ins-title"></h5> <h5 id="ins-title"></h5>
Administered by:<a id="ins-admin"></a><br> Administered by:<a id="ins-admin"></a><br>
<span id="ins-desc"></span><br> <span id="ins-desc"></span><br>
<img src="../../img/loading.svg" id="ins-prof" width="200"><br> <img src="../../img/loading.svg" id="ins-prof" width="200"><br>
<br> <br>
ドメイン名:<span id="ins-name"></span><br> ドメイン名:<span id="ins-name"></span><br>
接続サーバー数:<span id="ins-connect"></span><br> 接続サーバー数:<span id="ins-connect"></span><br>
トゥート数:<span id="ins-toot"></span><br> トゥート数:<span id="ins-toot"></span><br>
ユーザー数:<span id="ins-user"></span>ユーザー数<br> ユーザー数:<span id="ins-user"></span>ユーザー数<br>
コネクション:<span id="ins-per"></span>%<br> コネクション:<span id="ins-per"></span>%<br>
Mastodonバージョン:<span id="ins-ver"></span>@<span id="ins-upd"></span><br> Mastodonバージョン:<span id="ins-ver"></span>@<span id="ins-upd"></span><br>
</div> </div>
<script type="text/javascript" src="../../js/ui/theme.js"></script> <script type="text/javascript" src="../../js/ui/theme.js"></script>
<script type="text/javascript" src="../../js/platform/end.js"></script> <script type="text/javascript" src="../../js/platform/end.js"></script>
<script type="text/javascript" src="../../js/common/sha256.js"></script> <script type="text/javascript" src="../../js/common/sha256.js"></script>
<script type="text/javascript" src="../../js/login/tkn.js"></script> <script type="text/javascript" src="../../js/login/tkn.js"></script>
<script type="text/javascript" src="../../js/login/instance.js"></script> <script type="text/javascript" src="../../js/login/instance.js"></script>
<script type="text/javascript" src="../../js/login/manager.js"></script> <script type="text/javascript" src="../../js/login/manager.js"></script>
<script type="text/javascript" src="../../js/tl/date.js"></script> <script type="text/javascript" src="../../js/tl/date.js"></script>

View File

@ -98,10 +98,12 @@
title="箇条書きリスト">format_list_bulleted</i> title="箇条書きリスト">format_list_bulleted</i>
<i class="material-icons pointer setting waves-effect" onclick="markdown('1. ','yes','yes')" <i class="material-icons pointer setting waves-effect" onclick="markdown('1. ','yes','yes')"
title="番号付きリスト">format_list_numbered</i> title="番号付きリスト">format_list_numbered</i>
<i class="pointer setting fa fa-subscript waves-effect" onclick="markdown('__','yes','no','before')" <i class="pointer setting fa fa-subscript waves-effect"
title="下付き文字 テキストボックス内を選択してから押すと囲みます。" style="font-size:1.5rem"></i> onclick="markdown('__','yes','no','before')" title="下付き文字 テキストボックス内を選択してから押すと囲みます。"
<i class="pointer setting fa fa-superscript waves-effect" onclick="markdown('_','yes','no','before')" style="font-size:1.5rem"></i>
title="上付き文字 テキストボックス内を選択してから押すと囲みます。" style="font-size:1.5rem"></i> <i class="pointer setting fa fa-superscript waves-effect"
onclick="markdown('_','yes','no','before')" title="上付き文字 テキストボックス内を選択してから押すと囲みます。"
style="font-size:1.5rem"></i>
<i class="material-icons pointer setting waves-effect" onclick="tagsel('spin')" <i class="material-icons pointer setting waves-effect" onclick="tagsel('spin')"
title="回転 テキストボックス内を選択してから押すと囲みます。">autorenew</i> title="回転 テキストボックス内を選択してから押すと囲みます。">autorenew</i>
<i class="material-icons pointer setting waves-effect" onclick="tagsel('pulse')" <i class="material-icons pointer setting waves-effect" onclick="tagsel('pulse')"
@ -121,14 +123,19 @@
title="文字色変更 テキストボックス内を選択してから押すと囲みます。">color_lens</i> title="文字色変更 テキストボックス内を選択してから押すと囲みます。">color_lens</i>
<input id="colorhex" style="width: calc(50% - 50px); margin: 0; height: 24px;" type="color"> <input id="colorhex" style="width: calc(50% - 50px); margin: 0; height: 24px;" type="color">
<br> <br>
<i class="material-icons pointer setting waves-effect" onclick="markdownLink()" title="リンク挿入">link</i> <i class="material-icons pointer setting waves-effect" onclick="markdownLink()"
<input id="linkt" style="width: calc(50% - 20px); margin: 0; height: 24px;" placeholder="リンクテキスト">&nbsp; title="リンク挿入">link</i>
<input id="link2" style="width: calc(50% - 20px); margin: 0; height: 24px;" placeholder="リンクアドレス"> <input id="linkt" style="width: calc(50% - 20px); margin: 0; height: 24px;"
placeholder="リンクテキスト">&nbsp;
<input id="link2" style="width: calc(50% - 20px); margin: 0; height: 24px;"
placeholder="リンクアドレス">
<br> <br>
<i class="material-icons pointer setting waves-effect" onclick="markdownImage()" <i class="material-icons pointer setting waves-effect" onclick="markdownImage()"
title="インライン画像挿入">image</i> title="インライン画像挿入">image</i>
<input id="image" style="width: calc(50% - 20px); margin: 0; height: 24px;" placeholder="代替テキスト">&nbsp; <input id="image" style="width: calc(50% - 20px); margin: 0; height: 24px;"
<input id="image2" style="width: calc(50% - 20px); margin: 0; height: 24px;" placeholder="画像アドレス"> placeholder="代替テキスト">&nbsp;
<input id="image2" style="width: calc(50% - 20px); margin: 0; height: 24px;"
placeholder="画像アドレス">
</div> </div>
</div> </div>
<div class="input-field col s12" id="preview-field" style="margin-top: 0;"> <div class="input-field col s12" id="preview-field" style="margin-top: 0;">
@ -154,14 +161,15 @@
<div class="col s12 mize" style="margin-top: 0; display:flex; justify-content: space-between"> <div class="col s12 mize" style="margin-top: 0; display:flex; justify-content: space-between">
<i class="waves-effect gray material-icons" id="nsfw" title="画像に制限を付与" <i class="waves-effect gray material-icons" id="nsfw" title="画像に制限を付与"
onclick="nsfw()">visibility_off</i> onclick="nsfw()">visibility_off</i>
<i class="waves-effect gray material-icons purple-text dropdown-button" data-activates='dropdown1' <i class="waves-effect gray material-icons purple-text dropdown-button"
id="vis-icon">public</i> data-activates='dropdown1' id="vis-icon">public</i>
<a class="waves-effect gray" id="cw" onclick="cw()" title="コンテンツワーニング(トゥートを表示する前にメッセージで隠す)">CW</a> <a class="waves-effect gray" id="cw" onclick="cw()" title="コンテンツワーニング(トゥートを表示する前にメッセージで隠す)">CW</a>
<span><span id="imgup"></span><span id="imgsel"><i class="waves-effect material-icons gray" <span><span id="imgup"></span><span id="imgsel"><i class="waves-effect material-icons gray"
onclick="fileselect()" title="ファイルを選択">photo_library</i></span></span> onclick="fileselect()" title="ファイルを選択">photo_library</i></span></span>
<i class="waves-effect gray material-icons" onclick="emojiToggle()" id="emojibtn" <i class="waves-effect gray material-icons" onclick="emojiToggle()" id="emojibtn"
title="絵文字を挿入">tag_faces</i> title="絵文字を挿入">tag_faces</i>
<i class="waves-effect gray material-icons dropdown-button" data-activates='dropdown2'>more_vert</i> <i class="waves-effect gray material-icons dropdown-button"
data-activates='dropdown2'>more_vert</i>
<i class="material-icons nex gray waves-effect" title="トゥートボックスのクリア(Ctrl+Shit+C)" <i class="material-icons nex gray waves-effect" title="トゥートボックスのクリア(Ctrl+Shit+C)"
data-trans-title="post_box_clear" id="clear">clear</i> data-trans-title="post_box_clear" id="clear">clear</i>
</div> </div>
@ -176,13 +184,15 @@
<br> <br>
<input type="text" id="cw-text" placeholder="警告文" class="mize" style="margin:0"> <input type="text" id="cw-text" placeholder="警告文" class="mize" style="margin:0">
<div id="sch-box">時間指定投稿<br><span class="sml">2.7.0~ 5分以内には投稿できません。サーバーの時計が正確とは限りません。</span><br> <div id="sch-box">時間指定投稿<br><span class="sml">2.7.0~ 5分以内には投稿できません。サーバーの時計が正確とは限りません。</span><br>
<input type="datetime-local" id="sch-date" placeholder="時間指定投稿" class="datepicker" style="margin:0"> <input type="datetime-local" id="sch-date" placeholder="時間指定投稿" class="datepicker"
style="margin:0">
</div> </div>
</div> </div>
</div> </div>
<!-- 公開範囲 Dropdown Structure --> <!-- 公開範囲 Dropdown Structure -->
<ul id='dropdown1' class='dropdown-content'> <ul id='dropdown1' class='dropdown-content'>
<li style="font-size: 16px; display: block; line-height: 22px; padding: 14px 16px;">公開範囲指定</li> <li style="font-size: 16px; display: block; line-height: 22px; padding: 14px 16px;">公開範囲指定
</li>
<li> <li>
<a onclick="vis('public')">公開(Public)</a> <a onclick="vis('public')">公開(Public)</a>
</li> </li>
@ -228,8 +238,9 @@
<div id="toot-btn-field"> <div id="toot-btn-field">
<button class="btn waves-effect indigo unmize toot-btn-group" onclick="post()" <button class="btn waves-effect indigo unmize toot-btn-group" onclick="post()"
id="toot-post-btn">トゥート</button> id="toot-post-btn">トゥート</button>
<button class="btn waves-effect indigo darken-3 unmize hide toot-btn-group" onclick="sec()" id="toot-sec-btn"><i <button class="btn waves-effect indigo darken-3 unmize hide toot-btn-group" onclick="sec()"
class="material-icons" id="toot-sec-icon" title="セカンダリートゥート">lock_open</i></button> id="toot-sec-btn"><i class="material-icons" id="toot-sec-icon"
title="セカンダリートゥート">lock_open</i></button>
</div> </div>
</div> </div>
<div id="right-side"> <div id="right-side">
@ -398,12 +409,12 @@
class="fas fa-share"></i></button> class="fas fa-share"></i></button>
</div> </div>
<div class="col s2"> <div class="col s2">
<button class="dropdown-button btn waves-effect indigo" style="width:100%;" onclick="staEx('rt')"><i <button class="dropdown-button btn waves-effect indigo" style="width:100%;"
class="fas fa-retweet"></i></button> onclick="staEx('rt')"><i class="fas fa-retweet"></i></button>
</div> </div>
<div class="col s2"> <div class="col s2">
<button class="dropdown-button btn waves-effect orange" style="width:100%;" onclick="staEx('fav')"><i <button class="dropdown-button btn waves-effect orange" style="width:100%;"
class="fas fa-star"></i></button> onclick="staEx('fav')"><i class="fas fa-star"></i></button>
</div> </div>
</div> </div>
<div id="toot-tools"> <div id="toot-tools">
@ -449,8 +460,8 @@
<div id="his-plus-action"> <div id="his-plus-action">
<a href="#!" class="btn waves-effect waves-effect blue-grey btn-flat" id="his-emp-btn" <a href="#!" class="btn waves-effect waves-effect blue-grey btn-flat" id="his-emp-btn"
onclick="empUser()">ユーザー強調</a> onclick="empUser()">ユーザー強調</a>
<a href="#!" class="btn waves-effect waves-effect blue-grey btn-flat only-his-data" id="his-end-btn" <a href="#!" class="btn waves-effect waves-effect blue-grey btn-flat only-his-data"
onclick="pinUser()">紹介する</a><br> id="his-end-btn" onclick="pinUser()">紹介する</a><br>
<a href="#!" class="btn waves-effect waves-effect blue-grey btn-flat" id="his-openin" <a href="#!" class="btn waves-effect waves-effect blue-grey btn-flat" id="his-openin"
onclick="profbrws()">ブラウザで開く</a><br> onclick="profbrws()">ブラウザで開く</a><br>
</div><br> </div><br>
@ -471,10 +482,12 @@
<a go="#his-follow-list" title="フォロー"><i class="material-icons">people</i></a> <a go="#his-follow-list" title="フォロー"><i class="material-icons">people</i></a>
</li> </li>
<li class="custom-tab col my-data-width"> <li class="custom-tab col my-data-width">
<a go="#his-follower-list" title="フォロワー"><i class="material-icons">people</i></a> <a go="#his-follower-list" title="フォロワー"><i
class="material-icons">people</i></a>
</li> </li>
<li class="custom-tab col my-data-width only-his-data"> <li class="custom-tab col my-data-width only-his-data">
<a go="#his-action" title="他のアカウントで操作"><i class="material-icons">account_box</i></a> <a go="#his-action" title="他のアカウントで操作"><i
class="material-icons">account_box</i></a>
</li> </li>
<li class="custom-tab col my-data-width only-his-data"> <li class="custom-tab col my-data-width only-his-data">
<a go="#his-list" title="リスト"><i class="material-icons">list</i></a> <a go="#his-list" title="リスト"><i class="material-icons">list</i></a>
@ -486,20 +499,23 @@
<a go="#his-blocking-list" title="ブロック"><i class="material-icons">block</i></a> <a go="#his-blocking-list" title="ブロック"><i class="material-icons">block</i></a>
</li> </li>
<li class="custom-tab col my-data-width only-my-data"> <li class="custom-tab col my-data-width only-my-data">
<a go="#his-blocking-list" title="ブロック"><i class="material-icons">voice_over_off</i></a> <a go="#his-blocking-list" title="ブロック"><i
class="material-icons">voice_over_off</i></a>
</li> </li>
<li class="custom-tab col my-data-width only-my-data"> <li class="custom-tab col my-data-width only-my-data">
<a go="#his-domain-list" title="ドメインブロック"><i class="material-icons">language</i><i <a go="#his-domain-list" title="ドメインブロック"><i
class="material-icons">block</i></a> class="material-icons">language</i><i class="material-icons">block</i></a>
</li> </li>
<li class="custom-tab col my-data-width only-my-data"> <li class="custom-tab col my-data-width only-my-data">
<a go="#his-prof-list" title="プロフィール編集"><i class="material-icons">create</i></a> <a go="#his-prof-list" title="プロフィール編集"><i class="material-icons">create</i></a>
</li> </li>
<li class="custom-tab col my-data-width only-my-data"> <li class="custom-tab col my-data-width only-my-data">
<a go="#his-request-list" title="フォローリクエスト"><i class="material-icons">how_to_reg</i></a> <a go="#his-request-list" title="フォローリクエスト"><i
class="material-icons">how_to_reg</i></a>
</li> </li>
<li class="custom-tab col my-data-width only-my-data"> <li class="custom-tab col my-data-width only-my-data">
<a go="#his-follow-recom-list" title="おすすめ"><i class="material-icons">recent_actors</i></a> <a go="#his-follow-recom-list" title="おすすめ"><i
class="material-icons">recent_actors</i></a>
</li> </li>
</ul> </ul>
</div> </div>
@ -523,10 +539,12 @@
</div> </div>
<div id="his-action" class="tab-content"> <div id="his-action" class="tab-content">
他のアカウントを使用するフォロー((解除はできません。))<br> 他のアカウントを使用するフォロー((解除はできません。))<br>
<div style="max-width:500px;"><select id="user-acct-sel" class="acct-sel"></select></div> <div style="max-width:500px;"><select id="user-acct-sel" class="acct-sel"></select></div>
<a href="#!" class="waves-effect btn" onclick="follow('selector','true')">フォロー</a><br> <a href="#!" class="waves-effect btn" onclick="follow('selector','true')">フォロー</a><br>
または<br> または<br>
<a href="#!" class="waves-effect btn" onclick="udgEx('selector', 'selector')">プロフィールを表示</a><br> <a href="#!" class="waves-effect btn"
onclick="udgEx('selector', 'selector')">プロフィールを表示</a><br>
</div> </div>
<div id="his-list" class="tab-content"> <div id="his-list" class="tab-content">
<div id="his-lists-a">リストに追加するためにはフォローが必要です。</div> <div id="his-lists-a">リストに追加するためにはフォローが必要です。</div>
@ -536,17 +554,20 @@
<div id="his-fav-list" class="tab-content"> <div id="his-fav-list" class="tab-content">
<div id="his-fav-list-contents" class="cont-series"> <div id="his-fav-list-contents" class="cont-series">
</div> </div>
<button class="btn waves-effect" style="width:100%; padding:0;" onclick="showFav('more')">もっと</button> <button class="btn waves-effect" style="width:100%; padding:0;"
onclick="showFav('more')">もっと</button>
</div> </div>
<div id="his-blocking-list" class="tab-content"> <div id="his-blocking-list" class="tab-content">
<div id="his-blocking-list-contents" class="cont-series"> <div id="his-blocking-list-contents" class="cont-series">
</div> </div>
<button class="btn waves-effect " style="width:100%; padding:0;" onclick="showBlo('more')">もっと</button> <button class="btn waves-effect " style="width:100%; padding:0;"
onclick="showBlo('more')">もっと</button>
</div> </div>
<div id="his-muting-list" class="tab-content"> <div id="his-muting-list" class="tab-content">
<div id="his-muting-list-contents" class="cont-series"> <div id="his-muting-list-contents" class="cont-series">
</div> </div>
<button class="btn waves-effect " style="width:100%; padding:0;" onclick="showMut('more')">もっと</button> <button class="btn waves-effect " style="width:100%; padding:0;"
onclick="showMut('more')">もっと</button>
</div> </div>
<div id="his-domain-list" class="tab-content"> <div id="his-domain-list" class="tab-content">
<div id="his-domain-list-contents" class="cont-series"> <div id="his-domain-list-contents" class="cont-series">
@ -567,7 +588,8 @@
<textarea placeholder="自己紹介" id="his-des-val" class="materialize-textarea"></textarea> <textarea placeholder="自己紹介" id="his-des-val" class="materialize-textarea"></textarea>
<label for="his-des-val">自己紹介</label> <label for="his-des-val">自己紹介</label>
</div> </div>
<button class="btn waves-effect" style="width:100%; padding:0;" onclick="profedit()">変更</button> <button class="btn waves-effect" style="width:100%; padding:0;"
onclick="profedit()">変更</button>
<br>アバターを変更: <br>アバターを変更:
<span id="prof-change"> <span id="prof-change">
<input type="file" onchange="imgChange(this,'avatar')"> <input type="file" onchange="imgChange(this,'avatar')">
@ -580,7 +602,8 @@
<div id="his-request-list" class="tab-content"> <div id="his-request-list" class="tab-content">
<div id="his-request-list-contents" class="cont-series"> <div id="his-request-list-contents" class="cont-series">
</div> </div>
<button class="btn waves-effect " style="width:100%; padding:0;" onclick="showReq('more')">もっと</button> <button class="btn waves-effect " style="width:100%; padding:0;"
onclick="showReq('more')">もっと</button>
</div> </div>
<div id="his-follow-recom-list" class="tab-content"> <div id="his-follow-recom-list" class="tab-content">
<div id="his-follow-recom-contents" class="cont-series"> <div id="his-follow-recom-contents" class="cont-series">
@ -686,7 +709,8 @@
Amazonほしいものリスト Amazonほしいものリスト
</a> </a>
<br> <br>
<a href="mailto:web-pro@cutls.com" target="_blank">web-pro@cutls.com</a>にAmazonギフトカードを送る<br> <a href="mailto:web-pro@cutls.com"
target="_blank">web-pro@cutls.com</a>にAmazonギフトカードを送る<br>
Kyash<br> Kyash<br>
<img src="../../img/kyash.png" width="100"><br> <img src="../../img/kyash.png" width="100"><br>
</div> </div>
@ -720,7 +744,8 @@
class="material-icons">view_headline</i><span>リスト</span></div> class="material-icons">view_headline</i><span>リスト</span></div>
<div class="waves-effect" onclick="filterMenu()" id="filterMenu"><i <div class="waves-effect" onclick="filterMenu()" id="filterMenu"><i
class="material-icons">filter_list</i><span>フィルター</span></div> class="material-icons">filter_list</i><span>フィルター</span></div>
<div class="waves-effect" onclick="help()"><i class="material-icons">help_outline</i><span>ヘルプ</span></div> <div class="waves-effect" onclick="help()"><i
class="material-icons">help_outline</i><span>ヘルプ</span></div>
<div class="waves-effect" onclick="location.href='index.html'"><i <div class="waves-effect" onclick="location.href='index.html'"><i
class="material-icons">refresh</i><span>TL再読込</span></div> class="material-icons">refresh</i><span>TL再読込</span></div>
</div> </div>
@ -741,7 +766,8 @@
<div><i class="material-icons">people_outline</i></div><span>ローカル</span> <div><i class="material-icons">people_outline</i></div><span>ローカル</span>
</div> </div>
<div class="type waves-effect" data-type="local-media"> <div class="type waves-effect" data-type="local-media">
<div><i class="material-icons">people_outline</i><i class="material-icons sub-icon">perm_media</i> <div><i class="material-icons">people_outline</i><i
class="material-icons sub-icon">perm_media</i>
</div><span>ローカル(メディア)</span> </div><span>ローカル(メディア)</span>
</div> </div>
<div class="type waves-effect" data-type="home"> <div class="type waves-effect" data-type="home">
@ -751,7 +777,8 @@
<div><i class="material-icons">language</i></div><span>連合</span> <div><i class="material-icons">language</i></div><span>連合</span>
</div> </div>
<div class="type waves-effect" data-type="pub-media"> <div class="type waves-effect" data-type="pub-media">
<div><i class="material-icons">language</i><i class="material-icons sub-icon">perm_media</i></div> <div><i class="material-icons">language</i><i
class="material-icons sub-icon">perm_media</i></div>
<span>連合(メディア)</span> <span>連合(メディア)</span>
</div> </div>
<div class="type waves-effect" data-type="dm"> <div class="type waves-effect" data-type="dm">
@ -761,7 +788,8 @@
<div><i class="material-icons">merge_type</i></div><span>統合(ローカルとホーム)</span> <div><i class="material-icons">merge_type</i></div><span>統合(ローカルとホーム)</span>
</div> </div>
<div class="type waves-effect" data-type="plus"> <div class="type waves-effect" data-type="plus">
<div><i class="material-icons">merge_type</i><i class="material-icons sub-icon">reply</i></div> <div><i class="material-icons">merge_type</i><i
class="material-icons sub-icon">reply</i></div>
<span>統合(LTL+BT+返信)</span> <span>統合(LTL+BT+返信)</span>
</div> </div>
<div class="type waves-effect" data-type="notf"> <div class="type waves-effect" data-type="notf">
@ -791,8 +819,8 @@
<div class="input-field"> <div class="input-field">
<input id="src" type="text" class="validate" style="width:60%"> <input id="src" type="text" class="validate" style="width:60%">
<label for="src" data-trans="src">検索</label> <label for="src" data-trans="src">検索</label>
<button class="btn waves-effect indigo" style="width: 36%;padding: 0;padding-left: 15px;" onclick="src()" <button class="btn waves-effect indigo" style="width: 36%;padding: 0;padding-left: 15px;"
data-trans-i="src"> onclick="src()" data-trans-i="src">
<i class="material-icons left" style="margin:0">search</i>検索 <i class="material-icons left" style="margin:0">search</i>検索
</button> </button>
<br> <br>
@ -819,7 +847,8 @@
<label>選択(スクロールで全選択肢表示)</label> <label>選択(スクロールで全選択肢表示)</label>
</div> </div>
<div style="float:left; padding-top:8px; padding-bottom:28px;"> <div style="float:left; padding-top:8px; padding-bottom:28px;">
<button class="btn waves-effect indigo" style="width:80px;" onclick="list()" data-trans-i="lists"> <button class="btn waves-effect indigo" style="width:80px;" onclick="list()"
data-trans-i="lists">
一覧 一覧
</button> </button>
</div> </div>
@ -836,7 +865,8 @@
<label>選択(スクロールで全選択肢表示)</label> <label>選択(スクロールで全選択肢表示)</label>
</div> </div>
<div style="float:left; padding-top:8px; padding-bottom:28px;"> <div style="float:left; padding-top:8px; padding-bottom:28px;">
<button class="btn waves-effect indigo" style="width:80px;" onclick="filter()" data-trans-i="filters"> <button class="btn waves-effect indigo" style="width:80px;" onclick="filter()"
data-trans-i="filters">
一覧 一覧
</button> </button>
</div> </div>
@ -915,7 +945,8 @@
<i class="material-icons nex" title="設定(Ctrl+Shift+S)">settings</i> <i class="material-icons nex" title="設定(Ctrl+Shift+S)">settings</i>
</a> </a>
<a onclick="nano()" class="nex waves-effect"> <a onclick="nano()" class="nex waves-effect">
<i class="material-icons" title="最小のマストドン。TheDesk Nano" data-trans-title="nano_desp">remove_from_queue</i> <i class="material-icons" title="最小のマストドン。TheDesk Nano"
data-trans-title="nano_desp">remove_from_queue</i>
</a> </a>
<a onclick="menu()" class="nex waves-effect" id="list-tgl"> <a onclick="menu()" class="nex waves-effect" id="list-tgl">
<i class="material-icons" title="リスト">apps</i> <i class="material-icons" title="リスト">apps</i>

View File

@ -22,6 +22,7 @@
input { input {
max-height: 50px !important max-height: 50px !important
} }
.pcr-result { .pcr-result {
height: 1rem !important; height: 1rem !important;
} }
@ -157,11 +158,11 @@
<input type="hidden" id="color-picker2_value"> <input type="hidden" id="color-picker2_value">
</div> </div>
<div> <div>
<h5>Accent</h5>ブーストの背景色など <h5>Accent</h5>ブーストの背景色など
<div id="color-picker3-wrap"> <div id="color-picker3-wrap">
<div class="color-picker" id="color-picker3"></div> <div class="color-picker" id="color-picker3"></div>
</div> </div>
<input type="hidden" id="color-picker3_value"> <input type="hidden" id="color-picker3_value">
</div> </div>
</div> </div>
<button class="btn-large waves-effect" onclick="customComp()">変更</button>&nbsp;<button <button class="btn-large waves-effect" onclick="customComp()">変更</button>&nbsp;<button
@ -210,10 +211,14 @@
</template> </template>
</div> </div>
<h5>カスタム通知音</h5> <h5>カスタム通知音</h5>
<button class="btn waves-effect" style="width:120px;" onclick="customSound(1)">Custom 1</button><span id="c1-file"></span><br> <button class="btn waves-effect" style="width:120px;" onclick="customSound(1)">Custom 1</button><span
<button class="btn waves-effect" style="width:120px;" onclick="customSound(2)">Custom 2</button><span id="c2-file"></span><br> id="c1-file"></span><br>
<button class="btn waves-effect" style="width:120px;" onclick="customSound(3)">Custom 3</button><span id="c3-file"></span><br> <button class="btn waves-effect" style="width:120px;" onclick="customSound(2)">Custom 2</button><span
<button class="btn waves-effect" style="width:120px;" onclick="customSound(4)">Custom 4</button><span id="c4-file"></span><br> id="c2-file"></span><br>
<button class="btn waves-effect" style="width:120px;" onclick="customSound(3)">Custom 3</button><span
id="c3-file"></span><br>
<button class="btn waves-effect" style="width:120px;" onclick="customSound(4)">Custom 4</button><span
id="c4-file"></span><br>
</div> </div>
</li> </li>
<li> <li>

File diff suppressed because it is too large Load Diff

View File

@ -1,235 +1,256 @@
<!doctype html> <!doctype html>
<html lang="ja"> <html lang="ja">
<head> <head>
<title>Update - TheDesk</title> <title>Update - TheDesk</title>
<link href="../../css/materialize.css" type="text/css" rel="stylesheet"> <link href="../../css/materialize.css" type="text/css" rel="stylesheet">
<link href="../../css/master.css" type="text/css" rel="stylesheet"> <link href="../../css/master.css" type="text/css" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons|Open+Sans:300" rel="stylesheet"> <link href="https://fonts.googleapis.com/icon?family=Material+Icons|Open+Sans:300" rel="stylesheet">
<meta charset="utf-8"> <meta charset="utf-8">
<!-- <!--
<script type="text/javascript"> <script type="text/javascript">
var _jipt = []; var _jipt = [];
_jipt.push(['project', 'thedesk']); _jipt.push(['project', 'thedesk']);
</script> </script>
<script type="text/javascript" src="https://cdn.crowdin.com/jipt/jipt.js"></script> <script type="text/javascript" src="https://cdn.crowdin.com/jipt/jipt.js"></script>
--> -->
</head> </head>
<body> <body>
<style> <style>
body{ body {
font-family:'Open Sans'; font-family: 'Open Sans';
-webkit-app-region: drag; -webkit-app-region: drag;
cursor: move; cursor: move;
padding:10px; padding: 10px;
text-align:right; text-align: right;
}
#start{
display: flex;
justify-content: center;
align-items: center;
width:100vw;
height: calc(100vh - 2.5rem);
text-align:center;
}
#checkbox{
text-align:left;
}
a,button,input,label,i{
-webkit-app-region: no-drag;
}
#updskip{
display: flex;
justify-content: center;
align-items: center;
}
.skipbtn{
display:block;
float:left;
width:200px;
height:200px;
border:1px solid;
margin-left:5px;
display: flex;
justify-content: center;
align-items: center;
border: 1px solid;
overflow: hidden;
}
.skipbtn:hover{
background-color: #b3e5fc;
transition: all 0.3s ease-in-out;
}
#prog{
font-size:200%;
}
</style>
<script type="text/javascript" src="../../js/common/jquery.js"></script>
<script type="text/javascript" src="../../js/platform/first.js"></script>
<script type="text/javascript" src="../../js/common/materialize.js"></script>
<i class="material-icons pointer waves-effect" onclick="about();">info</i>
<i class="material-icons pointer waves-effect" onclick="skipper();">clear</i>
<!--a href="update.html">Reload</a-->
<div id="start">
<div id="box" class="show">
<h2>TheDesk</h2>
<p>アップデートがあります</p>
<span id="now"></span><b id="ver"></b><br>
<span id="det"></span><br>
<button class="waves-effect btn windows hide" onclick="update('install')" style="margin-left:15px;">インストーラー版(推奨)</button>
<button class="waves-effect btn windows hide" onclick="update('portable')" style="margin-left:15px;">ポータブル版</button>
<button class="waves-effect btn linux hide" onclick="update('linux')" style="margin-left:15px;">開始</button>
<button class="waves-effect btn mac hide" onclick="update('mac')" style="margin-left:15px;">開始</button>
<br>
問題が発生しますか?<br><a href="https://thedesk.top">公式HP</a>からダウンロードをお試しください。
</div>
<div id="skipper" class="hide">
<h4>アップデートは必ず行ってください</h4>
アップデートをスキップする<br>
<div id="updskip">
<a onclick="window.close();" class="pointer skipbtn waves-effect waves-light"><div>次回TL表示時まで</div></a>
<a onclick="nextv();" class="pointer skipbtn waves-effect waves-light"><div>次のバージョンが出るまで</div></a>
</div>
<a class="pointer waves-effect" onclick="skipper();" style="margin-top:5px">アップデートを続行</a>
</div>
<div id="dlnow" class="hide">
<h4>ダウンロード中</h4>
<h4 id="prog"></h4>
</div>
</div>
<script type="text/javascript" src="../../js/common/about.js"></script>
<script type="text/javascript" src="../../js/platform/end.js"></script>
<script>
function skipper(){
$("#dlnow").addClass("hide");
$("#box").toggleClass("show");
if($("#box").hasClass("hide") && $("#skipper").hasClass("hide")){
$("#skipper").removeClass("hide");
$("#skipper").addClass("show");
}else{
$("#box").toggleClass("hide");
$("#skipper").toggleClass("hide");
$("#skipper").toggleClass("show");
}
}
var electron = require("electron");
var ipc = electron.ipcRenderer;
const shell=electron.shell;
verck();
function update(sel){
$("#box").toggleClass("show");
$("#box").toggleClass("hide");
$("#dlnow").toggleClass("hide");
$("#dlnow").toggleClass("show");
$("#prog").text("");
var remote=electron.remote;
var bit=process.arch;
var start="https://thedesk.top/ver.json";
fetch(start, {
method: 'GET',
headers: {'content-type': 'application/json'},
}).then(function(response) {
return response.json();
}).catch(function(error) {
todo(error);
console.error(error);
}).then(function(json) {
if(sel=="install"){
if(bit=="x64"){
var url=json["winx64"];
var file="TheDesk-setup.exe";
}else if(bit=="ia32"){
var url=json["winia32"];
var file="TheDesk-setup-ia32.exe";
}
}else if(sel=="portable"){
if(bit=="x64"){
var url=json["winx64p"];
var file="TheDesk.exe";
}else if(bit=="ia32"){
var url=json["winia32p"];
var file="TheDesk-ia32.exe";
}
}else if(sel=="linux"){
if(bit=="x64"){
var url=json["linuxx64"];
var file="TheDesk-linux-x64.zip";
}else if(bit=="ia32"){
var url=json["linuxia64"];
var file="TheDesk-linux-ia32.zip";
}
}else if(sel=="mac"){
var url=json["mac"];
shell.openExternal(url);
} }
ipc.send('download-btn', [url,file]);
}); #start {
display: flex;
} justify-content: center;
function quit(){ align-items: center;
ipc.send('quit', 'go'); width: 100vw;
} height: calc(100vh - 2.5rem);
ipc.on('prog', function (event, arg) { text-align: center;
console.log(arg); }
$("body").css('background','linear-gradient(#fff 0%,#fff '+(1-arg)*100+'%, #d7ccc8 '+(1-arg)*100+'%, #d7ccc8 100%)');
$("#prog").text(Math.floor(arg*100)+"%"); #checkbox {
}) text-align: left;
ipc.on('mess', function (event, arg) { }
console.log(arg);
$("#prog").text(arg); a,
}) button,
function verck(){ input,
var remote=electron.remote; label,
var platform=remote.process.platform; i {
var bit=process.arch; -webkit-app-region: no-drag;
if(platform=="win32"){ }
$('.windows').removeClass("hide")
}else if(platform=="linux"){ #updskip {
$('.linux').removeClass("hide") display: flex;
}else if(platform=="darwin"){ justify-content: center;
$('.mac').removeClass("hide") align-items: center;
} }
var start="https://thedesk.top/ver.json";
fetch(start, { .skipbtn {
method: 'GET', display: block;
headers: {'content-type': 'application/json'}, float: left;
}).then(function(response) { width: 200px;
return response.json(); height: 200px;
}).catch(function(error) { border: 1px solid;
todo(error); margin-left: 5px;
console.error(error); display: flex;
}).then(function(json) { justify-content: center;
console.log(json); align-items: center;
if(platform=="win32"){ border: 1px solid;
$("#ver").text(json.desk); overflow: hidden;
localStorage.setItem("next-ver",json.desk); }
}else if(platform=="linux"){
$("#ver").text(json.desk_linux); .skipbtn:hover {
localStorage.setItem("next-ver",json.desk_linux); background-color: #b3e5fc;
}else if(platform=="darwin"){ transition: all 0.3s ease-in-out;
$("#ver").text(json.desk_mac); }
localStorage.setItem("next-ver",json.desk_mac);
#prog {
font-size: 200%;
}
</style>
<script type="text/javascript" src="../../js/common/jquery.js"></script>
<script type="text/javascript" src="../../js/platform/first.js"></script>
<script type="text/javascript" src="../../js/common/materialize.js"></script>
<i class="material-icons pointer waves-effect" onclick="about();">info</i>
<i class="material-icons pointer waves-effect" onclick="skipper();">clear</i>
<!--a href="update.html">Reload</a-->
<div id="start">
<div id="box" class="show">
<h2>TheDesk</h2>
<p>アップデートがあります</p>
<span id="now"></span><b id="ver"></b><br>
<span id="det"></span><br>
<button class="waves-effect btn windows hide" onclick="update('install')"
style="margin-left:15px;">インストーラー版(推奨)</button>
<button class="waves-effect btn windows hide" onclick="update('portable')"
style="margin-left:15px;">ポータブル版</button>
<button class="waves-effect btn linux hide" onclick="update('linux')"
style="margin-left:15px;">開始</button>
<button class="waves-effect btn mac hide" onclick="update('mac')"
style="margin-left:15px;">開始</button>
<br>
問題が発生しますか?<br><a href="https://thedesk.top">公式HP</a>からダウンロードをお試しください。
</div>
<div id="skipper" class="hide">
<h4>アップデートは必ず行ってください</h4>
アップデートをスキップする<br>
<div id="updskip">
<a onclick="window.close();" class="pointer skipbtn waves-effect waves-light">
<div>次回TL表示時まで</div>
</a>
<a onclick="nextv();" class="pointer skipbtn waves-effect waves-light">
<div>次のバージョンが出るまで</div>
</a>
</div>
<a class="pointer waves-effect" onclick="skipper();" style="margin-top:5px">アップデートを続行</a>
</div>
<div id="dlnow" class="hide">
<h4>ダウンロード中</h4>
<h4 id="prog"></h4>
</div>
</div>
<script type="text/javascript" src="../../js/common/about.js"></script>
<script type="text/javascript" src="../../js/platform/end.js"></script>
<script>
function skipper() {
$("#dlnow").addClass("hide");
$("#box").toggleClass("show");
if ($("#box").hasClass("hide") && $("#skipper").hasClass("hide")) {
$("#skipper").removeClass("hide");
$("#skipper").addClass("show");
} else {
$("#box").toggleClass("hide");
$("#skipper").toggleClass("hide");
$("#skipper").toggleClass("show");
} }
var lang="ja"; }
if(lang=="ja"){ var electron = require("electron");
$("#det").html(json.detail); var ipc = electron.ipcRenderer;
}else{ const shell = electron.shell;
$("#det").html(json.detail_en); verck();
function update(sel) {
$("#box").toggleClass("show");
$("#box").toggleClass("hide");
$("#dlnow").toggleClass("hide");
$("#dlnow").toggleClass("show");
$("#prog").text("");
var remote = electron.remote;
var bit = process.arch;
var start = "https://thedesk.top/ver.json";
fetch(start, {
method: 'GET',
headers: { 'content-type': 'application/json' },
}).then(function (response) {
return response.json();
}).catch(function (error) {
todo(error);
console.error(error);
}).then(function (json) {
if (sel == "install") {
if (bit == "x64") {
var url = json["winx64"];
var file = "TheDesk-setup.exe";
} else if (bit == "ia32") {
var url = json["winia32"];
var file = "TheDesk-setup-ia32.exe";
}
} else if (sel == "portable") {
if (bit == "x64") {
var url = json["winx64p"];
var file = "TheDesk.exe";
} else if (bit == "ia32") {
var url = json["winia32p"];
var file = "TheDesk-ia32.exe";
}
} else if (sel == "linux") {
if (bit == "x64") {
var url = json["linuxx64"];
var file = "TheDesk-linux-x64.zip";
} else if (bit == "ia32") {
var url = json["linuxia64"];
var file = "TheDesk-linux-ia32.zip";
}
} else if (sel == "mac") {
var url = json["mac"];
shell.openExternal(url);
}
ipc.send('download-btn', [url, file]);
});
}
function quit() {
ipc.send('quit', 'go');
}
ipc.on('prog', function (event, arg) {
console.log(arg);
$("body").css('background', 'linear-gradient(#fff 0%,#fff ' + (1 - arg) * 100 + '%, #d7ccc8 ' + (1 - arg) * 100 + '%, #d7ccc8 100%)');
$("#prog").text(Math.floor(arg * 100) + "%");
})
ipc.on('mess', function (event, arg) {
console.log(arg);
$("#prog").text(arg);
})
function verck() {
var remote = electron.remote;
var platform = remote.process.platform;
var bit = process.arch;
if (platform == "win32") {
$('.windows').removeClass("hide")
} else if (platform == "linux") {
$('.linux').removeClass("hide")
} else if (platform == "darwin") {
$('.mac').removeClass("hide")
} }
var start = "https://thedesk.top/ver.json";
$("#now").text(localStorage.getItem("ver")); fetch(start, {
method: 'GET',
}); headers: { 'content-type': 'application/json' },
} }).then(function (response) {
function nextv(){ return response.json();
localStorage.setItem("new-ver-skip","true"); }).catch(function (error) {
window.close(); todo(error);
} console.error(error);
function enc(ver){ }).then(function (json) {
var ver = ver.replace( /\s/g , "" ); console.log(json);
var ver = ver.replace( /\(/g , "-" ); if (platform == "win32") {
var ver = ver.replace( /\)/g , "" ); $("#ver").text(json.desk);
var ver = ver.replace( /\[/g , "_" ); localStorage.setItem("next-ver", json.desk);
var ver = ver.replace( /\]/g , "" ); } else if (platform == "linux") {
return ver; $("#ver").text(json.desk_linux);
} localStorage.setItem("next-ver", json.desk_linux);
</script> } else if (platform == "darwin") {
$("#ver").text(json.desk_mac);
localStorage.setItem("next-ver", json.desk_mac);
}
var lang = "ja";
if (lang == "ja") {
$("#det").html(json.detail);
} else {
$("#det").html(json.detail_en);
}
$("#now").text(localStorage.getItem("ver"));
});
}
function nextv() {
localStorage.setItem("new-ver-skip", "true");
window.close();
}
function enc(ver) {
var ver = ver.replace(/\s/g, "");
var ver = ver.replace(/\(/g, "-");
var ver = ver.replace(/\)/g, "");
var ver = ver.replace(/\[/g, "_");
var ver = ver.replace(/\]/g, "");
return ver;
}
</script>

View File

@ -1,83 +1,122 @@
<!doctype html> <!doctype html>
<html lang="@@lang@@"> <html lang="@@lang@@">
<head> <head>
<title>Account Manager - TheDesk</title> <title>Account Manager - TheDesk</title>
<meta content="width=device-width,initial-scale=1.0" name="viewport"> <meta content="width=device-width,initial-scale=1.0" name="viewport">
<link href="../../css/materialize.css" type="text/css" rel="stylesheet"> <link href="../../css/materialize.css" type="text/css" rel="stylesheet">
<link href="../../css/themes.css" type="text/css" rel="stylesheet"> <link href="../../css/themes.css" type="text/css" rel="stylesheet">
<link href="../../css/master.css" type="text/css" rel="stylesheet"> <link href="../../css/master.css" type="text/css" rel="stylesheet">
<link href='../../css/font-awesome.css' rel='stylesheet' type='text/css'> <link href='../../css/font-awesome.css' rel='stylesheet' type='text/css'>
<link href='../../css/tl.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/userdata.css' rel='stylesheet' type='text/css'>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons|Open+Sans:300" rel="stylesheet"> <link href="https://fonts.googleapis.com/icon?family=Material+Icons|Open+Sans:300" rel="stylesheet">
<style>.acct{display:flex; justify-content:space-around;} <style>
.card{width:400px; background-color: #9e9e9e; margin:10px; } .acct {
body,html{overflow-y: scroll;} display: flex;
#acct-list{display:flex; flex-wrap:wrap; color:white; align-items: flex-start} justify-content: space-around;
.lts{font-size:150%} }
.colorsel{ display:flex; }
.card .colorsel div:not(.exc){width:20px;height:20px;} .card {
.card .colorsel div.exc{width:40px;height:20px;} width: 400px;
.first{ background-color: #9e9e9e;
display:flex; margin: 10px;
justify-content: center; }
align-items:center
} body,
.first .hide-first{ html {
display:none; overflow-y: scroll;
} }
</style>
<meta charset="utf-8"> #acct-list {
@@comment-start@@ display: flex;
<script type="text/javascript"> flex-wrap: wrap;
var _jipt = []; color: white;
_jipt.push(['project', 'thedesk']); align-items: flex-start
</script> }
<script type="text/javascript" src="https://cdn.crowdin.com/jipt/jipt.js"></script>
@@comment-end@@ .lts {
font-size: 150%
}
.colorsel {
display: flex;
}
.card .colorsel div:not(.exc) {
width: 20px;
height: 20px;
}
.card .colorsel div.exc {
width: 40px;
height: 20px;
}
.first {
display: flex;
justify-content: center;
align-items: center
}
.first .hide-first {
display: none;
}
</style>
<meta charset="utf-8">
@@comment-start@@
<script type="text/javascript">
var _jipt = [];
_jipt.push(['project', 'thedesk']);
</script>
<script type="text/javascript" src="https://cdn.crowdin.com/jipt/jipt.js"></script>
@@comment-end@@
</head> </head>
<body id="mainView"> <body id="mainView">
<script type="text/javascript" src="../../js/common/jquery.js"></script> <script type="text/javascript" src="../../js/common/jquery.js"></script>
<script type="text/javascript" src="../../js/platform/first.js"></script> <script type="text/javascript" src="../../js/platform/first.js"></script>
<script type="text/javascript" src="../../js/common/materialize.js"></script> <script type="text/javascript" src="../../js/common/materialize.js"></script>
<script type="text/javascript" src="../../js/lang/lang.@@lang@@.js"></script> <script type="text/javascript" src="../../js/lang/lang.@@lang@@.js"></script>
<script> <script>
var misskeytoken=false; var misskeytoken = false;
</script> </script>
<script type="text/javascript" src="../../js/ui/tips.js"></script> <script type="text/javascript" src="../../js/ui/tips.js"></script>
<script type="text/javascript" src="../../js/common/time.js"></script> <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/common/modal.js"></script>
<div class="hide-first"> <div class="hide-first">
<a href="index.html" class="btn waves-effect orange nex" style="width:100%; max-width:200px;">@@back@@</a><br> <a href="index.html" class="btn waves-effect orange nex"
<h5>@@list@@</h5> style="width:100%; max-width:200px;">@@back@@</a><br>
<div id="acct-list"></div> <h5>@@list@@</h5>
<div class="divider"></div> <div id="acct-list"></div>
</div> <div class="divider"></div>
<div>
<h5>@@add@@</h5><br>
<div id="add">
<div class="row">
<div class="col s8">
<input type="text" id="url" style="width:70%" placeholder="ex)mstdn.jp">
<div id="ins-suggest"></div>
@@codesetupwarn@@<br>
<input type="checkbox" class="filled-in" id="linux" />
<label for="linux">@@codesetup@@</label><br>
<input type="checkbox" class="filled-in" id="misskey" />
<label for="misskey">@@thisismisskey@@</label><br>
<button class="btn waves-effect" onclick="instance()">Login</button><br>
</div> </div>
<div class="col s4"> <div>
<span style="font-family:Open Sans;">Supports</span> <h5>@@add@@</h5><br>
<div id="support" class="collection transparent"></div> <div id="add">
</div> <div class="row">
</div></div> <div class="col s8">
<div id="auth" style="display:none"> <input type="text" id="url" style="width:70%" placeholder="ex)mstdn.jp">
@@codepastewarn@@<br> <div id="ins-suggest"></div>
<input type="text" id="code" placeholder="@@codepaste@@"> @@codesetupwarn@@<br>
<button class="btn waves-effect" onclick="code()">Auth</button><br> <input type="checkbox" class="filled-in" id="linux" />
</div> <label for="linux">@@codesetup@@</label><br>
<div id="misskeylogin" style="display:none"> <input type="checkbox" class="filled-in" id="misskey" />
<label for="misskey">@@thisismisskey@@</label><br>
<button class="btn waves-effect" onclick="instance()">Login</button><br>
</div>
<div class="col s4">
<span style="font-family:Open Sans;">Supports</span>
<div id="support" class="collection transparent"></div>
</div>
</div>
</div>
<div id="auth" style="display:none">
@@codepastewarn@@<br>
<input type="text" id="code" placeholder="@@codepaste@@">
<button class="btn waves-effect" onclick="code()">Auth</button><br>
</div>
<div id="misskeylogin" style="display:none">
<h5>AppSecret</h5> <h5>AppSecret</h5>
@@misskeylogin@@<br> @@misskeylogin@@<br>
<input type="hidden" id="misskey-url"> <input type="hidden" id="misskey-url">
@ -85,30 +124,30 @@ body,html{overflow-y: scroll;}
<button class="btn waves-effect" onclick="misskeyLogin()">Auth</button><br> <button class="btn waves-effect" onclick="misskeyLogin()">Auth</button><br>
</div> </div>
</div> </div>
<div class="hide-first"> <div class="hide-first">
<h5>@@mainacct@@</h5> <h5>@@mainacct@@</h5>
<div class="input-field" style="width:300px"><span data-trans="your_acct">@@selacct@@</span> <div class="input-field" style="width:300px"><span data-trans="your_acct">@@selacct@@</span>
<br> <br>
<select id="main-acct-sel" class="acct-sel" style="color:black" onchange="mainacct()"></select> <select id="main-acct-sel" class="acct-sel" style="color:black" onchange="mainacct()"></select>
<label></label> <label></label>
</div> </div>
Some instance data by <a href="https://instances.social" target="_blank">instances.social API</a><br> Some instance data by <a href="https://instances.social" target="_blank">instances.social API</a><br>
<h5 id="ins-title"></h5> <h5 id="ins-title"></h5>
Administered by:<a id="ins-admin"></a><br> Administered by:<a id="ins-admin"></a><br>
<span id="ins-desc"></span><br> <span id="ins-desc"></span><br>
<img src="../../img/loading.svg" id="ins-prof" width="200"><br> <img src="../../img/loading.svg" id="ins-prof" width="200"><br>
<br> <br>
@@domain@@:<span id="ins-name"></span><br> @@domain@@:<span id="ins-name"></span><br>
@@connect@@:<span id="ins-connect"></span>@@ko@@<br> @@connect@@:<span id="ins-connect"></span>@@ko@@<br>
@@toots@@:<span id="ins-toot"></span>@@ko@@<br> @@toots@@:<span id="ins-toot"></span>@@ko@@<br>
@@users@@:<span id="ins-user"></span>@@users@@<br> @@users@@:<span id="ins-user"></span>@@users@@<br>
@@safety@@:<span id="ins-per"></span>%<br> @@safety@@:<span id="ins-per"></span>%<br>
@@ver@@:<span id="ins-ver"></span>@<span id="ins-upd"></span><br> @@ver@@:<span id="ins-ver"></span>@<span id="ins-upd"></span><br>
</div> </div>
<script type="text/javascript" src="../../js/ui/theme.js"></script> <script type="text/javascript" src="../../js/ui/theme.js"></script>
<script type="text/javascript" src="../../js/platform/end.js"></script> <script type="text/javascript" src="../../js/platform/end.js"></script>
<script type="text/javascript" src="../../js/common/sha256.js"></script> <script type="text/javascript" src="../../js/common/sha256.js"></script>
<script type="text/javascript" src="../../js/login/tkn.js"></script> <script type="text/javascript" src="../../js/login/tkn.js"></script>
<script type="text/javascript" src="../../js/login/instance.js"></script> <script type="text/javascript" src="../../js/login/instance.js"></script>
<script type="text/javascript" src="../../js/login/manager.js"></script> <script type="text/javascript" src="../../js/login/manager.js"></script>
<script type="text/javascript" src="../../js/tl/date.js"></script> <script type="text/javascript" src="../../js/tl/date.js"></script>

View File

@ -98,10 +98,12 @@
title="箇条書きリスト">format_list_bulleted</i> title="箇条書きリスト">format_list_bulleted</i>
<i class="material-icons pointer setting waves-effect" onclick="markdown('1. ','yes','yes')" <i class="material-icons pointer setting waves-effect" onclick="markdown('1. ','yes','yes')"
title="番号付きリスト">format_list_numbered</i> title="番号付きリスト">format_list_numbered</i>
<i class="pointer setting fa fa-subscript waves-effect" onclick="markdown('__','yes','no','before')" <i class="pointer setting fa fa-subscript waves-effect"
title="下付き文字 テキストボックス内を選択してから押すと囲みます。" style="font-size:1.5rem"></i> onclick="markdown('__','yes','no','before')" title="下付き文字 テキストボックス内を選択してから押すと囲みます。"
<i class="pointer setting fa fa-superscript waves-effect" onclick="markdown('_','yes','no','before')" style="font-size:1.5rem"></i>
title="上付き文字 テキストボックス内を選択してから押すと囲みます。" style="font-size:1.5rem"></i> <i class="pointer setting fa fa-superscript waves-effect"
onclick="markdown('_','yes','no','before')" title="上付き文字 テキストボックス内を選択してから押すと囲みます。"
style="font-size:1.5rem"></i>
<i class="material-icons pointer setting waves-effect" onclick="tagsel('spin')" <i class="material-icons pointer setting waves-effect" onclick="tagsel('spin')"
title="回転 テキストボックス内を選択してから押すと囲みます。">autorenew</i> title="回転 テキストボックス内を選択してから押すと囲みます。">autorenew</i>
<i class="material-icons pointer setting waves-effect" onclick="tagsel('pulse')" <i class="material-icons pointer setting waves-effect" onclick="tagsel('pulse')"
@ -121,14 +123,19 @@
title="文字色変更 テキストボックス内を選択してから押すと囲みます。">color_lens</i> title="文字色変更 テキストボックス内を選択してから押すと囲みます。">color_lens</i>
<input id="colorhex" style="width: calc(50% - 50px); margin: 0; height: 24px;" type="color"> <input id="colorhex" style="width: calc(50% - 50px); margin: 0; height: 24px;" type="color">
<br> <br>
<i class="material-icons pointer setting waves-effect" onclick="markdownLink()" title="リンク挿入">link</i> <i class="material-icons pointer setting waves-effect" onclick="markdownLink()"
<input id="linkt" style="width: calc(50% - 20px); margin: 0; height: 24px;" placeholder="リンクテキスト">&nbsp; title="リンク挿入">link</i>
<input id="link2" style="width: calc(50% - 20px); margin: 0; height: 24px;" placeholder="リンクアドレス"> <input id="linkt" style="width: calc(50% - 20px); margin: 0; height: 24px;"
placeholder="リンクテキスト">&nbsp;
<input id="link2" style="width: calc(50% - 20px); margin: 0; height: 24px;"
placeholder="リンクアドレス">
<br> <br>
<i class="material-icons pointer setting waves-effect" onclick="markdownImage()" <i class="material-icons pointer setting waves-effect" onclick="markdownImage()"
title="インライン画像挿入">image</i> title="インライン画像挿入">image</i>
<input id="image" style="width: calc(50% - 20px); margin: 0; height: 24px;" placeholder="代替テキスト">&nbsp; <input id="image" style="width: calc(50% - 20px); margin: 0; height: 24px;"
<input id="image2" style="width: calc(50% - 20px); margin: 0; height: 24px;" placeholder="画像アドレス"> placeholder="代替テキスト">&nbsp;
<input id="image2" style="width: calc(50% - 20px); margin: 0; height: 24px;"
placeholder="画像アドレス">
</div> </div>
</div> </div>
<div class="input-field col s12" id="preview-field" style="margin-top: 0;"> <div class="input-field col s12" id="preview-field" style="margin-top: 0;">
@ -154,14 +161,15 @@
<div class="col s12 mize" style="margin-top: 0; display:flex; justify-content: space-between"> <div class="col s12 mize" style="margin-top: 0; display:flex; justify-content: space-between">
<i class="waves-effect gray material-icons" id="nsfw" title="@@nsfwDes@@" <i class="waves-effect gray material-icons" id="nsfw" title="@@nsfwDes@@"
onclick="nsfw()">visibility_off</i> onclick="nsfw()">visibility_off</i>
<i class="waves-effect gray material-icons purple-text dropdown-button" data-activates='dropdown1' <i class="waves-effect gray material-icons purple-text dropdown-button"
id="vis-icon">public</i> data-activates='dropdown1' id="vis-icon">public</i>
<a class="waves-effect gray" id="cw" onclick="cw()" title="@@cwDes@@">CW</a> <a class="waves-effect gray" id="cw" onclick="cw()" title="@@cwDes@@">CW</a>
<span><span id="imgup"></span><span id="imgsel"><i class="waves-effect material-icons gray" <span><span id="imgup"></span><span id="imgsel"><i class="waves-effect material-icons gray"
onclick="fileselect()" title="@@selfile@@">photo_library</i></span></span> onclick="fileselect()" title="@@selfile@@">photo_library</i></span></span>
<i class="waves-effect gray material-icons" onclick="emojiToggle()" id="emojibtn" <i class="waves-effect gray material-icons" onclick="emojiToggle()" id="emojibtn"
title="@@insertEmoji@@">tag_faces</i> title="@@insertEmoji@@">tag_faces</i>
<i class="waves-effect gray material-icons dropdown-button" data-activates='dropdown2'>more_vert</i> <i class="waves-effect gray material-icons dropdown-button"
data-activates='dropdown2'>more_vert</i>
<i class="material-icons nex gray waves-effect" title="@@clearToot@@(Ctrl+Shit+C)" <i class="material-icons nex gray waves-effect" title="@@clearToot@@(Ctrl+Shit+C)"
data-trans-title="post_box_clear" id="clear">clear</i> data-trans-title="post_box_clear" id="clear">clear</i>
</div> </div>
@ -176,13 +184,15 @@
<br> <br>
<input type="text" id="cw-text" placeholder="@@cwtext@@" class="mize" style="margin:0"> <input type="text" id="cw-text" placeholder="@@cwtext@@" class="mize" style="margin:0">
<div id="sch-box">@@postat@@<br><span class="sml">@@scheduleWarn@@</span><br> <div id="sch-box">@@postat@@<br><span class="sml">@@scheduleWarn@@</span><br>
<input type="datetime-local" id="sch-date" placeholder="@@schedule@@" class="datepicker" style="margin:0"> <input type="datetime-local" id="sch-date" placeholder="@@schedule@@" class="datepicker"
style="margin:0">
</div> </div>
</div> </div>
</div> </div>
<!-- 公開範囲 Dropdown Structure --> <!-- 公開範囲 Dropdown Structure -->
<ul id='dropdown1' class='dropdown-content'> <ul id='dropdown1' class='dropdown-content'>
<li style="font-size: 16px; display: block; line-height: 22px; padding: 14px 16px;">@@selectVis@@</li> <li style="font-size: 16px; display: block; line-height: 22px; padding: 14px 16px;">@@selectVis@@
</li>
<li> <li>
<a onclick="vis('public')">@@publicJP@@(Public)</a> <a onclick="vis('public')">@@publicJP@@(Public)</a>
</li> </li>
@ -228,8 +238,9 @@
<div id="toot-btn-field"> <div id="toot-btn-field">
<button class="btn waves-effect indigo unmize toot-btn-group" onclick="post()" <button class="btn waves-effect indigo unmize toot-btn-group" onclick="post()"
id="toot-post-btn">@@toot@@</button> id="toot-post-btn">@@toot@@</button>
<button class="btn waves-effect indigo darken-3 unmize hide toot-btn-group" onclick="sec()" id="toot-sec-btn"><i <button class="btn waves-effect indigo darken-3 unmize hide toot-btn-group" onclick="sec()"
class="material-icons" id="toot-sec-icon" title="@@sectoot@@">lock_open</i></button> id="toot-sec-btn"><i class="material-icons" id="toot-sec-icon"
title="@@sectoot@@">lock_open</i></button>
</div> </div>
</div> </div>
<div id="right-side"> <div id="right-side">
@ -398,12 +409,12 @@
class="fas fa-share"></i></button> class="fas fa-share"></i></button>
</div> </div>
<div class="col s2"> <div class="col s2">
<button class="dropdown-button btn waves-effect indigo" style="width:100%;" onclick="staEx('rt')"><i <button class="dropdown-button btn waves-effect indigo" style="width:100%;"
class="fas fa-retweet"></i></button> onclick="staEx('rt')"><i class="fas fa-retweet"></i></button>
</div> </div>
<div class="col s2"> <div class="col s2">
<button class="dropdown-button btn waves-effect orange" style="width:100%;" onclick="staEx('fav')"><i <button class="dropdown-button btn waves-effect orange" style="width:100%;"
class="fas fa-star"></i></button> onclick="staEx('fav')"><i class="fas fa-star"></i></button>
</div> </div>
</div> </div>
<div id="toot-tools"> <div id="toot-tools">
@ -449,8 +460,8 @@
<div id="his-plus-action"> <div id="his-plus-action">
<a href="#!" class="btn waves-effect waves-effect blue-grey btn-flat" id="his-emp-btn" <a href="#!" class="btn waves-effect waves-effect blue-grey btn-flat" id="his-emp-btn"
onclick="empUser()">@@empUser@@</a> onclick="empUser()">@@empUser@@</a>
<a href="#!" class="btn waves-effect waves-effect blue-grey btn-flat only-his-data" id="his-end-btn" <a href="#!" class="btn waves-effect waves-effect blue-grey btn-flat only-his-data"
onclick="pinUser()">@@endorse@@</a><br> id="his-end-btn" onclick="pinUser()">@@endorse@@</a><br>
<a href="#!" class="btn waves-effect waves-effect blue-grey btn-flat" id="his-openin" <a href="#!" class="btn waves-effect waves-effect blue-grey btn-flat" id="his-openin"
onclick="profbrws()">@@openinbrowser@@</a><br> onclick="profbrws()">@@openinbrowser@@</a><br>
</div><br> </div><br>
@ -471,10 +482,12 @@
<a go="#his-follow-list" title="@@follow@@"><i class="material-icons">people</i></a> <a go="#his-follow-list" title="@@follow@@"><i class="material-icons">people</i></a>
</li> </li>
<li class="custom-tab col my-data-width"> <li class="custom-tab col my-data-width">
<a go="#his-follower-list" title="@@follower@@"><i class="material-icons">people</i></a> <a go="#his-follower-list" title="@@follower@@"><i
class="material-icons">people</i></a>
</li> </li>
<li class="custom-tab col my-data-width only-his-data"> <li class="custom-tab col my-data-width only-his-data">
<a go="#his-action" title="@@operateOtherAcct@@"><i class="material-icons">account_box</i></a> <a go="#his-action" title="@@operateOtherAcct@@"><i
class="material-icons">account_box</i></a>
</li> </li>
<li class="custom-tab col my-data-width only-his-data"> <li class="custom-tab col my-data-width only-his-data">
<a go="#his-list" title="@@list@@"><i class="material-icons">list</i></a> <a go="#his-list" title="@@list@@"><i class="material-icons">list</i></a>
@ -486,20 +499,23 @@
<a go="#his-blocking-list" title="@@blocks@@"><i class="material-icons">block</i></a> <a go="#his-blocking-list" title="@@blocks@@"><i class="material-icons">block</i></a>
</li> </li>
<li class="custom-tab col my-data-width only-my-data"> <li class="custom-tab col my-data-width only-my-data">
<a go="#his-blocking-list" title="@@blocks@@"><i class="material-icons">voice_over_off</i></a> <a go="#his-blocking-list" title="@@blocks@@"><i
class="material-icons">voice_over_off</i></a>
</li> </li>
<li class="custom-tab col my-data-width only-my-data"> <li class="custom-tab col my-data-width only-my-data">
<a go="#his-domain-list" title="@@domainBlock@@"><i class="material-icons">language</i><i <a go="#his-domain-list" title="@@domainBlock@@"><i
class="material-icons">block</i></a> class="material-icons">language</i><i class="material-icons">block</i></a>
</li> </li>
<li class="custom-tab col my-data-width only-my-data"> <li class="custom-tab col my-data-width only-my-data">
<a go="#his-prof-list" title="@@editProf@@"><i class="material-icons">create</i></a> <a go="#his-prof-list" title="@@editProf@@"><i class="material-icons">create</i></a>
</li> </li>
<li class="custom-tab col my-data-width only-my-data"> <li class="custom-tab col my-data-width only-my-data">
<a go="#his-request-list" title="@@followReq@@"><i class="material-icons">how_to_reg</i></a> <a go="#his-request-list" title="@@followReq@@"><i
class="material-icons">how_to_reg</i></a>
</li> </li>
<li class="custom-tab col my-data-width only-my-data"> <li class="custom-tab col my-data-width only-my-data">
<a go="#his-follow-recom-list" title="@@frc@@"><i class="material-icons">recent_actors</i></a> <a go="#his-follow-recom-list" title="@@frc@@"><i
class="material-icons">recent_actors</i></a>
</li> </li>
</ul> </ul>
</div> </div>
@ -523,10 +539,12 @@
</div> </div>
<div id="his-action" class="tab-content"> <div id="his-action" class="tab-content">
@@useOtherAcct1@@@@revoverJP@@@@follow@@(@@warnUseOtherAcct@@)<br> @@useOtherAcct1@@@@revoverJP@@@@follow@@(@@warnUseOtherAcct@@)<br>
<div style="max-width:500px;"><select id="user-acct-sel" class="acct-sel"></select></div>@@revoverJPde@@ <div style="max-width:500px;"><select id="user-acct-sel" class="acct-sel"></select></div>
@@revoverJPde@@
<a href="#!" class="waves-effect btn" onclick="follow('selector','true')">@@follow@@</a><br> <a href="#!" class="waves-effect btn" onclick="follow('selector','true')">@@follow@@</a><br>
@@or@@<br> @@or@@<br>
<a href="#!" class="waves-effect btn" onclick="udgEx('selector', 'selector')">@@openProf@@</a><br> <a href="#!" class="waves-effect btn"
onclick="udgEx('selector', 'selector')">@@openProf@@</a><br>
</div> </div>
<div id="his-list" class="tab-content"> <div id="his-list" class="tab-content">
<div id="his-lists-a">@@warnListRegist@@</div> <div id="his-lists-a">@@warnListRegist@@</div>
@ -536,17 +554,20 @@
<div id="his-fav-list" class="tab-content"> <div id="his-fav-list" class="tab-content">
<div id="his-fav-list-contents" class="cont-series"> <div id="his-fav-list-contents" class="cont-series">
</div> </div>
<button class="btn waves-effect" style="width:100%; padding:0;" onclick="showFav('more')">@@more@@</button> <button class="btn waves-effect" style="width:100%; padding:0;"
onclick="showFav('more')">@@more@@</button>
</div> </div>
<div id="his-blocking-list" class="tab-content"> <div id="his-blocking-list" class="tab-content">
<div id="his-blocking-list-contents" class="cont-series"> <div id="his-blocking-list-contents" class="cont-series">
</div> </div>
<button class="btn waves-effect " style="width:100%; padding:0;" onclick="showBlo('more')">@@more@@</button> <button class="btn waves-effect " style="width:100%; padding:0;"
onclick="showBlo('more')">@@more@@</button>
</div> </div>
<div id="his-muting-list" class="tab-content"> <div id="his-muting-list" class="tab-content">
<div id="his-muting-list-contents" class="cont-series"> <div id="his-muting-list-contents" class="cont-series">
</div> </div>
<button class="btn waves-effect " style="width:100%; padding:0;" onclick="showMut('more')">@@more@@</button> <button class="btn waves-effect " style="width:100%; padding:0;"
onclick="showMut('more')">@@more@@</button>
</div> </div>
<div id="his-domain-list" class="tab-content"> <div id="his-domain-list" class="tab-content">
<div id="his-domain-list-contents" class="cont-series"> <div id="his-domain-list-contents" class="cont-series">
@ -567,7 +588,8 @@
<textarea placeholder="@@note@@" id="his-des-val" class="materialize-textarea"></textarea> <textarea placeholder="@@note@@" id="his-des-val" class="materialize-textarea"></textarea>
<label for="his-des-val">@@note@@</label> <label for="his-des-val">@@note@@</label>
</div> </div>
<button class="btn waves-effect" style="width:100%; padding:0;" onclick="profedit()">@@change@@</button> <button class="btn waves-effect" style="width:100%; padding:0;"
onclick="profedit()">@@change@@</button>
<br>@@editProfImg@@: <br>@@editProfImg@@:
<span id="prof-change"> <span id="prof-change">
<input type="file" onchange="imgChange(this,'avatar')"> <input type="file" onchange="imgChange(this,'avatar')">
@ -580,7 +602,8 @@
<div id="his-request-list" class="tab-content"> <div id="his-request-list" class="tab-content">
<div id="his-request-list-contents" class="cont-series"> <div id="his-request-list-contents" class="cont-series">
</div> </div>
<button class="btn waves-effect " style="width:100%; padding:0;" onclick="showReq('more')">@@more@@</button> <button class="btn waves-effect " style="width:100%; padding:0;"
onclick="showReq('more')">@@more@@</button>
</div> </div>
<div id="his-follow-recom-list" class="tab-content"> <div id="his-follow-recom-list" class="tab-content">
<div id="his-follow-recom-contents" class="cont-series"> <div id="his-follow-recom-contents" class="cont-series">
@ -686,7 +709,8 @@
@@AWLSupport@@ @@AWLSupport@@
</a> </a>
<br> <br>
@@SendAmazonGift1@@<a href="mailto:web-pro@cutls.com" target="_blank">web-pro@cutls.com</a>@@SendAmazonGift2@@<br> @@SendAmazonGift1@@<a href="mailto:web-pro@cutls.com"
target="_blank">web-pro@cutls.com</a>@@SendAmazonGift2@@<br>
Kyash<br> Kyash<br>
<img src="../../img/kyash.png" width="100"><br> <img src="../../img/kyash.png" width="100"><br>
</div> </div>
@ -720,7 +744,8 @@
class="material-icons">view_headline</i><span>@@list@@</span></div> class="material-icons">view_headline</i><span>@@list@@</span></div>
<div class="waves-effect" onclick="filterMenu()" id="filterMenu"><i <div class="waves-effect" onclick="filterMenu()" id="filterMenu"><i
class="material-icons">filter_list</i><span>@@filter@@</span></div> class="material-icons">filter_list</i><span>@@filter@@</span></div>
<div class="waves-effect" onclick="help()"><i class="material-icons">help_outline</i><span>@@help@@</span></div> <div class="waves-effect" onclick="help()"><i
class="material-icons">help_outline</i><span>@@help@@</span></div>
<div class="waves-effect" onclick="location.href='index.html'"><i <div class="waves-effect" onclick="location.href='index.html'"><i
class="material-icons">refresh</i><span>@@f5@@</span></div> class="material-icons">refresh</i><span>@@f5@@</span></div>
</div> </div>
@ -741,7 +766,8 @@
<div><i class="material-icons">people_outline</i></div><span>@@local@@</span> <div><i class="material-icons">people_outline</i></div><span>@@local@@</span>
</div> </div>
<div class="type waves-effect" data-type="local-media"> <div class="type waves-effect" data-type="local-media">
<div><i class="material-icons">people_outline</i><i class="material-icons sub-icon">perm_media</i> <div><i class="material-icons">people_outline</i><i
class="material-icons sub-icon">perm_media</i>
</div><span>@@localMedia@@</span> </div><span>@@localMedia@@</span>
</div> </div>
<div class="type waves-effect" data-type="home"> <div class="type waves-effect" data-type="home">
@ -751,7 +777,8 @@
<div><i class="material-icons">language</i></div><span>@@fed@@</span> <div><i class="material-icons">language</i></div><span>@@fed@@</span>
</div> </div>
<div class="type waves-effect" data-type="pub-media"> <div class="type waves-effect" data-type="pub-media">
<div><i class="material-icons">language</i><i class="material-icons sub-icon">perm_media</i></div> <div><i class="material-icons">language</i><i
class="material-icons sub-icon">perm_media</i></div>
<span>@@fedMedia@@</span> <span>@@fedMedia@@</span>
</div> </div>
<div class="type waves-effect" data-type="dm"> <div class="type waves-effect" data-type="dm">
@ -761,7 +788,8 @@
<div><i class="material-icons">merge_type</i></div><span>@@integratedTLDes@@</span> <div><i class="material-icons">merge_type</i></div><span>@@integratedTLDes@@</span>
</div> </div>
<div class="type waves-effect" data-type="plus"> <div class="type waves-effect" data-type="plus">
<div><i class="material-icons">merge_type</i><i class="material-icons sub-icon">reply</i></div> <div><i class="material-icons">merge_type</i><i
class="material-icons sub-icon">reply</i></div>
<span>@@localPlusDes@@</span> <span>@@localPlusDes@@</span>
</div> </div>
<div class="type waves-effect" data-type="notf"> <div class="type waves-effect" data-type="notf">
@ -791,8 +819,8 @@
<div class="input-field"> <div class="input-field">
<input id="src" type="text" class="validate" style="width:60%"> <input id="src" type="text" class="validate" style="width:60%">
<label for="src" data-trans="src">@@search@@</label> <label for="src" data-trans="src">@@search@@</label>
<button class="btn waves-effect indigo" style="width: 36%;padding: 0;padding-left: 15px;" onclick="src()" <button class="btn waves-effect indigo" style="width: 36%;padding: 0;padding-left: 15px;"
data-trans-i="src"> onclick="src()" data-trans-i="src">
<i class="material-icons left" style="margin:0">search</i>@@search@@ <i class="material-icons left" style="margin:0">search</i>@@search@@
</button> </button>
<br> <br>
@ -819,7 +847,8 @@
<label>@@selectAcct@@</label> <label>@@selectAcct@@</label>
</div> </div>
<div style="float:left; padding-top:8px; padding-bottom:28px;"> <div style="float:left; padding-top:8px; padding-bottom:28px;">
<button class="btn waves-effect indigo" style="width:80px;" onclick="list()" data-trans-i="lists"> <button class="btn waves-effect indigo" style="width:80px;" onclick="list()"
data-trans-i="lists">
@@listLocale@@ @@listLocale@@
</button> </button>
</div> </div>
@ -836,7 +865,8 @@
<label>@@selectAcct@@</label> <label>@@selectAcct@@</label>
</div> </div>
<div style="float:left; padding-top:8px; padding-bottom:28px;"> <div style="float:left; padding-top:8px; padding-bottom:28px;">
<button class="btn waves-effect indigo" style="width:80px;" onclick="filter()" data-trans-i="filters"> <button class="btn waves-effect indigo" style="width:80px;" onclick="filter()"
data-trans-i="filters">
@@listLocale@@ @@listLocale@@
</button> </button>
</div> </div>
@ -915,7 +945,8 @@
<i class="material-icons nex" title="@@setting@@(Ctrl+Shift+S)">settings</i> <i class="material-icons nex" title="@@setting@@(Ctrl+Shift+S)">settings</i>
</a> </a>
<a onclick="nano()" class="nex waves-effect"> <a onclick="nano()" class="nex waves-effect">
<i class="material-icons" title="@@nanoDes@@TheDesk Nano" data-trans-title="nano_desp">remove_from_queue</i> <i class="material-icons" title="@@nanoDes@@TheDesk Nano"
data-trans-title="nano_desp">remove_from_queue</i>
</a> </a>
<a onclick="menu()" class="nex waves-effect" id="list-tgl"> <a onclick="menu()" class="nex waves-effect" id="list-tgl">
<i class="material-icons" title="@@list@@">apps</i> <i class="material-icons" title="@@list@@">apps</i>

View File

@ -1,37 +1,37 @@
const fs = require("fs") const fs = require("fs")
const ver="Usamin (18.4.0)" const ver = "Usamin (18.4.0)"
const langs=["ja","en","ps"] const langs = ["ja", "en", "ps"]
const langsh=["日本語","English","Crowdin translate system(beta)"] const langsh = ["日本語", "English", "Crowdin translate system(beta)"]
const simples=["acct","index","setting","update","setting"] const simples = ["acct", "index", "setting", "update", "setting"]
const samples=["acct.sample.html","index.sample.html","setting.sample.html","update.sample.html","setting.sample.js"] const samples = ["acct.sample.html", "index.sample.html", "setting.sample.html", "update.sample.html", "setting.sample.js"]
const pages=["acct.html","index.html","setting.html","update.html","setting.vue.js"] const pages = ["acct.html", "index.html", "setting.html", "update.html", "setting.vue.js"]
let langstr="" let langstr = ""
for(let n=0; n<langs.length; n++){ for (let n = 0; n < langs.length; n++) {
let lang=langs[n] let lang = langs[n]
langstr=langstr+'<a onclick="changelang(\''+lang+'\')" class="pointer" style="margin-right:5px;">'+langsh[n]+'</a>' langstr = langstr + '<a onclick="changelang(\'' + lang + '\')" class="pointer" style="margin-right:5px;">' + langsh[n] + '</a>'
} }
for(let i=0; i<samples.length; i++){ for (let i = 0; i < samples.length; i++) {
let sample=samples[i] let sample = samples[i]
let sourceParent = fs.readFileSync(sample, 'utf8') let sourceParent = fs.readFileSync(sample, 'utf8')
for(let j=0; j<langs.length; j++){ for (let j = 0; j < langs.length; j++) {
let source=sourceParent let source = sourceParent
let lang=langs[j] let lang = langs[j]
let target = JSON.parse(fs.readFileSync("language/"+simples[i]+"."+lang+".json", 'utf8')) let target = JSON.parse(fs.readFileSync("language/" + simples[i] + "." + lang + ".json", 'utf8'))
Object.keys(target).forEach(function(key) { Object.keys(target).forEach(function (key) {
let str = target[key] let str = target[key]
var regExp = new RegExp("@@" + key + "@@", "g") var regExp = new RegExp("@@" + key + "@@", "g")
source = source.replace(regExp, str) source = source.replace(regExp, str)
}) })
if(lang=="ps"){ if (lang == "ps") {
source = source.replace(/@@comment-start@@/g, "") source = source.replace(/@@comment-start@@/g, "")
source = source.replace(/@@comment-end@@/g, "") source = source.replace(/@@comment-end@@/g, "")
}else{ } else {
source = source.replace(/@@comment-start@@/g, "<!--") source = source.replace(/@@comment-start@@/g, "<!--")
source = source.replace(/@@comment-end@@/g, "-->") source = source.replace(/@@comment-end@@/g, "-->")
} }
source = source.replace(/@@versionLetter@@/g, ver) source = source.replace(/@@versionLetter@@/g, ver)
source = source.replace(/@@lang@@/g, lang) source = source.replace(/@@lang@@/g, lang)
source = source.replace(/@@langlist@@/g, langstr) source = source.replace(/@@langlist@@/g, langstr)
fs.writeFileSync("../"+lang+"/"+pages[i], source) fs.writeFileSync("../" + lang + "/" + pages[i], source)
} }
} }

View File

@ -22,6 +22,7 @@
input { input {
max-height: 50px !important max-height: 50px !important
} }
.pcr-result { .pcr-result {
height: 1rem !important; height: 1rem !important;
} }
@ -157,11 +158,11 @@
<input type="hidden" id="color-picker2_value"> <input type="hidden" id="color-picker2_value">
</div> </div>
<div> <div>
<h5>Accent</h5>@@accent@@ <h5>Accent</h5>@@accent@@
<div id="color-picker3-wrap"> <div id="color-picker3-wrap">
<div class="color-picker" id="color-picker3"></div> <div class="color-picker" id="color-picker3"></div>
</div> </div>
<input type="hidden" id="color-picker3_value"> <input type="hidden" id="color-picker3_value">
</div> </div>
</div> </div>
<button class="btn-large waves-effect" onclick="customComp()">@@change@@</button>&nbsp;<button <button class="btn-large waves-effect" onclick="customComp()">@@change@@</button>&nbsp;<button
@ -210,10 +211,14 @@
</template> </template>
</div> </div>
<h5>@@customSound@@</h5> <h5>@@customSound@@</h5>
<button class="btn waves-effect" style="width:120px;" onclick="customSound(1)">Custom 1</button><span id="c1-file"></span><br> <button class="btn waves-effect" style="width:120px;" onclick="customSound(1)">Custom 1</button><span
<button class="btn waves-effect" style="width:120px;" onclick="customSound(2)">Custom 2</button><span id="c2-file"></span><br> id="c1-file"></span><br>
<button class="btn waves-effect" style="width:120px;" onclick="customSound(3)">Custom 3</button><span id="c3-file"></span><br> <button class="btn waves-effect" style="width:120px;" onclick="customSound(2)">Custom 2</button><span
<button class="btn waves-effect" style="width:120px;" onclick="customSound(4)">Custom 4</button><span id="c4-file"></span><br> id="c2-file"></span><br>
<button class="btn waves-effect" style="width:120px;" onclick="customSound(3)">Custom 3</button><span
id="c3-file"></span><br>
<button class="btn waves-effect" style="width:120px;" onclick="customSound(4)">Custom 4</button><span
id="c4-file"></span><br>
</div> </div>
</li> </li>
<li> <li>

File diff suppressed because it is too large Load Diff

View File

@ -1,235 +1,256 @@
<!doctype html> <!doctype html>
<html lang="@@lang@@"> <html lang="@@lang@@">
<head> <head>
<title>Update - TheDesk</title> <title>Update - TheDesk</title>
<link href="../../css/materialize.css" type="text/css" rel="stylesheet"> <link href="../../css/materialize.css" type="text/css" rel="stylesheet">
<link href="../../css/master.css" type="text/css" rel="stylesheet"> <link href="../../css/master.css" type="text/css" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons|Open+Sans:300" rel="stylesheet"> <link href="https://fonts.googleapis.com/icon?family=Material+Icons|Open+Sans:300" rel="stylesheet">
<meta charset="utf-8"> <meta charset="utf-8">
@@comment-start@@ @@comment-start@@
<script type="text/javascript"> <script type="text/javascript">
var _jipt = []; var _jipt = [];
_jipt.push(['project', 'thedesk']); _jipt.push(['project', 'thedesk']);
</script> </script>
<script type="text/javascript" src="https://cdn.crowdin.com/jipt/jipt.js"></script> <script type="text/javascript" src="https://cdn.crowdin.com/jipt/jipt.js"></script>
@@comment-end@@ @@comment-end@@
</head> </head>
<body> <body>
<style> <style>
body{ body {
font-family:'Open Sans'; font-family: 'Open Sans';
-webkit-app-region: drag; -webkit-app-region: drag;
cursor: move; cursor: move;
padding:10px; padding: 10px;
text-align:right; text-align: right;
}
#start{
display: flex;
justify-content: center;
align-items: center;
width:100vw;
height: calc(100vh - 2.5rem);
text-align:center;
}
#checkbox{
text-align:left;
}
a,button,input,label,i{
-webkit-app-region: no-drag;
}
#updskip{
display: flex;
justify-content: center;
align-items: center;
}
.skipbtn{
display:block;
float:left;
width:200px;
height:200px;
border:1px solid;
margin-left:5px;
display: flex;
justify-content: center;
align-items: center;
border: 1px solid;
overflow: hidden;
}
.skipbtn:hover{
background-color: #b3e5fc;
transition: all 0.3s ease-in-out;
}
#prog{
font-size:200%;
}
</style>
<script type="text/javascript" src="../../js/common/jquery.js"></script>
<script type="text/javascript" src="../../js/platform/first.js"></script>
<script type="text/javascript" src="../../js/common/materialize.js"></script>
<i class="material-icons pointer waves-effect" onclick="about();">info</i>
<i class="material-icons pointer waves-effect" onclick="skipper();">clear</i>
<!--a href="update.html">Reload</a-->
<div id="start">
<div id="box" class="show">
<h2>TheDesk</h2>
<p>@@updatehere@@</p>
<span id="now"></span><b id="ver"></b><br>
<span id="det"></span><br>
<button class="waves-effect btn windows hide" onclick="update('install')" style="margin-left:15px;">@@installer@@</button>
<button class="waves-effect btn windows hide" onclick="update('portable')" style="margin-left:15px;">@@portable@@</button>
<button class="waves-effect btn linux hide" onclick="update('linux')" style="margin-left:15px;">@@download@@</button>
<button class="waves-effect btn mac hide" onclick="update('mac')" style="margin-left:15px;">@@download@@</button>
<br>
@@problem1@@<br>@@problem2@@
</div>
<div id="skipper" class="hide">
<h4>@@sureupd@@</h4>
@@skipupd@@<br>
<div id="updskip">
<a onclick="window.close();" class="pointer skipbtn waves-effect waves-light"><div>@@nexttl@@</div></a>
<a onclick="nextv();" class="pointer skipbtn waves-effect waves-light"><div>@@nextver@@</div></a>
</div>
<a class="pointer waves-effect" onclick="skipper();" style="margin-top:5px">@@continue@@</a>
</div>
<div id="dlnow" class="hide">
<h4>@@dlnow@@</h4>
<h4 id="prog"></h4>
</div>
</div>
<script type="text/javascript" src="../../js/common/about.js"></script>
<script type="text/javascript" src="../../js/platform/end.js"></script>
<script>
function skipper(){
$("#dlnow").addClass("hide");
$("#box").toggleClass("show");
if($("#box").hasClass("hide") && $("#skipper").hasClass("hide")){
$("#skipper").removeClass("hide");
$("#skipper").addClass("show");
}else{
$("#box").toggleClass("hide");
$("#skipper").toggleClass("hide");
$("#skipper").toggleClass("show");
}
}
var electron = require("electron");
var ipc = electron.ipcRenderer;
const shell=electron.shell;
verck();
function update(sel){
$("#box").toggleClass("show");
$("#box").toggleClass("hide");
$("#dlnow").toggleClass("hide");
$("#dlnow").toggleClass("show");
$("#prog").text("");
var remote=electron.remote;
var bit=process.arch;
var start="https://thedesk.top/ver.json";
fetch(start, {
method: 'GET',
headers: {'content-type': 'application/json'},
}).then(function(response) {
return response.json();
}).catch(function(error) {
todo(error);
console.error(error);
}).then(function(json) {
if(sel=="install"){
if(bit=="x64"){
var url=json["winx64"];
var file="TheDesk-setup.exe";
}else if(bit=="ia32"){
var url=json["winia32"];
var file="TheDesk-setup-ia32.exe";
}
}else if(sel=="portable"){
if(bit=="x64"){
var url=json["winx64p"];
var file="TheDesk.exe";
}else if(bit=="ia32"){
var url=json["winia32p"];
var file="TheDesk-ia32.exe";
}
}else if(sel=="linux"){
if(bit=="x64"){
var url=json["linuxx64"];
var file="TheDesk-linux-x64.zip";
}else if(bit=="ia32"){
var url=json["linuxia64"];
var file="TheDesk-linux-ia32.zip";
}
}else if(sel=="mac"){
var url=json["mac"];
shell.openExternal(url);
} }
ipc.send('download-btn', [url,file]);
}); #start {
display: flex;
} justify-content: center;
function quit(){ align-items: center;
ipc.send('quit', 'go'); width: 100vw;
} height: calc(100vh - 2.5rem);
ipc.on('prog', function (event, arg) { text-align: center;
console.log(arg); }
$("body").css('background','linear-gradient(#fff 0%,#fff '+(1-arg)*100+'%, #d7ccc8 '+(1-arg)*100+'%, #d7ccc8 100%)');
$("#prog").text(Math.floor(arg*100)+"%"); #checkbox {
}) text-align: left;
ipc.on('mess', function (event, arg) { }
console.log(arg);
$("#prog").text(arg); a,
}) button,
function verck(){ input,
var remote=electron.remote; label,
var platform=remote.process.platform; i {
var bit=process.arch; -webkit-app-region: no-drag;
if(platform=="win32"){ }
$('.windows').removeClass("hide")
}else if(platform=="linux"){ #updskip {
$('.linux').removeClass("hide") display: flex;
}else if(platform=="darwin"){ justify-content: center;
$('.mac').removeClass("hide") align-items: center;
} }
var start="https://thedesk.top/ver.json";
fetch(start, { .skipbtn {
method: 'GET', display: block;
headers: {'content-type': 'application/json'}, float: left;
}).then(function(response) { width: 200px;
return response.json(); height: 200px;
}).catch(function(error) { border: 1px solid;
todo(error); margin-left: 5px;
console.error(error); display: flex;
}).then(function(json) { justify-content: center;
console.log(json); align-items: center;
if(platform=="win32"){ border: 1px solid;
$("#ver").text(json.desk); overflow: hidden;
localStorage.setItem("next-ver",json.desk); }
}else if(platform=="linux"){
$("#ver").text(json.desk_linux); .skipbtn:hover {
localStorage.setItem("next-ver",json.desk_linux); background-color: #b3e5fc;
}else if(platform=="darwin"){ transition: all 0.3s ease-in-out;
$("#ver").text(json.desk_mac); }
localStorage.setItem("next-ver",json.desk_mac);
#prog {
font-size: 200%;
}
</style>
<script type="text/javascript" src="../../js/common/jquery.js"></script>
<script type="text/javascript" src="../../js/platform/first.js"></script>
<script type="text/javascript" src="../../js/common/materialize.js"></script>
<i class="material-icons pointer waves-effect" onclick="about();">info</i>
<i class="material-icons pointer waves-effect" onclick="skipper();">clear</i>
<!--a href="update.html">Reload</a-->
<div id="start">
<div id="box" class="show">
<h2>TheDesk</h2>
<p>@@updatehere@@</p>
<span id="now"></span><b id="ver"></b><br>
<span id="det"></span><br>
<button class="waves-effect btn windows hide" onclick="update('install')"
style="margin-left:15px;">@@installer@@</button>
<button class="waves-effect btn windows hide" onclick="update('portable')"
style="margin-left:15px;">@@portable@@</button>
<button class="waves-effect btn linux hide" onclick="update('linux')"
style="margin-left:15px;">@@download@@</button>
<button class="waves-effect btn mac hide" onclick="update('mac')"
style="margin-left:15px;">@@download@@</button>
<br>
@@problem1@@<br>@@problem2@@
</div>
<div id="skipper" class="hide">
<h4>@@sureupd@@</h4>
@@skipupd@@<br>
<div id="updskip">
<a onclick="window.close();" class="pointer skipbtn waves-effect waves-light">
<div>@@nexttl@@</div>
</a>
<a onclick="nextv();" class="pointer skipbtn waves-effect waves-light">
<div>@@nextver@@</div>
</a>
</div>
<a class="pointer waves-effect" onclick="skipper();" style="margin-top:5px">@@continue@@</a>
</div>
<div id="dlnow" class="hide">
<h4>@@dlnow@@</h4>
<h4 id="prog"></h4>
</div>
</div>
<script type="text/javascript" src="../../js/common/about.js"></script>
<script type="text/javascript" src="../../js/platform/end.js"></script>
<script>
function skipper() {
$("#dlnow").addClass("hide");
$("#box").toggleClass("show");
if ($("#box").hasClass("hide") && $("#skipper").hasClass("hide")) {
$("#skipper").removeClass("hide");
$("#skipper").addClass("show");
} else {
$("#box").toggleClass("hide");
$("#skipper").toggleClass("hide");
$("#skipper").toggleClass("show");
} }
var lang="@@lang@@"; }
if(lang=="ja"){ var electron = require("electron");
$("#det").html(json.detail); var ipc = electron.ipcRenderer;
}else{ const shell = electron.shell;
$("#det").html(json.detail_en); verck();
function update(sel) {
$("#box").toggleClass("show");
$("#box").toggleClass("hide");
$("#dlnow").toggleClass("hide");
$("#dlnow").toggleClass("show");
$("#prog").text("");
var remote = electron.remote;
var bit = process.arch;
var start = "https://thedesk.top/ver.json";
fetch(start, {
method: 'GET',
headers: { 'content-type': 'application/json' },
}).then(function (response) {
return response.json();
}).catch(function (error) {
todo(error);
console.error(error);
}).then(function (json) {
if (sel == "install") {
if (bit == "x64") {
var url = json["winx64"];
var file = "TheDesk-setup.exe";
} else if (bit == "ia32") {
var url = json["winia32"];
var file = "TheDesk-setup-ia32.exe";
}
} else if (sel == "portable") {
if (bit == "x64") {
var url = json["winx64p"];
var file = "TheDesk.exe";
} else if (bit == "ia32") {
var url = json["winia32p"];
var file = "TheDesk-ia32.exe";
}
} else if (sel == "linux") {
if (bit == "x64") {
var url = json["linuxx64"];
var file = "TheDesk-linux-x64.zip";
} else if (bit == "ia32") {
var url = json["linuxia64"];
var file = "TheDesk-linux-ia32.zip";
}
} else if (sel == "mac") {
var url = json["mac"];
shell.openExternal(url);
}
ipc.send('download-btn', [url, file]);
});
}
function quit() {
ipc.send('quit', 'go');
}
ipc.on('prog', function (event, arg) {
console.log(arg);
$("body").css('background', 'linear-gradient(#fff 0%,#fff ' + (1 - arg) * 100 + '%, #d7ccc8 ' + (1 - arg) * 100 + '%, #d7ccc8 100%)');
$("#prog").text(Math.floor(arg * 100) + "%");
})
ipc.on('mess', function (event, arg) {
console.log(arg);
$("#prog").text(arg);
})
function verck() {
var remote = electron.remote;
var platform = remote.process.platform;
var bit = process.arch;
if (platform == "win32") {
$('.windows').removeClass("hide")
} else if (platform == "linux") {
$('.linux').removeClass("hide")
} else if (platform == "darwin") {
$('.mac').removeClass("hide")
} }
var start = "https://thedesk.top/ver.json";
$("#now").text(localStorage.getItem("ver")); fetch(start, {
method: 'GET',
}); headers: { 'content-type': 'application/json' },
} }).then(function (response) {
function nextv(){ return response.json();
localStorage.setItem("new-ver-skip","true"); }).catch(function (error) {
window.close(); todo(error);
} console.error(error);
function enc(ver){ }).then(function (json) {
var ver = ver.replace( /\s/g , "" ); console.log(json);
var ver = ver.replace( /\(/g , "-" ); if (platform == "win32") {
var ver = ver.replace( /\)/g , "" ); $("#ver").text(json.desk);
var ver = ver.replace( /\[/g , "_" ); localStorage.setItem("next-ver", json.desk);
var ver = ver.replace( /\]/g , "" ); } else if (platform == "linux") {
return ver; $("#ver").text(json.desk_linux);
} localStorage.setItem("next-ver", json.desk_linux);
</script> } else if (platform == "darwin") {
$("#ver").text(json.desk_mac);
localStorage.setItem("next-ver", json.desk_mac);
}
var lang = "@@lang@@";
if (lang == "ja") {
$("#det").html(json.detail);
} else {
$("#det").html(json.detail_en);
}
$("#now").text(localStorage.getItem("ver"));
});
}
function nextv() {
localStorage.setItem("new-ver-skip", "true");
window.close();
}
function enc(ver) {
var ver = ver.replace(/\s/g, "");
var ver = ver.replace(/\(/g, "-");
var ver = ver.replace(/\)/g, "");
var ver = ver.replace(/\[/g, "_");
var ver = ver.replace(/\]/g, "");
return ver;
}
</script>

View File

@ -1,83 +1,122 @@
<!doctype html> <!doctype html>
<html lang="ps"> <html lang="ps">
<head> <head>
<title>Account Manager - TheDesk</title> <title>Account Manager - TheDesk</title>
<meta content="width=device-width,initial-scale=1.0" name="viewport"> <meta content="width=device-width,initial-scale=1.0" name="viewport">
<link href="../../css/materialize.css" type="text/css" rel="stylesheet"> <link href="../../css/materialize.css" type="text/css" rel="stylesheet">
<link href="../../css/themes.css" type="text/css" rel="stylesheet"> <link href="../../css/themes.css" type="text/css" rel="stylesheet">
<link href="../../css/master.css" type="text/css" rel="stylesheet"> <link href="../../css/master.css" type="text/css" rel="stylesheet">
<link href='../../css/font-awesome.css' rel='stylesheet' type='text/css'> <link href='../../css/font-awesome.css' rel='stylesheet' type='text/css'>
<link href='../../css/tl.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/userdata.css' rel='stylesheet' type='text/css'>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons|Open+Sans:300" rel="stylesheet"> <link href="https://fonts.googleapis.com/icon?family=Material+Icons|Open+Sans:300" rel="stylesheet">
<style>.acct{display:flex; justify-content:space-around;} <style>
.card{width:400px; background-color: #9e9e9e; margin:10px; } .acct {
body,html{overflow-y: scroll;} display: flex;
#acct-list{display:flex; flex-wrap:wrap; color:white; align-items: flex-start} justify-content: space-around;
.lts{font-size:150%} }
.colorsel{ display:flex; }
.card .colorsel div:not(.exc){width:20px;height:20px;}
.card .colorsel div.exc{width:40px;height:20px;}
.first{
display:flex;
justify-content: center;
align-items:center
}
.first .hide-first{
display:none;
}
</style>
<meta charset="utf-8">
<script type="text/javascript"> .card {
var _jipt = []; width: 400px;
_jipt.push(['project', 'thedesk']); background-color: #9e9e9e;
</script> margin: 10px;
<script type="text/javascript" src="https://cdn.crowdin.com/jipt/jipt.js"></script> }
body,
html {
overflow-y: scroll;
}
#acct-list {
display: flex;
flex-wrap: wrap;
color: white;
align-items: flex-start
}
.lts {
font-size: 150%
}
.colorsel {
display: flex;
}
.card .colorsel div:not(.exc) {
width: 20px;
height: 20px;
}
.card .colorsel div.exc {
width: 40px;
height: 20px;
}
.first {
display: flex;
justify-content: center;
align-items: center
}
.first .hide-first {
display: none;
}
</style>
<meta charset="utf-8">
<script type="text/javascript">
var _jipt = [];
_jipt.push(['project', 'thedesk']);
</script>
<script type="text/javascript" src="https://cdn.crowdin.com/jipt/jipt.js"></script>
</head> </head>
<body id="mainView"> <body id="mainView">
<script type="text/javascript" src="../../js/common/jquery.js"></script> <script type="text/javascript" src="../../js/common/jquery.js"></script>
<script type="text/javascript" src="../../js/platform/first.js"></script> <script type="text/javascript" src="../../js/platform/first.js"></script>
<script type="text/javascript" src="../../js/common/materialize.js"></script> <script type="text/javascript" src="../../js/common/materialize.js"></script>
<script type="text/javascript" src="../../js/lang/lang.ps.js"></script> <script type="text/javascript" src="../../js/lang/lang.ps.js"></script>
<script> <script>
var misskeytoken=false; var misskeytoken = false;
</script> </script>
<script type="text/javascript" src="../../js/ui/tips.js"></script> <script type="text/javascript" src="../../js/ui/tips.js"></script>
<script type="text/javascript" src="../../js/common/time.js"></script> <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/common/modal.js"></script>
<div class="hide-first"> <div class="hide-first">
<a href="index.html" class="btn waves-effect orange nex" style="width:100%; max-width:200px;">crwdns366:0crwdne366:0</a><br> <a href="index.html" class="btn waves-effect orange nex"
<h5>crwdns365:0crwdne365:0</h5> style="width:100%; max-width:200px;">crwdns366:0crwdne366:0</a><br>
<div id="acct-list"></div> <h5>crwdns365:0crwdne365:0</h5>
<div class="divider"></div> <div id="acct-list"></div>
</div> <div class="divider"></div>
<div>
<h5>crwdns367:0crwdne367:0</h5><br>
<div id="add">
<div class="row">
<div class="col s8">
<input type="text" id="url" style="width:70%" placeholder="ex)mstdn.jp">
<div id="ins-suggest"></div>
crwdns368:0crwdne368:0<br>
<input type="checkbox" class="filled-in" id="linux" />
<label for="linux">crwdns369:0crwdne369:0</label><br>
<input type="checkbox" class="filled-in" id="misskey" />
<label for="misskey">crwdns382:0crwdne382:0</label><br>
<button class="btn waves-effect" onclick="instance()">Login</button><br>
</div> </div>
<div class="col s4"> <div>
<span style="font-family:Open Sans;">Supports</span> <h5>crwdns367:0crwdne367:0</h5><br>
<div id="support" class="collection transparent"></div> <div id="add">
</div> <div class="row">
</div></div> <div class="col s8">
<div id="auth" style="display:none"> <input type="text" id="url" style="width:70%" placeholder="ex)mstdn.jp">
crwdns372:0crwdne372:0<br> <div id="ins-suggest"></div>
<input type="text" id="code" placeholder="crwdns373:0crwdne373:0"> crwdns368:0crwdne368:0<br>
<button class="btn waves-effect" onclick="code()">Auth</button><br> <input type="checkbox" class="filled-in" id="linux" />
</div> <label for="linux">crwdns369:0crwdne369:0</label><br>
<div id="misskeylogin" style="display:none"> <input type="checkbox" class="filled-in" id="misskey" />
<label for="misskey">crwdns382:0crwdne382:0</label><br>
<button class="btn waves-effect" onclick="instance()">Login</button><br>
</div>
<div class="col s4">
<span style="font-family:Open Sans;">Supports</span>
<div id="support" class="collection transparent"></div>
</div>
</div>
</div>
<div id="auth" style="display:none">
crwdns372:0crwdne372:0<br>
<input type="text" id="code" placeholder="crwdns373:0crwdne373:0">
<button class="btn waves-effect" onclick="code()">Auth</button><br>
</div>
<div id="misskeylogin" style="display:none">
<h5>AppSecret</h5> <h5>AppSecret</h5>
crwdns383:0crwdne383:0<br> crwdns383:0crwdne383:0<br>
<input type="hidden" id="misskey-url"> <input type="hidden" id="misskey-url">
@ -85,30 +124,30 @@ body,html{overflow-y: scroll;}
<button class="btn waves-effect" onclick="misskeyLogin()">Auth</button><br> <button class="btn waves-effect" onclick="misskeyLogin()">Auth</button><br>
</div> </div>
</div> </div>
<div class="hide-first"> <div class="hide-first">
<h5>crwdns370:0crwdne370:0</h5> <h5>crwdns370:0crwdne370:0</h5>
<div class="input-field" style="width:300px"><span data-trans="your_acct">crwdns371:0crwdne371:0</span> <div class="input-field" style="width:300px"><span data-trans="your_acct">crwdns371:0crwdne371:0</span>
<br> <br>
<select id="main-acct-sel" class="acct-sel" style="color:black" onchange="mainacct()"></select> <select id="main-acct-sel" class="acct-sel" style="color:black" onchange="mainacct()"></select>
<label></label> <label></label>
</div> </div>
Some instance data by <a href="https://instances.social" target="_blank">instances.social API</a><br> Some instance data by <a href="https://instances.social" target="_blank">instances.social API</a><br>
<h5 id="ins-title"></h5> <h5 id="ins-title"></h5>
Administered by:<a id="ins-admin"></a><br> Administered by:<a id="ins-admin"></a><br>
<span id="ins-desc"></span><br> <span id="ins-desc"></span><br>
<img src="../../img/loading.svg" id="ins-prof" width="200"><br> <img src="../../img/loading.svg" id="ins-prof" width="200"><br>
<br> <br>
crwdns374:0crwdne374:0:<span id="ins-name"></span><br> crwdns374:0crwdne374:0:<span id="ins-name"></span><br>
crwdns375:0crwdne375:0:<span id="ins-connect"></span>crwdns381:0crwdne381:0<br> crwdns375:0crwdne375:0:<span id="ins-connect"></span>crwdns381:0crwdne381:0<br>
crwdns376:0crwdne376:0:<span id="ins-toot"></span>crwdns381:0crwdne381:0<br> crwdns376:0crwdne376:0:<span id="ins-toot"></span>crwdns381:0crwdne381:0<br>
crwdns377:0crwdne377:0:<span id="ins-user"></span>crwdns377:0crwdne377:0<br> crwdns377:0crwdne377:0:<span id="ins-user"></span>crwdns377:0crwdne377:0<br>
crwdns379:0crwdne379:0:<span id="ins-per"></span>%<br> crwdns379:0crwdne379:0:<span id="ins-per"></span>%<br>
crwdns380:0crwdne380:0:<span id="ins-ver"></span>@<span id="ins-upd"></span><br> crwdns380:0crwdne380:0:<span id="ins-ver"></span>@<span id="ins-upd"></span><br>
</div> </div>
<script type="text/javascript" src="../../js/ui/theme.js"></script> <script type="text/javascript" src="../../js/ui/theme.js"></script>
<script type="text/javascript" src="../../js/platform/end.js"></script> <script type="text/javascript" src="../../js/platform/end.js"></script>
<script type="text/javascript" src="../../js/common/sha256.js"></script> <script type="text/javascript" src="../../js/common/sha256.js"></script>
<script type="text/javascript" src="../../js/login/tkn.js"></script> <script type="text/javascript" src="../../js/login/tkn.js"></script>
<script type="text/javascript" src="../../js/login/instance.js"></script> <script type="text/javascript" src="../../js/login/instance.js"></script>
<script type="text/javascript" src="../../js/login/manager.js"></script> <script type="text/javascript" src="../../js/login/manager.js"></script>
<script type="text/javascript" src="../../js/tl/date.js"></script> <script type="text/javascript" src="../../js/tl/date.js"></script>

View File

@ -98,10 +98,12 @@
title="箇条書きリスト">format_list_bulleted</i> title="箇条書きリスト">format_list_bulleted</i>
<i class="material-icons pointer setting waves-effect" onclick="markdown('1. ','yes','yes')" <i class="material-icons pointer setting waves-effect" onclick="markdown('1. ','yes','yes')"
title="番号付きリスト">format_list_numbered</i> title="番号付きリスト">format_list_numbered</i>
<i class="pointer setting fa fa-subscript waves-effect" onclick="markdown('__','yes','no','before')" <i class="pointer setting fa fa-subscript waves-effect"
title="下付き文字 テキストボックス内を選択してから押すと囲みます。" style="font-size:1.5rem"></i> onclick="markdown('__','yes','no','before')" title="下付き文字 テキストボックス内を選択してから押すと囲みます。"
<i class="pointer setting fa fa-superscript waves-effect" onclick="markdown('_','yes','no','before')" style="font-size:1.5rem"></i>
title="上付き文字 テキストボックス内を選択してから押すと囲みます。" style="font-size:1.5rem"></i> <i class="pointer setting fa fa-superscript waves-effect"
onclick="markdown('_','yes','no','before')" title="上付き文字 テキストボックス内を選択してから押すと囲みます。"
style="font-size:1.5rem"></i>
<i class="material-icons pointer setting waves-effect" onclick="tagsel('spin')" <i class="material-icons pointer setting waves-effect" onclick="tagsel('spin')"
title="回転 テキストボックス内を選択してから押すと囲みます。">autorenew</i> title="回転 テキストボックス内を選択してから押すと囲みます。">autorenew</i>
<i class="material-icons pointer setting waves-effect" onclick="tagsel('pulse')" <i class="material-icons pointer setting waves-effect" onclick="tagsel('pulse')"
@ -121,14 +123,19 @@
title="文字色変更 テキストボックス内を選択してから押すと囲みます。">color_lens</i> title="文字色変更 テキストボックス内を選択してから押すと囲みます。">color_lens</i>
<input id="colorhex" style="width: calc(50% - 50px); margin: 0; height: 24px;" type="color"> <input id="colorhex" style="width: calc(50% - 50px); margin: 0; height: 24px;" type="color">
<br> <br>
<i class="material-icons pointer setting waves-effect" onclick="markdownLink()" title="リンク挿入">link</i> <i class="material-icons pointer setting waves-effect" onclick="markdownLink()"
<input id="linkt" style="width: calc(50% - 20px); margin: 0; height: 24px;" placeholder="リンクテキスト">&nbsp; title="リンク挿入">link</i>
<input id="link2" style="width: calc(50% - 20px); margin: 0; height: 24px;" placeholder="リンクアドレス"> <input id="linkt" style="width: calc(50% - 20px); margin: 0; height: 24px;"
placeholder="リンクテキスト">&nbsp;
<input id="link2" style="width: calc(50% - 20px); margin: 0; height: 24px;"
placeholder="リンクアドレス">
<br> <br>
<i class="material-icons pointer setting waves-effect" onclick="markdownImage()" <i class="material-icons pointer setting waves-effect" onclick="markdownImage()"
title="インライン画像挿入">image</i> title="インライン画像挿入">image</i>
<input id="image" style="width: calc(50% - 20px); margin: 0; height: 24px;" placeholder="代替テキスト">&nbsp; <input id="image" style="width: calc(50% - 20px); margin: 0; height: 24px;"
<input id="image2" style="width: calc(50% - 20px); margin: 0; height: 24px;" placeholder="画像アドレス"> placeholder="代替テキスト">&nbsp;
<input id="image2" style="width: calc(50% - 20px); margin: 0; height: 24px;"
placeholder="画像アドレス">
</div> </div>
</div> </div>
<div class="input-field col s12" id="preview-field" style="margin-top: 0;"> <div class="input-field col s12" id="preview-field" style="margin-top: 0;">
@ -154,14 +161,15 @@
<div class="col s12 mize" style="margin-top: 0; display:flex; justify-content: space-between"> <div class="col s12 mize" style="margin-top: 0; display:flex; justify-content: space-between">
<i class="waves-effect gray material-icons" id="nsfw" title="crwdns389:0crwdne389:0" <i class="waves-effect gray material-icons" id="nsfw" title="crwdns389:0crwdne389:0"
onclick="nsfw()">visibility_off</i> onclick="nsfw()">visibility_off</i>
<i class="waves-effect gray material-icons purple-text dropdown-button" data-activates='dropdown1' <i class="waves-effect gray material-icons purple-text dropdown-button"
id="vis-icon">public</i> data-activates='dropdown1' id="vis-icon">public</i>
<a class="waves-effect gray" id="cw" onclick="cw()" title="crwdns390:0crwdne390:0">CW</a> <a class="waves-effect gray" id="cw" onclick="cw()" title="crwdns390:0crwdne390:0">CW</a>
<span><span id="imgup"></span><span id="imgsel"><i class="waves-effect material-icons gray" <span><span id="imgup"></span><span id="imgsel"><i class="waves-effect material-icons gray"
onclick="fileselect()" title="crwdns391:0crwdne391:0">photo_library</i></span></span> onclick="fileselect()" title="crwdns391:0crwdne391:0">photo_library</i></span></span>
<i class="waves-effect gray material-icons" onclick="emojiToggle()" id="emojibtn" <i class="waves-effect gray material-icons" onclick="emojiToggle()" id="emojibtn"
title="crwdns393:0crwdne393:0">tag_faces</i> title="crwdns393:0crwdne393:0">tag_faces</i>
<i class="waves-effect gray material-icons dropdown-button" data-activates='dropdown2'>more_vert</i> <i class="waves-effect gray material-icons dropdown-button"
data-activates='dropdown2'>more_vert</i>
<i class="material-icons nex gray waves-effect" title="crwdns395:0crwdne395:0(Ctrl+Shit+C)" <i class="material-icons nex gray waves-effect" title="crwdns395:0crwdne395:0(Ctrl+Shit+C)"
data-trans-title="post_box_clear" id="clear">clear</i> data-trans-title="post_box_clear" id="clear">clear</i>
</div> </div>
@ -176,13 +184,15 @@
<br> <br>
<input type="text" id="cw-text" placeholder="crwdns402:0crwdne402:0" class="mize" style="margin:0"> <input type="text" id="cw-text" placeholder="crwdns402:0crwdne402:0" class="mize" style="margin:0">
<div id="sch-box">crwdns1886:0crwdne1886:0<br><span class="sml">crwdns1888:0crwdne1888:0</span><br> <div id="sch-box">crwdns1886:0crwdne1886:0<br><span class="sml">crwdns1888:0crwdne1888:0</span><br>
<input type="datetime-local" id="sch-date" placeholder="crwdns1884:0crwdne1884:0" class="datepicker" style="margin:0"> <input type="datetime-local" id="sch-date" placeholder="crwdns1884:0crwdne1884:0" class="datepicker"
style="margin:0">
</div> </div>
</div> </div>
</div> </div>
<!-- 公開範囲 Dropdown Structure --> <!-- 公開範囲 Dropdown Structure -->
<ul id='dropdown1' class='dropdown-content'> <ul id='dropdown1' class='dropdown-content'>
<li style="font-size: 16px; display: block; line-height: 22px; padding: 14px 16px;">crwdns403:0crwdne403:0</li> <li style="font-size: 16px; display: block; line-height: 22px; padding: 14px 16px;">crwdns403:0crwdne403:0
</li>
<li> <li>
<a onclick="vis('public')">crwdns404:0crwdne404:0(Public)</a> <a onclick="vis('public')">crwdns404:0crwdne404:0(Public)</a>
</li> </li>
@ -228,8 +238,9 @@
<div id="toot-btn-field"> <div id="toot-btn-field">
<button class="btn waves-effect indigo unmize toot-btn-group" onclick="post()" <button class="btn waves-effect indigo unmize toot-btn-group" onclick="post()"
id="toot-post-btn">crwdns388:0crwdne388:0</button> id="toot-post-btn">crwdns388:0crwdne388:0</button>
<button class="btn waves-effect indigo darken-3 unmize hide toot-btn-group" onclick="sec()" id="toot-sec-btn"><i <button class="btn waves-effect indigo darken-3 unmize hide toot-btn-group" onclick="sec()"
class="material-icons" id="toot-sec-icon" title="crwdns1890:0crwdne1890:0">lock_open</i></button> id="toot-sec-btn"><i class="material-icons" id="toot-sec-icon"
title="crwdns1890:0crwdne1890:0">lock_open</i></button>
</div> </div>
</div> </div>
<div id="right-side"> <div id="right-side">
@ -398,12 +409,12 @@
class="fas fa-share"></i></button> class="fas fa-share"></i></button>
</div> </div>
<div class="col s2"> <div class="col s2">
<button class="dropdown-button btn waves-effect indigo" style="width:100%;" onclick="staEx('rt')"><i <button class="dropdown-button btn waves-effect indigo" style="width:100%;"
class="fas fa-retweet"></i></button> onclick="staEx('rt')"><i class="fas fa-retweet"></i></button>
</div> </div>
<div class="col s2"> <div class="col s2">
<button class="dropdown-button btn waves-effect orange" style="width:100%;" onclick="staEx('fav')"><i <button class="dropdown-button btn waves-effect orange" style="width:100%;"
class="fas fa-star"></i></button> onclick="staEx('fav')"><i class="fas fa-star"></i></button>
</div> </div>
</div> </div>
<div id="toot-tools"> <div id="toot-tools">
@ -449,8 +460,8 @@
<div id="his-plus-action"> <div id="his-plus-action">
<a href="#!" class="btn waves-effect waves-effect blue-grey btn-flat" id="his-emp-btn" <a href="#!" class="btn waves-effect waves-effect blue-grey btn-flat" id="his-emp-btn"
onclick="empUser()">crwdns472:0crwdne472:0</a> onclick="empUser()">crwdns472:0crwdne472:0</a>
<a href="#!" class="btn waves-effect waves-effect blue-grey btn-flat only-his-data" id="his-end-btn" <a href="#!" class="btn waves-effect waves-effect blue-grey btn-flat only-his-data"
onclick="pinUser()">crwdns454:0crwdne454:0</a><br> id="his-end-btn" onclick="pinUser()">crwdns454:0crwdne454:0</a><br>
<a href="#!" class="btn waves-effect waves-effect blue-grey btn-flat" id="his-openin" <a href="#!" class="btn waves-effect waves-effect blue-grey btn-flat" id="his-openin"
onclick="profbrws()">crwdns455:0crwdne455:0</a><br> onclick="profbrws()">crwdns455:0crwdne455:0</a><br>
</div><br> </div><br>
@ -471,10 +482,12 @@
<a go="#his-follow-list" title="crwdns440:0crwdne440:0"><i class="material-icons">people</i></a> <a go="#his-follow-list" title="crwdns440:0crwdne440:0"><i class="material-icons">people</i></a>
</li> </li>
<li class="custom-tab col my-data-width"> <li class="custom-tab col my-data-width">
<a go="#his-follower-list" title="crwdns441:0crwdne441:0"><i class="material-icons">people</i></a> <a go="#his-follower-list" title="crwdns441:0crwdne441:0"><i
class="material-icons">people</i></a>
</li> </li>
<li class="custom-tab col my-data-width only-his-data"> <li class="custom-tab col my-data-width only-his-data">
<a go="#his-action" title="crwdns443:0crwdne443:0"><i class="material-icons">account_box</i></a> <a go="#his-action" title="crwdns443:0crwdne443:0"><i
class="material-icons">account_box</i></a>
</li> </li>
<li class="custom-tab col my-data-width only-his-data"> <li class="custom-tab col my-data-width only-his-data">
<a go="#his-list" title="crwdns444:0crwdne444:0"><i class="material-icons">list</i></a> <a go="#his-list" title="crwdns444:0crwdne444:0"><i class="material-icons">list</i></a>
@ -486,20 +499,23 @@
<a go="#his-blocking-list" title="crwdns446:0crwdne446:0"><i class="material-icons">block</i></a> <a go="#his-blocking-list" title="crwdns446:0crwdne446:0"><i class="material-icons">block</i></a>
</li> </li>
<li class="custom-tab col my-data-width only-my-data"> <li class="custom-tab col my-data-width only-my-data">
<a go="#his-blocking-list" title="crwdns446:0crwdne446:0"><i class="material-icons">voice_over_off</i></a> <a go="#his-blocking-list" title="crwdns446:0crwdne446:0"><i
class="material-icons">voice_over_off</i></a>
</li> </li>
<li class="custom-tab col my-data-width only-my-data"> <li class="custom-tab col my-data-width only-my-data">
<a go="#his-domain-list" title="crwdns450:0crwdne450:0"><i class="material-icons">language</i><i <a go="#his-domain-list" title="crwdns450:0crwdne450:0"><i
class="material-icons">block</i></a> class="material-icons">language</i><i class="material-icons">block</i></a>
</li> </li>
<li class="custom-tab col my-data-width only-my-data"> <li class="custom-tab col my-data-width only-my-data">
<a go="#his-prof-list" title="crwdns451:0crwdne451:0"><i class="material-icons">create</i></a> <a go="#his-prof-list" title="crwdns451:0crwdne451:0"><i class="material-icons">create</i></a>
</li> </li>
<li class="custom-tab col my-data-width only-my-data"> <li class="custom-tab col my-data-width only-my-data">
<a go="#his-request-list" title="crwdns452:0crwdne452:0"><i class="material-icons">how_to_reg</i></a> <a go="#his-request-list" title="crwdns452:0crwdne452:0"><i
class="material-icons">how_to_reg</i></a>
</li> </li>
<li class="custom-tab col my-data-width only-my-data"> <li class="custom-tab col my-data-width only-my-data">
<a go="#his-follow-recom-list" title="crwdns456:0crwdne456:0"><i class="material-icons">recent_actors</i></a> <a go="#his-follow-recom-list" title="crwdns456:0crwdne456:0"><i
class="material-icons">recent_actors</i></a>
</li> </li>
</ul> </ul>
</div> </div>
@ -523,10 +539,12 @@
</div> </div>
<div id="his-action" class="tab-content"> <div id="his-action" class="tab-content">
crwdns430:0crwdne430:0crwdns458:0crwdne458:0crwdns440:0crwdne440:0(crwdns459:0crwdne459:0)<br> crwdns430:0crwdne430:0crwdns458:0crwdne458:0crwdns440:0crwdne440:0(crwdns459:0crwdne459:0)<br>
<div style="max-width:500px;"><select id="user-acct-sel" class="acct-sel"></select></div>crwdns460:0crwdne460:0 <div style="max-width:500px;"><select id="user-acct-sel" class="acct-sel"></select></div>
crwdns460:0crwdne460:0
<a href="#!" class="waves-effect btn" onclick="follow('selector','true')">crwdns440:0crwdne440:0</a><br> <a href="#!" class="waves-effect btn" onclick="follow('selector','true')">crwdns440:0crwdne440:0</a><br>
crwdns461:0crwdne461:0<br> crwdns461:0crwdne461:0<br>
<a href="#!" class="waves-effect btn" onclick="udgEx('selector', 'selector')">crwdns462:0crwdne462:0</a><br> <a href="#!" class="waves-effect btn"
onclick="udgEx('selector', 'selector')">crwdns462:0crwdne462:0</a><br>
</div> </div>
<div id="his-list" class="tab-content"> <div id="his-list" class="tab-content">
<div id="his-lists-a">crwdns463:0crwdne463:0</div> <div id="his-lists-a">crwdns463:0crwdne463:0</div>
@ -536,17 +554,20 @@
<div id="his-fav-list" class="tab-content"> <div id="his-fav-list" class="tab-content">
<div id="his-fav-list-contents" class="cont-series"> <div id="his-fav-list-contents" class="cont-series">
</div> </div>
<button class="btn waves-effect" style="width:100%; padding:0;" onclick="showFav('more')">crwdns457:0crwdne457:0</button> <button class="btn waves-effect" style="width:100%; padding:0;"
onclick="showFav('more')">crwdns457:0crwdne457:0</button>
</div> </div>
<div id="his-blocking-list" class="tab-content"> <div id="his-blocking-list" class="tab-content">
<div id="his-blocking-list-contents" class="cont-series"> <div id="his-blocking-list-contents" class="cont-series">
</div> </div>
<button class="btn waves-effect " style="width:100%; padding:0;" onclick="showBlo('more')">crwdns457:0crwdne457:0</button> <button class="btn waves-effect " style="width:100%; padding:0;"
onclick="showBlo('more')">crwdns457:0crwdne457:0</button>
</div> </div>
<div id="his-muting-list" class="tab-content"> <div id="his-muting-list" class="tab-content">
<div id="his-muting-list-contents" class="cont-series"> <div id="his-muting-list-contents" class="cont-series">
</div> </div>
<button class="btn waves-effect " style="width:100%; padding:0;" onclick="showMut('more')">crwdns457:0crwdne457:0</button> <button class="btn waves-effect " style="width:100%; padding:0;"
onclick="showMut('more')">crwdns457:0crwdne457:0</button>
</div> </div>
<div id="his-domain-list" class="tab-content"> <div id="his-domain-list" class="tab-content">
<div id="his-domain-list-contents" class="cont-series"> <div id="his-domain-list-contents" class="cont-series">
@ -567,7 +588,8 @@
<textarea placeholder="crwdns466:0crwdne466:0" id="his-des-val" class="materialize-textarea"></textarea> <textarea placeholder="crwdns466:0crwdne466:0" id="his-des-val" class="materialize-textarea"></textarea>
<label for="his-des-val">crwdns466:0crwdne466:0</label> <label for="his-des-val">crwdns466:0crwdne466:0</label>
</div> </div>
<button class="btn waves-effect" style="width:100%; padding:0;" onclick="profedit()">crwdns1892:0crwdne1892:0</button> <button class="btn waves-effect" style="width:100%; padding:0;"
onclick="profedit()">crwdns1892:0crwdne1892:0</button>
<br>crwdns467:0crwdne467:0: <br>crwdns467:0crwdne467:0:
<span id="prof-change"> <span id="prof-change">
<input type="file" onchange="imgChange(this,'avatar')"> <input type="file" onchange="imgChange(this,'avatar')">
@ -580,7 +602,8 @@
<div id="his-request-list" class="tab-content"> <div id="his-request-list" class="tab-content">
<div id="his-request-list-contents" class="cont-series"> <div id="his-request-list-contents" class="cont-series">
</div> </div>
<button class="btn waves-effect " style="width:100%; padding:0;" onclick="showReq('more')">crwdns457:0crwdne457:0</button> <button class="btn waves-effect " style="width:100%; padding:0;"
onclick="showReq('more')">crwdns457:0crwdne457:0</button>
</div> </div>
<div id="his-follow-recom-list" class="tab-content"> <div id="his-follow-recom-list" class="tab-content">
<div id="his-follow-recom-contents" class="cont-series"> <div id="his-follow-recom-contents" class="cont-series">
@ -686,7 +709,8 @@
crwdns476:0crwdne476:0 crwdns476:0crwdne476:0
</a> </a>
<br> <br>
crwdns477:0crwdne477:0<a href="mailto:web-pro@cutls.com" target="_blank">web-pro@cutls.com</a>crwdns478:0crwdne478:0<br> crwdns477:0crwdne477:0<a href="mailto:web-pro@cutls.com"
target="_blank">web-pro@cutls.com</a>crwdns478:0crwdne478:0<br>
Kyash<br> Kyash<br>
<img src="../../img/kyash.png" width="100"><br> <img src="../../img/kyash.png" width="100"><br>
</div> </div>
@ -720,7 +744,8 @@
class="material-icons">view_headline</i><span>crwdns444:0crwdne444:0</span></div> class="material-icons">view_headline</i><span>crwdns444:0crwdne444:0</span></div>
<div class="waves-effect" onclick="filterMenu()" id="filterMenu"><i <div class="waves-effect" onclick="filterMenu()" id="filterMenu"><i
class="material-icons">filter_list</i><span>crwdns515:0crwdne515:0</span></div> class="material-icons">filter_list</i><span>crwdns515:0crwdne515:0</span></div>
<div class="waves-effect" onclick="help()"><i class="material-icons">help_outline</i><span>crwdns1894:0crwdne1894:0</span></div> <div class="waves-effect" onclick="help()"><i
class="material-icons">help_outline</i><span>crwdns1894:0crwdne1894:0</span></div>
<div class="waves-effect" onclick="location.href='index.html'"><i <div class="waves-effect" onclick="location.href='index.html'"><i
class="material-icons">refresh</i><span>crwdns518:0crwdne518:0</span></div> class="material-icons">refresh</i><span>crwdns518:0crwdne518:0</span></div>
</div> </div>
@ -741,7 +766,8 @@
<div><i class="material-icons">people_outline</i></div><span>crwdns480:0crwdne480:0</span> <div><i class="material-icons">people_outline</i></div><span>crwdns480:0crwdne480:0</span>
</div> </div>
<div class="type waves-effect" data-type="local-media"> <div class="type waves-effect" data-type="local-media">
<div><i class="material-icons">people_outline</i><i class="material-icons sub-icon">perm_media</i> <div><i class="material-icons">people_outline</i><i
class="material-icons sub-icon">perm_media</i>
</div><span>crwdns481:0crwdne481:0</span> </div><span>crwdns481:0crwdne481:0</span>
</div> </div>
<div class="type waves-effect" data-type="home"> <div class="type waves-effect" data-type="home">
@ -751,7 +777,8 @@
<div><i class="material-icons">language</i></div><span>crwdns483:0crwdne483:0</span> <div><i class="material-icons">language</i></div><span>crwdns483:0crwdne483:0</span>
</div> </div>
<div class="type waves-effect" data-type="pub-media"> <div class="type waves-effect" data-type="pub-media">
<div><i class="material-icons">language</i><i class="material-icons sub-icon">perm_media</i></div> <div><i class="material-icons">language</i><i
class="material-icons sub-icon">perm_media</i></div>
<span>crwdns484:0crwdne484:0</span> <span>crwdns484:0crwdne484:0</span>
</div> </div>
<div class="type waves-effect" data-type="dm"> <div class="type waves-effect" data-type="dm">
@ -761,7 +788,8 @@
<div><i class="material-icons">merge_type</i></div><span>crwdns486:0crwdne486:0</span> <div><i class="material-icons">merge_type</i></div><span>crwdns486:0crwdne486:0</span>
</div> </div>
<div class="type waves-effect" data-type="plus"> <div class="type waves-effect" data-type="plus">
<div><i class="material-icons">merge_type</i><i class="material-icons sub-icon">reply</i></div> <div><i class="material-icons">merge_type</i><i
class="material-icons sub-icon">reply</i></div>
<span>crwdns487:0crwdne487:0</span> <span>crwdns487:0crwdne487:0</span>
</div> </div>
<div class="type waves-effect" data-type="notf"> <div class="type waves-effect" data-type="notf">
@ -791,8 +819,8 @@
<div class="input-field"> <div class="input-field">
<input id="src" type="text" class="validate" style="width:60%"> <input id="src" type="text" class="validate" style="width:60%">
<label for="src" data-trans="src">crwdns492:0crwdne492:0</label> <label for="src" data-trans="src">crwdns492:0crwdne492:0</label>
<button class="btn waves-effect indigo" style="width: 36%;padding: 0;padding-left: 15px;" onclick="src()" <button class="btn waves-effect indigo" style="width: 36%;padding: 0;padding-left: 15px;"
data-trans-i="src"> onclick="src()" data-trans-i="src">
<i class="material-icons left" style="margin:0">search</i>crwdns492:0crwdne492:0 <i class="material-icons left" style="margin:0">search</i>crwdns492:0crwdne492:0
</button> </button>
<br> <br>
@ -819,7 +847,8 @@
<label>crwdns494:0crwdne494:0</label> <label>crwdns494:0crwdne494:0</label>
</div> </div>
<div style="float:left; padding-top:8px; padding-bottom:28px;"> <div style="float:left; padding-top:8px; padding-bottom:28px;">
<button class="btn waves-effect indigo" style="width:80px;" onclick="list()" data-trans-i="lists"> <button class="btn waves-effect indigo" style="width:80px;" onclick="list()"
data-trans-i="lists">
crwdns495:0crwdne495:0 crwdns495:0crwdne495:0
</button> </button>
</div> </div>
@ -836,7 +865,8 @@
<label>crwdns494:0crwdne494:0</label> <label>crwdns494:0crwdne494:0</label>
</div> </div>
<div style="float:left; padding-top:8px; padding-bottom:28px;"> <div style="float:left; padding-top:8px; padding-bottom:28px;">
<button class="btn waves-effect indigo" style="width:80px;" onclick="filter()" data-trans-i="filters"> <button class="btn waves-effect indigo" style="width:80px;" onclick="filter()"
data-trans-i="filters">
crwdns495:0crwdne495:0 crwdns495:0crwdne495:0
</button> </button>
</div> </div>
@ -915,7 +945,8 @@
<i class="material-icons nex" title="crwdns516:0crwdne516:0(Ctrl+Shift+S)">settings</i> <i class="material-icons nex" title="crwdns516:0crwdne516:0(Ctrl+Shift+S)">settings</i>
</a> </a>
<a onclick="nano()" class="nex waves-effect"> <a onclick="nano()" class="nex waves-effect">
<i class="material-icons" title="crwdns519:0crwdne519:0TheDesk Nano" data-trans-title="nano_desp">remove_from_queue</i> <i class="material-icons" title="crwdns519:0crwdne519:0TheDesk Nano"
data-trans-title="nano_desp">remove_from_queue</i>
</a> </a>
<a onclick="menu()" class="nex waves-effect" id="list-tgl"> <a onclick="menu()" class="nex waves-effect" id="list-tgl">
<i class="material-icons" title="crwdns444:0crwdne444:0">apps</i> <i class="material-icons" title="crwdns444:0crwdne444:0">apps</i>

View File

@ -22,6 +22,7 @@
input { input {
max-height: 50px !important max-height: 50px !important
} }
.pcr-result { .pcr-result {
height: 1rem !important; height: 1rem !important;
} }
@ -157,11 +158,11 @@
<input type="hidden" id="color-picker2_value"> <input type="hidden" id="color-picker2_value">
</div> </div>
<div> <div>
<h5>Accent</h5>crwdns2434:0crwdne2434:0 <h5>Accent</h5>crwdns2434:0crwdne2434:0
<div id="color-picker3-wrap"> <div id="color-picker3-wrap">
<div class="color-picker" id="color-picker3"></div> <div class="color-picker" id="color-picker3"></div>
</div> </div>
<input type="hidden" id="color-picker3_value"> <input type="hidden" id="color-picker3_value">
</div> </div>
</div> </div>
<button class="btn-large waves-effect" onclick="customComp()">crwdns528:0crwdne528:0</button>&nbsp;<button <button class="btn-large waves-effect" onclick="customComp()">crwdns528:0crwdne528:0</button>&nbsp;<button
@ -210,10 +211,14 @@
</template> </template>
</div> </div>
<h5>@@customSound@@</h5> <h5>@@customSound@@</h5>
<button class="btn waves-effect" style="width:120px;" onclick="customSound(1)">Custom 1</button><span id="c1-file"></span><br> <button class="btn waves-effect" style="width:120px;" onclick="customSound(1)">Custom 1</button><span
<button class="btn waves-effect" style="width:120px;" onclick="customSound(2)">Custom 2</button><span id="c2-file"></span><br> id="c1-file"></span><br>
<button class="btn waves-effect" style="width:120px;" onclick="customSound(3)">Custom 3</button><span id="c3-file"></span><br> <button class="btn waves-effect" style="width:120px;" onclick="customSound(2)">Custom 2</button><span
<button class="btn waves-effect" style="width:120px;" onclick="customSound(4)">Custom 4</button><span id="c4-file"></span><br> id="c2-file"></span><br>
<button class="btn waves-effect" style="width:120px;" onclick="customSound(3)">Custom 3</button><span
id="c3-file"></span><br>
<button class="btn waves-effect" style="width:120px;" onclick="customSound(4)">Custom 4</button><span
id="c4-file"></span><br>
</div> </div>
</li> </li>
<li> <li>

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More