Compare commits
4 Commits
v21.1.0
...
use-strict
Author | SHA1 | Date | |
---|---|---|---|
|
957ef30fc0 | ||
|
bae73521e9 | ||
|
2583c3b80a | ||
|
2b6cf60868 |
2
.github/FUNDING.yml
vendored
@@ -5,4 +5,4 @@ patreon: cutls
|
||||
open_collective: # Replace with a single Open Collective username
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||
custom: https://cutls.fanbox.cc
|
||||
custom: https://www.pixiv.net/fanbox/creator/28105985
|
||||
|
1
.gitignore
vendored
@@ -23,4 +23,3 @@ app/view/es-AR
|
||||
app/git
|
||||
*.code-workspace
|
||||
releasenote.md
|
||||
app/yarn-error.log
|
||||
|
26
README.md
@@ -28,6 +28,7 @@ The icon is provided under [Creative Commons BY-NC-SA](https://creativecommons.o
|
||||
* [SVG 4095x4096](https://d2upiril6ywqp9.cloudfront.net/press/thedesk-fullcolor.svg)
|
||||
* [ico 256x256](https://d2upiril6ywqp9.cloudfront.net/press/thedesk.ico)
|
||||
* [icns old](https://d2upiril6ywqp9.cloudfront.net/press/thedesk.icns)
|
||||
* [Illustrator .ai](https://d2upiril6ywqp9.cloudfront.net/press/thedesk.ai)
|
||||
|
||||
The default sounds of notifications is provided [Creative Commons BY](https://creativecommons.org/licenses/by/4.0/)
|
||||
|
||||
@@ -46,6 +47,19 @@ The default sounds of notifications is provided [Creative Commons BY](https://cr
|
||||
|
||||
Crowdin project is available! Visit: https://translate.thedesk.top
|
||||
|
||||
## Requirement and development
|
||||
|
||||
* Electron 4.2 or above(install yourself)
|
||||
* electron-dl(in package.json)
|
||||
* Jimp(in package.json)
|
||||
* font-manager(in package.json)
|
||||
* Python 2.x(install yourself)
|
||||
* VisualC++(Windows)(install yourself)
|
||||
* itunes-nowplaying-mac(for macOS)(in package.json)
|
||||
* node-notifier(in package.json)
|
||||
* sumchecker(in package.json)
|
||||
* Ability to read unformated files!(install yourself)
|
||||
|
||||
### Run on developer mode
|
||||
|
||||
`npm run dev` on `app` folder.
|
||||
@@ -145,17 +159,6 @@ Linux
|
||||
macOS
|
||||
`electron-packager ./app TheDesk --executable-name="TheDesk" --app-copyright="Copyright (c) TheDesk 2018 Cutls.com 2015 All Right Reserved" --platform=darwin --arch=all --electron-version=4.0.5 --icon=./app/icon.icns --overwrite`
|
||||
|
||||
### PWA support
|
||||
|
||||
TheDesk is a wed-based app, so you can run it on a browser. Of course, the main stream is as Electron. Some features won't work as well as Electron.
|
||||
|
||||
You can run `npm run build:pwa` to build as PWA, including `manifest.json` and the ServiceWorker.
|
||||
|
||||
**You have to rename `node_modules` to `dependencies` to run as a web application. (restricted by Netlify)**
|
||||
|
||||
Check the app on Chrome or Firefox: [Here](https://app.thedesk.top) (it follows the `master` branch, so not stable.)
|
||||
[](https://app.netlify.com/sites/thedesk/deploys)
|
||||
|
||||
## Pleroma support
|
||||
|
||||
Did you find a bug with Pleroma accounts?
|
||||
@@ -165,3 +168,4 @@ Please write issues to improve TheDesk affinity with Pleroma.
|
||||
## Vulnerabilities when `npm i`???
|
||||
|
||||
No, if your npm says materialize-css has vulnerabilities(CVE-2019-11002/3/4), look at [here](https://github.com/Dogfalo/materialize/issues/6286) under discussion.
|
||||
|
||||
|
24
README_ja.md
@@ -46,6 +46,19 @@ Download:[TheDesk](https://thedesk.top) [
|
||||
* electron-dl(in package.json)
|
||||
* Jimp(in package.json)
|
||||
* font-manager(in package.json)
|
||||
* Python 2.x(自分で入れて)
|
||||
* VisualC++(Windows)(自分で入れて)
|
||||
* itunes-nowplaying-mac(macOS向け)(in package.json)
|
||||
* node-notifier(in package.json)
|
||||
* sumchecker(in package.json)
|
||||
* Ability to read unformated files!(自分で入れて)
|
||||
|
||||
### デベロッパーモード
|
||||
|
||||
`npm run dev`を`app`フォルダ内で実行
|
||||
@@ -145,17 +158,6 @@ Linux
|
||||
macOS
|
||||
`electron-packager ./app TheDesk --executable-name="TheDesk" --app-copyright="Copyright (c) TheDesk 2018 Cutls.com 2015 All Right Reserved" --platform=darwin --arch=all --electron-version=4.0.5 --icon=./app/icon.icns --overwrite`
|
||||
|
||||
### PWAとして実行
|
||||
|
||||
TheDeskはウェブ技術を使用して作られているので、ブラウザで動かすこともできます。もちろん、Electron向けに設計されているので一部機能は動きません。
|
||||
|
||||
`npm run build:pwa`でビルドできます。PWAに必要な`manifest.json`やサービスワーカーなども要員されています。
|
||||
|
||||
**`node_modules`を`dependencies`にリネームしないと動きません。(Netlifyの制限です)**
|
||||
|
||||
ChromeまたはFirefoxでチェック: [こちら](https://app.thedesk.top) (`master`ブランチに追従しています。不安定です。)
|
||||
[](https://app.netlify.com/sites/thedesk/deploys)
|
||||
|
||||
## Pleromaのサポート
|
||||
|
||||
Pleromaは、Mastodon APIとの互換性を謳っていますが、実際には様々な差異があり、TheDeskで不具合が発生することがあります。
|
||||
|
@@ -1,5 +0,0 @@
|
||||
js/common/blurhash.js
|
||||
js/common/hammer.min.js
|
||||
js/common/sha256.js
|
||||
js/platform/punycode.js
|
||||
js/platform/tj-deck.js
|
@@ -1,14 +0,0 @@
|
||||
{
|
||||
"extends": "eslint:recommended",
|
||||
"env": {"browser": true},
|
||||
"rules": {
|
||||
"no-console": "off",
|
||||
"semi": ["error", "never"]
|
||||
},
|
||||
"globals": {
|
||||
"$": false,
|
||||
"ver": true,
|
||||
"pwa": true,
|
||||
"lang": true
|
||||
}
|
||||
}
|
@@ -1,14 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html lang="ja">
|
||||
<head>
|
||||
|
||||
<head>
|
||||
<title>TheDesk</title>
|
||||
<meta content="width=device-width,initial-scale=1.0" name="viewport" />
|
||||
<link href="./node_modules/materialize-css/dist/css/materialize.css" type="text/css" rel="stylesheet" />
|
||||
<link href="./css/font-awesome.css" rel="stylesheet" type="text/css" />
|
||||
<link href="./css/themes.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" />
|
||||
<meta charset="utf-8" />
|
||||
<meta content="width=device-width,initial-scale=1.0" name="viewport">
|
||||
<link href="./node_modules/materialize-css/dist/css/materialize.css" type="text/css" rel="stylesheet">
|
||||
<link href='./css/font-awesome.css' rel='stylesheet' type='text/css'>
|
||||
<link href="./css/themes.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">
|
||||
<meta charset="utf-8">
|
||||
<style>
|
||||
body {
|
||||
font-family: 'Open Sans';
|
||||
@@ -28,7 +29,7 @@
|
||||
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' 'name6 data6';
|
||||
grid-template-areas: 'name1 data1''name2 data2''name3 data3''name4 data4''name5 data5''name6 data6';
|
||||
text-align: left;
|
||||
margin: 5px;
|
||||
}
|
||||
@@ -81,13 +82,13 @@
|
||||
grid-area: data6;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
</head>
|
||||
|
||||
<body class="center" style="overflow: hidden;">
|
||||
<body class="center " style="overflow:hidden">
|
||||
<script type="text/javascript" src="./node_modules/jquery/dist/jquery.js"></script>
|
||||
<script type="text/javascript" src="./js/platform/first-not-view.js"></script>
|
||||
<script type="text/javascript" src="./node_modules/materialize-css/dist/js/materialize.js"></script>
|
||||
<img src="./img/desk.svg" style="max-width: 62%;" />
|
||||
<img src="./img/desk.svg" style="max-width:62%;">
|
||||
<h5>TheDesk</h5>
|
||||
<div class="container">
|
||||
<div class="area-name1">Display version</div>
|
||||
@@ -103,37 +104,32 @@
|
||||
<div class="area-name6">Node.js</div>
|
||||
<div class="area-data6" id="node"></div>
|
||||
</div>
|
||||
<div class="cp">
|
||||
Copyright © TheDesk 2018<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://pl.kpherox.dev/kPherox"
|
||||
target="_blank"
|
||||
>kPherox</a
|
||||
>
|
||||
and all users
|
||||
<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" />
|
||||
<br /><a href="https://thedesk.top" target="_blank">Web site</a>
|
||||
</div>
|
||||
<button onclick="window.close()" class="btn waves-effect indigo" style="width: calc(100% - 10px);"><i class="material-icons left">close</i>Close</button>
|
||||
<div class="cp">Copyright © TheDesk 2018<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://pl.kpherox.dev/kPherox"
|
||||
target="_blank">kPherox</a> and all users
|
||||
<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">
|
||||
<br><a href="https://thedesk.top" target="_blank">Web site</a></div>
|
||||
<button onclick="window.close()" class="btn waves-effect indigo" style="width:calc(100% - 10px);"><i
|
||||
class="material-icons left">close</i>Close</button>
|
||||
<script type="text/javascript" src="./js/ui/theme.js"></script>
|
||||
<script>
|
||||
var about = JSON.parse(localStorage.getItem('about'))
|
||||
$('#now').text(localStorage.getItem('ver'))
|
||||
$('#node').text(about[0])
|
||||
$('#chrome').text(about[1])
|
||||
$('#electron').text(about[2])
|
||||
var about = JSON.parse(localStorage.getItem("about"));
|
||||
$("#now").text(localStorage.getItem("ver"));
|
||||
$("#node").text(about[0]);
|
||||
$("#chrome").text(about[1]);
|
||||
$("#electron").text(about[2]);
|
||||
if (location.search) {
|
||||
var m = location.search.match(/\?ver=([a-zA-Z-0-9.]+)/)
|
||||
var ver = m[1]
|
||||
$('#ver').text(ver)
|
||||
var m = location.search.match(/\?ver=([a-zA-Z-0-9.]+)/);
|
||||
var ver = m[1];
|
||||
$("#ver").text(ver);
|
||||
}
|
||||
$('#hash').html('<a href="https://github.com/cutls/TheDesk/commits/' + about[3] + '" target="_blank">' + about[3].slice(0, 7) + '</a>')
|
||||
$(document).on('click', 'a', (e) => {
|
||||
var url = $(e.target).attr('href')
|
||||
postMessage(['openUrl', url], '*')
|
||||
return false
|
||||
})
|
||||
$("#hash").html('<a href="https://github.com/cutls/TheDesk/commits/' + about[3] + '" target="_blank">' + about[3].slice(0, 7) + '</a>');
|
||||
$(document).on('click', 'a', e => {
|
||||
var url = $(e.target).attr('href');
|
||||
postMessage(["openUrl", url], "*")
|
||||
return false;
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 9.4 KiB |
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 9.7 KiB After Width: | Height: | Size: 9.4 KiB |
@@ -1,91 +0,0 @@
|
||||
.acct {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
}
|
||||
|
||||
.card {
|
||||
width: 400px;
|
||||
background-color: #494949;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
body,
|
||||
html {
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
#acct-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
color: white;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
#acct-list .btn-flat.white-text {
|
||||
color: inherit !important;
|
||||
}
|
||||
|
||||
#acct-list .btn-flat.red-text {
|
||||
background-color: white !important;
|
||||
}
|
||||
|
||||
|
||||
.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;
|
||||
}
|
||||
.hide-second {
|
||||
display: none;
|
||||
}
|
||||
.first .hide-second {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
#compt {
|
||||
margin-top: 20px;
|
||||
margin-bottom: 50px;
|
||||
border: 1px solid;
|
||||
border: 1px solid;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
#compt li {
|
||||
list-style-type: disc;
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
#domain-list {
|
||||
width: 500px;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
i.left {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
#domain-list .title {
|
||||
font-size: 1.3rem;
|
||||
}
|
@@ -5,43 +5,19 @@ body {
|
||||
overflow: hidden;
|
||||
user-select: none;
|
||||
cursor: default;
|
||||
font-size: 13px;
|
||||
height: 100vh;
|
||||
color: var(--color);
|
||||
}
|
||||
html {
|
||||
font-size: 13px;
|
||||
}
|
||||
.titlebar,
|
||||
.menubar-menu-container,
|
||||
.action-menu-item {
|
||||
background-color: var(--notfbox) !important;
|
||||
filter: brightness(110%) !important;
|
||||
color: var(--color) !important;
|
||||
}
|
||||
.action-menu-item:hover {
|
||||
filter: brightness(80%) !important;
|
||||
}
|
||||
.btn, .btn-flat {
|
||||
font-size: 1.1rem;
|
||||
margin: 0.4rem;
|
||||
.btn {
|
||||
margin: 5px;
|
||||
text-transform: none;
|
||||
height: 2.76rem;
|
||||
line-height: 2.76rem;
|
||||
}
|
||||
.markdown {
|
||||
display: none;
|
||||
}
|
||||
.accessMark {
|
||||
font-size: 12px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
background-color: var(--emphasized);
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
}
|
||||
.accessibility .scr {
|
||||
display: none !important;
|
||||
help {
|
||||
display: none;
|
||||
}
|
||||
.show-help {
|
||||
display: inline;
|
||||
@@ -81,7 +57,7 @@ option {
|
||||
padding: 0;
|
||||
}
|
||||
#imagemodal .modal-footer {
|
||||
overflow-x: hidden;
|
||||
overflow-x: scroll;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
@@ -94,7 +70,7 @@ option {
|
||||
}
|
||||
.badge {
|
||||
min-width: 0 !important;
|
||||
margin-left: 0.4rem !important;
|
||||
margin-left: 5px !important;
|
||||
}
|
||||
.unvisible {
|
||||
opacity: 0;
|
||||
@@ -153,7 +129,7 @@ option {
|
||||
}
|
||||
code:before,
|
||||
.pre:before {
|
||||
content: 'Code';
|
||||
content: "Code";
|
||||
font-size: 1.8rem;
|
||||
line-height: 1em;
|
||||
font-family: monospace, monospace;
|
||||
@@ -168,17 +144,16 @@ pre {
|
||||
display: block;
|
||||
border-left: 5px solid;
|
||||
border-color: #079903;
|
||||
padding-left: 0.75rem;
|
||||
margin-top: 0.75rem;
|
||||
margin-bottom: 0.75rem;
|
||||
margin-left: 0.75rem;
|
||||
padding-left: 10px;
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
margin-left: 5px;
|
||||
background-color: #000;
|
||||
padding: 1em 1em 1em;
|
||||
position: relative;
|
||||
border-top-left-radius: 0.75rem;
|
||||
border-bottom-right-radius: 0.75rem;
|
||||
border-bottom-left-radius: 0.75rem;
|
||||
white-space: normal;
|
||||
border-top-left-radius: 10px;
|
||||
border-bottom-right-radius: 10px;
|
||||
border-bottom-left-radius: 10px;
|
||||
}
|
||||
blockquote,
|
||||
.quote p {
|
||||
@@ -190,13 +165,13 @@ blockquote,
|
||||
background-color: #ddd;
|
||||
padding: 1em 1em 1em;
|
||||
position: relative;
|
||||
border-top-left-radius: 0.75rem;
|
||||
border-bottom-right-radius: 0.75rem;
|
||||
border-bottom-left-radius: 0.5rem;
|
||||
border-top-left-radius: 10px;
|
||||
border-bottom-right-radius: 10px;
|
||||
border-bottom-left-radius: 10px;
|
||||
}
|
||||
blockquote:before,
|
||||
.quote:before {
|
||||
content: 'Quote';
|
||||
content: "Quote";
|
||||
font-size: 1.8rem;
|
||||
line-height: 1em;
|
||||
font-family: Open Sans, cursive;
|
||||
@@ -210,13 +185,13 @@ blockquote:before,
|
||||
background-color: #fff;
|
||||
padding: 1em 1em 1em;
|
||||
position: relative;
|
||||
border-top-left-radius: 0.75rem;
|
||||
border-bottom-right-radius: 0.75rem;
|
||||
border-bottom-left-radius: 0.75rem;
|
||||
border-top-left-radius: 10px;
|
||||
border-bottom-right-radius: 10px;
|
||||
border-bottom-left-radius: 10px;
|
||||
border-left: 5px solid #0096fa;
|
||||
}
|
||||
.pixiv-post :before {
|
||||
content: 'From Pixiv';
|
||||
content: "From Pixiv";
|
||||
font-size: 1.8rem;
|
||||
line-height: 1em;
|
||||
font-family: Open Sans;
|
||||
@@ -229,9 +204,8 @@ blockquote:before,
|
||||
display: none;
|
||||
position: fixed;
|
||||
width: 100vw;
|
||||
height: calc(100vh - 3rem);
|
||||
height: calc(100vh - 40px);
|
||||
background-color: var(--bg);
|
||||
filter: brightness(50%);
|
||||
color: var(--color);
|
||||
z-index: 99999;
|
||||
justify-content: center;
|
||||
@@ -325,7 +299,7 @@ blockquote:before,
|
||||
}
|
||||
.font {
|
||||
font-size: 1.5rem;
|
||||
margin-bottom: 0.4rem;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.font:hover {
|
||||
background-color: #999;
|
||||
@@ -341,14 +315,14 @@ blockquote:before,
|
||||
}
|
||||
#menu {
|
||||
position: fixed;
|
||||
z-index: 999;
|
||||
z-index: 9999;
|
||||
background-color: var(--postbox);
|
||||
width: 540px;
|
||||
top: calc(50% - 150px);
|
||||
left: calc(50% - 250px);
|
||||
padding: 0.4rem;
|
||||
padding: 5px;
|
||||
border: thin solid gray;
|
||||
border-radius: 0.4rem;
|
||||
border-radius: 5px;
|
||||
overflow: hidden;
|
||||
}
|
||||
#menu-wrapper {
|
||||
@@ -358,34 +332,30 @@ blockquote:before,
|
||||
overflow: hidden;
|
||||
}
|
||||
#left-menu {
|
||||
width: 17.7rem;
|
||||
width: 230px;
|
||||
}
|
||||
#left-menu a {
|
||||
padding-left: 0.4rem;
|
||||
#left-menu div {
|
||||
padding-left: 5px;
|
||||
width: 100%;
|
||||
height: 3rem;
|
||||
height: 50px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
color: var(--color);
|
||||
}
|
||||
#left-menu a:hover {
|
||||
#left-menu div:hover {
|
||||
background-color: var(--beforehover);
|
||||
}
|
||||
#left-menu span {
|
||||
margin-left: 0.4rem;
|
||||
margin-left: 5px;
|
||||
}
|
||||
#left-menu a.active {
|
||||
#left-menu div.active {
|
||||
background-color: var(--emphasized);
|
||||
}
|
||||
#left-menu a.active span {
|
||||
text-decoration: underline;
|
||||
}
|
||||
#right-menu {
|
||||
width: 100%;
|
||||
overflow-y: scroll;
|
||||
overflow-x: hidden;
|
||||
padding: 0.4rem;
|
||||
padding: 5px;
|
||||
}
|
||||
#tltype {
|
||||
display: flex;
|
||||
@@ -395,13 +365,12 @@ blockquote:before,
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
width: 13rem;
|
||||
height: 3.1rem;
|
||||
width: 170px;
|
||||
height: 40px;
|
||||
cursor: pointer;
|
||||
color: var(--color);
|
||||
}
|
||||
#tltype .type span {
|
||||
width: calc(100% - 2.3rem);
|
||||
width: calc(100% - 30px);
|
||||
}
|
||||
#tltype .type:hover {
|
||||
background-color: var(--beforehover);
|
||||
@@ -410,28 +379,28 @@ blockquote:before,
|
||||
background-color: var(--emphasized);
|
||||
}
|
||||
#tltype i {
|
||||
font-size: 2.3rem;
|
||||
font-size: 30px;
|
||||
}
|
||||
#tltype i.sub-icon {
|
||||
font-size: 1.53rem;
|
||||
font-size: 20px;
|
||||
position: absolute;
|
||||
color: var(--beforehover);
|
||||
left: 0.9rem;
|
||||
bottom: 0.4rem;
|
||||
left: 10px;
|
||||
bottom: 5px;
|
||||
background-color: #fff;
|
||||
}
|
||||
.drag-bar {
|
||||
cursor: move;
|
||||
text-align: center;
|
||||
width: calc(100% + 0.8rem);
|
||||
width: calc(100% + 10px);
|
||||
border-radius: 5px;
|
||||
background-color: var(--box);
|
||||
filter: brightness(80%);
|
||||
margin-left: -0.4rem;
|
||||
margin-right: -0.4rem;
|
||||
margin-top: -0.4rem;
|
||||
font-size: 1.3rem;
|
||||
padding: 0.3rem;
|
||||
margin-left: -5px;
|
||||
margin-right: -5px;
|
||||
margin-top: -5px;
|
||||
font-size: 16px;
|
||||
padding: 4px;
|
||||
}
|
||||
#something-wrong {
|
||||
flex-direction: column;
|
||||
@@ -448,11 +417,11 @@ blockquote:before,
|
||||
width: 100vw;
|
||||
background-color: var(--box);
|
||||
z-index: 9999;
|
||||
padding: 0.8rem;
|
||||
padding: 10px;
|
||||
display: grid;
|
||||
grid-template-columns: 3fr 1fr 1fr;
|
||||
grid-template-rows: 1fr 2.7rem;
|
||||
grid-template-areas: 'note middle right' 'note close close';
|
||||
grid-template-rows: 1fr 36px;
|
||||
grid-template-areas: "note middle right" "note close close";
|
||||
}
|
||||
#support-btm-en,
|
||||
#support-btm-ja {
|
||||
@@ -468,7 +437,7 @@ blockquote:before,
|
||||
grid-area: close;
|
||||
}
|
||||
.select-wrapper .dropdown-content {
|
||||
width: 19.2rem !important;
|
||||
width: 250px !important;
|
||||
}
|
||||
input,
|
||||
textarea {
|
||||
@@ -484,7 +453,7 @@ textarea {
|
||||
color: var(--color) !important;
|
||||
}
|
||||
#src-contents svg {
|
||||
margin-right: 0.4rem;
|
||||
margin-right: 5px;
|
||||
}
|
||||
.contributor {
|
||||
cursor: pointer;
|
||||
@@ -492,64 +461,6 @@ textarea {
|
||||
.contributor img {
|
||||
width: 1rem;
|
||||
}
|
||||
.tagComp {
|
||||
display: grid;
|
||||
grid-template-columns: 4.6rem 6.15rem 1fr;
|
||||
grid-template-rows: 1fr 1fr;
|
||||
grid-template-areas: 'svg toot user' 'svg toot tag' 'svg toots tag';
|
||||
border-top: dotted 0.5px var(--gray);
|
||||
padding: 0.4rem;
|
||||
}
|
||||
.tagCompSvg {
|
||||
grid-area: svg;
|
||||
}
|
||||
.tagCompToot {
|
||||
grid-area: toot;
|
||||
text-align: center;
|
||||
}
|
||||
.tagCompToots {
|
||||
grid-area: toots;
|
||||
text-align: center;
|
||||
}
|
||||
.tagCompUser {
|
||||
grid-area: user;
|
||||
}
|
||||
.tagCompTag {
|
||||
grid-area: tag;
|
||||
padding-top: 0.4rem;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
#sabakanMark {
|
||||
background-color: var(--emphasized);
|
||||
}
|
||||
#pageSrc {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: calc(50vw - 11.53rem);
|
||||
width: 23rem;
|
||||
max-width: 100%;
|
||||
background-color: var(--box);
|
||||
z-index: 501;
|
||||
padding: 0.4rem;
|
||||
}
|
||||
#pageSrcInput {
|
||||
width: 12.3rem;
|
||||
}
|
||||
.voice {
|
||||
clip: rect(1px, 1px, 1px, 1px);
|
||||
position: absolute !important;
|
||||
height: 1px;
|
||||
width: 1px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
@media (max-width: 500px) {
|
||||
#pageSrc {
|
||||
left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
/*スクロールバー*/
|
||||
::-webkit-scrollbar {
|
||||
@@ -570,23 +481,28 @@ textarea {
|
||||
}
|
||||
/* Web Fonts */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-family: "Open Sans";
|
||||
font-style: normal;
|
||||
font-weight: 300;
|
||||
src: local('Open Sans Light'), local('OpenSans-Light'), url('../fonts/OpenSans-Light.ttf') format('truetype');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
src: local("Open Sans Light"), local("OpenSans-Light"),
|
||||
url(https://fonts.gstatic.com/s/opensans/v17/mem5YaGs126MiZpBA-UN_r8OUuhp.woff2)
|
||||
format("woff2");
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
|
||||
U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
|
||||
U+FEFF, U+FFFD;
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Material Icons';
|
||||
font-family: "Material Icons";
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: url(https://fonts.gstatic.com/s/materialicons/v48/flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2) format('woff2');
|
||||
src: url(https://fonts.gstatic.com/s/materialicons/v48/flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2)
|
||||
format("woff2");
|
||||
}
|
||||
.material-icons {
|
||||
font-family: 'Material Icons';
|
||||
font-family: "Material Icons";
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
font-size: 1.84rem;
|
||||
font-size: 24px;
|
||||
line-height: 1;
|
||||
letter-spacing: normal;
|
||||
text-transform: none;
|
||||
@@ -594,22 +510,6 @@ textarea {
|
||||
white-space: nowrap;
|
||||
word-wrap: normal;
|
||||
direction: ltr;
|
||||
-webkit-font-feature-settings: 'liga';
|
||||
-webkit-font-feature-settings: "liga";
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
.pwaView .pwa,
|
||||
.pwaView .mac,
|
||||
.pwaView .win {
|
||||
display: none;
|
||||
}
|
||||
.win32 .mac,
|
||||
.linux .mac {
|
||||
display: none;
|
||||
}
|
||||
.linux .win,
|
||||
.darwin .win {
|
||||
display: none;
|
||||
}
|
||||
.dropdown-content.header:hover {
|
||||
background-color: white;
|
||||
}
|
@@ -8,16 +8,15 @@
|
||||
border: thin solid gray;
|
||||
z-index: 501;
|
||||
max-width: 100%;
|
||||
padding: 0.4rem;
|
||||
border-radius: 0.4rem;
|
||||
padding: 5px;
|
||||
border-radius: 5px;
|
||||
overflow: hidden;
|
||||
}
|
||||
textarea {
|
||||
min-height: 7.7rem !important;
|
||||
min-height: 100px !important;
|
||||
font-family: inherit;
|
||||
}
|
||||
#post-box .ui-resizable-s,
|
||||
#post-box .ui-resizable-se {
|
||||
#post-box .ui-resizable-s, #post-box .ui-resizable-se{
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
@@ -65,69 +64,66 @@ textarea {
|
||||
#emoji {
|
||||
}
|
||||
#suggest {
|
||||
max-height: 23rem;
|
||||
max-height: 300px;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
#emoji-list {
|
||||
width: 100%;
|
||||
height: 15.4rem;
|
||||
height: 200px;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
#preview-field {
|
||||
display: none;
|
||||
}
|
||||
.preview-img {
|
||||
width: 4rem;
|
||||
max-height: 7.6rem;
|
||||
width: 50px;
|
||||
max-height: 100px;
|
||||
}
|
||||
.pi-wrap {
|
||||
display: inline-block;
|
||||
width: 3.8rem;
|
||||
max-height: 7.7rem;
|
||||
width: 50px;
|
||||
max-height: 100px;
|
||||
}
|
||||
#default-emoji a {
|
||||
color: var(--color);
|
||||
margin-right: 0.15rem;
|
||||
margin-right: 2px;
|
||||
}
|
||||
.character-counter {
|
||||
position: relative;
|
||||
top: -1.9rem;
|
||||
top: -25px;
|
||||
}
|
||||
.trendtag {
|
||||
overflow-y: scroll;
|
||||
max-height: 7.7rem;
|
||||
max-height: 100px;
|
||||
}
|
||||
#toot-btn-field {
|
||||
display: flex;
|
||||
}
|
||||
#toot-post-btn {
|
||||
width: calc(100% - 0.7rem);
|
||||
width: calc(100% - 10px);
|
||||
padding: 0;
|
||||
margin-top: 0.7rem;
|
||||
height: 2.7rem;
|
||||
margin-top: 10px;
|
||||
}
|
||||
#toot-sec-btn {
|
||||
width: 2.3rem;
|
||||
width: 30px;
|
||||
padding: 0;
|
||||
margin-top: 0.7rem;
|
||||
margin-top: 10px;
|
||||
}
|
||||
#left-side {
|
||||
float: left;
|
||||
overflow-x: hidden;
|
||||
height: calc(100% - 2.5rem);
|
||||
height: calc(100% - 32px);
|
||||
}
|
||||
#right-side {
|
||||
display: none;
|
||||
float: left;
|
||||
width: 23rem;
|
||||
padding: 0.4rem;
|
||||
width: 300px;
|
||||
padding: 5px;
|
||||
overflow-x: hidden;
|
||||
height: calc(100% - 2.5rem);
|
||||
height: calc(100% - 32px);
|
||||
}
|
||||
#posttgl,
|
||||
#toot-post-btn {
|
||||
#posttgl,#toot-post-btn {
|
||||
background-color: var(--accentbtn);
|
||||
color: var(--color);
|
||||
}
|
||||
/*mini*/
|
||||
.mini-post .mize {
|
||||
@@ -137,8 +133,8 @@ textarea {
|
||||
padding: 0;
|
||||
}
|
||||
.mini-post #post-box {
|
||||
width: 15.4rem;
|
||||
min-width: 7.7rem;
|
||||
width: 200px;
|
||||
min-width: 100px;
|
||||
}
|
||||
.mini-post #toot-field {
|
||||
padding: 0;
|
||||
|
@@ -3,29 +3,29 @@
|
||||
cursor: move;
|
||||
user-select: none;
|
||||
background-color: var(--modalfooter);
|
||||
margin: 0.4rem;
|
||||
border-radius: 0.4rem;
|
||||
margin: 5px;
|
||||
border-radius: 5px;
|
||||
color: var(--color);
|
||||
padding: 3px;
|
||||
display: grid;
|
||||
grid-template-columns: 3.3rem 1fr 4.6rem;
|
||||
grid-template-columns: 43px 1fr 60px;
|
||||
grid-template-areas: "sorticon sorttitle sorttitle" "sorticon sortacct sortaction";
|
||||
}
|
||||
.sorticon {
|
||||
grid-area: sorticon;
|
||||
}
|
||||
.sorticon i {
|
||||
font-size: 3.3rem;
|
||||
font-size: 43px;
|
||||
}
|
||||
.sorttitle {
|
||||
margin-left: 0.4rem;
|
||||
margin-left: 5px;
|
||||
grid-area: sorttitle;
|
||||
}
|
||||
.sortacct {
|
||||
margin-left: 0.4rem;
|
||||
margin-left: 5px;
|
||||
grid-area: sortacct;
|
||||
}
|
||||
.sortaction {
|
||||
margin-left: 0.4rem;
|
||||
margin-left: 5px;
|
||||
grid-area: sortaction;
|
||||
}
|
||||
|
@@ -142,51 +142,3 @@
|
||||
.bluetheme #imagemodal {
|
||||
background: url("../img/pixel.white.svg");
|
||||
}
|
||||
.polartheme {
|
||||
--bg: #2e3440;
|
||||
--drag: rgba(0, 0, 0, 0.8);
|
||||
--color: white;
|
||||
--beforehover: #8d94a0;
|
||||
--modal: #3b4252;
|
||||
--subcolor: #434c5e;
|
||||
--box: #4c566a;
|
||||
--sidebar: #3b4252;
|
||||
--shared: #2d3b58;
|
||||
--notfbox: #2a3857;
|
||||
--emphasized: #2f4b86;
|
||||
--his-data: rgba(0, 0, 0, 0.8);
|
||||
--active: #2a3857;
|
||||
--postbox: #434c5e;
|
||||
--modalfooter: #485166;
|
||||
--accentbtn: #2f4b86;
|
||||
--selected: #464f61;
|
||||
--selectedWithShare: #3e527e;
|
||||
--gray: #cccccc;
|
||||
}
|
||||
.polartheme #imagemodal {
|
||||
background: url("../img/pixel.svg");
|
||||
}
|
||||
.snowtheme {
|
||||
--bg: #eceff4;
|
||||
--drag: rgba(255, 255, 255, 0.8);
|
||||
--color: #36425a;
|
||||
--beforehover: #344058;
|
||||
--modal: #e5e9f0;
|
||||
--subcolor: #d8dee9;
|
||||
--box: #c0c8d6;
|
||||
--sidebar: #eeeeee;
|
||||
--shared: #c3d4e6;
|
||||
--notfbox: #d8dee9;
|
||||
--emphasized: #88c0d0;
|
||||
--his-data: rgba(255, 255, 255, 0.9);
|
||||
--active: #8fbcbb;
|
||||
--postbox: #d8dee9;
|
||||
--modalfooter: #b2bed4;
|
||||
--accentbtn: #81a1c1;
|
||||
--selected: #b4bdd0;
|
||||
--selectedWithShare: #a3afbb;
|
||||
--gray: #5c6c8c;
|
||||
}
|
||||
.snowtheme #imagemodal {
|
||||
background: url("../img/pixel.white.svg");
|
||||
}
|
318
app/css/tl.css
@@ -1,7 +1,7 @@
|
||||
/*TL CSS(ただしBBCode pulse:master.css/spin:font-awesome*/
|
||||
#main {
|
||||
width: 100vw;
|
||||
height: calc(100% - 3rem);
|
||||
height: calc(100vh - 40px);
|
||||
}
|
||||
#timeline-container {
|
||||
overflow-x: scroll;
|
||||
@@ -11,19 +11,18 @@
|
||||
}
|
||||
#bottom {
|
||||
position: absolute;
|
||||
overflow: hidden;
|
||||
bottom: 0;
|
||||
width: 100vw;
|
||||
height: 3rem;
|
||||
padding: 0.23rem;
|
||||
height: 40px;
|
||||
padding: 3px;
|
||||
padding-right: 0;
|
||||
padding-left: 3rem;
|
||||
padding-left: 40px;
|
||||
background-color: var(--sidebar);
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
z-index: 500;
|
||||
box-shadow: 0.77rem 0 0.77rem, 0.77rem rgba(0, 0, 0, 0.2);
|
||||
box-shadow: 10px 0 10px 10px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
#demobottom {
|
||||
width: 500px;
|
||||
@@ -31,24 +30,24 @@
|
||||
}
|
||||
#bottom.reverse {
|
||||
padding-left: 0;
|
||||
padding-right: 3rem;
|
||||
padding-right: 40px;
|
||||
}
|
||||
.reverse {
|
||||
flex-direction: row-reverse;
|
||||
}
|
||||
#bottom #dambox {
|
||||
width: 23rem;
|
||||
margin-right: 0.76rem;
|
||||
width: 300px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
#bottom.reverse #dambox {
|
||||
margin-right: 0;
|
||||
}
|
||||
#bottom .trendtag {
|
||||
height: 3rem;
|
||||
height: 40px;
|
||||
}
|
||||
#bottom #group,
|
||||
#demogroup {
|
||||
margin-right: 3rem;
|
||||
margin-right: 40px;
|
||||
}
|
||||
#bottom .leftside {
|
||||
display: flex;
|
||||
@@ -58,41 +57,33 @@
|
||||
align-items: center;
|
||||
}
|
||||
#bottom #tips img {
|
||||
vertical-align: -0.23rem;
|
||||
vertical-align: -3px;
|
||||
}
|
||||
#bottom a,
|
||||
#demogroup a {
|
||||
color: var(--color);
|
||||
}
|
||||
#bottom i {
|
||||
font-size: 2.3rem;
|
||||
font-size: 30px;
|
||||
}
|
||||
.exc-icons {
|
||||
font-size: 1.53rem;
|
||||
font-size: 20px;
|
||||
}
|
||||
.exc-chb {
|
||||
padding-left: 1.84rem !important;
|
||||
padding-left: 24px !important;
|
||||
}
|
||||
.btnsgroup {
|
||||
border: 1px solid;
|
||||
padding-top: 1px;
|
||||
padding-left: 0.4rem;
|
||||
padding-right: 0.4rem;
|
||||
margin-right: 1.15rem;
|
||||
border-radius: 0.4rem;
|
||||
height: 2.7rem;
|
||||
}
|
||||
.bgReport {
|
||||
height: 2.61rem;
|
||||
padding-top: 0.45rem;
|
||||
text-decoration: underline;
|
||||
padding-left: 0.4rem;
|
||||
padding-right: 0.4rem;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
margin-right: 15px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
#spot-box {
|
||||
display: grid;
|
||||
grid-template-columns: 3rem 2.3rem 2.5fr 1fr 4.6rem;
|
||||
grid-template-rows: 1.7rem 1.5rem;
|
||||
grid-template-columns: 40px 30px 2.5fr 1fr 60px;
|
||||
grid-template-rows: 22px 20px;
|
||||
grid-template-areas: 'cover name name artist refresh' 'cover progress progress progress time';
|
||||
}
|
||||
#spot-refresh {
|
||||
@@ -106,14 +97,14 @@
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
line-height: 1.92rem;
|
||||
line-height: 25px;
|
||||
}
|
||||
#spot-artist {
|
||||
grid-area: artist;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
line-height: 1.92rem;
|
||||
line-height: 25px;
|
||||
}
|
||||
#spot-img {
|
||||
width: 90%;
|
||||
@@ -127,7 +118,7 @@
|
||||
}
|
||||
.btnsgroup .grouptitle {
|
||||
font-family: Open Sans;
|
||||
font-size: 1.1rem;
|
||||
font-size: 15px;
|
||||
}
|
||||
@media screen and (max-width: 890px) {
|
||||
.btnsgroup .grouptitle {
|
||||
@@ -141,7 +132,7 @@
|
||||
iframe,
|
||||
.cvo video {
|
||||
max-width: 100%;
|
||||
max-height: 23rem;
|
||||
max-height: 300px;
|
||||
}
|
||||
@media screen and (max-width: 600px) {
|
||||
.mobile #timeline-container {
|
||||
@@ -158,12 +149,11 @@ iframe,
|
||||
.box {
|
||||
overflow: hidden;
|
||||
min-width: 300px;
|
||||
max-width: 600px;
|
||||
flex: 1;
|
||||
border-top: none;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-bottom: -0.75rem;
|
||||
margin-bottom: -10px;
|
||||
}
|
||||
.img_FTL {
|
||||
display: none;
|
||||
@@ -217,23 +207,16 @@ iframe,
|
||||
}
|
||||
.emoji,
|
||||
.emoji-img {
|
||||
width: 1.153rem;
|
||||
height: 1.153rem;
|
||||
object-fit: cover;
|
||||
width: 15px;
|
||||
}
|
||||
.area-toot .emoji,
|
||||
.area-toot .emoji-img {
|
||||
width: 1.538rem;
|
||||
height: 1.538rem;
|
||||
object-fit: cover;
|
||||
width: 20px;
|
||||
vertical-align: middle;
|
||||
margin: -1px 0;
|
||||
}
|
||||
.bigemoji {
|
||||
width: 7.7rem !important;
|
||||
height: auto !important;
|
||||
position: relative;
|
||||
z-index: 9999;
|
||||
width: 60px !important;
|
||||
}
|
||||
.faicon_FTL {
|
||||
display: none;
|
||||
@@ -243,7 +226,6 @@ iframe,
|
||||
flex: 1;
|
||||
overflow-y: scroll;
|
||||
overflow-x: hidden;
|
||||
background-color: var(--bg);
|
||||
}
|
||||
.additional {
|
||||
overflow-x: scroll;
|
||||
@@ -260,13 +242,13 @@ iframe,
|
||||
}
|
||||
.cvo {
|
||||
user-select: text;
|
||||
padding-left: 0.4rem;
|
||||
padding-left: 5px;
|
||||
border-bottom: 0.5px solid;
|
||||
padding-right: 0.15rem;
|
||||
padding-right: 2px;
|
||||
word-break: break-word;
|
||||
width: 100%;
|
||||
display: grid;
|
||||
grid-template-columns: 3.3rem 2fr 1fr;
|
||||
grid-template-columns: 43px 2fr 1fr;
|
||||
grid-template-rows: auto 1.6rem 1fr auto 2.5rem;
|
||||
grid-template-areas: 'notice notice notice' 'icon display_name display_name' 'space toot toot' 'space additional additional' 'vis actions side';
|
||||
}
|
||||
@@ -292,21 +274,21 @@ iframe,
|
||||
}
|
||||
|
||||
.area-notice {
|
||||
margin: 0.15rem;
|
||||
margin: 2px;
|
||||
grid-area: notice;
|
||||
}
|
||||
|
||||
.area-icon {
|
||||
width: 3rem;
|
||||
margin: 0.15rem;
|
||||
width: 40px;
|
||||
margin: 2px;
|
||||
grid-area: icon;
|
||||
}
|
||||
|
||||
.area-display_name {
|
||||
user-select: text;
|
||||
height: 1.5em;
|
||||
margin: 0.15rem;
|
||||
margin-left: 0.4rem;
|
||||
margin: 2px;
|
||||
margin-left: 5px;
|
||||
overflow: hidden;
|
||||
grid-area: display_name;
|
||||
white-space: nowrap;
|
||||
@@ -317,7 +299,7 @@ iframe,
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
.flex-name {
|
||||
max-width: calc(100% - 4.6rem);
|
||||
max-width: calc(100% - 60px);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
@@ -325,9 +307,9 @@ iframe,
|
||||
.area-toot {
|
||||
cursor: text;
|
||||
user-select: auto;
|
||||
margin-top: 0.4rem;
|
||||
margin-bottom: 0.4rem;
|
||||
margin-left: 0.4rem;
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
margin-left: 5px;
|
||||
grid-area: toot;
|
||||
}
|
||||
|
||||
@@ -360,7 +342,7 @@ iframe,
|
||||
.area-actions {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
top: -0.4rem;
|
||||
top: -5px;
|
||||
position: relative;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
@@ -368,59 +350,34 @@ iframe,
|
||||
grid-area: actions;
|
||||
}
|
||||
.area-vis {
|
||||
margin: 0.4rem;
|
||||
margin: 2px;
|
||||
grid-area: vis;
|
||||
text-align: center;
|
||||
}
|
||||
.area-side {
|
||||
display: flex;
|
||||
top: -0.4rem;
|
||||
top: -5px;
|
||||
position: relative;
|
||||
justify-content: flex-end;
|
||||
margin: 0.15rem;
|
||||
margin: 2px;
|
||||
grid-area: side;
|
||||
}
|
||||
|
||||
.cusr {
|
||||
user-select: text;
|
||||
padding-left: 0.4rem;
|
||||
border-bottom: 0.5px solid;
|
||||
padding-right: 0.15rem;
|
||||
word-break: break-word;
|
||||
width: 100%;
|
||||
display: grid;
|
||||
grid-template-columns: 3.3rem 2fr 1fr;
|
||||
grid-template-rows: auto 1.6rem 2fr auto;
|
||||
grid-template-areas: 'notice notice notice' 'icon display_name display_name' 'space status status' 'space actions actions';
|
||||
}
|
||||
|
||||
.area-status {
|
||||
grid-area: status;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
|
||||
.cusr .cbadge {
|
||||
margin-top: 0.46rem;
|
||||
margin-left: 0.46rem;
|
||||
}
|
||||
|
||||
.quote-inline {
|
||||
display: none;
|
||||
}
|
||||
.quote-renote {
|
||||
display: grid;
|
||||
grid-template-columns: 3.3rem 2fr 1.92rem;
|
||||
grid-template-columns: 43px 2fr 25px;
|
||||
grid-template-areas: 'ricon ruser rdet' 'ricon rtext rdet';
|
||||
border: 1px solid;
|
||||
margin-top: 0.23rem;
|
||||
margin-top: 3px;
|
||||
padding: 1px;
|
||||
border-radius: 0.23rem;
|
||||
border-radius: 3px;
|
||||
}
|
||||
.renote-icon {
|
||||
grid-area: ricon;
|
||||
padding: 0.4rem;
|
||||
padding: 5px;
|
||||
}
|
||||
.renote-details {
|
||||
grid-area: rdet;
|
||||
@@ -439,17 +396,17 @@ iframe,
|
||||
color: var(--color);
|
||||
}
|
||||
.area-side i {
|
||||
margin-left: 0.75rem;
|
||||
margin-left: 10px;
|
||||
}
|
||||
.viabadge {
|
||||
margin-top: 0.75rem;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.action i {
|
||||
font-size: 1.2rem;
|
||||
margin-right: 0.15rem;
|
||||
margin-right: 2px;
|
||||
}
|
||||
.action .fa-quote-right {
|
||||
margin-top: 0.15rem;
|
||||
margin-top: 2px;
|
||||
}
|
||||
.actct {
|
||||
color: var(--beforehover);
|
||||
@@ -468,24 +425,24 @@ iframe,
|
||||
position: fixed;
|
||||
background-color: var(--box);
|
||||
z-index: 9999;
|
||||
border-radius: 0.4rem;
|
||||
padding: 0.4rem;
|
||||
border-radius: 5px;
|
||||
padding: 5px;
|
||||
}
|
||||
.contextMenu.bottom:before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
right: 2rem;
|
||||
border: 1.2rem solid transparent;
|
||||
border-top: 1.2rem solid var(--box);
|
||||
right: 27px;
|
||||
border: 15px solid transparent;
|
||||
border-top: 15px solid var(--box);
|
||||
}
|
||||
.contextMenu.top:before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: -2.3rem;
|
||||
right: 2rem;
|
||||
border: 1.5rem solid transparent;
|
||||
border-bottom: 1.5rem solid var(--box);
|
||||
top: -30px;
|
||||
right: 27px;
|
||||
border: 15px solid transparent;
|
||||
border-bottom: 15px solid var(--box);
|
||||
}
|
||||
.contextMenu .btn-flat {
|
||||
text-transform: none !important;
|
||||
@@ -508,26 +465,26 @@ iframe,
|
||||
}
|
||||
.toot img:not(.emoji-img) {
|
||||
max-width: 100%;
|
||||
max-height: 23rem;
|
||||
max-height: 300px;
|
||||
}
|
||||
.cbadge {
|
||||
display: inline-block;
|
||||
min-width: 0.76rem;
|
||||
max-width: 7.7rem;
|
||||
padding: 0.23rem 0.5rem;
|
||||
min-width: 10px;
|
||||
max-width: 100px;
|
||||
padding: 3px 7px;
|
||||
font-size: 0.8em;
|
||||
margin-right: 0.4rem;
|
||||
margin-right: 5px;
|
||||
line-height: 1;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
vertical-align: middle;
|
||||
background-color: #777;
|
||||
border-radius: 0.75rem;
|
||||
border-radius: 10px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
height: calc(0.8em + 0.6rem);
|
||||
height: calc(0.8em + 8px);
|
||||
user-select: none;
|
||||
}
|
||||
.cbadge-hover {
|
||||
@@ -541,10 +498,10 @@ iframe,
|
||||
p {
|
||||
margin: 0;
|
||||
margin-bottom: 0px;
|
||||
line-height: 1.53rem;
|
||||
line-height: 20px;
|
||||
}
|
||||
p:not(:last-child) {
|
||||
margin-bottom: 0.76rem;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.shared {
|
||||
background-color: var(--shared);
|
||||
@@ -560,14 +517,14 @@ p:not(:last-child) {
|
||||
background-color: var(--notfbox);
|
||||
filter: brightness(110%);
|
||||
position: relative;
|
||||
margin-right: 0.7rem;
|
||||
margin-right: 10px;
|
||||
width: 100%;
|
||||
min-height: 4.6rem;
|
||||
min-height: 60px;
|
||||
z-index: 500;
|
||||
padding: 0.4rem;
|
||||
padding: 5px;
|
||||
display: grid;
|
||||
grid-template-columns: 3rem 5rem 1fr 1.8rem;
|
||||
grid-template-rows: 2.3rem 2.3rem;
|
||||
grid-template-columns: 40px 1fr 1fr 24px;
|
||||
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';
|
||||
}
|
||||
.emp {
|
||||
@@ -611,8 +568,8 @@ p:not(:last-child) {
|
||||
}
|
||||
#tools {
|
||||
position: fixed;
|
||||
top: 0.76rem;
|
||||
right: 0.76rem;
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
float: right;
|
||||
}
|
||||
.setting {
|
||||
@@ -625,14 +582,14 @@ p:not(:last-child) {
|
||||
}
|
||||
.notf-box {
|
||||
position: fixed;
|
||||
right: 5.4rem;
|
||||
right: 70px;
|
||||
background-color: var(--box);
|
||||
border: thin solid gray;
|
||||
z-index: 501;
|
||||
width: 30rem;
|
||||
padding: 0.4rem;
|
||||
min-height: 7.7rem;
|
||||
max-height: 38.4rem;
|
||||
width: 400px;
|
||||
padding: 5px;
|
||||
min-height: 100px;
|
||||
max-height: 500px;
|
||||
}
|
||||
.column-hide {
|
||||
display: none;
|
||||
@@ -640,21 +597,17 @@ p:not(:last-child) {
|
||||
height: 0;
|
||||
}
|
||||
.prof-img {
|
||||
border-radius: 0.23rem;
|
||||
width: 3rem;
|
||||
}
|
||||
.prof-img-sml {
|
||||
width: 1.5rem;
|
||||
border-radius: 3px;
|
||||
}
|
||||
.notf-icon {
|
||||
position: relative;
|
||||
top: -1.53rem;
|
||||
width: 1.5rem;
|
||||
left: 1.5rem;
|
||||
top: -20px;
|
||||
width: 20px;
|
||||
left: 20px;
|
||||
}
|
||||
.notf-indv-box {
|
||||
width: 100%;
|
||||
max-height: 30.7rem;
|
||||
max-height: 400px;
|
||||
overflow-y: scroll;
|
||||
overflow-x: hidden;
|
||||
border: thin solid gray;
|
||||
@@ -687,72 +640,47 @@ p:not(:last-child) {
|
||||
.vote {
|
||||
width: 100%;
|
||||
border: 1px solid;
|
||||
margin-top: 0.23rem;
|
||||
margin-top: 3px;
|
||||
padding: 1px;
|
||||
border-radius: 0.23rem;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
border-radius: 3px;
|
||||
}
|
||||
.fa-2x > .emoji-img {
|
||||
width: 2.3rem !important;
|
||||
height: 2.3rem !important;
|
||||
width: 36px !important;
|
||||
height: 36px !important;
|
||||
}
|
||||
.fa-3x > .emoji-img {
|
||||
width: 4.15rem !important;
|
||||
height: 4.15rem !important;
|
||||
width: 54px !important;
|
||||
height: 54px !important;
|
||||
}
|
||||
.fa-4x > .emoji-img {
|
||||
width: 4.6rem !important;
|
||||
height: 4.6rem !important;
|
||||
width: 72px !important;
|
||||
height: 72px !important;
|
||||
}
|
||||
.fa-5x > .emoji-img {
|
||||
width: 6.9rem !important;
|
||||
height: 6.9rem !important;
|
||||
width: 90px !important;
|
||||
height: 90px !important;
|
||||
}
|
||||
#lists-user {
|
||||
overflow-y: scroll;
|
||||
overflow-x: hidden;
|
||||
max-height: 15.4rem;
|
||||
max-height: 200px;
|
||||
}
|
||||
.votebtn {
|
||||
border: 1px solid;
|
||||
color: var(--bg);
|
||||
background-color: var(--beforehover);
|
||||
cursor: pointer;
|
||||
width: 3.8rem;
|
||||
height: 1.7rem;
|
||||
width: 50px;
|
||||
padding: 2px;
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
margin-top: 0.38rem;
|
||||
border-radius: 0.75rem;
|
||||
margin-top: 5px;
|
||||
border-radius: 10px;
|
||||
transition-duration: 0.5s;
|
||||
}
|
||||
.votebtn:hover {
|
||||
background-color: var(--color);
|
||||
}
|
||||
.leadPoll {
|
||||
position: absolute;
|
||||
background-color: var(--box);
|
||||
height: 1.5rem;
|
||||
border-radius: 0.23rem;
|
||||
}
|
||||
.lpAnime {
|
||||
animation-duration: 1s;
|
||||
animation-name: fadeInLeft;
|
||||
}
|
||||
.onPoll {
|
||||
position: relative;
|
||||
}
|
||||
.maxVoter {
|
||||
background-color: var(--emphasized);
|
||||
filter: brightness(120%);
|
||||
}
|
||||
.ownMark img {
|
||||
width: 1.2rem !important;
|
||||
position: relative;
|
||||
top: -1px;
|
||||
margin-left: 0.38rem !important;
|
||||
}
|
||||
.jump {
|
||||
display: inline-block;
|
||||
animation: jump 0.75s linear infinite;
|
||||
@@ -776,9 +704,6 @@ p:not(:last-child) {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.fav_ct, .rt_ct, .rep_ct {
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
.shared.selectedToot {
|
||||
background-color: var(--selectedWithShare);
|
||||
}
|
||||
@@ -792,18 +717,17 @@ audio {
|
||||
white-space: normal;
|
||||
}
|
||||
.cw_btn {
|
||||
margin: 0.23rem;
|
||||
margin: 3px;
|
||||
background-color: var(--emphasized);
|
||||
color: var(--color);
|
||||
padding-left: 0.23rem;
|
||||
padding-right: 0.23rem;
|
||||
border-radius: 0.23rem;
|
||||
padding-left: 3px;
|
||||
padding-right: 3px;
|
||||
border-radius: 3px;
|
||||
border: 1px solid var(--color);
|
||||
user-select: none;
|
||||
}
|
||||
.vis-data {
|
||||
font-size: 1rem !important;
|
||||
margin: 0.4rem;
|
||||
margin: 5px;
|
||||
user-select: none;
|
||||
}
|
||||
@keyframes jump {
|
||||
@@ -876,31 +800,3 @@ audio {
|
||||
.box .ui-resizable-se {
|
||||
display: none !important;
|
||||
}
|
||||
.announcement {
|
||||
padding: 0.38rem;
|
||||
border-bottom: 1px solid;
|
||||
}
|
||||
.announReaction {
|
||||
width: 2.7rem;
|
||||
height: 1.7rem;
|
||||
font-size: 1.1rem;
|
||||
margin: 0.23rem;
|
||||
cursor: pointer;
|
||||
border: solid 1px;
|
||||
padding-left: 0.15rem;
|
||||
background-color: var(--notfbox);
|
||||
border-radius: 0.15rem;
|
||||
}
|
||||
.announReaction img {
|
||||
position: relative;
|
||||
top: 0.23rem;
|
||||
}
|
||||
.announReaction.reactioned {
|
||||
background-color: var(--emphasized);
|
||||
}
|
||||
.announReaction.add {
|
||||
width: 1.46rem;
|
||||
}
|
||||
.reactionsPack {
|
||||
display: flex;
|
||||
}
|
@@ -1,7 +1,7 @@
|
||||
/*アイコンをクリックした時とかにでてくるユーザーデータ*/
|
||||
#his-data {
|
||||
background-repeat: no-repeat;
|
||||
background-image: url("../img/loading.svg");
|
||||
background-image: url("../../loading.svg");
|
||||
overflow-y: hidden;
|
||||
}
|
||||
#his-data .btn .material-icons{
|
||||
@@ -16,27 +16,31 @@
|
||||
}
|
||||
#his-prof {
|
||||
float: left;
|
||||
width: 7.7rem;
|
||||
margin-right: 0.4rem;
|
||||
width: 100px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
.his-float {
|
||||
overflow-y: scroll;
|
||||
padding: 0.4rem;
|
||||
padding: 5px;
|
||||
}
|
||||
#his-float-data {
|
||||
height: 100%;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
#his-leftside {
|
||||
width: 38.4rem;
|
||||
width: 500px;
|
||||
}
|
||||
#his-float-timeline {
|
||||
max-width: 59.6rem;
|
||||
max-width: 775px;
|
||||
height: 100%;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
#his-basic-prof {
|
||||
min-height: 10rem;
|
||||
min-height: 130px;
|
||||
}
|
||||
#his-matching-list {
|
||||
overflow-y: scroll;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
#his-field {
|
||||
vertical-align: baseline;
|
||||
@@ -51,14 +55,14 @@
|
||||
padding: 0;
|
||||
background-color: #757575;
|
||||
text-align: center;
|
||||
padding: 0.4rem;
|
||||
padding: 5px;
|
||||
margin-bottom: 1px;
|
||||
width: 30%;
|
||||
}
|
||||
.his-field-content {
|
||||
height: 1.5rem;
|
||||
padding: 0;
|
||||
padding-left: 0.4rem;
|
||||
padding-left: 5px;
|
||||
}
|
||||
.his-var-content a span.ellipsis:after {
|
||||
content: "...";
|
||||
@@ -72,13 +76,13 @@
|
||||
display: inline !important;
|
||||
}
|
||||
#his-data-show {
|
||||
margin: 1.5rem;
|
||||
margin-left: 3.8rem;
|
||||
margin-right: 3.8rem;
|
||||
margin: 20px;
|
||||
margin-left: 50px;
|
||||
margin-right: 50px;
|
||||
background-color: var(--his-data);
|
||||
height: calc(100% - 1.5rem);
|
||||
height: calc(100% - 20px);
|
||||
margin-bottom: 0;
|
||||
padding: 0.4rem;
|
||||
padding: 5px;
|
||||
}
|
||||
#his-data-wrap {
|
||||
display: flex;
|
||||
@@ -86,40 +90,39 @@
|
||||
.his-var-content {
|
||||
overflow-y: scroll;
|
||||
overflow-x: hidden;
|
||||
height: calc(100% - 3.4rem);
|
||||
padding-bottom: 60px;
|
||||
height: calc(100% - 45px);
|
||||
}
|
||||
#my-data-nav .btn {
|
||||
width: 10.7rem;
|
||||
width: 140px;
|
||||
}
|
||||
.active-back {
|
||||
background-color: var(--active);
|
||||
}
|
||||
#his-name .emojione,
|
||||
#his-name .emoji-img {
|
||||
width: 1.538rem;
|
||||
width: 20px;
|
||||
}
|
||||
#his-plus-action .btn {
|
||||
padding-right: 0.4rem;
|
||||
padding-left: 0.4rem;
|
||||
padding-right: 5px;
|
||||
padding-left: 5px;
|
||||
}
|
||||
.tabs {
|
||||
display: flex;
|
||||
}
|
||||
.tabs .tab a {
|
||||
padding: 0.6rem 0.9rem;
|
||||
padding: 8px 12px;
|
||||
}
|
||||
#his-des {
|
||||
max-height: 17.7rem;
|
||||
max-height: 250px;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
#his-sign-action {
|
||||
border: 1px solid;
|
||||
border-radius: 0.4rem;
|
||||
border-radius: 5px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-left: 0.75rem;
|
||||
padding-right: 0.75rem;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
#his-sign-action .btn {
|
||||
@@ -130,7 +133,7 @@
|
||||
cursor: pointer;
|
||||
}
|
||||
#his-table{
|
||||
max-height: 11.538rem;
|
||||
max-height: 150px;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
#his-float-blocked {
|
||||
@@ -143,9 +146,6 @@
|
||||
#hisdropdown{
|
||||
background-color: var(--bg);
|
||||
}
|
||||
#hisdropdown li a {
|
||||
color: white;
|
||||
}
|
||||
#hisdropdown li:hover{
|
||||
background-color: var(--active);
|
||||
}
|
@@ -1,69 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 600 600" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||
<g id="輝き" transform="matrix(0.892356,0,0,0.892356,36.941,-15.9516)">
|
||||
<g transform="matrix(2.39479,0,0,2.21494,-178.97,-182.183)">
|
||||
<ellipse cx="123.217" cy="151.049" rx="36.923" ry="35.804" style="fill:rgb(84,82,81);"/>
|
||||
</g>
|
||||
<g transform="matrix(1,0,0,1,8.39159,-32.1678)">
|
||||
<ellipse cx="120.479" cy="305.524" rx="112.5" ry="52" style="fill:rgb(84,82,81);"/>
|
||||
</g>
|
||||
<g transform="matrix(0.952046,-0.305955,0.305955,0.952046,-139.881,8.62199)">
|
||||
<ellipse cx="134.479" cy="430.524" rx="46.5" ry="84" style="fill:rgb(84,82,81);"/>
|
||||
</g>
|
||||
<g transform="matrix(1,0,0,1,2.39158,-65.1678)">
|
||||
<ellipse cx="130.479" cy="561.024" rx="72.5" ry="74.5" style="fill:rgb(84,82,81);"/>
|
||||
</g>
|
||||
<g transform="matrix(1,0,0,1,8.39159,-32.1678)">
|
||||
<ellipse cx="156.979" cy="651.76" rx="68" ry="60.235" style="fill:rgb(84,82,81);"/>
|
||||
</g>
|
||||
<g transform="matrix(0.954888,0.296965,-0.296965,0.954888,55.6063,-54.2336)">
|
||||
<ellipse cx="199.479" cy="158.995" rx="98.5" ry="51" style="fill:rgb(240,132,46);"/>
|
||||
</g>
|
||||
<g transform="matrix(0.931851,0.362841,-0.362841,0.931851,63.1962,-89.0819)">
|
||||
<ellipse cx="344.979" cy="135.857" rx="74" ry="90.137" style="fill:rgb(240,132,46);"/>
|
||||
</g>
|
||||
<g transform="matrix(1,0,0,1,-56.6084,-45.1678)">
|
||||
<ellipse cx="493.479" cy="301.22" rx="126.5" ry="55.5" style="fill:rgb(240,132,46);"/>
|
||||
</g>
|
||||
<g transform="matrix(1,0,0,1,-14.6084,-70.1678)">
|
||||
<ellipse cx="531.479" cy="368.22" rx="58.5" ry="54.5" style="fill:rgb(240,132,46);"/>
|
||||
</g>
|
||||
<g transform="matrix(0.973706,-0.227807,0.227807,0.973706,-124.722,44.48)">
|
||||
<ellipse cx="265.479" cy="614.97" rx="98.5" ry="37.5" style="fill:rgb(54,76,159);"/>
|
||||
</g>
|
||||
<g transform="matrix(0.982834,-0.184492,0.184492,0.982834,-148.417,-31.379)">
|
||||
<ellipse cx="407.479" cy="676.47" rx="71.5" ry="96" style="fill:rgb(54,76,159);"/>
|
||||
</g>
|
||||
<g transform="matrix(1,0,0,1,-34.6084,-22.1678)">
|
||||
<ellipse cx="468.979" cy="511.47" rx="48" ry="31" style="fill:rgb(54,76,159);"/>
|
||||
</g>
|
||||
<g transform="matrix(0.880625,0.473815,-0.473815,0.880625,260.236,-235.714)">
|
||||
<ellipse cx="533.979" cy="472.97" rx="46" ry="99.5" style="fill:rgb(54,76,159);"/>
|
||||
</g>
|
||||
<g transform="matrix(1,0,0,1,9.39159,-36.1678)">
|
||||
<circle cx="69.229" cy="310.72" r="24.25" style="fill:white;"/>
|
||||
</g>
|
||||
<g transform="matrix(1,0,0,1,8.39159,-48.1678)">
|
||||
<circle cx="98.229" cy="417.72" r="25.25" style="fill:white;"/>
|
||||
</g>
|
||||
<g transform="matrix(0.76,0,0,0.76,96.9465,101.545)">
|
||||
<circle cx="375.229" cy="646.72" r="56.25" style="fill:white;"/>
|
||||
</g>
|
||||
<g transform="matrix(1,0,0,1,8.39159,-32.1678)">
|
||||
<circle cx="427.729" cy="287.22" r="32.75" style="fill:white;"/>
|
||||
</g>
|
||||
<g id="cat" transform="matrix(0.0249784,0,0,0.0249784,346.146,563.341)">
|
||||
<path d="M1592.47,2584L2048.94,2584C2048.94,2519.11 2044.31,2506.24 1936.84,2506.24C1954.01,2454.74 2023.79,2330.13 2062.57,2330.13C2096.88,2330.13 2137.81,2332.02 2137.81,2410.3C2137.81,2499.17 2287.37,2642.46 2323.63,2584C2377.67,2496.88 2230.72,2523.45 2230.72,2313.35C2230.72,2025.92 2398.46,2066.84 2398.46,1905.36C2398.46,1824.57 2376.14,1813.66 2376.14,1755.9C2376.14,1679.56 2443.39,1683.99 2430.31,1620.7C2421.27,1576.98 2414.2,1541.92 2408.93,1489.05C2405.19,1451.54 2404,1411.55 2365.03,1413.16C2319.25,1415.05 2301.88,1495.63 2230.72,1501.41C2159.7,1507.18 2099.15,1440.95 2071.66,1450.41C2044.41,1459.79 2052.98,1533.73 2069.14,1586.24C2094.54,1668.78 2149.93,1776.1 2048.94,1792.26C1947.95,1808.42 1774.25,1824.58 1649.02,1990.2C1523.79,2155.82 1528.42,2350.19 1479.36,2410.31C1314.72,2612.08 1146,2529.23 1146,2697.11C1146,2772.27 1273.35,2826.38 1293.55,2802.14C1313.75,2777.9 1121.93,2705.68 1336.56,2620.36C1519.91,2547.46 1536.28,2532.58 1592.47,2584Z" style="fill:rgb(5,127,254);"/>
|
||||
</g>
|
||||
<g id="cat1" serif:id="cat" transform="matrix(-0.0249784,0,0,0.0249784,147.519,318.341)">
|
||||
<path d="M1592.47,2584L2048.94,2584C2048.94,2519.11 2044.31,2506.24 1936.84,2506.24C1954.01,2454.74 2023.79,2330.13 2062.57,2330.13C2096.88,2330.13 2137.81,2332.02 2137.81,2410.3C2137.81,2499.17 2287.37,2642.46 2323.63,2584C2377.67,2496.88 2230.72,2523.45 2230.72,2313.35C2230.72,2025.92 2398.46,2066.84 2398.46,1905.36C2398.46,1824.57 2376.14,1813.66 2376.14,1755.9C2376.14,1679.56 2443.39,1683.99 2430.31,1620.7C2421.27,1576.98 2414.2,1541.92 2408.93,1489.05C2405.19,1451.54 2404,1411.55 2365.03,1413.16C2319.25,1415.05 2301.88,1495.63 2230.72,1501.41C2159.7,1507.18 2099.15,1440.95 2071.66,1450.41C2044.41,1459.79 2052.98,1533.73 2069.14,1586.24C2094.54,1668.78 2149.93,1776.1 2048.94,1792.26C1947.95,1808.42 1774.25,1824.58 1649.02,1990.2C1523.79,2155.82 1528.42,2350.19 1479.36,2410.31C1314.72,2612.08 1146,2529.23 1146,2697.11C1146,2772.27 1273.35,2826.38 1293.55,2802.14C1313.75,2777.9 1121.93,2705.68 1336.56,2620.36C1519.91,2547.46 1536.28,2532.58 1592.47,2584Z" style="fill:rgb(5,127,254);"/>
|
||||
</g>
|
||||
<g id="cat2" serif:id="cat" transform="matrix(-0.0249784,0,0,0.0249784,120.519,222.341)">
|
||||
<path d="M1592.47,2584L2048.94,2584C2048.94,2519.11 2044.31,2506.24 1936.84,2506.24C1954.01,2454.74 2023.79,2330.13 2062.57,2330.13C2096.88,2330.13 2137.81,2332.02 2137.81,2410.3C2137.81,2499.17 2287.37,2642.46 2323.63,2584C2377.67,2496.88 2230.72,2523.45 2230.72,2313.35C2230.72,2025.92 2398.46,2066.84 2398.46,1905.36C2398.46,1824.57 2376.14,1813.66 2376.14,1755.9C2376.14,1679.56 2443.39,1683.99 2430.31,1620.7C2421.27,1576.98 2414.2,1541.92 2408.93,1489.05C2405.19,1451.54 2404,1411.55 2365.03,1413.16C2319.25,1415.05 2301.88,1495.63 2230.72,1501.41C2159.7,1507.18 2099.15,1440.95 2071.66,1450.41C2044.41,1459.79 2052.98,1533.73 2069.14,1586.24C2094.54,1668.78 2149.93,1776.1 2048.94,1792.26C1947.95,1808.42 1774.25,1824.58 1649.02,1990.2C1523.79,2155.82 1528.42,2350.19 1479.36,2410.31C1314.72,2612.08 1146,2529.23 1146,2697.11C1146,2772.27 1273.35,2826.38 1293.55,2802.14C1313.75,2777.9 1121.93,2705.68 1336.56,2620.36C1519.91,2547.46 1536.28,2532.58 1592.47,2584Z" style="fill:rgb(5,127,254);"/>
|
||||
</g>
|
||||
<g id="cat3" serif:id="cat" transform="matrix(0.0249784,0,0,0.0249784,390.146,196.341)">
|
||||
<path d="M1592.47,2584L2048.94,2584C2048.94,2519.11 2044.31,2506.24 1936.84,2506.24C1954.01,2454.74 2023.79,2330.13 2062.57,2330.13C2096.88,2330.13 2137.81,2332.02 2137.81,2410.3C2137.81,2499.17 2287.37,2642.46 2323.63,2584C2377.67,2496.88 2230.72,2523.45 2230.72,2313.35C2230.72,2025.92 2398.46,2066.84 2398.46,1905.36C2398.46,1824.57 2376.14,1813.66 2376.14,1755.9C2376.14,1679.56 2443.39,1683.99 2430.31,1620.7C2421.27,1576.98 2414.2,1541.92 2408.93,1489.05C2405.19,1451.54 2404,1411.55 2365.03,1413.16C2319.25,1415.05 2301.88,1495.63 2230.72,1501.41C2159.7,1507.18 2099.15,1440.95 2071.66,1450.41C2044.41,1459.79 2052.98,1533.73 2069.14,1586.24C2094.54,1668.78 2149.93,1776.1 2048.94,1792.26C1947.95,1808.42 1774.25,1824.58 1649.02,1990.2C1523.79,2155.82 1528.42,2350.19 1479.36,2410.31C1314.72,2612.08 1146,2529.23 1146,2697.11C1146,2772.27 1273.35,2826.38 1293.55,2802.14C1313.75,2777.9 1121.93,2705.68 1336.56,2620.36C1519.91,2547.46 1536.28,2532.58 1592.47,2584Z" style="fill:rgb(5,127,254);"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 7.8 KiB |
@@ -1,37 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 4096 4096" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||
<g id="TheDesk">
|
||||
<g id="back">
|
||||
<g transform="matrix(1,0,0,1.53232,-11.8871,-1144.65)">
|
||||
<rect x="1044.02" y="1686.36" width="2335.77" height="782.558" style="fill:rgba(255,255,255,0);">
|
||||
<animate attributeName="fill" begin="0.5s" dur="0.1s" fill="freeze" values="rgba(255,255,255,0);rgba(255,255,255,1)" />
|
||||
</rect>
|
||||
</g>
|
||||
<rect x="1058.89" y="609.971" width="711.146" height="2885.69" style="fill:rgba(255,255,255,0);">
|
||||
<animate attributeName="fill" begin="0.5s" dur="0.1s" fill="freeze" values="rgba(255,255,255,0);rgba(255,255,255,1)" />
|
||||
</rect>
|
||||
<g transform="matrix(1.08582,0,0,1,-142.973,0)">
|
||||
<rect x="1665.9" y="1021.89" width="776.607" height="2050.26" style="fill:rgba(255,255,255,0);">
|
||||
<animate attributeName="fill" begin="0.5s" dur="0.1s" fill="freeze" values="rgba(255,255,255,0);rgba(255,255,255,1)" />
|
||||
</rect>
|
||||
</g>
|
||||
</g>
|
||||
<g transform="matrix(1,0,0,0.998821,0,4.65666)" id="gray">
|
||||
<rect x="678.5" y="128.48" width="450" height="3821.5" style="fill:rgb(84,82,81);"/>
|
||||
</g>
|
||||
<g transform="matrix(0.999978,-5.55112e-17,-2.20005e-08,0.996112,-1237.17,972.039)" id="orange">
|
||||
<rect x="1915.71" y="-583.55" width="450" height="3117.62" style="fill:rgb(240,132,46);" r="3117.62">
|
||||
<animateTransform attributeName="transform" attributeType="XML" type="rotate" from="0,1915.71,-583.55" to="-60,1915.71,-583.55" dur="0.5s" repeatCount="1" fill="freeze" />
|
||||
</rect>
|
||||
</g>
|
||||
<g transform="matrix(0.999978,5.55112e-17,-5.55112e-17,0.999978,-1236.96,-1164.58)" id="blue">
|
||||
<rect x="1915.5" y="1775.41" width="450" height="3105.58" style="fill:rgb(54,76,159);" r="3117.62">
|
||||
<animateTransform attributeName="transform" attributeType="XML" type="rotate" from="0,1915.71,4881" to="60,1915.71,4881" dur="0.5s" repeatCount="1" fill="freeze" />
|
||||
</rect>
|
||||
</g>
|
||||
<path id="cat" d="M1592.47,2584L2048.94,2584C2048.94,2519.11 2044.31,2506.24 1936.84,2506.24C1954.01,2454.74 2023.79,2330.13 2062.57,2330.13C2096.88,2330.13 2137.81,2332.02 2137.81,2410.3C2137.81,2499.17 2287.37,2642.46 2323.63,2584C2377.67,2496.88 2230.72,2523.45 2230.72,2313.35C2230.72,2025.92 2398.46,2066.84 2398.46,1905.36C2398.46,1824.57 2376.14,1813.66 2376.14,1755.9C2376.14,1679.56 2443.39,1683.99 2430.31,1620.7C2421.27,1576.98 2414.2,1541.92 2408.93,1489.05C2405.19,1451.54 2404,1411.55 2365.03,1413.16C2319.25,1415.05 2301.88,1495.63 2230.72,1501.41C2159.7,1507.18 2099.15,1440.95 2071.66,1450.41C2044.41,1459.79 2052.98,1533.73 2069.14,1586.24C2094.54,1668.78 2149.93,1776.1 2048.94,1792.26C1947.95,1808.42 1774.25,1824.58 1649.02,1990.2C1523.79,2155.82 1528.42,2350.19 1479.36,2410.31C1314.72,2612.08 1146,2529.23 1146,2697.11C1146,2772.27 1273.35,2826.38 1293.55,2802.14C1313.75,2777.9 1121.93,2705.68 1336.56,2620.36C1519.91,2547.46 1536.28,2532.58 1592.47,2584Z" style="fill:rgba(0,0,0,0);">
|
||||
<animate attributeName="fill" begin="0.6s" dur="0.5s" fill="freeze" values="rgba(0,0,0,0);rgba(0,0,0,1)" repeatCount="1" />
|
||||
</path>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 3.6 KiB |
BIN
app/img/desk.png
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 11 KiB |
@@ -1,26 +1,35 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 4096 4096" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||
<g id="TheDesk">
|
||||
<g>
|
||||
<g transform="matrix(1,0,0,1.53232,-11.8871,-1144.65)">
|
||||
<rect x="1044.02" y="1686.36" width="2335.77" height="782.558" style="fill:white;"/>
|
||||
</g>
|
||||
<rect x="1058.89" y="609.971" width="711.146" height="2885.69" style="fill:white;"/>
|
||||
<g transform="matrix(1.08582,0,0,1,-142.973,0)">
|
||||
<rect x="1665.9" y="1021.89" width="776.607" height="2050.26" style="fill:white;"/>
|
||||
</g>
|
||||
</g>
|
||||
<g transform="matrix(1,0,0,0.998821,0,4.65666)">
|
||||
<rect x="678.5" y="128.48" width="450" height="3821.5" style="fill:rgb(84,82,81);"/>
|
||||
</g>
|
||||
<g transform="matrix(0.5,-0.866,0.862652,0.498067,224.046,2340.41)">
|
||||
<rect x="1915.71" y="-583.55" width="450" height="3117.62" style="fill:rgb(240,132,46);"/>
|
||||
</g>
|
||||
<g transform="matrix(0.5,0.866,-0.866,0.5,3757.17,-299.625)">
|
||||
<rect x="1915.5" y="1555.41" width="450" height="3105.58" style="fill:rgb(54,76,159);"/>
|
||||
</g>
|
||||
<path id="cat" d="M1592.47,2584L2048.94,2584C2048.94,2519.11 2044.31,2506.24 1936.84,2506.24C1954.01,2454.74 2023.79,2330.13 2062.57,2330.13C2096.88,2330.13 2137.81,2332.02 2137.81,2410.3C2137.81,2499.17 2287.37,2642.46 2323.63,2584C2377.67,2496.88 2230.72,2523.45 2230.72,2313.35C2230.72,2025.92 2398.46,2066.84 2398.46,1905.36C2398.46,1824.57 2376.14,1813.66 2376.14,1755.9C2376.14,1679.56 2443.39,1683.99 2430.31,1620.7C2421.27,1576.98 2414.2,1541.92 2408.93,1489.05C2405.19,1451.54 2404,1411.55 2365.03,1413.16C2319.25,1415.05 2301.88,1495.63 2230.72,1501.41C2159.7,1507.18 2099.15,1440.95 2071.66,1450.41C2044.41,1459.79 2052.98,1533.73 2069.14,1586.24C2094.54,1668.78 2149.93,1776.1 2048.94,1792.26C1947.95,1808.42 1774.25,1824.58 1649.02,1990.2C1523.79,2155.82 1528.42,2350.19 1479.36,2410.31C1314.72,2612.08 1146,2529.23 1146,2697.11C1146,2772.27 1273.35,2826.38 1293.55,2802.14C1313.75,2777.9 1121.93,2705.68 1336.56,2620.36C1519.91,2547.46 1536.28,2532.58 1592.47,2584Z" style="fill:rgb(4,0,0);"/>
|
||||
<rect x="0" y="0" width="4096" height="4096" style="fill:none;"/>
|
||||
</g>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 23.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 4096 4096" style="enable-background:new 0 0 4096 4096;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{display:none;}
|
||||
.st1{fill:#FFFFFF;}
|
||||
.st2{fill:#545251;stroke:#040000;stroke-miterlimit:10;}
|
||||
.st3{fill:#F0842E;}
|
||||
.st4{fill:#364C9F;}
|
||||
.st5{fill:#FFFFFF;stroke:#040000;stroke-miterlimit:10;}
|
||||
.st6{fill-rule:evenodd;clip-rule:evenodd;fill:#040000;}
|
||||
.st7{fill-rule:evenodd;clip-rule:evenodd;fill:none;}
|
||||
</style>
|
||||
<g id="レイヤー_1" class="st0">
|
||||
</g>
|
||||
<g id="レイヤー_2">
|
||||
<polyline class="st1" points="1128.5,650.67 3378,1950 3378,2137 1128.5,3432.67 "/>
|
||||
<rect x="678.5" y="128.48" class="st2" width="450" height="3821.5"/>
|
||||
|
||||
<rect x="1915.71" y="-583.55" transform="matrix(0.5 -0.866 0.866 0.5 225.753 2341.5386)" class="st3" width="450" height="3117.62"/>
|
||||
|
||||
<rect x="1915.5" y="1555.41" transform="matrix(0.5 0.866 -0.866 0.5 3762.031 -299.6245)" class="st4" width="450" height="3105.58"/>
|
||||
<path class="st5" d="M714.5,2953.5"/>
|
||||
<path id="path1891" class="st6" d="M1592.47,2584h456.47c0-64.89-4.63-77.76-112.1-77.76c17.17-51.5,86.95-176.11,125.73-176.11
|
||||
c34.31,0,75.24,1.89,75.24,80.17c0,88.87,149.56,232.16,185.82,173.7c54.04-87.12-92.91-60.55-92.91-270.65
|
||||
c0-287.43,167.74-246.51,167.74-407.99c0-80.79-22.32-91.7-22.32-149.46c0-76.34,67.25-71.91,54.17-135.2
|
||||
c-9.04-43.72-16.11-78.78-21.38-131.65c-3.74-37.51-4.93-77.5-43.9-75.89c-45.78,1.89-63.15,82.47-134.31,88.25
|
||||
c-71.02,5.77-131.57-60.46-159.06-51c-27.25,9.38-18.68,83.32-2.52,135.83c25.4,82.54,80.79,189.86-20.2,206.02
|
||||
c-100.99,16.16-274.69,32.32-399.92,197.94s-120.6,359.99-169.66,420.11C1314.72,2612.08,1146,2529.23,1146,2697.11
|
||||
c0,75.16,127.35,129.27,147.55,105.03c20.2-24.24-171.62-96.46,43.01-181.78C1519.91,2547.46,1536.28,2532.58,1592.47,2584z"/>
|
||||
<rect class="st7" width="4096" height="4096"/>
|
||||
<path class="st1" d="M-58,1122"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.1 KiB |
@@ -1,9 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 23.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!--
|
||||
TheDesk icon, Cutls P.
|
||||
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
|
||||
-->
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 4096 4096" style="enable-background:new 0 0 4096 4096;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 15 KiB |
@@ -1,2 +0,0 @@
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>
|
Before Width: | Height: | Size: 259 B |
@@ -1,8 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
ThinkingDesk: Cutls P's icon, Cutls P.
|
||||
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
|
||||
-->
|
||||
<!-- Generator: Adobe Illustrator 23.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 4096 4096" style="enable-background:new 0 0 4096 4096;" xml:space="preserve">
|
||||
|
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 7.6 KiB |
@@ -1,7 +0,0 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv=”refresh” content=”0;URL=’./view/ja'” />
|
||||
<script>location.href = './view/ja';</script>
|
||||
</head>
|
||||
</html>
|
@@ -1,4 +1,4 @@
|
||||
//@ts-check
|
||||
'use strict'
|
||||
//このソフトについて
|
||||
function about() {
|
||||
postMessage(["sendSinmpleIpc", "about"], "*")
|
||||
|
@@ -1,3 +1,4 @@
|
||||
'use strict'
|
||||
var digitCharacters = [
|
||||
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
|
||||
"A", "B", "C", "D", "E", "F", "G", "H", "I", "J",
|
||||
|
1
app/js/common/hammer.min.js
vendored
@@ -1,3 +1,4 @@
|
||||
'use strict'
|
||||
/*! Hammer.JS - v2.0.8 - 2016-04-23
|
||||
* http://hammerjs.github.io/
|
||||
*
|
||||
|
@@ -1,5 +1,6 @@
|
||||
selectedColumn = 0
|
||||
selectedToot = 0
|
||||
'use strict'
|
||||
var selectedColumn = 0
|
||||
var selectedToot = 0
|
||||
$(function($) {
|
||||
//キーボードショートカット
|
||||
$(window).keydown(function(e) {
|
||||
@@ -84,12 +85,6 @@ $(function($) {
|
||||
show()
|
||||
}
|
||||
}
|
||||
//Ctrl+F:検索
|
||||
if (event.metaKey || event.ctrlKey) {
|
||||
if (e.keyCode === 70) {
|
||||
srcBox()
|
||||
}
|
||||
}
|
||||
//X:開閉
|
||||
if (e.keyCode === 88) {
|
||||
if (!$('#post-box').hasClass('appear')) {
|
||||
@@ -115,13 +110,6 @@ $(function($) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
//Ctrl+K:メニュー開閉
|
||||
if (event.metaKey || event.ctrlKey) {
|
||||
if (e.keyCode === 75) {
|
||||
menu()
|
||||
return false
|
||||
}
|
||||
}
|
||||
//Ctrl+Space:読み込み
|
||||
if (event.metaKey || event.ctrlKey) {
|
||||
if (e.keyCode === 32) {
|
||||
|
@@ -1,3 +1,4 @@
|
||||
'use strict'
|
||||
//モーダル・ドロップダウンの各種設定
|
||||
$(document).ready(function () {
|
||||
// the "href" attribute of the modal trigger must specify the modal ID that wants to be triggered
|
||||
@@ -10,7 +11,7 @@ $(document).ready(function () {
|
||||
belowOrigin: false, // Displays dropdown below the button
|
||||
alignment: 'left', // Displays dropdown with edge aligned to the left of button
|
||||
stopPropagation: false
|
||||
})
|
||||
});
|
||||
$('.dropdown-trigger').dropdown({
|
||||
inDuration: 300,
|
||||
outDuration: 225,
|
||||
@@ -21,9 +22,9 @@ $(document).ready(function () {
|
||||
alignment: 'left', // Displays dropdown with edge aligned to the left of button
|
||||
stopPropagation: false // Stops event propagation
|
||||
}
|
||||
)
|
||||
$('.collapsible').collapsible()
|
||||
);
|
||||
$('.collapsible').collapsible();
|
||||
$('#videomodal').modal({
|
||||
onCloseEnd: stopVideo
|
||||
})
|
||||
})
|
||||
});
|
||||
});
|
@@ -1,3 +1,4 @@
|
||||
'use strict'
|
||||
var sha256 = function sha256(ascii) {
|
||||
function rightRotate(value, amount) {
|
||||
return (value >>> amount) | (value << (32 - amount));
|
||||
|
@@ -17,26 +17,26 @@
|
||||
(function (factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['jquery'], factory)
|
||||
define(['jquery'], factory);
|
||||
} else if (typeof module === 'object' && typeof module.exports === 'object') {
|
||||
factory(require('jquery'))
|
||||
factory(require('jquery'));
|
||||
} else {
|
||||
// Browser globals
|
||||
factory(jQuery)
|
||||
factory(jQuery);
|
||||
}
|
||||
}(function ($) {
|
||||
$.timeago = function (timestamp) {
|
||||
if (timestamp instanceof Date) {
|
||||
return inWords(timestamp)
|
||||
return inWords(timestamp);
|
||||
} else if (typeof timestamp === "string") {
|
||||
return inWords($.timeago.parse(timestamp))
|
||||
return inWords($.timeago.parse(timestamp));
|
||||
} else if (typeof timestamp === "number") {
|
||||
return inWords(new Date(timestamp))
|
||||
return inWords(new Date(timestamp));
|
||||
} else {
|
||||
return inWords($.timeago.datetime(timestamp))
|
||||
return inWords($.timeago.datetime(timestamp));
|
||||
}
|
||||
}
|
||||
var $t = $.timeago
|
||||
};
|
||||
var $t = $.timeago;
|
||||
$.extend($.timeago, {
|
||||
settings: {
|
||||
refreshMillis: 60000,
|
||||
@@ -69,33 +69,33 @@
|
||||
|
||||
inWords: function (distanceMillis) {
|
||||
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 prefix = $l.prefixAgo
|
||||
var suffix = $l.suffixAgo
|
||||
var $l = this.settings.strings;
|
||||
var prefix = $l.prefixAgo;
|
||||
var suffix = $l.suffixAgo;
|
||||
if (this.settings.allowFuture) {
|
||||
if (distanceMillis < 0) {
|
||||
prefix = $l.prefixFromNow
|
||||
suffix = $l.suffixFromNow
|
||||
prefix = $l.prefixFromNow;
|
||||
suffix = $l.suffixFromNow;
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.settings.allowPast && distanceMillis >= 0) {
|
||||
return this.settings.strings.inPast
|
||||
return this.settings.strings.inPast;
|
||||
}
|
||||
|
||||
var seconds = Math.abs(distanceMillis) / 1000
|
||||
var minutes = seconds / 60
|
||||
var hours = minutes / 60
|
||||
var days = hours / 24
|
||||
var years = days / 365
|
||||
var seconds = Math.abs(distanceMillis) / 1000;
|
||||
var minutes = seconds / 60;
|
||||
var hours = minutes / 60;
|
||||
var days = hours / 24;
|
||||
var years = days / 365;
|
||||
|
||||
function substitute(stringOrFunction, number) {
|
||||
var string = $.isFunction(stringOrFunction) ? stringOrFunction(number, distanceMillis) : stringOrFunction
|
||||
var value = ($l.numbers && $l.numbers[number]) || number
|
||||
return string.replace(/%d/i, value)
|
||||
var string = $.isFunction(stringOrFunction) ? stringOrFunction(number, distanceMillis) : stringOrFunction;
|
||||
var value = ($l.numbers && $l.numbers[number]) || number;
|
||||
return string.replace(/%d/i, value);
|
||||
}
|
||||
|
||||
var words = seconds < 45 && substitute($l.seconds, Math.round(seconds)) ||
|
||||
@@ -108,124 +108,124 @@
|
||||
days < 45 && substitute($l.month, 1) ||
|
||||
days < 365 && substitute($l.months, Math.round(days / 30)) ||
|
||||
years < 1.5 && substitute($l.year, 1) ||
|
||||
substitute($l.years, Math.round(years))
|
||||
substitute($l.years, Math.round(years));
|
||||
|
||||
var separator = $l.wordSeparator || ""
|
||||
if ($l.wordSeparator === undefined) { separator = " " }
|
||||
return $.trim([prefix, words, suffix].join(separator))
|
||||
var separator = $l.wordSeparator || "";
|
||||
if ($l.wordSeparator === undefined) { separator = " "; }
|
||||
return $.trim([prefix, words, suffix].join(separator));
|
||||
},
|
||||
|
||||
parse: function (iso8601) {
|
||||
var s = $.trim(iso8601)
|
||||
s = s.replace(/\.\d+/, "") // remove milliseconds
|
||||
s = s.replace(/-/, "/").replace(/-/, "/")
|
||||
s = s.replace(/T/, " ").replace(/Z/, " UTC")
|
||||
s = s.replace(/([\+\-]\d\d)\:?(\d\d)/, " $1$2") // -04:00 -> -0400
|
||||
s = s.replace(/([\+\-]\d\d)$/, " $100") // +09 -> +0900
|
||||
return new Date(s)
|
||||
var s = $.trim(iso8601);
|
||||
s = s.replace(/\.\d+/, ""); // remove milliseconds
|
||||
s = s.replace(/-/, "/").replace(/-/, "/");
|
||||
s = s.replace(/T/, " ").replace(/Z/, " UTC");
|
||||
s = s.replace(/([\+\-]\d\d)\:?(\d\d)/, " $1$2"); // -04:00 -> -0400
|
||||
s = s.replace(/([\+\-]\d\d)$/, " $100"); // +09 -> +0900
|
||||
return new Date(s);
|
||||
},
|
||||
datetime: function (elem) {
|
||||
var iso8601 = $t.isTime(elem) ? $(elem).attr("datetime") : $(elem).attr("title")
|
||||
return $t.parse(iso8601)
|
||||
var iso8601 = $t.isTime(elem) ? $(elem).attr("datetime") : $(elem).attr("title");
|
||||
return $t.parse(iso8601);
|
||||
},
|
||||
isTime: function (elem) {
|
||||
// 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");
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
// functions that can be called via $(el).timeago('action')
|
||||
// init is default when no action is given
|
||||
// functions are called with context of a single element
|
||||
var functions = {
|
||||
init: function () {
|
||||
functions.dispose.call(this)
|
||||
var refresh_el = $.proxy(refresh, this)
|
||||
refresh_el()
|
||||
var $s = $t.settings
|
||||
functions.dispose.call(this);
|
||||
var refresh_el = $.proxy(refresh, this);
|
||||
refresh_el();
|
||||
var $s = $t.settings;
|
||||
if ($s.refreshMillis > 0) {
|
||||
this._timeagoInterval = setInterval(refresh_el, $s.refreshMillis)
|
||||
this._timeagoInterval = setInterval(refresh_el, $s.refreshMillis);
|
||||
}
|
||||
},
|
||||
update: function (timestamp) {
|
||||
var date = (timestamp instanceof Date) ? timestamp : $t.parse(timestamp)
|
||||
$(this).data('timeago', { datetime: date })
|
||||
var date = (timestamp instanceof Date) ? timestamp : $t.parse(timestamp);
|
||||
$(this).data('timeago', { datetime: date });
|
||||
if ($t.settings.localeTitle) {
|
||||
$(this).attr("title", date.toLocaleString())
|
||||
$(this).attr("title", date.toLocaleString());
|
||||
}
|
||||
refresh.apply(this)
|
||||
refresh.apply(this);
|
||||
},
|
||||
updateFromDOM: function () {
|
||||
$(this).data('timeago', { datetime: $t.parse($t.isTime(this) ? $(this).attr("datetime") : $(this).attr("title")) })
|
||||
refresh.apply(this)
|
||||
$(this).data('timeago', { datetime: $t.parse($t.isTime(this) ? $(this).attr("datetime") : $(this).attr("title")) });
|
||||
refresh.apply(this);
|
||||
},
|
||||
dispose: function () {
|
||||
if (this._timeagoInterval) {
|
||||
window.clearInterval(this._timeagoInterval)
|
||||
this._timeagoInterval = null
|
||||
}
|
||||
window.clearInterval(this._timeagoInterval);
|
||||
this._timeagoInterval = null;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.timeago = function (action, options) {
|
||||
var fn = action ? functions[action] : functions.init
|
||||
var fn = action ? functions[action] : functions.init;
|
||||
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
|
||||
this.each(function () {
|
||||
fn.call(this, options)
|
||||
})
|
||||
return this
|
||||
}
|
||||
fn.call(this, options);
|
||||
});
|
||||
return this;
|
||||
};
|
||||
|
||||
function refresh() {
|
||||
var $s = $t.settings
|
||||
var $s = $t.settings;
|
||||
|
||||
//check if it's still visible
|
||||
if ($s.autoDispose && !$.contains(document.documentElement, this)) {
|
||||
//stop if it has been removed
|
||||
$(this).timeago("dispose")
|
||||
return this
|
||||
$(this).timeago("dispose");
|
||||
return this;
|
||||
}
|
||||
|
||||
var data = prepareData(this)
|
||||
var data = prepareData(this);
|
||||
|
||||
if (!isNaN(data.datetime)) {
|
||||
if ($s.cutoff === 0 || Math.abs(distance(data.datetime)) < $s.cutoff) {
|
||||
$(this).text(inWords(data.datetime))
|
||||
$(this).text(inWords(data.datetime));
|
||||
} else {
|
||||
if ($(this).attr('title').length > 0) {
|
||||
$(this).text($(this).attr('title'))
|
||||
$(this).text($(this).attr('title'));
|
||||
}
|
||||
}
|
||||
}
|
||||
return this
|
||||
return this;
|
||||
}
|
||||
|
||||
function prepareData(element) {
|
||||
element = $(element)
|
||||
element = $(element);
|
||||
if (!element.data("timeago")) {
|
||||
element.data("timeago", { datetime: $t.datetime(element) })
|
||||
var text = $.trim(element.text())
|
||||
element.data("timeago", { datetime: $t.datetime(element) });
|
||||
var text = $.trim(element.text());
|
||||
if ($t.settings.localeTitle) {
|
||||
element.attr("title", element.data('timeago').datetime.toLocaleString())
|
||||
element.attr("title", element.data('timeago').datetime.toLocaleString());
|
||||
} else if (text.length > 0 && !($t.isTime(element) && element.attr("title"))) {
|
||||
element.attr("title", text)
|
||||
element.attr("title", text);
|
||||
}
|
||||
}
|
||||
return element.data("timeago")
|
||||
return element.data("timeago");
|
||||
}
|
||||
|
||||
function inWords(date) {
|
||||
return $t.inWords(distance(date))
|
||||
return $t.inWords(distance(date));
|
||||
}
|
||||
|
||||
function distance(date) {
|
||||
return (new Date().getTime() - date.getTime())
|
||||
return (new Date().getTime() - date.getTime());
|
||||
}
|
||||
|
||||
// fix for IE6 suckage
|
||||
document.createElement("abbr")
|
||||
document.createElement("time")
|
||||
}))
|
||||
document.createElement("abbr");
|
||||
document.createElement("time");
|
||||
}));
|
@@ -1,31 +1,28 @@
|
||||
'use strict'
|
||||
//バージョンチェッカー
|
||||
function verck(ver, jp) {
|
||||
console.log('%c Welcome😊 ' + ver, 'color: red;font-size:200%;')
|
||||
$('body').addClass(localStorage.getItem('platform'))
|
||||
console.log('%c Welcome😊', 'color: red;font-size:200%;')
|
||||
var date = new Date()
|
||||
var showVer = false
|
||||
//Spotify
|
||||
if (localStorage.getItem('spotify')) {
|
||||
localStorage.removeItem('spotify')
|
||||
localStorage.removeItem('spotify-refresh')
|
||||
var spDc = 'Spotify NowPlaying sysytem was changed, please re-login to Spotify'
|
||||
if(lang.language == 'ja') {
|
||||
spDc = 'Spotify NowPlayingの機能が変更されたため、もう一度ログインしてください'
|
||||
}
|
||||
Swal.fire({
|
||||
type: 'info',
|
||||
title: spDc,
|
||||
})
|
||||
}
|
||||
//Spotify(e)
|
||||
var show = false
|
||||
if (localStorage.getItem('ver') != ver && localStorage.getItem('winstore')) {
|
||||
showVer = true
|
||||
//ちょっと削除とリンク解析の都合上アレ(s)
|
||||
//対象外のアプデ:storageが20の最初まで"Usamin (18.6.5)"
|
||||
if (!localStorage.getItem('usamin_18_6_5_flag')) {
|
||||
localStorage.setItem('usamin_18_6_5_flag', true)
|
||||
var multi = localStorage.getItem('column')
|
||||
var obj = JSON.parse(multi)
|
||||
for (var i = 0; i < obj.length; i++) {
|
||||
localStorage.removeItem('card_' + i)
|
||||
}
|
||||
}
|
||||
//ちょっと削除とリンク解析の都合上アレ(e)
|
||||
show = true
|
||||
console.log('%c Thank you for your update🎉', 'color: red;font-size:200%;')
|
||||
$(document).ready(function() {
|
||||
if (localStorage.getItem('winstore') && !pwa) {
|
||||
if (localStorage.getItem('winstore')) {
|
||||
$('#releasenote').modal('open')
|
||||
}
|
||||
verp = ver.replace('(', '')
|
||||
var verp = ver.replace('(', '')
|
||||
verp = verp.replace('.', '-')
|
||||
verp = verp.replace('.', '-')
|
||||
verp = verp.replace('[', '-')
|
||||
@@ -41,18 +38,16 @@ function verck(ver, jp) {
|
||||
})
|
||||
}
|
||||
localStorage.setItem('ver', ver)
|
||||
if (!showVer) {
|
||||
console.log(showVer)
|
||||
if (!show) {
|
||||
console.log(show)
|
||||
if (
|
||||
date.getFullYear() * 100 + date.getMonth() + 1 >= localStorage.getItem('showSupportMe') ||
|
||||
date.getMonth() + 1 >= localStorage.getItem('showSupportMe') ||
|
||||
!localStorage.getItem('showSupportMe')
|
||||
) {
|
||||
if (date.getMonth() == 11) {
|
||||
var yrs = date.getFullYear() + 1
|
||||
var nextmonth = yrs * 100 + 1
|
||||
var nextmonth = 1
|
||||
} else {
|
||||
var yrs = date.getFullYear()
|
||||
var nextmonth = yrs * 100 + date.getMonth() + 2
|
||||
var nextmonth = date.getMonth() + 2
|
||||
}
|
||||
if (lang.language != 'ja') {
|
||||
$('#support-btm-ja').addClass('hide')
|
||||
@@ -72,7 +67,7 @@ function verck(ver, jp) {
|
||||
}
|
||||
var platform = localStorage.getItem('platform')
|
||||
console.log('Your platform:' + platform)
|
||||
if (!localStorage.getItem('winstore') && !pwa) {
|
||||
if (!localStorage.getItem('winstore')) {
|
||||
$('#start').css('display', 'flex')
|
||||
}
|
||||
if (
|
||||
@@ -146,10 +141,9 @@ function verck(ver, jp) {
|
||||
if (!localStorage.getItem('last-notice-id')) {
|
||||
localStorage.setItem('last-notice-id', 0)
|
||||
}
|
||||
var start = 'https://thedesk.top/notice/index.php?since_id=' + localStorage.getItem('last-notice-id')
|
||||
var start = 'https://thedesk.top/notice?since_id=' + localStorage.getItem('last-notice-id')
|
||||
fetch(start, {
|
||||
method: 'GET',
|
||||
cors: true
|
||||
method: 'GET'
|
||||
})
|
||||
.then(function(response) {
|
||||
if (!response.ok) {
|
||||
@@ -177,7 +171,7 @@ function verck(ver, jp) {
|
||||
} else {
|
||||
if (obj.type == 'textv2') {
|
||||
if (~obj.languages.indexOf(lang.language)) {
|
||||
var showVer = true
|
||||
var show = true
|
||||
if (obj.toot != '') {
|
||||
var toot =
|
||||
'<button class="btn-flat toast-action" onclick="detEx(\'' +
|
||||
@@ -188,25 +182,25 @@ function verck(ver, jp) {
|
||||
}
|
||||
if (obj.ver != '') {
|
||||
if (obj.ver == ver) {
|
||||
showVer = true
|
||||
show = true
|
||||
} else {
|
||||
showVer = false
|
||||
show = false
|
||||
}
|
||||
}
|
||||
if (obj.domain != '') {
|
||||
var multi = localStorage.getItem('multi')
|
||||
if (multi) {
|
||||
showVer = false
|
||||
show = false
|
||||
var accts = JSON.parse(multi)
|
||||
Object.keys(accts).forEach(function(key) {
|
||||
var acct = accts[key]
|
||||
if (acct.domain == obj.domain) {
|
||||
showVer = true
|
||||
show = true
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
if (showVer) {
|
||||
if (show) {
|
||||
M.toast({
|
||||
html:
|
||||
escapeHTML(obj.text) +
|
||||
@@ -224,7 +218,7 @@ function verck(ver, jp) {
|
||||
}
|
||||
var infostreaming = false
|
||||
function infowebsocket() {
|
||||
infows = new WebSocket('wss://thedesk.top/ws/')
|
||||
var infows = new WebSocket('wss://thedesk.top/ws/')
|
||||
infows.onopen = function(mess) {
|
||||
console.log([tlid, ':Connect Streaming Info:', mess])
|
||||
infostreaming = true
|
||||
@@ -236,7 +230,7 @@ function infowebsocket() {
|
||||
if (obj.type == 'textv2') {
|
||||
if (~obj.languages.indexOf(lang.language)) {
|
||||
localStorage.setItem('last-notice-id', obj.id)
|
||||
var showVer = true
|
||||
var show = true
|
||||
if (obj.toot != '') {
|
||||
var toot =
|
||||
'<button class="btn-flat toast-action" onclick="detEx(\'' +
|
||||
@@ -247,25 +241,25 @@ function infowebsocket() {
|
||||
}
|
||||
if (obj.ver != '') {
|
||||
if (obj.ver == ver) {
|
||||
showVer = true
|
||||
show = true
|
||||
} else {
|
||||
showVer = false
|
||||
show = false
|
||||
}
|
||||
}
|
||||
if (obj.domain != '') {
|
||||
var multi = localStorage.getItem('multi')
|
||||
if (multi) {
|
||||
showVer = false
|
||||
show = false
|
||||
var accts = JSON.parse(multi)
|
||||
Object.keys(accts).forEach(function(key) {
|
||||
var acct = accts[key]
|
||||
if (acct.domain == obj.domain) {
|
||||
showVer = true
|
||||
show = true
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
if (showVer) {
|
||||
if (show) {
|
||||
console.log(obj.text)
|
||||
console.log(escapeHTML(obj.text))
|
||||
M.toast({
|
||||
@@ -328,17 +322,13 @@ function closeSupport() {
|
||||
)
|
||||
}
|
||||
function storeDialog(platform, ver) {
|
||||
if($('body').hasClass('accessibility')) return false
|
||||
if (platform == 'win32') {
|
||||
var mes = lang.lang_version_platform
|
||||
} else if (platform == 'linux') {
|
||||
var mes = lang.lang_version_platform_linux
|
||||
} else if (platform == 'darwin') {
|
||||
var mes = lang.lang_version_platform_mac
|
||||
} else {
|
||||
var mes = false
|
||||
}
|
||||
if (mes) {
|
||||
Swal.fire({
|
||||
title: 'Select your platform',
|
||||
text: mes,
|
||||
@@ -356,12 +346,10 @@ function storeDialog(platform, ver) {
|
||||
localStorage.setItem('winstore', 'localinstall')
|
||||
}
|
||||
localStorage.setItem('ver', ver)
|
||||
showVer = true
|
||||
if(pwa) return false
|
||||
console.log('%c Thank you for your update🎉', 'color: red;font-size:200%;')
|
||||
$(document).ready(function() {
|
||||
$('#releasenote').modal('open')
|
||||
verp = ver.replace('(', '')
|
||||
var verp = ver.replace('(', '')
|
||||
verp = verp.replace('.', '-')
|
||||
verp = verp.replace('.', '-')
|
||||
verp = verp.replace('[', '-')
|
||||
@@ -376,29 +364,6 @@ function storeDialog(platform, ver) {
|
||||
}
|
||||
})
|
||||
})
|
||||
} else {
|
||||
localStorage.setItem('ver', ver)
|
||||
showVer = true
|
||||
console.log('%c Thank you for your update🎉', 'color: red;font-size:200%;')
|
||||
$(document).ready(function() {
|
||||
if(pwa) return false
|
||||
$('#releasenote').modal('open')
|
||||
verp = ver.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%;')
|
||||
if (lang.language == 'ja') {
|
||||
$('#release-' + verp).show()
|
||||
} else {
|
||||
$('#release-en').show()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
function closeStart() {
|
||||
$('#start').css('display', 'none')
|
||||
|
@@ -1,3 +1,4 @@
|
||||
'use strict'
|
||||
var defaultemojiList = ['activity', 'flag', 'food', 'nature', 'object', 'people', 'place', 'symbol']
|
||||
var defaultemoji = {
|
||||
activity: activity,
|
||||
@@ -34,26 +35,17 @@ if (lang == 'ja') {
|
||||
}
|
||||
|
||||
function defaultEmoji(target) {
|
||||
var announcement = false
|
||||
if ($('#media').val() == 'announcement') {
|
||||
announcement = true
|
||||
}
|
||||
var json = defaultemoji[target]
|
||||
var emojis = ''
|
||||
Object.keys(json).forEach(function(key) {
|
||||
var emoji = json[key]
|
||||
if (announcement) {
|
||||
var def = `<a onclick="emojiReactionDef('${emoji['shortcode']}')" class="pointer">`
|
||||
} else {
|
||||
var def = `<a onclick="defEmoji('${emoji['shortcode']}')" class="pointer">`
|
||||
}
|
||||
emojis =
|
||||
emojis +
|
||||
`${def}
|
||||
<span style="
|
||||
width: 20px; height: 20px; display: inline-block; background-image: url('../../img/sheet.png'); background-size: 4900%;
|
||||
background-position:${emoji['css']};"></span>
|
||||
</a>`
|
||||
'<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)
|
||||
$('#now-emoji').text(lang.lang_defaultemojis_text.replace('{{cat}}', defaultemojiname[target]))
|
||||
@@ -81,7 +73,7 @@ function defEmoji(target) {
|
||||
var now = $('#textarea').val()
|
||||
var before = now.substr(0, selin)
|
||||
var after = now.substr(selin, now.length)
|
||||
newt = before + emoji + after
|
||||
var newt = before + emoji + after
|
||||
$('#textarea').val(newt)
|
||||
$('#textarea').focus()
|
||||
}
|
||||
|
@@ -1,3 +1,4 @@
|
||||
'use strict'
|
||||
var activity=[
|
||||
{shortcode:"soccer",css:"4.16667% 10.4167%"},
|
||||
{shortcode:"basketball",css:"16.6667% 56.25%"},
|
||||
@@ -92,7 +93,7 @@ var activity=[
|
||||
{shortcode:"man-rowing-boat",css:"95.8333% 14.5833%"},
|
||||
{shortcode:"man-biking",css:"95.8333% 39.5833%"},
|
||||
{shortcode:"man-mountain-biking",css:"95.8333% 64.5833%"}
|
||||
]
|
||||
];
|
||||
var flag=[
|
||||
{shortcode:"checkered_flag",css:"16.6667% 58.3333%"},
|
||||
{shortcode:"crossed_flags",css:"14.5833% 60.4167%"},
|
||||
@@ -356,7 +357,7 @@ var flag=[
|
||||
{shortcode:"rainbow-flag",css:"83.3333% 100%"},
|
||||
{shortcode:"triangular_flag_on_post",css:"54.1667% 6.25%"},
|
||||
{shortcode:"waving_black_flag",css:"20.8333% 29.1667%"},
|
||||
{shortcode:"waving_white_flag",css:"20.8333% 27.0833%"}]
|
||||
{shortcode:"waving_white_flag",css:"20.8333% 27.0833%"}];
|
||||
var food=[
|
||||
{shortcode:"green_apple",css:"12.5% 25%"},
|
||||
{shortcode:"apple",css:"12.5% 22.9167%"},
|
||||
@@ -444,7 +445,7 @@ var food=[
|
||||
{shortcode:"spoon",css:"62.5% 14.5833%"},
|
||||
{shortcode:"fork_and_knife",css:"14.5833% 0%"},
|
||||
{shortcode:"knife_fork_plate",css:"14.5833% 18.75%"}
|
||||
]
|
||||
];
|
||||
var nature=[
|
||||
{shortcode:"dog",css:"22.9167% 62.5%"},
|
||||
{shortcode:"cat",css:"22.9167% 52.0833%"},
|
||||
@@ -605,7 +606,7 @@ var nature=[
|
||||
{shortcode:"droplet",css:"35.4167% 39.5833%"},
|
||||
{shortcode:"sweat_drops",css:"35.4167% 37.5%"},
|
||||
{shortcode:"umbrella_with_rain_drops",css:"0% 100%"}
|
||||
]
|
||||
];
|
||||
var object=[
|
||||
{shortcode:"watch",css:"0% 29.1667%"},
|
||||
{shortcode:"iphone",css:"39.5833% 0%"},
|
||||
@@ -780,7 +781,7 @@ var object=[
|
||||
{shortcode:"closed_lock_with_key",css:"39.5833% 62.5%"},
|
||||
{shortcode:"lock",css:"39.5833% 66.6667%"},
|
||||
{shortcode:"unlock",css:"39.5833% 68.75%"}
|
||||
]
|
||||
];
|
||||
var people=[
|
||||
{shortcode:"grinning",css:"45.8333% 68.75%"},
|
||||
{shortcode:"smiley",css:"45.8333% 75%"},
|
||||
@@ -1096,7 +1097,7 @@ var people=[
|
||||
{shortcode:"woman-raising-hand",css:"93.75% 29.1667%"},
|
||||
{shortcode:"woman-frowning",css:"93.75% 54.1667%"},
|
||||
{shortcode:"woman-pouting",css:"93.75% 79.1667%"}
|
||||
]
|
||||
];
|
||||
var place=[
|
||||
{shortcode:"car",css:"52.0833% 60.4167%"},
|
||||
{shortcode:"taxi",css:"52.0833% 56.25%"},
|
||||
@@ -1217,7 +1218,7 @@ var place=[
|
||||
{shortcode:"milky_way",css:"8.33333% 93.75%"},
|
||||
{shortcode:"bridge_at_night",css:"8.33333% 87.5%"},
|
||||
{shortcode:"foggy",css:"8.33333% 70.8333%"}
|
||||
]
|
||||
];
|
||||
var symbol=[
|
||||
{shortcode:"heart",css:"6.25% 62.5%"},
|
||||
{shortcode:"yellow_heart",css:"35.4167% 14.5833%"},
|
||||
@@ -1492,7 +1493,7 @@ var symbol=[
|
||||
{shortcode:"female_sign",css:"2.08333% 37.5%"},
|
||||
{shortcode:"male_sign",css:"2.08333% 39.5833%"},
|
||||
{shortcode:"staff_of_aesculapius",css:"2.08333% 87.5%"}
|
||||
]
|
||||
];
|
||||
var faicons=[
|
||||
"fa-500px",
|
||||
"fa-address-book",
|
||||
|
@@ -1,3 +1,4 @@
|
||||
'use strict'
|
||||
//インスタンスリスト
|
||||
var idata = {
|
||||
"kirishima.cloud": "instance",
|
||||
@@ -83,6 +84,6 @@ var idata = {
|
||||
"nitiasa.com_quote":"enabled",
|
||||
"biwakodon.com_quote":"enabled",
|
||||
"comm.cx_quote":"enabled"
|
||||
}
|
||||
};
|
||||
|
||||
localStorage.setItem("instance", JSON.stringify(idata))
|
||||
localStorage.setItem("instance", JSON.stringify(idata));
|
||||
|
@@ -1,3 +1,4 @@
|
||||
'use strict'
|
||||
/*ログイン処理・認証までのJS*/
|
||||
//最初に読むやつ
|
||||
//アスタルテ判定初期化
|
||||
@@ -47,9 +48,6 @@ function ck() {
|
||||
multiSelector(false)
|
||||
verck(ver, jp)
|
||||
$('.stw').show()
|
||||
if (localStorage.getItem('tips')) {
|
||||
tips(localStorage.getItem('tips'))
|
||||
}
|
||||
$('#something-wrong img').attr('src', '../../img/thinking.svg')
|
||||
}
|
||||
}
|
||||
@@ -382,9 +380,7 @@ function ckdb(acct_id) {
|
||||
localStorage.setItem('imas', 'true')
|
||||
$('.imasonly').show()
|
||||
}
|
||||
var at = localStorage.getItem('acct_' + acct_id + '_at')
|
||||
var bbcode = domain + '_bbcode'
|
||||
var letters = domain + '_letters'
|
||||
var quoteMarker = domain + '_quote'
|
||||
if (localStorage.getItem('instance')) {
|
||||
var json = JSON.parse(localStorage.getItem('instance'))
|
||||
@@ -582,18 +578,17 @@ function multiSelector(parseC) {
|
||||
//バージョンエンコ
|
||||
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, '')
|
||||
ver = ver.replace(/\(/g, '-')
|
||||
ver = ver.replace(/\)/g, '')
|
||||
ver = ver.replace(/\[/g, '_')
|
||||
ver = ver.replace(/\]/g, '')
|
||||
return ver
|
||||
}
|
||||
//インスタンスティッカー
|
||||
function ticker() {
|
||||
var start = 'https://s.0px.io/json'
|
||||
var start = 'https://toot.app/toot/'
|
||||
fetch(start, {
|
||||
method: 'GET',
|
||||
cors: true,
|
||||
headers: {
|
||||
'content-type': 'application/json'
|
||||
}
|
||||
@@ -611,8 +606,7 @@ function ticker() {
|
||||
})
|
||||
.then(function(json) {
|
||||
if (json) {
|
||||
localStorage.removeItem('ticker')
|
||||
localStorage.setItem('sticker', JSON.stringify(json))
|
||||
localStorage.setItem('ticker', JSON.stringify(json))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@@ -1,7 +1,8 @@
|
||||
'use strict'
|
||||
//ログアウトします
|
||||
function logout() {
|
||||
localStorage.removeItem("acct_" + acct_id + "_at")
|
||||
localStorage.removeItem("domain_" + acct_id)
|
||||
location.href = "index.html"
|
||||
todc()
|
||||
localStorage.removeItem("acct_" + acct_id + "_at");
|
||||
localStorage.removeItem("domain_" + acct_id);
|
||||
location.href = "index.html";
|
||||
todc();
|
||||
}
|
@@ -1,3 +1,4 @@
|
||||
'use strict'
|
||||
//アカウントマネージャ
|
||||
//最初に読むやつ
|
||||
function load() {
|
||||
@@ -33,9 +34,7 @@ function load() {
|
||||
}
|
||||
|
||||
console.table(obj)
|
||||
var domains = []
|
||||
var templete
|
||||
$('#acct-list').html('')
|
||||
Object.keys(obj).forEach(function(key) {
|
||||
var acct = obj[key]
|
||||
var list = key * 1 + 1
|
||||
@@ -49,7 +48,6 @@ function load() {
|
||||
} else {
|
||||
var name = acct.user
|
||||
}
|
||||
domains.push(acct.domain)
|
||||
templete = `
|
||||
<div id="acct_${key}" class="card" ${style}>
|
||||
<div class="card-content ">
|
||||
@@ -57,12 +55,15 @@ function load() {
|
||||
<span class="card-title">${name}</span>${escapeHTML(acct.user)}@${acct.domain}
|
||||
</div>
|
||||
<div class="card-action">
|
||||
<button class="btn-flat waves-effect disTar pointer white-text" onclick="refresh('${key}')">
|
||||
<i class="material-icons left">refresh</i>${lang.lang_manager_refresh}
|
||||
</button>
|
||||
<button class="btn-flat waves-effect disTar pointer red-text" onclick="multiDel('${key}')">
|
||||
<i class="material-icons left">delete</i>${lang.lang_manager_delete}
|
||||
</button><br />${lang.lang_manager_color}
|
||||
<a class="waves-effect disTar pointer white-text" onclick="data('${acct.domain}')">
|
||||
<i class="material-icons">info</i>${lang.lang_manager_info}
|
||||
</a>
|
||||
<a class="waves-effect disTar pointer white-text" onclick="refresh('${key}')">
|
||||
<i class="material-icons">refresh</i>${lang.lang_manager_refresh}
|
||||
</a>
|
||||
<a class="waves-effect disTar pointer red-text" onclick="multiDel('${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>
|
||||
@@ -70,30 +71,6 @@ function load() {
|
||||
$('#acct-list').append(templete)
|
||||
colorpicker(key)
|
||||
})
|
||||
domains = _.uniq(domains)
|
||||
$('#domain-list').html('')
|
||||
Object.keys(domains).forEach(function(key2) {
|
||||
var domain = domains[key2]
|
||||
if (localStorage.getItem('letters_' + key2)) {
|
||||
var maxChars = localStorage.getItem('letters_' + key2)
|
||||
} else {
|
||||
var maxChars = 500
|
||||
}
|
||||
var templete = `
|
||||
<li class="collection-item transparent">
|
||||
<div>
|
||||
<p class="title">${domain}</p>
|
||||
${lang.lang_manager_maxChars} <input style="width: 100px" value="${maxChars}" id="maxChars${key2}">
|
||||
<button class="btn-flat waves-effect" onclick="maxChars('${domain}', '${key2}')">
|
||||
<i class="material-icons">send</i>
|
||||
</button>
|
||||
<button class="btn-flat waves-effect secondary-content" onclick="data('${domain}', '${key2}')">
|
||||
<i class="material-icons left">info</i>${lang.lang_manager_info}
|
||||
</button>
|
||||
</div></li>
|
||||
`
|
||||
$('#domain-list').append(templete)
|
||||
})
|
||||
multisel()
|
||||
var acctN = localStorage.getItem('acct')
|
||||
if (!acctN) {
|
||||
@@ -106,35 +83,9 @@ function load() {
|
||||
//最初に読む
|
||||
load()
|
||||
support()
|
||||
function maxChars(domain, uid) {
|
||||
var value = $('#maxChars' + uid).val()
|
||||
if(value*1 < 1 || !Number.isInteger(value*1)) {
|
||||
Swal.fire({
|
||||
type: 'error',
|
||||
title: 'Error'
|
||||
})
|
||||
return false
|
||||
}
|
||||
var multi = localStorage.getItem('multi')
|
||||
if (!multi) {
|
||||
var obj = []
|
||||
} else {
|
||||
var obj = JSON.parse(multi)
|
||||
}
|
||||
if (obj[0]) {
|
||||
if (!obj[0].at) {
|
||||
obj = []
|
||||
localStorage.removeItem('multi')
|
||||
}
|
||||
}
|
||||
Object.keys(obj).forEach(function(key) {
|
||||
if(obj[key].domain == domain) localStorage.setItem('letters_' + key, value)
|
||||
})
|
||||
console.log('#maxChars' + uid, value)
|
||||
load()
|
||||
}
|
||||
|
||||
//instances.social/instances API
|
||||
async function data(domain, acct_id) {
|
||||
function data(domain) {
|
||||
$('#ins-upd').text('Loading...')
|
||||
$('#ins-add').text('Loading...')
|
||||
$('#ins-connect').text('Loading...')
|
||||
@@ -146,7 +97,7 @@ async function data(domain, acct_id) {
|
||||
$('#ins-name').text('Loading...')
|
||||
$('#ins-prof').attr('src', '../../img/loading.svg')
|
||||
var start = 'https://instances.social/api/1.0/instances/show?name=' + domain
|
||||
let promise = await fetch(start, {
|
||||
fetch(start, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
@@ -154,7 +105,21 @@ async function data(domain, acct_id) {
|
||||
'Bearer tC8F6xWGWBUwGScyNevYlx62iO6fdQ4oIK0ad68Oo7ZKB8GQdGpjW9TKxBnIh8grAhvd5rw3iyP9JPamoDpeLQdz62EToPJUW99hDx8rfuJfGdjQuimZPTbIOx0woA5M'
|
||||
}
|
||||
})
|
||||
var json = await promise.json()
|
||||
.then(function(response) {
|
||||
if (!response.ok) {
|
||||
response.text().then(function(text) {
|
||||
setLog(response.url, response.status, text)
|
||||
})
|
||||
}
|
||||
return response.json()
|
||||
})
|
||||
.catch(function(error) {
|
||||
todo(error)
|
||||
setLog(start, 'JSON', error)
|
||||
console.error(error)
|
||||
})
|
||||
.then(function(json) {
|
||||
if (!json.error) {
|
||||
$('#ins-name').text(json.name)
|
||||
$('#ins-upd').text(date(json.checked_at, 'full'))
|
||||
$('#ins-add').text(date(json.added_at, 'full'))
|
||||
@@ -164,14 +129,32 @@ async function data(domain, acct_id) {
|
||||
$('#ins-per').text(json.uptime * 100)
|
||||
$('#ins-user').text(json.users)
|
||||
$('#ins-ver').text(json.version)
|
||||
} else {
|
||||
console.error(json.error)
|
||||
}
|
||||
})
|
||||
var start = 'https://' + domain + '/api/v1/instance'
|
||||
let promise2 = await fetch(start, {
|
||||
fetch(start, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'content-type': 'application/json'
|
||||
}
|
||||
})
|
||||
var json = await promise2.json()
|
||||
.then(function(response) {
|
||||
if (!response.ok) {
|
||||
response.text().then(function(text) {
|
||||
setLog(response.url, response.status, text)
|
||||
})
|
||||
}
|
||||
return response.json()
|
||||
})
|
||||
.catch(function(error) {
|
||||
todo(error)
|
||||
setLog(start, 'JSON', error)
|
||||
console.error(error)
|
||||
})
|
||||
.then(function(json) {
|
||||
if (!json.error) {
|
||||
$('#ins-title').text(json.title)
|
||||
$('#ins-desc').html(json.description)
|
||||
$('#ins-email').text(json.email)
|
||||
@@ -186,10 +169,10 @@ async function data(domain, acct_id) {
|
||||
'href',
|
||||
'index.html?mode=user&code=' + json.contact_account.username + '@' + domain
|
||||
)
|
||||
if (json['max_toot_chars']) {
|
||||
localStorage.setItem('letters_' + acct_id, json['max_toot_chars'])
|
||||
load()
|
||||
} else {
|
||||
console.error(json.error)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//アカウントデータ 消す
|
||||
@@ -252,31 +235,11 @@ function multiDel(target) {
|
||||
var newdom = oldcol.domain
|
||||
}
|
||||
var type = oldcol.type
|
||||
var data = null
|
||||
if(oldcol.data) {
|
||||
data = oldcol.data
|
||||
}
|
||||
var background = null
|
||||
if(oldcol.background) {
|
||||
background = oldcol.background
|
||||
}
|
||||
var text = null
|
||||
if(oldcol.text) {
|
||||
text = oldcol.text
|
||||
}
|
||||
var left_fold = false
|
||||
if(oldcol.left_fold) {
|
||||
left_fold = true
|
||||
}
|
||||
//消した垢のコラムじゃないときコピー
|
||||
if (target != oldcol.domain) {
|
||||
var add = {
|
||||
domain: newdom,
|
||||
type: type,
|
||||
data: data,
|
||||
background: background,
|
||||
text: text,
|
||||
left_fold: left_fold
|
||||
type: type
|
||||
}
|
||||
newcols.push(add)
|
||||
}
|
||||
@@ -354,14 +317,8 @@ function support() {
|
||||
Object.keys(idata).forEach(function(key) {
|
||||
var instance = idata[key]
|
||||
if (instance == 'instance') {
|
||||
templete =
|
||||
'<a onclick="login(\'' +
|
||||
key +
|
||||
'\')" class="collection-item pointer transparent">' +
|
||||
idata[key + '_name'] +
|
||||
'(' +
|
||||
key +
|
||||
')</a>'
|
||||
var templete =
|
||||
`<a onclick="login('${key}')" class="collection-item pointer transparent">${idata[key + '_name']}(${key})</a>`
|
||||
$('#support').append(templete)
|
||||
}
|
||||
})
|
||||
@@ -369,8 +326,6 @@ function support() {
|
||||
|
||||
//URL指定してポップアップ
|
||||
function login(url) {
|
||||
var multi = localStorage.getItem('multi')
|
||||
var obj = JSON.parse(multi)
|
||||
if ($('#misskey:checked').val() == 'on') {
|
||||
$('#misskey').prop('checked', true)
|
||||
misskeyLogin(url)
|
||||
@@ -526,7 +481,7 @@ function misskeyLogin(url) {
|
||||
if (!url) {
|
||||
var url = $('#misskey-url').val()
|
||||
}
|
||||
var start = 'https://' + url + '/api/app/create'
|
||||
var start = 'http://' + url + '/api/app/create'
|
||||
var httpreq = new XMLHttpRequest()
|
||||
httpreq.open('POST', start, true)
|
||||
httpreq.setRequestHeader('Content-Type', 'application/json')
|
||||
@@ -976,7 +931,6 @@ function multisel() {
|
||||
} else {
|
||||
var obj = JSON.parse(multi)
|
||||
}
|
||||
var templete
|
||||
var last = localStorage.getItem('main')
|
||||
var sel
|
||||
if (obj.length < 1) {
|
||||
@@ -985,21 +939,18 @@ function multisel() {
|
||||
} else {
|
||||
Object.keys(obj).forEach(function(key) {
|
||||
var acct = obj[key]
|
||||
var list = key * 1 + 1
|
||||
if (key == last) {
|
||||
sel = 'selected'
|
||||
mainb = '(' + lang.lang_manager_def + ')'
|
||||
var domain = localStorage.getItem('domain_' + key)
|
||||
var mainb = '(' + lang.lang_manager_def + ')'
|
||||
var profimg = localStorage.getItem('prof_' + key)
|
||||
var domain = localStorage.getItem('domain_' + key)
|
||||
if (!profimg) {
|
||||
profimg = '../../img/missing.svg'
|
||||
}
|
||||
} else {
|
||||
sel = ''
|
||||
mainb = ''
|
||||
var mainb = ''
|
||||
}
|
||||
template = `
|
||||
var template = `
|
||||
<option value="${key}" data-icon="${acct.prof}" class="left circle" ${sel}>
|
||||
${acct.user}@${acct.domain}${mainb}
|
||||
</option>
|
||||
@@ -1015,7 +966,7 @@ function mainacct() {
|
||||
M.toast({ html: lang.lang_manager_mainAcct, displayLength: 3000 })
|
||||
}
|
||||
function colorpicker(key) {
|
||||
temp = `<div onclick="coloradd('${key}','def','def')" class="pointer exc">${lang.lang_manager_none}</div>
|
||||
var temp = `<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}','e91e63','white')" class="pink white-text pointer"></div>
|
||||
<div onclick="coloradd('${key}','9c27b0','white')" class="purple white-text pointer"></div>
|
||||
|
@@ -1,3 +1,4 @@
|
||||
'use strict'
|
||||
//プラットフォーム別 最後に読むやつ
|
||||
//リンクを外部で開くか内部で出すか
|
||||
$(document).on('click', 'a', e => {
|
||||
@@ -10,7 +11,7 @@ $(document).on('click', 'a', e => {
|
||||
if (url) {
|
||||
urls = url.match(/https?:\/\/(.+)/)
|
||||
//トゥートのURLぽかったら
|
||||
toot = url.match(/https:\/\/([^+_]+)\/@([a-zA-Z0-9_]+)\/([0-9]+)/)
|
||||
var toot = url.match(/https:\/\/([^+_]+)\/@([a-zA-Z0-9_]+)\/([0-9]+)/)
|
||||
if (!toot) {
|
||||
//Pleroma対策
|
||||
toot = url.match(/https:\/\/([^+_]+)\/users\/([a-zA-Z0-9_]+)\/statuses\/([0-9]+)/)
|
||||
@@ -45,18 +46,11 @@ $(document).on('click', 'a', e => {
|
||||
if (!~ats[2].indexOf('@')) {
|
||||
udgEx(url, 'main')
|
||||
return false
|
||||
} else {
|
||||
if(pwa) {
|
||||
return true
|
||||
} else {
|
||||
postMessage(['openUrl', url], '*')
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if(pwa) {
|
||||
return true
|
||||
}
|
||||
//hrefがhttp/httpsならブラウザで
|
||||
if (urls) {
|
||||
if (urls[0]) {
|
||||
@@ -110,7 +104,7 @@ function playSound() {
|
||||
if (soundFile) {
|
||||
soundFile.stop()
|
||||
}
|
||||
context = new AudioContext()
|
||||
var context = new AudioContext()
|
||||
context.createBufferSource().start(0)
|
||||
context.decodeAudioData(request.response, function(buf) {
|
||||
//console.log("Playing:" , source)
|
||||
@@ -140,14 +134,14 @@ onmessage = function(e) {
|
||||
} else if (e.data[0] == 'udg') {
|
||||
udg(e.data[1][0], e.data[1][1])
|
||||
} else if (e.data[0] == 'media') {
|
||||
media(e.data[1][0], e.data[1][1], e.data[1][2], e.data[1][3])
|
||||
media(e.data[1][0], e.data[1][1], e.data[1][2])
|
||||
} else if (e.data[0] == 'post') {
|
||||
post('pass')
|
||||
} else if (e.data[0] == 'toastSaved') {
|
||||
var showTxt = `${lang.lang_img_DLDone}${
|
||||
var show = `${lang.lang_img_DLDone}${
|
||||
e.data[1][0]
|
||||
}<button class="btn-flat toast-action" onclick="openFinder('${e.data[1][1]}')">Show</button>`
|
||||
M.toast({ html: showTxt, displayLength: 5000 })
|
||||
}<button class="btn-flat toast-action" onclick="openFinder(${e.data[1][1]}')">Show</button>`
|
||||
M.toast({ html: show, displayLength: 5000 })
|
||||
} else if (e.data[0] == 'parseColumn') {
|
||||
parseColumn(e.data[1])
|
||||
} else if (e.data[0] == 'exportSettingsCore') {
|
||||
@@ -181,10 +175,6 @@ onmessage = function(e) {
|
||||
asRead()
|
||||
} else if (e.data[0] == 'asReadEnd') {
|
||||
asReadEnd()
|
||||
} else if (e.data[0] == 'accessibility') {
|
||||
console.log('atrue')
|
||||
$('body').addClass('accessibility')
|
||||
$('.window-title').before('<div class="accessMark">Screen Reader Optimized</div>')
|
||||
} else if (e.data[0] == 'logData') {
|
||||
$('#logs').val(e.data[1])
|
||||
var obj = document.getElementById('logs')
|
||||
@@ -196,23 +186,3 @@ onmessage = function(e) {
|
||||
})
|
||||
}
|
||||
}
|
||||
/* PWA */
|
||||
if(pwa) {
|
||||
function postMessage(e) {
|
||||
if (e[0] == 'openUrl') {
|
||||
urls = e[1].match(/https?:\/\/(.+)/)
|
||||
if (urls) {
|
||||
Swal.fire({
|
||||
title: 'Open URL',
|
||||
icon: 'info',
|
||||
html:
|
||||
`If you are OK, click: <a href="${urls[0]}" target="_blank" class="btn waves-effect">Here</a>`,
|
||||
showCloseButton: false,
|
||||
showCancelButton: true,
|
||||
focusConfirm: false,
|
||||
confirmButtonText: 'Close'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1 +1,2 @@
|
||||
'use strict'
|
||||
//jQuery読む
|
||||
|
@@ -1,3 +1,5 @@
|
||||
'use strict'
|
||||
document.title = 'TheDesk'
|
||||
$.strip_tags = function(str, allowed) {
|
||||
if (!str) {
|
||||
return ''
|
||||
@@ -160,8 +162,8 @@ $.mb_substr = function(str, begin, end) {
|
||||
var splitter = new GraphemeSplitter()
|
||||
var arr = splitter.splitGraphemes(str)
|
||||
var newarr = []
|
||||
for (var i = 0; i < arr.length; i++) {
|
||||
if (i >= begin && i <= end) {
|
||||
for(var i = 0; i < arr.length; i++){
|
||||
if(i >= begin && i <= end){
|
||||
newarr.push(arr[i])
|
||||
}
|
||||
}
|
||||
@@ -204,81 +206,9 @@ function escapeCsv(str) {
|
||||
return str
|
||||
}
|
||||
var result
|
||||
result = str.toString().replace(/\"/g, '""')
|
||||
result = str.replace(/\"/g, '""')
|
||||
if (result.indexOf(',') >= 0) {
|
||||
result = '"' + result + '"'
|
||||
}
|
||||
return result
|
||||
}
|
||||
function evalAttr(json, attr, lenCk) {
|
||||
if (json[attr]) {
|
||||
if (lenCk) {
|
||||
if (json[attr][0]) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
function statusModel(now) {
|
||||
if (!now) {
|
||||
var now = new Date().toString()
|
||||
}
|
||||
return {
|
||||
id: '',
|
||||
created_at: now,
|
||||
in_reply_to_id: null,
|
||||
in_reply_to_account_id: null,
|
||||
sensitive: false,
|
||||
spoiler_text: '',
|
||||
visibility: 'public',
|
||||
language: 'en',
|
||||
uri: '',
|
||||
url: '',
|
||||
replies_count: 0,
|
||||
reblogs_count: 0,
|
||||
favourites_count: 0,
|
||||
favourited: false,
|
||||
reblogged: false,
|
||||
muted: false,
|
||||
bookmarked: false,
|
||||
pinned: false,
|
||||
content: '<p><i>No status here</i></p>',
|
||||
reblog: null,
|
||||
application: {
|
||||
name: null,
|
||||
website: null
|
||||
},
|
||||
account: {
|
||||
id: '',
|
||||
username: '',
|
||||
acct: '',
|
||||
display_name: '',
|
||||
locked: false,
|
||||
bot: false,
|
||||
created_at: now,
|
||||
note: '',
|
||||
url: '',
|
||||
avatar: '',
|
||||
avatar_static: '',
|
||||
header: '',
|
||||
header_static: '',
|
||||
followers_count: 0,
|
||||
following_count: 0,
|
||||
statuses_count: 0,
|
||||
last_status_at: now,
|
||||
emojis: [],
|
||||
fields: []
|
||||
},
|
||||
media_attachments: [],
|
||||
mentions: [],
|
||||
tags: [],
|
||||
card: null,
|
||||
poll: null
|
||||
}
|
||||
}
|
||||
|
@@ -1,3 +1,4 @@
|
||||
'use strict'
|
||||
//TL取得
|
||||
var websocket
|
||||
function tl(data) {
|
||||
|
@@ -1,31 +1,10 @@
|
||||
'use strict'
|
||||
var electron = require('electron')
|
||||
const shell = electron.shell
|
||||
var ipc = electron.ipcRenderer
|
||||
//title bar
|
||||
const customTitlebar = require('custom-electron-titlebar')
|
||||
window.addEventListener('DOMContentLoaded', () => {
|
||||
document.title = 'TheDesk'
|
||||
ipc.send('acsCheck', '')
|
||||
ipc.send('frameCheck', '')
|
||||
ipc.on('frame', function(event, args) {
|
||||
const file = location.href.substr(-10)
|
||||
if (
|
||||
file == 'index.html' ||
|
||||
file == '/acct.html' ||
|
||||
file == 'tting.html'
|
||||
) {
|
||||
new customTitlebar.Titlebar({
|
||||
backgroundColor: customTitlebar.Color.fromHex('#000'),
|
||||
titleHorizontalAlignment: 'right',
|
||||
icon: '../../img/desk.png'
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
onmessage = function(e) {
|
||||
if (e.data[0] == 'openUrl') {
|
||||
urls = e.data[1].match(/https?:\/\/(.+)/)
|
||||
var urls = e.data[1].match(/https?:\/\/(.+)/)
|
||||
if (urls) {
|
||||
shell.openExternal(e.data[1])
|
||||
}
|
||||
@@ -35,10 +14,6 @@ onmessage = function(e) {
|
||||
ipc.send('dialogStore', e.data[1])
|
||||
} else if (e.data[0] == 'bmpImage') {
|
||||
ipc.send('bmp-image', e.data[1])
|
||||
} else if (e.data[0] == 'resizeImage') {
|
||||
ipc.send('resize-image', e.data[1])
|
||||
} else if (e.data[0] == 'stampImage') {
|
||||
ipc.send('stamp-image', e.data[1])
|
||||
} else if (e.data[0] == 'dialogCW') {
|
||||
ipc.send('dialogCW', e.data[1])
|
||||
} else if (e.data[0] == 'nativeNotf') {
|
||||
@@ -49,7 +24,7 @@ onmessage = function(e) {
|
||||
} else if (e.data[0] == 'generalDL') {
|
||||
ipc.send('general-dl', e.data[1])
|
||||
} else if (e.data[0] == 'openFinder') {
|
||||
ipc.send('openFinder', e.data[1])
|
||||
ipc.send('open-finder', e.data[1])
|
||||
} else if (e.data[0] == 'columnDel') {
|
||||
ipc.send('column-del', e.data[1])
|
||||
} else if (e.data[0] == 'lang') {
|
||||
@@ -70,8 +45,6 @@ onmessage = function(e) {
|
||||
ipc.send('theme-json-request', e.data[1])
|
||||
} else if (e.data[0] == 'ha') {
|
||||
ipc.send('ha', e.data[1])
|
||||
} else if (e.data[0] == 'frameSet') {
|
||||
ipc.send('frameSet', e.data[1])
|
||||
} else if (e.data[0] == 'ua') {
|
||||
ipc.send('ua', e.data[1])
|
||||
} else if (e.data[0] == 'aboutData') {
|
||||
@@ -140,38 +113,14 @@ ipc.on('theme-css-response', function(event, arg) {
|
||||
})
|
||||
//img.js
|
||||
ipc.on('bmp-img-comp', function(event, b64) {
|
||||
if (b64[2]) {
|
||||
var stamped = true
|
||||
} else {
|
||||
var stamped = false
|
||||
}
|
||||
postMessage(['media', [b64[0], 'image/png', b64[1], stamped]], '*')
|
||||
})
|
||||
ipc.on('resizeJudgement', function(event, b64) {
|
||||
var resize = localStorage.getItem('uploadCrop') * 1
|
||||
if (resize > 0) {
|
||||
var element = new Image()
|
||||
var width
|
||||
element.onload = function() {
|
||||
var width = element.naturalWidth
|
||||
var height = element.naturalHeight
|
||||
if (width > resize || height > resize) {
|
||||
ipc.send('resize-image', [b64[0], resize])
|
||||
} else {
|
||||
postMessage(['media', [b64[0], 'image/png', b64[1]]], '*')
|
||||
}
|
||||
}
|
||||
element.src = 'data:image/png;base64,' + b64[0]
|
||||
} else {
|
||||
postMessage(['media', [b64[0], 'image/png', b64[1]]], '*')
|
||||
}
|
||||
})
|
||||
//ui,img.js
|
||||
ipc.on('general-dl-prog', function(event, arg) {
|
||||
console.log('Progress: ' + arg)
|
||||
})
|
||||
ipc.on('general-dl-message', function(event, arg) {
|
||||
var argC = arg.replace(/\\/g, '\\\\')
|
||||
var argC = arg.replace(/\\/g, '\\\\') + '\\\\.'
|
||||
console.log('saved')
|
||||
postMessage(['toastSaved', [arg, argC]], '*')
|
||||
})
|
||||
@@ -232,16 +181,12 @@ ipc.on('prog', function(event, arg) {
|
||||
ipc.on('mess', function(event, arg) {
|
||||
postMessage(['updateMess', arg], '*')
|
||||
})
|
||||
//misc
|
||||
ipc.on('asRead', function(event, arg) {
|
||||
postMessage(['asRead', ''], '*')
|
||||
})
|
||||
ipc.on('asReadEnd', function(event, arg) {
|
||||
postMessage(['asReadEnd', ''], '*')
|
||||
})
|
||||
ipc.on('accessibility', function(event, arg) {
|
||||
postMessage(['accessibility', 'true'], '*')
|
||||
})
|
||||
var webviewDom = document.getElementById('webview')
|
||||
if (webviewDom) {
|
||||
webviewDom.addEventListener('new-window', function(e) {
|
||||
|
@@ -1,3 +1,4 @@
|
||||
'use strict'
|
||||
/*! https://mths.be/punycode v1.4.1 by @mathias */
|
||||
;(function(root) {
|
||||
/** Detect free variables */
|
||||
|
@@ -1,3 +1,4 @@
|
||||
'use strict'
|
||||
//BBCodeとMarkdownの入力・パーサー
|
||||
//アカウント変えた時にBBとかMDとか
|
||||
function mdCheck() {
|
||||
@@ -49,14 +50,9 @@ function mdCheck() {
|
||||
}
|
||||
if (idata[domain + '_letters']) {
|
||||
$('#textarea').attr('data-length', idata[domain + '_letters'])
|
||||
} else {
|
||||
var maxletters = localStorage.getItem('letters_' + acct_id)
|
||||
if (maxletters > 0) {
|
||||
$('#textarea').attr('data-length', maxletters)
|
||||
} else {
|
||||
$('#textarea').attr('data-length', 500)
|
||||
}
|
||||
}
|
||||
if (idata[domain + '_glitch'] === 'true') {
|
||||
$('#local-button').removeClass('hide')
|
||||
} else {
|
||||
|
@@ -1,3 +1,4 @@
|
||||
'use strict'
|
||||
//絵文字ピッカー
|
||||
//最初に読み込む
|
||||
$('#emoji-before').addClass('disabled')
|
||||
@@ -193,15 +194,7 @@ function emojiGet(parse, started) {
|
||||
function emojiList(target, reaction) {
|
||||
$('#now-emoji').text(lang.lang_emoji_custom)
|
||||
var acct_id = $('#post-acct-sel').val()
|
||||
if(reaction && $('#media').val() == 'misskey') {
|
||||
var misskeyReact = true
|
||||
} else {
|
||||
var misskeyReact = false
|
||||
}
|
||||
if (
|
||||
misskeyReact &&
|
||||
localStorage.getItem('emojiReaction_' + acct_id) != 'true'
|
||||
) {
|
||||
if (reaction && localStorage.getItem('emojiReaction_' + acct_id) != 'true') {
|
||||
console.error('Disabled')
|
||||
clear()
|
||||
hide()
|
||||
@@ -271,20 +264,9 @@ function emojiList(target, reaction) {
|
||||
var emoji = obj[i]
|
||||
if (emoji) {
|
||||
if (reaction) {
|
||||
if (emoji.divider) {
|
||||
html = html + '<p style="margin-bottom:0">' + emoji.cat + '</p>'
|
||||
} else {
|
||||
if (emoji.listed) {
|
||||
if(misskeyReact) {
|
||||
var shortcode = `:${emoji.shortcode}:`
|
||||
} else {
|
||||
var shortcode = emoji.shortcode
|
||||
}
|
||||
html =
|
||||
html +
|
||||
`<a onclick="emojiReaction('${shortcode}')" class="pointer"><img src="${emoji.url}" width="20" title="${emoji.shortcode}"></a>`
|
||||
}
|
||||
}
|
||||
`<a onclick="emojiReaction(':${emoji.shortcode}:')" class="pointer"><img src="${emoji.url}" width="20" title="${emoji.shortcode}"></a>`
|
||||
} else {
|
||||
if (emoji.divider) {
|
||||
html = html + '<p style="margin-bottom:0">' + emoji.cat + '</p>'
|
||||
|
@@ -1,3 +1,4 @@
|
||||
'use strict'
|
||||
//ドラッグ・アンド・ドロップからアップロードまで。uiのimg.jsとは異なります。
|
||||
var obj = $('body')
|
||||
var system
|
||||
@@ -60,24 +61,6 @@ function handleFileUpload(files, obj, no) {
|
||||
var fr = new FileReader()
|
||||
fr.onload = function(evt) {
|
||||
var b64 = evt.target.result
|
||||
var resize = localStorage.getItem('uploadCrop') * 1
|
||||
if (resize > 0) {
|
||||
var element = new Image()
|
||||
var width
|
||||
element.onload = function() {
|
||||
var width = element.naturalWidth
|
||||
var height = element.naturalHeight
|
||||
if (width > resize || height > resize) {
|
||||
postMessage(['resizeImage', [b64, resize]], '*')
|
||||
return false
|
||||
} else {
|
||||
$('#b64-box').val(b64)
|
||||
var ret = media(b64, files['type'], no)
|
||||
}
|
||||
}
|
||||
element.src = b64
|
||||
return false
|
||||
}
|
||||
$('#b64-box').val(b64)
|
||||
var ret = media(b64, files['type'], no)
|
||||
}
|
||||
@@ -86,14 +69,7 @@ function handleFileUpload(files, obj, no) {
|
||||
}
|
||||
|
||||
//ファイルアップロード
|
||||
async function media(b64, type, no, stamped) {
|
||||
var acct_id = $('#post-acct-sel').val()
|
||||
var domain = localStorage.getItem('domain_' + acct_id)
|
||||
var user = localStorage.getItem('user_' + acct_id)
|
||||
if ($('#stamp').hasClass('stamp-avail') && !stamped) {
|
||||
postMessage(['stampImage', [b64, user + '@' + domain]], '*')
|
||||
return false
|
||||
}
|
||||
function media(b64, type, no) {
|
||||
var l = 4
|
||||
var c = 'abcdefghijklmnopqrstuvwxyz0123456789'
|
||||
var cl = c.length
|
||||
@@ -113,6 +89,8 @@ async function media(b64, type, no, stamped) {
|
||||
var media = toBlob(b64, type)
|
||||
var fd = new FormData()
|
||||
fd.append('file', media)
|
||||
var acct_id = $('#post-acct-sel').val()
|
||||
var domain = localStorage.getItem('domain_' + acct_id)
|
||||
var at = localStorage.getItem('acct_' + acct_id + '_at')
|
||||
var httpreq = new XMLHttpRequest()
|
||||
if (localStorage.getItem('mode_' + domain) == 'misskey') {
|
||||
@@ -127,60 +105,22 @@ async function media(b64, type, no, stamped) {
|
||||
}
|
||||
var previewer = 'url'
|
||||
fd.append('i', at)
|
||||
//fd.append('isSensitive', nsfw);
|
||||
httpreq.send(fd)
|
||||
} else {
|
||||
var previewer = 'preview_url'
|
||||
//v2/media
|
||||
try {
|
||||
var id = await v2MediaUpload(domain, at, fd)
|
||||
if(!id) {
|
||||
var start = 'https://' + domain + '/api/v1/media'
|
||||
httpreq.open('POST', start, true)
|
||||
httpreq.upload.addEventListener('progress', progshow, false)
|
||||
httpreq.responseType = 'json'
|
||||
httpreq.setRequestHeader('Authorization', 'Bearer ' + at)
|
||||
httpreq.send(fd)
|
||||
} else {
|
||||
var mediav = $('#media').val()
|
||||
var regExp = new RegExp('tmp_' + r, 'g')
|
||||
mediav = mediav.replace(regExp, id)
|
||||
$('#media').val(mediav)
|
||||
var html = `<img src="../../img/picture.svg" class="preview-img pointer unknown" data-media="${id}" oncontextmenu="deleteImage('${id}')" onclick="altImage('${acct_id}','${id}')" title="${lang.lang_postimg_delete}">`
|
||||
$('#preview').append(html)
|
||||
todc()
|
||||
if (localStorage.getItem('nsfw_' + acct_id)) {
|
||||
$('#nsfw').addClass('yellow-text')
|
||||
$('#nsfw').html('visibility')
|
||||
$('#nsfw').addClass('nsfw-avail')
|
||||
}
|
||||
$('.toot-btn-group').prop('disabled', false)
|
||||
$('select').formSelect()
|
||||
$('#mec').text(lang.lang_there)
|
||||
M.toast({ html: '<span>' + lang.lang_postimg_sync + '</span><button class="btn-flat toast-action" onclick="syncDetail()">Click</button>', displayLength: 3000 })
|
||||
$('#imgup').text('')
|
||||
$('#imgsel').show()
|
||||
localStorage.removeItem('image')
|
||||
}
|
||||
} catch {
|
||||
var start = 'https://' + domain + '/api/v1/media'
|
||||
httpreq.open('POST', start, true)
|
||||
httpreq.upload.addEventListener('progress', progshow, false)
|
||||
httpreq.responseType = 'json'
|
||||
httpreq.setRequestHeader('Authorization', 'Bearer ' + at)
|
||||
httpreq.send(fd)
|
||||
}
|
||||
}
|
||||
httpreq.onreadystatechange = function() {
|
||||
if (httpreq.readyState === 4) {
|
||||
var json = httpreq.response
|
||||
if (this.status !== 200) {
|
||||
setLog(start, this.status, json)
|
||||
$('.toot-btn-group').prop('disabled', false)
|
||||
$('select').formSelect()
|
||||
$('#mec').text(lang.lang_there)
|
||||
M.toast({ html: this.status + ':' +json, displayLength: 2000 })
|
||||
$('#imgup').text('')
|
||||
$('#imgsel').show()
|
||||
}
|
||||
if (!json.id) {
|
||||
todc()
|
||||
@@ -192,13 +132,13 @@ async function media(b64, type, no, stamped) {
|
||||
M.toast({ html: lang.lang_postimg_failupload, displayLength: 5000 })
|
||||
return false
|
||||
}
|
||||
$('#imgup').text('')
|
||||
$('.toot-btn-group').prop('disabled', false)
|
||||
$('select').formSelect()
|
||||
$('#imgsel').show()
|
||||
var img = localStorage.getItem('img')
|
||||
if (json.type.indexOf('image') != -1) {
|
||||
var html = `<img src="${json[previewer]}" class="preview-img pointer" data-media="${json['id']}" oncontextmenu="deleteImage('${json['id']}')" onclick="altImage('${acct_id}','${json['id']}')" title="${lang.lang_postimg_delete}">`
|
||||
var html = `<img src="${json[previewer]}" class="preview-img pointer" data-media="${
|
||||
json['id']
|
||||
}" oncontextmenu="deleteImage('${json['id']}')" onclick="altImage('${acct_id}','${
|
||||
json['id']
|
||||
}')" title="${lang.lang_postimg_delete}">`
|
||||
$('#preview').append(html)
|
||||
} else {
|
||||
$('#preview').append(lang.lang_postimg_previewdis)
|
||||
@@ -212,9 +152,22 @@ async function media(b64, type, no, stamped) {
|
||||
mediav = mediav.replace(regExp, json['id'])
|
||||
$('#media').val(mediav)
|
||||
}
|
||||
if (img == 'url' && json['text_url']) {
|
||||
if (img == 'url') {
|
||||
$('#textarea').val($('#textarea').val() + ' ' + json['text_url'])
|
||||
}
|
||||
todc()
|
||||
if (localStorage.getItem('nsfw_' + acct_id)) {
|
||||
$('#nsfw').addClass('yellow-text')
|
||||
$('#nsfw').html('visibility')
|
||||
$('#nsfw').addClass('nsfw-avail')
|
||||
}
|
||||
$('.toot-btn-group').prop('disabled', false)
|
||||
$('select').formSelect()
|
||||
$('#mec').text(lang.lang_there)
|
||||
M.toast({ html: lang.lang_postimg_aftupload, displayLength: 1000 })
|
||||
$('#imgup').text('')
|
||||
$('#imgsel').show()
|
||||
localStorage.removeItem('image')
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -299,35 +252,7 @@ function altImage(acct_id, id) {
|
||||
var domain = localStorage.getItem('domain_' + acct_id)
|
||||
var at = localStorage.getItem('acct_' + acct_id + '_at')
|
||||
var start = 'https://' + domain + '/api/v1/media/' + id
|
||||
if($('[data-media=' + id + ']').hasClass('unknown')) {
|
||||
fetch(start, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
Authorization: 'Bearer ' + at
|
||||
}
|
||||
})
|
||||
.then(function(response) {
|
||||
if (!response.ok) {
|
||||
response.text().then(function(text) {
|
||||
setLog(response.url, response.status, text)
|
||||
})
|
||||
}
|
||||
return response.json()
|
||||
})
|
||||
.catch(function(error) {
|
||||
todo(error)
|
||||
setLog(start, 'JSON', error)
|
||||
console.error(error)
|
||||
})
|
||||
.then(function(json) {
|
||||
console.log(json)
|
||||
$('[data-media=' + id + ']').removeClass('unknown')
|
||||
if(json.preview_url) {
|
||||
$('[data-media=' + id + ']').attr('src', json.preview_url)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
|
||||
Swal.fire({
|
||||
title: lang.lang_postimg_desc,
|
||||
text: lang.lang_postimg_leadContext,
|
||||
@@ -375,53 +300,4 @@ function altImage(acct_id, id) {
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
function stamp() {
|
||||
if ($('#stamp').hasClass('stamp-avail')) {
|
||||
$('#stamp').html('Off')
|
||||
$('#stamp').removeClass('stamp-avail')
|
||||
} else {
|
||||
$('#stamp').html('On')
|
||||
$('#stamp').addClass('stamp-avail')
|
||||
}
|
||||
}
|
||||
//v2/media対応
|
||||
async function v2MediaUpload(domain, at, fd) {
|
||||
var start = 'https://' + domain + '/api/v2/media'
|
||||
let promise = await fetch(start, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
Authorization:
|
||||
'Bearer ' + at
|
||||
},
|
||||
body: fd
|
||||
})
|
||||
var json = await promise.json()
|
||||
if(json.id) {
|
||||
return json.id
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
function alertProcessUnfinished() {
|
||||
Swal.fire({
|
||||
title: lang.lang_post_unfinishedMedia,
|
||||
type: 'error',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: lang.lang_post_retry,
|
||||
cancelButtonText: lang.lang_no
|
||||
}).then(result => {
|
||||
if (result.value) {
|
||||
post()
|
||||
}
|
||||
})
|
||||
}
|
||||
function syncDetail() {
|
||||
Swal.fire({
|
||||
title: lang.lang_post_syncDetail,
|
||||
text: lang.lang_post_syncDetailText,
|
||||
type: 'info'
|
||||
})
|
||||
}
|
@@ -1,3 +1,4 @@
|
||||
'use strict'
|
||||
//Renpost
|
||||
function renote(id, acct_id, remote) {
|
||||
if ($('#pub_' + id).hasClass('rted')) {
|
||||
@@ -116,7 +117,6 @@ function reactiontoggle(id, acct_id, tlid) {
|
||||
//reactioncustom
|
||||
function reactioncustom(acct_id, id) {
|
||||
$('#reply').val(id)
|
||||
$('#media').val('misskey')
|
||||
$('#unreact').hide()
|
||||
$('#addreact').removeClass('hide')
|
||||
$('#post-acct-sel').val(acct_id)
|
||||
@@ -187,14 +187,9 @@ function reactRefreshCore(json) {
|
||||
}
|
||||
}
|
||||
function emojiReaction(emoji) {
|
||||
var media = $('#media').val()
|
||||
var acct_id = $('#post-acct-sel').val()
|
||||
var id = $('#reply').val()
|
||||
if(media == 'announcement') {
|
||||
announReaction(id, acct_id, 0, false, emoji)
|
||||
} else {
|
||||
reaction(emoji, id, acct_id, null)
|
||||
}
|
||||
clear()
|
||||
hide()
|
||||
}
|
||||
|
@@ -1,3 +1,4 @@
|
||||
'use strict'
|
||||
/*投稿系*/
|
||||
//投稿
|
||||
function sec() {
|
||||
@@ -17,13 +18,6 @@ function post(mode, postvis) {
|
||||
var acct_id = $('#post-acct-sel').val()
|
||||
localStorage.setItem('last-use', acct_id)
|
||||
var domain = localStorage.getItem('domain_' + acct_id)
|
||||
if ($('#ideKey').val() != '') {
|
||||
var ideKey = $('#ideKey').val()
|
||||
} else {
|
||||
var user = localStorage.getItem('user_' + acct_id)
|
||||
var ideKey = Math.floor(Date.now() / 1000) + '/TheDesk/' + user + '@' + domain
|
||||
$('#ideKey').val(ideKey)
|
||||
}
|
||||
if (!localStorage.getItem('cw_sentence')) {
|
||||
var cw_sent = 500
|
||||
} else {
|
||||
@@ -122,10 +116,6 @@ function post(mode, postvis) {
|
||||
console.log('This toot will be posted at:' + scheduled)
|
||||
schedule()
|
||||
toot.scheduled_at = scheduled
|
||||
if($('#sch-box').hasClass('expire')) {
|
||||
toot.scheduled_at = null
|
||||
toot.expires_at = scheduled
|
||||
}
|
||||
} else {
|
||||
var scheduled = ''
|
||||
}
|
||||
@@ -163,19 +153,14 @@ function post(mode, postvis) {
|
||||
httpreq.open('POST', start, true)
|
||||
httpreq.setRequestHeader('Content-Type', 'application/json')
|
||||
httpreq.setRequestHeader('Authorization', 'Bearer ' + at)
|
||||
httpreq.setRequestHeader('Idempotency-Key', ideKey)
|
||||
httpreq.responseType = 'json'
|
||||
httpreq.send(JSON.stringify(toot))
|
||||
httpreq.onreadystatechange = function() {
|
||||
if (httpreq.readyState === 4) {
|
||||
var json = httpreq.response
|
||||
if (this.status !== 200) {
|
||||
if(media && this.status == 422) {
|
||||
$('#ideKey').val('')
|
||||
$('.toot-btn-group').prop('disabled', false)
|
||||
alertProcessUnfinished()
|
||||
} else {
|
||||
setLog(start, this.status, json)
|
||||
}
|
||||
var box = localStorage.getItem('box')
|
||||
if (box == 'yes' || !box) {
|
||||
$('#textarea').blur()
|
||||
@@ -185,32 +170,6 @@ function post(mode, postvis) {
|
||||
todc()
|
||||
clear()
|
||||
}
|
||||
} else {
|
||||
$('#ideKey').val('')
|
||||
var box = localStorage.getItem('box')
|
||||
if (box == 'yes' || !box) {
|
||||
$('#textarea').blur()
|
||||
hide()
|
||||
}
|
||||
$('.toot-btn-group').prop('disabled', false)
|
||||
todc()
|
||||
clear()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function expPostMode() {
|
||||
$('#sch-box').toggleClass('expire')
|
||||
if($('#sch-box').hasClass('expire')) {
|
||||
Swal.fire({
|
||||
type: 'info',
|
||||
title: 'Expiring toot On'
|
||||
})
|
||||
} else {
|
||||
Swal.fire({
|
||||
type: 'info',
|
||||
title: 'Expireing toot Off'
|
||||
})
|
||||
}
|
||||
}
|
||||
function misskeyPost() {
|
||||
@@ -297,7 +256,6 @@ function misskeyPost() {
|
||||
//クリア(Shift+C)
|
||||
function clear() {
|
||||
$('#textarea').val('')
|
||||
$('#ideKey').val('')
|
||||
if (localStorage.getItem('stable')) {
|
||||
$('#textarea').val('#' + localStorage.getItem('stable') + ' ')
|
||||
}
|
||||
@@ -327,8 +285,6 @@ function clear() {
|
||||
$('#nsfw').removeClass('yellow-text')
|
||||
$('#nsfw').html('visibility_off')
|
||||
$('#nsfw').removeClass('nsfw-avail')
|
||||
$('#stamp').html('Off')
|
||||
$('#stamp').removeClass('stamp-avail')
|
||||
$('#nsc').text(lang.lang_nothing)
|
||||
$('#drag').css('background-color', '#e0e0e0')
|
||||
$('#preview').html('')
|
||||
|
@@ -1,3 +1,4 @@
|
||||
'use strict'
|
||||
/*保護系*/
|
||||
//画像保護
|
||||
function nsfw() {
|
||||
@@ -96,9 +97,9 @@ function cw() {
|
||||
}
|
||||
}
|
||||
//TLでコンテントワーニングを表示トグル
|
||||
function cw_show(e) {
|
||||
$(e).parent().parent().find('.cw_hide').toggleClass('cw')
|
||||
$(e).parent().find('.cw_long').toggleClass('hide')
|
||||
function cw_show(id) {
|
||||
$('.cw_hide_' + id).toggleClass('cw')
|
||||
$('.cw-long-' + id).toggleClass('hide')
|
||||
}
|
||||
$(function() {
|
||||
$('#cw-text').on('change', function(event) {
|
||||
|
@@ -1,7 +1,8 @@
|
||||
'use strict'
|
||||
//お気に入り登録やブースト等、フォローやブロック等
|
||||
//お気に入り登録
|
||||
function fav(id, acct_id, remote) {
|
||||
if ($(`.cvo[unique-id=${id}]`).hasClass('faved')) {
|
||||
if ($('#pub_' + id).hasClass('faved')) {
|
||||
var flag = 'unfavourite'
|
||||
} else {
|
||||
var flag = 'favourite'
|
||||
@@ -57,7 +58,7 @@ function fav(id, acct_id, remote) {
|
||||
|
||||
//ブースト
|
||||
function rt(id, acct_id, remote, vis) {
|
||||
if ($(`.cvo[toot-id=${id}]`).hasClass('rted')) {
|
||||
if ($('#pub_' + id).hasClass('rted')) {
|
||||
var flag = 'unreblog'
|
||||
} else {
|
||||
var flag = 'reblog'
|
||||
@@ -85,7 +86,7 @@ function rt(id, acct_id, remote, vis) {
|
||||
json = json.reblog
|
||||
}
|
||||
console.log(['Success: boost', json])
|
||||
$('[toot-id=' + id + '] .fav_ct').text(json.favourites_count)
|
||||
$('[unique-id=' + id + '] .fav_ct').text(json.favourites_count)
|
||||
if (!json.reblog) {
|
||||
if (flag == 'unreblog') {
|
||||
var rt = json.reblogs_count - 1
|
||||
@@ -95,16 +96,16 @@ function rt(id, acct_id, remote, vis) {
|
||||
} else {
|
||||
var rt = json.reblogs_count
|
||||
}
|
||||
$('[toot-id=' + id + '] .rt_ct').text(rt)
|
||||
$('[unique-id=' + id + '] .rt_ct').text(rt)
|
||||
} else {
|
||||
$('[toot-id=' + id + '] .rt_ct').text(json.reblogs_count)
|
||||
$('[unique-id=' + id + '] .rt_ct').text(json.reblogs_count)
|
||||
}
|
||||
|
||||
if ($('[toot-id=' + id + ']').hasClass('rted')) {
|
||||
$('[toot-id=' + id + ']').removeClass('rted')
|
||||
if ($('[unique-id=' + id + ']').hasClass('rted')) {
|
||||
$('[unique-id=' + id + ']').removeClass('rted')
|
||||
$('.rt_' + id).removeClass('light-blue-text')
|
||||
} else {
|
||||
$('[toot-id=' + id + ']').addClass('rted')
|
||||
$('[unique-id=' + id + ']').addClass('rted')
|
||||
$('.rt_' + id).addClass('light-blue-text')
|
||||
}
|
||||
}
|
||||
@@ -117,7 +118,7 @@ function boostWith(vis) {
|
||||
}
|
||||
//ブックマーク
|
||||
function bkm(id, acct_id, tlid) {
|
||||
if ($(`.cvo[unique-id=${id}]`).hasClass('bkmed')) {
|
||||
if ($('#pub_' + id).hasClass('bkmed')) {
|
||||
var flag = 'unbookmark'
|
||||
} else {
|
||||
var flag = 'bookmark'
|
||||
@@ -153,21 +154,15 @@ function bkm(id, acct_id, tlid) {
|
||||
$('[toot-id=' + id + ']').addClass('bkmed')
|
||||
}
|
||||
var tlidTar = $(`.bookmark-timeline[data-acct=${acct_id}]`).attr('tlid')
|
||||
columnReload(tlidTar, 'bookmark')
|
||||
columnReload(tlidTar,'bookmark')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//フォロー
|
||||
async function follow(acct_id, resolve) {
|
||||
if($('#his-data').hasClass('locked')) {
|
||||
locked = true
|
||||
} else {
|
||||
locked = false
|
||||
}
|
||||
if (!acct_id && acct_id != 'selector') {
|
||||
var acct_id = $('#his-data').attr('use-acct')
|
||||
|
||||
} else if (acct_id == 'selector') {
|
||||
var acct_id = $('#user-acct-sel').val()
|
||||
}
|
||||
@@ -178,7 +173,6 @@ async function follow(acct_id, resolve) {
|
||||
var flag = 'follow'
|
||||
var flagm = 'create'
|
||||
}
|
||||
|
||||
var id = $('#his-data').attr('user-id')
|
||||
if (resolve == 'selector') {
|
||||
var fullacct = $('#his-acct').attr('fullname')
|
||||
@@ -212,14 +206,10 @@ async function follow(acct_id, resolve) {
|
||||
$('#his-follow-btn-text').text(lang.lang_status_follow)
|
||||
} else {
|
||||
$('#his-data').addClass('following')
|
||||
if(locked) {
|
||||
$('#his-follow-btn-text').text(lang.lang_status_requesting)
|
||||
} else {
|
||||
$('#his-follow-btn-text').text(lang.lang_status_unfollow)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
async function acctResolve(acct_id, user) {
|
||||
console.log('Get user data of ' + user)
|
||||
@@ -400,63 +390,23 @@ function redraft(id, acct_id) {
|
||||
}).then(result => {
|
||||
if (result.value) {
|
||||
show()
|
||||
var domain = localStorage.getItem('domain_' + acct_id)
|
||||
var at = localStorage.getItem('acct_' + acct_id + '_at')
|
||||
if (localStorage.getItem('mode_' + domain) == 'misskey') {
|
||||
var start = 'https://' + domain + '/api/notes/delete'
|
||||
var httpreq = new XMLHttpRequest()
|
||||
httpreq.open('POST', start, true)
|
||||
httpreq.setRequestHeader('Content-Type', 'application/json')
|
||||
httpreq.responseType = 'json'
|
||||
httpreq.send(JSON.stringify({ i: at, noteId: id }))
|
||||
$('[toot-id=' + id + ']').hide()
|
||||
$('[toot-id=' + id + ']').remove()
|
||||
} else {
|
||||
var start = 'https://' + domain + '/api/v1/statuses/' + id
|
||||
var httpreq = new XMLHttpRequest()
|
||||
httpreq.open('DELETE', start, true)
|
||||
httpreq.setRequestHeader('Content-Type', 'application/json')
|
||||
httpreq.setRequestHeader('Authorization', 'Bearer ' + at)
|
||||
httpreq.responseType = 'json'
|
||||
httpreq.send()
|
||||
}
|
||||
httpreq.onreadystatechange = function() {
|
||||
if (httpreq.readyState === 4) {
|
||||
if (this.status !== 200) {
|
||||
setLog(start, this.status, this.response)
|
||||
}
|
||||
var json = httpreq.response
|
||||
del(id, acct_id)
|
||||
$('#post-acct-sel').prop('disabled', true)
|
||||
$('#post-acct-sel').val(acct_id)
|
||||
$('select').formSelect()
|
||||
mdCheck()
|
||||
var medias = $('[toot-id=' + id + ']').attr('data-medias')
|
||||
var mediack = json.media_attachments[0]
|
||||
//メディアがあれば
|
||||
var media_ids = []
|
||||
if (mediack) {
|
||||
for (var i = 0; i <= 4; i++) {
|
||||
if (json.media_attachments[i]) {
|
||||
media_ids.push(json.media_attachments[i].id)
|
||||
$('#preview').append(
|
||||
'<img src="' +
|
||||
json.media_attachments[i].preview_url +
|
||||
'" style="width:50px; max-height:100px;">'
|
||||
)
|
||||
} else {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
var vismode = $('[toot-id=' + id + '] .vis-data').attr('data-vis')
|
||||
vis(vismode)
|
||||
var medias = media_ids.join(',');
|
||||
$('#media').val(medias)
|
||||
localStorage.setItem('nohide', true)
|
||||
show()
|
||||
if (json.text) {
|
||||
var html = json.text
|
||||
} else {
|
||||
var ct = medias.split(',').length
|
||||
$('[toot-id=' + id + '] img.toot-img').each(function(i, elem) {
|
||||
if (i < ct) {
|
||||
var url = $(elem).attr('src')
|
||||
console.log('Play back image data:' + url)
|
||||
$('#preview').append('<img src="' + url + '" style="width:50px; max-height:100px;">')
|
||||
}
|
||||
})
|
||||
var html = $('[toot-id=' + id + '] .toot').html()
|
||||
html = html.replace(/^<p>(.+)<\/p>$/, '$1')
|
||||
html = html.replace(/<br\s?\/?>/, '\n')
|
||||
@@ -464,28 +414,21 @@ function redraft(id, acct_id) {
|
||||
html = html.replace(/<\/p>/, '\n')
|
||||
html = html.replace(/<img[\s\S]*alt="(.+?)"[\s\S]*?>/g, '$1')
|
||||
html = $.strip_tags(html)
|
||||
}
|
||||
localStorage.setItem('nohide', true)
|
||||
show()
|
||||
$('#textarea').val(html)
|
||||
if (json.spoiler_text) {
|
||||
var cwtxt = $('[toot-id=' + id + '] .cw_text').html()
|
||||
if (cwtxt != '') {
|
||||
cwtxt = $.strip_tags(cwtxt)
|
||||
cw()
|
||||
$('#cw-text').val(json.spoiler_text)
|
||||
}
|
||||
if (json.sensitive) {
|
||||
$('#nsfw').addClass('yellow-text')
|
||||
$('#nsfw').html('visibility')
|
||||
$('#nsfw').addClass('nsfw-avail')
|
||||
}
|
||||
if (json.in_reply_to_id) {
|
||||
$('#reply').val(json.in_reply_to_id)
|
||||
}
|
||||
}
|
||||
$('#cw-text').val(cwtxt)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
//ピン留め
|
||||
function pin(id, acct_id) {
|
||||
if ($(`.cvo[unique-id=${id}]`).hasClass('pined')) {
|
||||
if ($('#pub_' + id).hasClass('pined')) {
|
||||
var flag = 'unpin'
|
||||
} else {
|
||||
var flag = 'pin'
|
||||
@@ -665,8 +608,6 @@ function staEx(mode) {
|
||||
console.error(error)
|
||||
})
|
||||
.then(function(json) {
|
||||
if (json.statuses) {
|
||||
if (json.statuses[0]) {
|
||||
var id = json.statuses[0].id
|
||||
if (mode == 'rt') {
|
||||
rt(id, acct_id, 'remote')
|
||||
@@ -675,13 +616,10 @@ function staEx(mode) {
|
||||
} else if (mode == 'reply') {
|
||||
reEx(id)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
function toggleAction(elem, ct) {
|
||||
var height = ct * 39 + 6
|
||||
function toggleAction(elem, height) {
|
||||
var cont = elem.parents('.cvo').find('.contextMenu')
|
||||
if (cont.hasClass('hide')) {
|
||||
$('#contextWrap').removeClass('hide')
|
||||
@@ -692,14 +630,13 @@ function toggleAction(elem, ct) {
|
||||
cont.removeClass('bottom')
|
||||
cont.addClass('top')
|
||||
} else {
|
||||
top = elem.offset().top - 105
|
||||
cont.removeClass('top')
|
||||
cont.addClass('bottom')
|
||||
}
|
||||
if (elem.parents('.cvo').attr('id') == 'toot-this') {
|
||||
if(elem.parents('.cvo').attr('id') == 'toot-this'){
|
||||
console.log($('#toot-this').offset().top, elem.offset().top)
|
||||
left = $('#toot-this').offset().left + elem.offset().left + 10
|
||||
top = $('#toot-this').offset().top - $('#toot-this').height() - height + 25
|
||||
top = $('#toot-this').offset().top - $('#toot-this').height() -height + 25
|
||||
}
|
||||
cont.css('top', top + 'px')
|
||||
cont.css('right', `calc(100vw - ${left}px)`)
|
||||
|
@@ -1,3 +1,4 @@
|
||||
'use strict'
|
||||
//入力時にハッシュタグと@をサジェスト
|
||||
var timer = null
|
||||
|
||||
|
@@ -1,3 +1,4 @@
|
||||
'use strict'
|
||||
/*リプライ*/
|
||||
function re(id, ats_cm, acct_id, mode) {
|
||||
clear()
|
||||
|
@@ -1,145 +0,0 @@
|
||||
function announParse(obj, acct_id, tlid) {
|
||||
var template = ''
|
||||
var datetype = localStorage.getItem('datetype')
|
||||
var gif = localStorage.getItem('gif')
|
||||
//Ticker
|
||||
var tickerck = localStorage.getItem('ticker_ok')
|
||||
if (tickerck == 'yes') {
|
||||
var ticker = true
|
||||
} else if (!ticker || ticker == 'no') {
|
||||
var ticker = false
|
||||
}
|
||||
if (!datetype) {
|
||||
datetype = 'absolute'
|
||||
}
|
||||
if (!gif) {
|
||||
var gif = 'yes'
|
||||
}
|
||||
Object.keys(obj).forEach(function(key) {
|
||||
var toot = obj[key]
|
||||
var content = toot.content
|
||||
if (toot.emojis) {
|
||||
Object.keys(toot.emojis).forEach(function(key1) {
|
||||
var emoji = toot.emojis[key1]
|
||||
var shortcode = emoji.shortcode
|
||||
if (gif == 'yes') {
|
||||
var emoSource = emoji.url
|
||||
} else {
|
||||
var emoSource = emoji.static_url
|
||||
}
|
||||
var emoji_url = `
|
||||
<img draggable="false" src="${emoSource}" class="emoji-img" data-emoji="${shortcode}"
|
||||
alt=" :${shortcode}: " title="${shortcode}" onclick="this.classList.toggle('bigemoji');">
|
||||
`
|
||||
var regExp = new RegExp(':' + shortcode + ':', 'g')
|
||||
content = content.replace(regExp, emoji_url)
|
||||
})
|
||||
}
|
||||
content = twemoji.parse(content)
|
||||
var reactions = ''
|
||||
//既存のリアクション
|
||||
if (toot.reactions) {
|
||||
Object.keys(toot.reactions).forEach(function(key2) {
|
||||
var reaction = toot.reactions[key2]
|
||||
//普通の絵文字 or カスタム絵文字 は文字数判断。ただしスコットランド国旗みたいなやべぇやつに注意
|
||||
var splitter = new GraphemeSplitter()
|
||||
if (splitter.splitGraphemes(reaction.name).length > 1) {
|
||||
//カスタム絵文字
|
||||
var shortcode = reaction.shortcode
|
||||
if (gif == 'yes') {
|
||||
var emoSource = reaction.url
|
||||
} else {
|
||||
var emoSource = reaction.static_url
|
||||
}
|
||||
var emoji_url = `
|
||||
<img draggable="false" src="${emoSource}" class="emoji-img" data-emoji="${shortcode}"
|
||||
alt=" :${shortcode}: " title="${shortcode}">`
|
||||
} else {
|
||||
emoji_url = twemoji.parse(reaction.name)
|
||||
}
|
||||
var addClass = ''
|
||||
if (reaction.me) {
|
||||
addClass = 'reactioned'
|
||||
}
|
||||
reactions =
|
||||
reactions +
|
||||
`<div class="announReaction ${addClass}" onclick="announReaction('${toot.id}', '${acct_id}', '${tlid}', ${reaction.me},'${reaction.name}')">
|
||||
${emoji_url} ${reaction.count}
|
||||
</div>`
|
||||
})
|
||||
}
|
||||
if (toot.ends_at) {
|
||||
var ended = `<div class="announReaction" title="${date(toot.ends_at, 'absolute')}" style="width: auto; cursor: default;">
|
||||
<i class="fas fa-arrow-right"></i>
|
||||
${date(toot.ends_at, datetype)}
|
||||
</div>`
|
||||
} else {
|
||||
var ended = ''
|
||||
}
|
||||
|
||||
template =
|
||||
template +
|
||||
`<div class="announcement" data-id="${toot.id}">
|
||||
${content}
|
||||
<div class="reactionsPack">
|
||||
${reactions}
|
||||
<div class="announReaction add" onclick="announReactionNew('${toot.id}', '${acct_id}', '${tlid}')"><i class="fas fa-plus"></i></div>
|
||||
${ended}
|
||||
</div>
|
||||
</div>`
|
||||
})
|
||||
return template
|
||||
}
|
||||
function announReaction(id, acct_id, tlid, del, name) {
|
||||
var at = localStorage.getItem('acct_' + acct_id + '_at')
|
||||
var domain = localStorage.getItem('domain_' + acct_id)
|
||||
var start = 'https://' + domain + '/api/v1/announcements/' + id + '/reactions/' + encodeURIComponent(name)
|
||||
var httpreq = new XMLHttpRequest()
|
||||
if(del) {
|
||||
var method = 'DELETE'
|
||||
} else {
|
||||
var method = 'PUT'
|
||||
}
|
||||
httpreq.open(method, start, true)
|
||||
httpreq.setRequestHeader('Content-Type', 'application/json')
|
||||
httpreq.setRequestHeader('Authorization', 'Bearer ' + at)
|
||||
httpreq.responseType = 'json'
|
||||
httpreq.send()
|
||||
httpreq.onreadystatechange = function() {
|
||||
if (httpreq.readyState === 4) {
|
||||
var json = httpreq.response
|
||||
if (this.status !== 200) {
|
||||
setLog(start, this.status, this.response)
|
||||
}
|
||||
announ(acct_id, tlid)
|
||||
}
|
||||
}
|
||||
}
|
||||
function announReactionNew(id, acct_id, tlid) {
|
||||
$('#reply').val(id)
|
||||
$('#media').val('announcement')
|
||||
$('#unreact').hide()
|
||||
$('#addreact').removeClass('hide')
|
||||
$('#post-acct-sel').val(acct_id)
|
||||
$('select').formSelect()
|
||||
localStorage.setItem('nohide', true)
|
||||
show()
|
||||
emojiToggle(true)
|
||||
$('#left-side').hide()
|
||||
}
|
||||
function emojiReactionDef(target) {
|
||||
var emojiraw = newpack.filter(function(item, index) {
|
||||
if (item.short_name == target) return true
|
||||
})
|
||||
var hex = emojiraw[0].unified.split('-')
|
||||
if (hex.length === 2) {
|
||||
emoji = twemoji.convert.fromCodePoint(hex[0]) + twemoji.convert.fromCodePoint(hex[1])
|
||||
} else {
|
||||
emoji = twemoji.convert.fromCodePoint(hex[0])
|
||||
}
|
||||
var acct_id = $('#post-acct-sel').val()
|
||||
var id = $('#reply').val()
|
||||
announReaction(id, acct_id, 0, false, emoji)
|
||||
clear()
|
||||
hide()
|
||||
}
|
@@ -1,3 +1,4 @@
|
||||
'use strict'
|
||||
//カード処理やメンション、ハッシュタグの別途表示
|
||||
//全てのTL処理で呼び出し
|
||||
function additional(acct_id, tlid) {
|
||||
@@ -37,7 +38,7 @@ function additional(acct_id, tlid) {
|
||||
}
|
||||
|
||||
//トゥートのURLぽかったら
|
||||
toot = text.match(/https:\/\/([a-zA-Z0-9.-]+)\/@([a-zA-Z0-9_]+)\/([0-9]+)/)
|
||||
var toot = text.match(/https:\/\/([a-zA-Z0-9.-]+)\/@([a-zA-Z0-9_]+)\/([0-9]+)/)
|
||||
if (toot) {
|
||||
if (toot[1]) {
|
||||
$(this).attr('data-acct', acct_id)
|
||||
@@ -172,7 +173,7 @@ function additionalIndv(tlid, acct_id, id) {
|
||||
console.error(error)
|
||||
})
|
||||
.then(function(json) {
|
||||
cards = json.card
|
||||
var cards = json.card
|
||||
var analyze = cardHtml(cards, acct_id, id)
|
||||
$('[toot-id=' + id + '] .additional').html(analyze)
|
||||
if (json.title) {
|
||||
|
@@ -1,3 +1,4 @@
|
||||
'use strict'
|
||||
//トゥートの詳細
|
||||
function details(id, acct_id, tlid, mode) {
|
||||
if (mode == 'dm') {
|
||||
|
@@ -1,98 +1,96 @@
|
||||
'use strict'
|
||||
//日付パーサー
|
||||
function date(str, datetype, lastStatus) {
|
||||
if (lastStatus) {
|
||||
var date = new Date(str)
|
||||
return date.getFullYear() + "/" + (date.getMonth() + 1) + "/" + date.getDate()
|
||||
} else if (datetype == "relative") {
|
||||
return '<time class="timeago" datetime="' + str + '"></time>'
|
||||
function date(str, datetype) {
|
||||
if (datetype == "relative") {
|
||||
return '<time class="timeago" datetime="' + str + '"></time>';
|
||||
} else {
|
||||
var date = new Date(str)
|
||||
var date = new Date(str);
|
||||
if (datetype == "unix") {
|
||||
var unixm = date.getTime()
|
||||
return Math.floor(unixm / 1000)
|
||||
var unixm = date.getTime();
|
||||
return Math.floor(unixm / 1000);
|
||||
}
|
||||
var now = new Date()
|
||||
var month = date.getMonth() + 1
|
||||
var now = new Date();
|
||||
var month = date.getMonth() + 1;
|
||||
if (date.getMinutes() < 10) {
|
||||
var min = "0" + date.getMinutes()
|
||||
var min = "0" + date.getMinutes();
|
||||
} else {
|
||||
var min = date.getMinutes()
|
||||
var min = date.getMinutes();
|
||||
}
|
||||
var sec = null
|
||||
var sec = null;
|
||||
if (date.getSeconds() < 10) {
|
||||
sec = "0" + date.getSeconds()
|
||||
sec = "0" + date.getSeconds();
|
||||
} else {
|
||||
sec = date.getSeconds()
|
||||
sec = date.getSeconds();
|
||||
}
|
||||
if (datetype == "full") {
|
||||
var ret = date.getFullYear() + "/" + month + "/" + date.getDate() + "/ " +
|
||||
date.getHours() + ":" + min + ":" + sec
|
||||
date.getHours() + ":" + min + ":" + sec;
|
||||
}
|
||||
if (date.getFullYear() == now.getFullYear()) {
|
||||
if (date.getMonth() == now.getMonth()) {
|
||||
if (date.getDate() == now.getDate()) {
|
||||
if (datetype == "medium") {
|
||||
var ret = '<time class="timeago" datetime="' + str + '"></time>'
|
||||
var ret = '<time class="timeago" datetime="' + str + '"></time>';
|
||||
} else {
|
||||
var ret = date.getHours() + ":" + min + ":" + sec
|
||||
var ret = date.getHours() + ":" + min + ":" + sec;
|
||||
}
|
||||
|
||||
} else {
|
||||
var ret = month + "/" + date.getDate() + " " + date.getHours() + ":" +
|
||||
min + ":" + sec
|
||||
min + ":" + sec;
|
||||
}
|
||||
} else {
|
||||
var ret = month + "/" + date.getDate() + " " + date.getHours() + ":" + min +
|
||||
":" + sec
|
||||
":" + sec;
|
||||
}
|
||||
} else {
|
||||
var ret = date.getFullYear() + "/" + month + "/" + date.getDate() + " " +
|
||||
date.getHours() + ":" + min + ":" + sec
|
||||
date.getHours() + ":" + min + ":" + sec;
|
||||
}
|
||||
if (datetype == "double") {
|
||||
return '<time class="timeago" datetime="' + str + '"></time>/' + ret
|
||||
return '<time class="timeago" datetime="' + str + '"></time>/' + ret;
|
||||
} else {
|
||||
return ret
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//特殊フォーマット(インスタンス情報で利用)
|
||||
function crat(str) {
|
||||
var date = new Date(str)
|
||||
var mnt = null
|
||||
var date = new Date(str);
|
||||
var mnt = null;
|
||||
if (date.getMonth() < 9) {
|
||||
mnt = "0" + (date.getMonth() + 1)
|
||||
mnt = "0" + (date.getMonth() + 1);
|
||||
} else {
|
||||
mnt = date.getMonth() + 1
|
||||
mnt = date.getMonth() + 1;
|
||||
}
|
||||
if (date.getDate() < 10) {
|
||||
var dat = "0" + date.getDate()
|
||||
var dat = "0" + date.getDate();
|
||||
} else {
|
||||
var dat = date.getDate()
|
||||
var dat = date.getDate();
|
||||
}
|
||||
if (date.getHours() < 10) {
|
||||
var hrs = "0" + date.getHours()
|
||||
var hrs = "0" + date.getHours();
|
||||
} else {
|
||||
var hrs = date.getHours()
|
||||
var hrs = date.getHours();
|
||||
}
|
||||
if (date.getMinutes() < 10) {
|
||||
var mns = "0" + date.getMinutes()
|
||||
var mns = "0" + date.getMinutes();
|
||||
} else {
|
||||
var mns = date.getMinutes()
|
||||
var mns = date.getMinutes();
|
||||
}
|
||||
if (date.getSeconds() < 10) {
|
||||
var sec = "0" + date.getSeconds()
|
||||
var sec = "0" + date.getSeconds();
|
||||
} else {
|
||||
var sec = date.getSeconds()
|
||||
var sec = date.getSeconds();
|
||||
}
|
||||
format_str = 'YYYY-MM-DD hh:mm:ss'
|
||||
format_str = format_str.replace(/YYYY/g, date.getFullYear())
|
||||
format_str = format_str.replace(/MM/g, mnt)
|
||||
format_str = format_str.replace(/DD/g, dat)
|
||||
format_str = format_str.replace(/hh/g, hrs)
|
||||
format_str = format_str.replace(/mm/g, mns)
|
||||
format_str = format_str.replace(/ss/g, sec)
|
||||
format_str = 'YYYY-MM-DD hh:mm:ss';
|
||||
format_str = format_str.replace(/YYYY/g, date.getFullYear());
|
||||
format_str = format_str.replace(/MM/g, mnt);
|
||||
format_str = format_str.replace(/DD/g, dat);
|
||||
format_str = format_str.replace(/hh/g, hrs);
|
||||
format_str = format_str.replace(/mm/g, mns);
|
||||
format_str = format_str.replace(/ss/g, sec);
|
||||
|
||||
return format_str
|
||||
return format_str;
|
||||
}
|
||||
|
@@ -1,49 +1,50 @@
|
||||
'use strict'
|
||||
//ディレクトリ
|
||||
//ディレクトリトグル
|
||||
function dirMenu() {
|
||||
$("#dir-contents").html("")
|
||||
directory()
|
||||
$("#left-menu a").removeClass("active")
|
||||
$("#dirMenu").addClass("active")
|
||||
$(".menu-content").addClass("hide")
|
||||
$("#dir-box").removeClass("hide")
|
||||
$("#dir-contents").html("");
|
||||
directory();
|
||||
$("#left-menu div").removeClass("active");
|
||||
$("#dirMenu").addClass("active");
|
||||
$(".menu-content").addClass("hide");
|
||||
$("#dir-box").removeClass("hide");
|
||||
}
|
||||
function dirselCk() {
|
||||
var acct = $("#dir-acct-sel").val()
|
||||
var acct = $("#dir-acct-sel").val();
|
||||
if (acct == "noauth") {
|
||||
$("#dirNoAuth").removeClass("hide")
|
||||
$("#dirNoAuth").removeClass("hide");
|
||||
} else {
|
||||
$("#dirNoAuth").addClass("hide")
|
||||
directory()
|
||||
$("#dirNoAuth").addClass("hide");
|
||||
directory();
|
||||
}
|
||||
}
|
||||
function directory(isMore) {
|
||||
var order = $("[name=sort]:checked").val()
|
||||
var order = $("[name=sort]:checked").val();
|
||||
if (!order) {
|
||||
order = "active"
|
||||
order = "active";
|
||||
}
|
||||
var local_only = $("#local_only:checked").val()
|
||||
var local_only = $("#local_only:checked").val();
|
||||
if (local_only) {
|
||||
local_only = "true"
|
||||
local_only = "true";
|
||||
} else {
|
||||
local_only = "false"
|
||||
local_only = "false";
|
||||
}
|
||||
var acct_id = $("#dir-acct-sel").val()
|
||||
var acct_id = $("#dir-acct-sel").val();
|
||||
if (acct_id == "noauth") {
|
||||
var domain = $("#dirNoAuth-url").val()
|
||||
var at = ""
|
||||
var domain = $("#dirNoAuth-url").val();
|
||||
var at = "";
|
||||
} else {
|
||||
var domain = localStorage.getItem("domain_" + acct_id)
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at")
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
}
|
||||
if (isMore) {
|
||||
var addOffset = $("#dir-contents .cvo").length
|
||||
var addOffset = $("#dir-contents .cvo").length;
|
||||
} else {
|
||||
var addOffset = 0
|
||||
$("#dir-contents").html("")
|
||||
var addOffset = 0;
|
||||
$("#dir-contents").html("");
|
||||
}
|
||||
var start = "https://" + domain + "/api/v1/directory?order=" + order + "&local=" + local_only + "&offset=" + addOffset
|
||||
console.log(start)
|
||||
var start = "https://" + domain + "/api/v1/directory?order=" + order + "&local=" + local_only + "&offset=" + addOffset;
|
||||
console.log(start);
|
||||
fetch(start, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
@@ -54,23 +55,23 @@ function directory(isMore) {
|
||||
.then(function(response) {
|
||||
if (!response.ok) {
|
||||
response.text().then(function(text) {
|
||||
setLog(response.url, response.status, text)
|
||||
})
|
||||
setLog(response.url, response.status, text);
|
||||
});
|
||||
}
|
||||
return response.json()
|
||||
return response.json();
|
||||
})
|
||||
.catch(function(error) {
|
||||
setLog(start, "JSON", error)
|
||||
console.error(error)
|
||||
setLog(start, "JSON", error);
|
||||
console.error(error);
|
||||
})
|
||||
.then(function(json) {
|
||||
if (json) {
|
||||
$("#moreDir").removeClass("disabled")
|
||||
var html = userparse(json, null, acct_id, "dir", null)
|
||||
$("#dir-contents").append(html)
|
||||
jQuery("time.timeago").timeago()
|
||||
$("#moreDir").removeClass("disabled");
|
||||
var html = userparse(json, null, acct_id, "dir", null);
|
||||
$("#dir-contents").append(html);
|
||||
jQuery("time.timeago").timeago();
|
||||
} else {
|
||||
$("#moreDir").addClass("disabled")
|
||||
$("#moreDir").addClass("disabled");
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
|
488
app/js/tl/dm.js
@@ -1,8 +1,8 @@
|
||||
//DM(Conv) TL
|
||||
function dm(acct_id, tlid, type, delc, voice) {
|
||||
var domain = localStorage.getItem("domain_" + acct_id)
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at")
|
||||
var start = "https://" + domain + "/api/v1/conversations"
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
var start = "https://" + domain + "/api/v1/conversations";
|
||||
fetch(start, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
@@ -13,38 +13,38 @@ function dm(acct_id, tlid, type, delc, voice) {
|
||||
.then(function(response) {
|
||||
if (!response.ok) {
|
||||
response.text().then(function(text) {
|
||||
setLog(response.url, response.status, text)
|
||||
})
|
||||
setLog(response.url, response.status, text);
|
||||
});
|
||||
}
|
||||
return response.json()
|
||||
return response.json();
|
||||
})
|
||||
.catch(function(error) {
|
||||
todo(error)
|
||||
setLog(start, "JSON", error)
|
||||
console.error(error)
|
||||
todo(error);
|
||||
setLog(start, "JSON", error);
|
||||
console.error(error);
|
||||
})
|
||||
.then(function(json) {
|
||||
var templete = '<div id="convList' + tlid + '">' + dmListParse(json, type, acct_id, tlid, "", mute) + "</div>"
|
||||
localStorage.setItem("lastobj_" + tlid, json[0].id)
|
||||
$("#timeline_" + tlid).html(templete)
|
||||
additional(acct_id, tlid)
|
||||
jQuery("time.timeago").timeago()
|
||||
todc()
|
||||
var templete = '<div id="convList' + tlid + '">' + dmListParse(json, type, acct_id, tlid, "", mute) + "</div>";
|
||||
localStorage.setItem("lastobj_" + tlid, json[0].id);
|
||||
$("#timeline_" + tlid).html(templete);
|
||||
additional(acct_id, tlid);
|
||||
jQuery("time.timeago").timeago();
|
||||
todc();
|
||||
//reload(type, '', acct_id, tlid, data, mute, delc,voice);
|
||||
$(window).scrollTop(0)
|
||||
})
|
||||
$(window).scrollTop(0);
|
||||
});
|
||||
}
|
||||
function dmmore(tlid) {
|
||||
var multi = localStorage.getItem("column")
|
||||
var obj = JSON.parse(multi)
|
||||
var acct_id = obj[tlid].domain
|
||||
var domain = localStorage.getItem("domain_" + acct_id)
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at")
|
||||
var multi = localStorage.getItem("column");
|
||||
var obj = JSON.parse(multi);
|
||||
var acct_id = obj[tlid].domain;
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
var sid = $("#timeline_" + tlid + " .cvo")
|
||||
.last()
|
||||
.attr("unique-id")
|
||||
var start = "https://" + domain + "/api/v1/conversations?max_id=" + sid
|
||||
var type = "dm"
|
||||
.attr("unique-id");
|
||||
var start = "https://" + domain + "/api/v1/conversations?max_id=" + sid;
|
||||
var type = "dm";
|
||||
fetch(start, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
@@ -55,444 +55,444 @@ function dmmore(tlid) {
|
||||
.then(function(response) {
|
||||
if (!response.ok) {
|
||||
response.text().then(function(text) {
|
||||
setLog(response.url, response.status, text)
|
||||
})
|
||||
setLog(response.url, response.status, text);
|
||||
});
|
||||
}
|
||||
return response.json()
|
||||
return response.json();
|
||||
})
|
||||
.catch(function(error) {
|
||||
todo(error)
|
||||
setLog(start, "JSON", error)
|
||||
console.error(error)
|
||||
todo(error);
|
||||
setLog(start, "JSON", error);
|
||||
console.error(error);
|
||||
})
|
||||
.then(function(json) {
|
||||
var templete = '<div id="convList' + tlid + '">' + dmListParse(json, type, acct_id, tlid, "", mute) + "</div>"
|
||||
$("#timeline_" + tlid).append(templete)
|
||||
additional(acct_id, tlid)
|
||||
jQuery("time.timeago").timeago()
|
||||
moreloading = false
|
||||
})
|
||||
var templete = '<div id="convList' + tlid + '">' + dmListParse(json, type, acct_id, tlid, "", mute) + "</div>";
|
||||
$("#timeline_" + tlid).append(templete);
|
||||
additional(acct_id, tlid);
|
||||
jQuery("time.timeago").timeago();
|
||||
moreloading = false;
|
||||
});
|
||||
}
|
||||
//DMオブジェクトパーサー(トゥート)
|
||||
function dmListParse(obj, mix, acct_id, tlid, popup, mutefilter) {
|
||||
var templete = ""
|
||||
var templete = "";
|
||||
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 = "re,rt,fav,qt,del,pin,red"
|
||||
var actb = localStorage.getItem("action_btns");
|
||||
var actb = "re,rt,fav,qt,del,pin,red";
|
||||
if (actb) {
|
||||
var actb = actb.split(",")
|
||||
var disp = {}
|
||||
var actb = actb.split(",");
|
||||
var disp = {};
|
||||
for (var k = 0; k < actb.length; k++) {
|
||||
if (k < 4) {
|
||||
var tp = "type-a"
|
||||
var tp = "type-a";
|
||||
} else {
|
||||
var tp = "type-b"
|
||||
var tp = "type-b";
|
||||
}
|
||||
disp[actb[k]] = tp
|
||||
disp[actb[k]] = tp;
|
||||
}
|
||||
}
|
||||
var datetype = localStorage.getItem("datetype")
|
||||
var nsfwtype = localStorage.getItem("nsfw")
|
||||
var sent = localStorage.getItem("sentence")
|
||||
var ltr = localStorage.getItem("letters")
|
||||
var gif = localStorage.getItem("gif")
|
||||
var imh = localStorage.getItem("img-height")
|
||||
var datetype = localStorage.getItem("datetype");
|
||||
var nsfwtype = localStorage.getItem("nsfw");
|
||||
var sent = localStorage.getItem("sentence");
|
||||
var ltr = localStorage.getItem("letters");
|
||||
var gif = localStorage.getItem("gif");
|
||||
var imh = localStorage.getItem("img-height");
|
||||
//独自ロケール
|
||||
var locale = localStorage.getItem("locale")
|
||||
var locale = localStorage.getItem("locale");
|
||||
if (locale == "yes") {
|
||||
var locale = false
|
||||
var locale = false;
|
||||
}
|
||||
//ネイティブ通知
|
||||
var native = localStorage.getItem("nativenotf")
|
||||
var native = localStorage.getItem("nativenotf");
|
||||
if (!native) {
|
||||
native = "yes"
|
||||
native = "yes";
|
||||
}
|
||||
//クライアント強調
|
||||
var emp = localStorage.getItem("client_emp")
|
||||
var emp = localStorage.getItem("client_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) {
|
||||
var mute = JSON.parse(mute)
|
||||
var mute = JSON.parse(mute);
|
||||
}
|
||||
//ユーザー強調
|
||||
var useremp = localStorage.getItem("user_emp")
|
||||
var useremp = localStorage.getItem("user_emp");
|
||||
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) {
|
||||
var wordemp = JSON.parse(wordemp)
|
||||
var wordemp = JSON.parse(wordemp);
|
||||
}
|
||||
//ワードミュート
|
||||
var wordmute = localStorage.getItem("word_mute")
|
||||
var wordmute = localStorage.getItem("word_mute");
|
||||
if (wordmute) {
|
||||
var wordmute = JSON.parse(wordmute)
|
||||
wordmute = wordmute.concat(mutefilter)
|
||||
var wordmute = JSON.parse(wordmute);
|
||||
wordmute = wordmute.concat(mutefilter);
|
||||
} else {
|
||||
wordmute = mutefilter
|
||||
wordmute = mutefilter;
|
||||
}
|
||||
//Ticker
|
||||
var tickerck = localStorage.getItem("ticker_ok")
|
||||
var tickerck = localStorage.getItem("ticker_ok");
|
||||
if (tickerck) {
|
||||
var ticker = true
|
||||
var ticker = true;
|
||||
} else {
|
||||
var ticker = false
|
||||
var ticker = false;
|
||||
}
|
||||
//Cards
|
||||
var card = localStorage.getItem("card_" + tlid)
|
||||
var card = localStorage.getItem("card_" + tlid);
|
||||
|
||||
if (!sent) {
|
||||
var sent = 500
|
||||
var sent = 500;
|
||||
}
|
||||
if (!ltr) {
|
||||
var ltr = 500
|
||||
var ltr = 500;
|
||||
}
|
||||
if (!nsfwtype || nsfwtype == "yes") {
|
||||
var nsfw = "ok"
|
||||
var nsfw = "ok";
|
||||
} else {
|
||||
var nsfw
|
||||
var nsfw;
|
||||
}
|
||||
var cwtype = localStorage.getItem("cw")
|
||||
var cwtype = localStorage.getItem("cw");
|
||||
if (!cwtype || cwtype == "yes") {
|
||||
var cw = "ok"
|
||||
var cw = "ok";
|
||||
} else {
|
||||
var cw
|
||||
var cw;
|
||||
}
|
||||
if (!datetype) {
|
||||
datetype = "absolute"
|
||||
datetype = "absolute";
|
||||
}
|
||||
if (!gif) {
|
||||
var gif = "yes"
|
||||
var gif = "yes";
|
||||
}
|
||||
if (!imh) {
|
||||
var imh = "200"
|
||||
var imh = "200";
|
||||
}
|
||||
if (!emp) {
|
||||
var emp = []
|
||||
var emp = [];
|
||||
}
|
||||
if (!mute) {
|
||||
var mute = []
|
||||
var mute = [];
|
||||
}
|
||||
if (!useremp) {
|
||||
var useremp = []
|
||||
var useremp = [];
|
||||
}
|
||||
if (!wordemp) {
|
||||
var wordemp = []
|
||||
var wordemp = [];
|
||||
}
|
||||
if (!wordmute) {
|
||||
var wordmute = []
|
||||
var wordmute = [];
|
||||
}
|
||||
//via通知
|
||||
var viashow = localStorage.getItem("viashow")
|
||||
var viashow = localStorage.getItem("viashow");
|
||||
if (!viashow) {
|
||||
viashow = "via-hide"
|
||||
viashow = "via-hide";
|
||||
}
|
||||
if (viashow == "hide") {
|
||||
viashow = "via-hide"
|
||||
viashow = "via-hide";
|
||||
}
|
||||
//認証なしTL
|
||||
if (mix == "noauth") {
|
||||
var noauth = "hide"
|
||||
var antinoauth = ""
|
||||
var noauth = "hide";
|
||||
var antinoauth = "";
|
||||
} else {
|
||||
var noauth = ""
|
||||
var antinoauth = "hide"
|
||||
var noauth = "";
|
||||
var antinoauth = "hide";
|
||||
}
|
||||
//マウスオーバーのみ
|
||||
var mouseover = localStorage.getItem("mouseover")
|
||||
var mouseover = localStorage.getItem("mouseover");
|
||||
if (!mouseover) {
|
||||
mouseover = ""
|
||||
mouseover = "";
|
||||
} else if (mouseover == "yes" || mouseover == "click") {
|
||||
mouseover = "hide"
|
||||
mouseover = "hide";
|
||||
} else if (mouseover == "no") {
|
||||
mouseover = ""
|
||||
mouseover = "";
|
||||
}
|
||||
var local = []
|
||||
var times = []
|
||||
var local = [];
|
||||
var times = [];
|
||||
Object.keys(obj).forEach(function(key) {
|
||||
var conv_id = obj[key].id
|
||||
var toot = obj[key].last_status
|
||||
var dis_name = escapeHTML(toot.account.display_name)
|
||||
var conv_id = obj[key].id;
|
||||
var toot = obj[key].last_status;
|
||||
var dis_name = escapeHTML(toot.account.display_name);
|
||||
if (toot.account.emojis) {
|
||||
var actemojick = toot.account.emojis[0]
|
||||
var actemojick = toot.account.emojis[0];
|
||||
} else {
|
||||
var actemojick = false
|
||||
var actemojick = false;
|
||||
}
|
||||
//絵文字があれば
|
||||
if (actemojick) {
|
||||
Object.keys(toot.account.emojis).forEach(function(key5) {
|
||||
var emoji = toot.account.emojis[key5]
|
||||
var shortcode = emoji.shortcode
|
||||
var emoji_url = '<img src="' + emoji.url + '" class="emoji-img" data-emoji="' + shortcode + '" alt=" :' + shortcode + ': ">'
|
||||
var regExp = new RegExp(":" + shortcode + ":", "g")
|
||||
dis_name = dis_name.replace(regExp, emoji_url)
|
||||
})
|
||||
var emoji = toot.account.emojis[key5];
|
||||
var shortcode = emoji.shortcode;
|
||||
var emoji_url = '<img src="' + emoji.url + '" class="emoji-img" data-emoji="' + shortcode + '" alt=" :' + shortcode + ': ">';
|
||||
var regExp = new RegExp(":" + shortcode + ":", "g");
|
||||
dis_name = dis_name.replace(regExp, emoji_url);
|
||||
});
|
||||
}
|
||||
var noticeavatar = ""
|
||||
var if_notf = ""
|
||||
var uniqueid = toot.id
|
||||
var notice = ""
|
||||
var boostback = ""
|
||||
var noticeavatar = "";
|
||||
var if_notf = "";
|
||||
var uniqueid = toot.id;
|
||||
var notice = "";
|
||||
var boostback = "";
|
||||
//ユーザー強調
|
||||
if (toot.account.username != toot.account.acct) {
|
||||
var fullname = toot.account.acct
|
||||
var fullname = toot.account.acct;
|
||||
} else {
|
||||
var domain = localStorage.getItem("domain_" + acct_id)
|
||||
var fullname = toot.account.acct + "@" + domain
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var fullname = toot.account.acct + "@" + domain;
|
||||
}
|
||||
if (useremp) {
|
||||
Object.keys(useremp).forEach(function(key10) {
|
||||
var user = useremp[key10]
|
||||
var user = useremp[key10];
|
||||
if (user == fullname) {
|
||||
boostback = "emphasized"
|
||||
boostback = "emphasized";
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
var id = toot.id
|
||||
var home = ""
|
||||
var id = toot.id;
|
||||
var home = "";
|
||||
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 {
|
||||
var locked = ""
|
||||
var locked = "";
|
||||
}
|
||||
if (!toot.application) {
|
||||
var via = ""
|
||||
viashow = "hide"
|
||||
var via = "";
|
||||
viashow = "hide";
|
||||
} else {
|
||||
var via = escapeHTML(toot.application.name)
|
||||
var via = escapeHTML(toot.application.name);
|
||||
//強調チェック
|
||||
Object.keys(emp).forEach(function(key6) {
|
||||
var cli = emp[key6]
|
||||
var cli = emp[key6];
|
||||
if (cli == via) {
|
||||
boostback = "emphasized"
|
||||
boostback = "emphasized";
|
||||
}
|
||||
})
|
||||
});
|
||||
//ミュートチェック
|
||||
Object.keys(mute).forEach(function(key7) {
|
||||
var cli = mute[key7]
|
||||
var cli = mute[key7];
|
||||
if (cli == via) {
|
||||
boostback = "hide"
|
||||
boostback = "hide";
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
if (mix == "pinned") {
|
||||
boostback = "emphasized"
|
||||
boostback = "emphasized";
|
||||
}
|
||||
if (toot.spoiler_text && cw) {
|
||||
var content = toot.content
|
||||
var spoil = escapeHTML(toot.spoiler_text)
|
||||
var spoiler = "cw cw_hide_" + toot.id
|
||||
var api_spoil = "gray"
|
||||
var spoiler_show = '<a href="#" onclick="cw_show(\'' + toot.id + '\')" class="nex parsed">' + lang.lang_parse_cwshow + "</a><br>"
|
||||
var content = toot.content;
|
||||
var spoil = escapeHTML(toot.spoiler_text);
|
||||
var spoiler = "cw cw_hide_" + toot.id;
|
||||
var api_spoil = "gray";
|
||||
var spoiler_show = '<a href="#" onclick="cw_show(\'' + toot.id + '\')" class="nex parsed">' + lang.lang_parse_cwshow + "</a><br>";
|
||||
} else {
|
||||
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 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;
|
||||
if (ct1 > ct2) {
|
||||
var ct = ct1
|
||||
var ct = ct1;
|
||||
} else {
|
||||
var ct = ct2
|
||||
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)) {
|
||||
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(toot.content), 0, 100) + '</span><span class="gray">' + lang.lang_parse_autofold + "</span>"
|
||||
var spoiler = "cw cw_hide_" + toot.id
|
||||
var spoiler_show = '<a href="#" onclick="cw_show(\'' + toot.id + '\')" class="nex parsed">' + lang.lang_parse_more + "</a><br>"
|
||||
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(toot.content), 0, 100) + '</span><span class="gray">' + lang.lang_parse_autofold + "</span>";
|
||||
var spoiler = "cw cw_hide_" + toot.id;
|
||||
var spoiler_show = '<a href="#" onclick="cw_show(\'' + toot.id + '\')" class="nex parsed">' + lang.lang_parse_more + "</a><br>";
|
||||
} else {
|
||||
var content = toot.content
|
||||
var spoil = escapeHTML(toot.spoiler_text)
|
||||
var spoiler = ""
|
||||
var spoiler_show = ""
|
||||
var content = toot.content;
|
||||
var spoil = escapeHTML(toot.spoiler_text);
|
||||
var spoiler = "";
|
||||
var spoiler_show = "";
|
||||
}
|
||||
}
|
||||
var urls = $.strip_tags(content)
|
||||
.replace(/\n/g, " ")
|
||||
.match(/https?:\/\/([-a-zA-Z0-9@.]+)\/?(?!.*((media|tags)|mentions)).*([-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)?/)
|
||||
.match(/https?:\/\/([-a-zA-Z0-9@.]+)\/?(?!.*((media|tags)|mentions)).*([-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)?/);
|
||||
if (urls) {
|
||||
var analyze = "<a onclick=\"additionalIndv('" + tlid + "'," + acct_id + ",'" + id + '\')" class="add-show pointer">' + lang.lang_parse_url + "</a><br>"
|
||||
var analyze = "<a onclick=\"additionalIndv('" + tlid + "'," + acct_id + ",'" + id + '\')" class="add-show pointer">' + lang.lang_parse_url + "</a><br>";
|
||||
} else {
|
||||
var analyze = ""
|
||||
var analyze = "";
|
||||
}
|
||||
var viewer = ""
|
||||
var hasmedia = ""
|
||||
var youtube = ""
|
||||
var viewer = "";
|
||||
var hasmedia = "";
|
||||
var youtube = "";
|
||||
if (toot.emojis) {
|
||||
var emojick = toot.emojis[0]
|
||||
var emojick = toot.emojis[0];
|
||||
} else {
|
||||
var emojick = false
|
||||
var emojick = false;
|
||||
}
|
||||
//絵文字があれば
|
||||
if (emojick) {
|
||||
Object.keys(toot.emojis).forEach(function(key5) {
|
||||
var emoji = toot.emojis[key5]
|
||||
var shortcode = emoji.shortcode
|
||||
var emoji_url = '<img src="' + emoji.url + '" class="emoji-img" data-emoji="' + shortcode + '" alt=" :' + shortcode + ': ">'
|
||||
var regExp = new RegExp(":" + shortcode + ":", "g")
|
||||
content = content.replace(regExp, emoji_url)
|
||||
spoil = spoil.replace(regExp, emoji_url)
|
||||
})
|
||||
var emoji = toot.emojis[key5];
|
||||
var shortcode = emoji.shortcode;
|
||||
var emoji_url = '<img src="' + emoji.url + '" class="emoji-img" data-emoji="' + shortcode + '" alt=" :' + shortcode + ': ">';
|
||||
var regExp = new RegExp(":" + shortcode + ":", "g");
|
||||
content = content.replace(regExp, emoji_url);
|
||||
spoil = spoil.replace(regExp, emoji_url);
|
||||
});
|
||||
}
|
||||
//ニコフレ絵文字
|
||||
if (toot.profile_emojis) {
|
||||
var nicoemojick = toot.profile_emojis[0]
|
||||
var nicoemojick = toot.profile_emojis[0];
|
||||
} else {
|
||||
var nicoemojick = false
|
||||
var nicoemojick = false;
|
||||
}
|
||||
//絵文字があれば
|
||||
if (nicoemojick) {
|
||||
Object.keys(toot.profile_emojis).forEach(function(keynico) {
|
||||
var emoji = toot.profile_emojis[keynico]
|
||||
var shortcode = emoji.shortcode
|
||||
var emoji_url = '<img src="' + emoji.url + '" class="emoji-img" data-emoji="' + shortcode + '" alt=" :' + shortcode + ': ">'
|
||||
var regExp = new RegExp(":" + shortcode + ":", "g")
|
||||
content = content.replace(regExp, emoji_url)
|
||||
spoil = spoil.replace(regExp, emoji_url)
|
||||
})
|
||||
var emoji = toot.profile_emojis[keynico];
|
||||
var shortcode = emoji.shortcode;
|
||||
var emoji_url = '<img src="' + emoji.url + '" class="emoji-img" data-emoji="' + shortcode + '" alt=" :' + shortcode + ': ">';
|
||||
var regExp = new RegExp(":" + shortcode + ":", "g");
|
||||
content = content.replace(regExp, emoji_url);
|
||||
spoil = spoil.replace(regExp, emoji_url);
|
||||
});
|
||||
}
|
||||
//デフォ絵文字
|
||||
content = twemoji.parse(content)
|
||||
content = twemoji.parse(content);
|
||||
if (dis_name) {
|
||||
dis_name = twemoji.parse(dis_name)
|
||||
dis_name = twemoji.parse(dis_name);
|
||||
}
|
||||
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) {
|
||||
hasmedia = "hasmedia"
|
||||
var cwdt = 100 / toot.media_attachments.length
|
||||
hasmedia = "hasmedia";
|
||||
var cwdt = 100 / toot.media_attachments.length;
|
||||
Object.keys(toot.media_attachments).forEach(function(key2) {
|
||||
var media = toot.media_attachments[key2]
|
||||
var purl = media.preview_url
|
||||
media_ids = media_ids + media.id + ","
|
||||
var url = media.url
|
||||
var media = toot.media_attachments[key2];
|
||||
var purl = media.preview_url;
|
||||
media_ids = media_ids + media.id + ",";
|
||||
var url = media.url;
|
||||
if (toot.sensitive && nsfw) {
|
||||
var sense = "sensitive"
|
||||
var sense = "sensitive";
|
||||
} else {
|
||||
var sense = ""
|
||||
var sense = "";
|
||||
}
|
||||
viewer = viewer + "<a onclick=\"imgv('" + id + "','" + key2 + "','" + acct_id + '\')" id="' + id + "-image-" + key2 + '" data-url="' + url + '" data-type="' + media.type + '" class="img-parsed"><img src="' + purl + '" class="' + sense + ' toot-img pointer" style="width:' + cwdt + "%; height:" + imh + 'px;"></a></span>'
|
||||
})
|
||||
media_ids = media_ids.slice(0, -1)
|
||||
viewer = viewer + "<a onclick=\"imgv('" + id + "','" + key2 + "','" + acct_id + '\')" id="' + id + "-image-" + key2 + '" data-url="' + url + '" data-type="' + media.type + '" class="img-parsed"><img src="' + purl + '" class="' + sense + ' toot-img pointer" style="width:' + cwdt + "%; height:" + imh + 'px;"></a></span>';
|
||||
});
|
||||
media_ids = media_ids.slice(0, -1);
|
||||
} else {
|
||||
viewer = ""
|
||||
hasmedia = "nomedia"
|
||||
viewer = "";
|
||||
hasmedia = "nomedia";
|
||||
}
|
||||
var menck = toot.mentions[0]
|
||||
var mentions = ""
|
||||
var menck = toot.mentions[0];
|
||||
var mentions = "";
|
||||
//メンションであれば
|
||||
if (menck) {
|
||||
mentions = ""
|
||||
mentions = "";
|
||||
Object.keys(toot.mentions).forEach(function(key3) {
|
||||
var mention = toot.mentions[key3]
|
||||
mentions = mentions + "<a onclick=\"udg('" + mention.id + "'," + acct_id + ')" class="pointer">@' + mention.acct + "</a> "
|
||||
})
|
||||
mentions = '<div style="float:right">' + mentions + "</div>"
|
||||
var mention = toot.mentions[key3];
|
||||
mentions = mentions + "<a onclick=\"udg('" + mention.id + "'," + acct_id + ')" class="pointer">@' + mention.acct + "</a> ";
|
||||
});
|
||||
mentions = '<div style="float:right">' + mentions + "</div>";
|
||||
}
|
||||
var tagck = toot.tags[0]
|
||||
var tags = ""
|
||||
var tagck = toot.tags[0];
|
||||
var tags = "";
|
||||
//タグであれば
|
||||
if (tagck) {
|
||||
Object.keys(toot.tags).forEach(function(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 + ',\'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> '
|
||||
})
|
||||
tags = '<div style="float:right">' + tags + "</div>"
|
||||
var tag = toot.tags[key4];
|
||||
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> ' + "<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>";
|
||||
}
|
||||
//アニメ再生
|
||||
if (gif == "yes") {
|
||||
var avatar = toot.account.avatar
|
||||
var avatar = toot.account.avatar;
|
||||
} else {
|
||||
var avatar = toot.account.avatar_static
|
||||
var avatar = toot.account.avatar_static;
|
||||
}
|
||||
//ワードミュート
|
||||
if (wordmute) {
|
||||
Object.keys(wordmute).forEach(function(key8) {
|
||||
var worde = wordmute[key8]
|
||||
var worde = wordmute[key8];
|
||||
if (worde) {
|
||||
if (worde.tag) {
|
||||
var word = worde.tag
|
||||
var word = worde.tag;
|
||||
} 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)) {
|
||||
boostback = "hide by_filter"
|
||||
boostback = "hide by_filter";
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
//ワード強調
|
||||
if (wordemp) {
|
||||
Object.keys(wordemp).forEach(function(key9) {
|
||||
var word = wordemp[key9]
|
||||
var word = wordemp[key9];
|
||||
if (word) {
|
||||
var word = word.tag
|
||||
var regExp = new RegExp(word, "g")
|
||||
content = content.replace(regExp, '<span class="emp">' + escapeHTML(word) + "</span>")
|
||||
var word = word.tag;
|
||||
var regExp = new RegExp(word, "g");
|
||||
content = content.replace(regExp, '<span class="emp">' + escapeHTML(word) + "</span>");
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
//日本語じゃない
|
||||
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 {
|
||||
var trans = ""
|
||||
var trans = "";
|
||||
}
|
||||
if (toot.favourited) {
|
||||
var if_fav = " yellow-text"
|
||||
var fav_app = "faved"
|
||||
var if_fav = " yellow-text";
|
||||
var fav_app = "faved";
|
||||
} else {
|
||||
var if_fav = ""
|
||||
var fav_app = ""
|
||||
var if_fav = "";
|
||||
var fav_app = "";
|
||||
}
|
||||
//Cards
|
||||
if (!card && toot.card) {
|
||||
var cards = toot.card
|
||||
var cards = toot.card;
|
||||
if (cards.provider_name == "Twitter") {
|
||||
if (cards.image) {
|
||||
var twiImg = '<br><img src="' + cards.image + '">'
|
||||
var twiImg = '<br><img src="' + cards.image + '">';
|
||||
} else {
|
||||
var twiImg = ""
|
||||
var twiImg = "";
|
||||
}
|
||||
analyze = '<blockquote class="twitter-tweet"><b>' + escapeHTML(cards.author_name) + "</b><br>" + escapeHTML(cards.description) + twiImg + "</blockquote>"
|
||||
analyze = '<blockquote class="twitter-tweet"><b>' + escapeHTML(cards.author_name) + "</b><br>" + escapeHTML(cards.description) + twiImg + "</blockquote>";
|
||||
}
|
||||
if (cards.title) {
|
||||
analyze = '<span class="gray">URL' + lang.lang_cards_check + ":<br>Title:" + escapeHTML(cards.title) + "<br>" + escapeHTML(cards.description) + "</span>"
|
||||
analyze = '<span class="gray">URL' + lang.lang_cards_check + ":<br>Title:" + escapeHTML(cards.title) + "<br>" + escapeHTML(cards.description) + "</span>";
|
||||
}
|
||||
if (cards.html) {
|
||||
analyze = cards.html + '<i class="material-icons" onclick="pip(' + id + ')" title="' + lang.lang_cards_pip + '">picture_in_picture_alt</i>'
|
||||
analyze = cards.html + '<i class="material-icons" onclick="pip(' + id + ')" title="' + lang.lang_cards_pip + '">picture_in_picture_alt</i>';
|
||||
}
|
||||
}
|
||||
//Ticker
|
||||
var tickerdom = ""
|
||||
var tickerdom = "";
|
||||
if (ticker) {
|
||||
var tickerdata = localStorage.getItem("ticker")
|
||||
var tickerdata = localStorage.getItem("ticker");
|
||||
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) {
|
||||
thisdomain = thisdomain[1]
|
||||
thisdomain = thisdomain[1];
|
||||
}
|
||||
for (var i = 0; i < tickerdata.length; i++) {
|
||||
var value = tickerdata[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
|
||||
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 ' + boostback + " " + fav_app + " " + hasmedia + '" toot-id="' + id + '" unique-id="' + uniqueid + '" data-medias="' + media_ids + ' " unixtime="' + date(obj[key].created_at, "unix") + '" ' + if_notf + ' onclick="dmStatus()">' + '<div class="area-notice"><span class="gray sharesta">' + notice + home + "</span></div>" + '<div class="area-icon"><a onclick="udg(\'' + toot.account.id + "'," + acct_id + ');" user="' + toot.account.acct + '" class="udg">' + '<img src="' + avatar + '" width="40" class="prof-img" user="' + toot.account.acct + '"></a>' + noticeavatar + "</div>" + '<div class="area-display_name"><div class="flex-name"><span class="user">' + dis_name + '</span><span class="sml gray" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis; cursor:text;"> @' + toot.account.acct + locked + "</span></div>" + '<div class="flex-time"><span class="cbadge cbadge-hover pointer waves-effect" onclick="tootUriCopy(\'' + toot.url + '\');" title="' + date(toot.created_at, "absolute") + "(" + lang.lang_parse_clickcopyurl + ')"><i class="far fa-clock-o"></i>' + date(toot.created_at, datetype) + "</span>" + "</div></div>" + '<div class="area-toot">' + tickerdom + '<span class="' + api_spoil + " cw_text_" + toot.id + '"><span class="cw_text">' + spoil + "</span>" + spoiler_show + '</span><span class="toot ' + spoiler + '">' + content + "</span>" + "" + viewer + "" + "<br><a onclick=\"details('" + toot.id + "'," + acct_id + ",'" + tlid + "','dm')\" class=\"pointer waves-effect\">" + lang.lang_parse_thread + "</a></div>" + '<div class="area-vis"></div>' + "</div></div>"
|
||||
})
|
||||
return templete
|
||||
templete = templete + '<div id="pub_' + toot.id + '" class="cvo ' + boostback + " " + fav_app + " " + hasmedia + '" toot-id="' + id + '" unique-id="' + uniqueid + '" data-medias="' + media_ids + ' " unixtime="' + date(obj[key].created_at, "unix") + '" ' + if_notf + ' onclick="dmStatus()">' + '<div class="area-notice"><span class="gray sharesta">' + notice + home + "</span></div>" + '<div class="area-icon"><a onclick="udg(\'' + toot.account.id + "'," + acct_id + ');" user="' + toot.account.acct + '" class="udg">' + '<img src="' + avatar + '" width="40" class="prof-img" user="' + toot.account.acct + '"></a>' + noticeavatar + "</div>" + '<div class="area-display_name"><div class="flex-name"><span class="user">' + dis_name + '</span><span class="sml gray" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis; cursor:text;"> @' + toot.account.acct + locked + "</span></div>" + '<div class="flex-time"><span class="cbadge cbadge-hover pointer waves-effect" onclick="tootUriCopy(\'' + toot.url + '\');" title="' + date(toot.created_at, "absolute") + "(" + lang.lang_parse_clickcopyurl + ')"><i class="far fa-clock-o"></i>' + date(toot.created_at, datetype) + "</span>" + "</div></div>" + '<div class="area-toot">' + tickerdom + '<span class="' + api_spoil + " cw_text_" + toot.id + '"><span class="cw_text">' + spoil + "</span>" + spoiler_show + '</span><span class="toot ' + spoiler + '">' + content + "</span>" + "" + viewer + "" + "<br><a onclick=\"details('" + toot.id + "'," + acct_id + ",'" + tlid + "','dm')\" class=\"pointer waves-effect\">" + lang.lang_parse_thread + "</a></div>" + '<div class="area-vis"></div>' + "</div></div>";
|
||||
});
|
||||
return templete;
|
||||
}
|
||||
|
@@ -1,3 +1,4 @@
|
||||
'use strict'
|
||||
/*メディアフィルター機能*/
|
||||
//各TL上方のMedia[On/Off]
|
||||
function mediaToggle(tlid) {
|
||||
@@ -14,46 +15,6 @@ function mediaToggle(tlid) {
|
||||
$('#timeline_' + tlid).addClass('media-filter')
|
||||
}
|
||||
}
|
||||
/* Remote only */
|
||||
function remoteOnly(tlid, type) {
|
||||
var multi = localStorage.getItem('column')
|
||||
var obj = JSON.parse(multi)
|
||||
if (obj[tlid].data) {
|
||||
if (obj[tlid].data.remote) {
|
||||
obj[tlid].data.remote = false
|
||||
var json = JSON.stringify(obj)
|
||||
localStorage.setItem('column', json)
|
||||
$('#sta-remote-' + tlid).text('Off')
|
||||
$('#sta-remote-' + tlid).css('color', '#009688')
|
||||
} else {
|
||||
obj[tlid].data.remote = true
|
||||
var json = JSON.stringify(obj)
|
||||
localStorage.setItem('column', json)
|
||||
$('#sta-remote-' + tlid).text('On')
|
||||
$('#sta-remote-' + tlid).css('color', 'red')
|
||||
}
|
||||
} else {
|
||||
obj[tlid].data = {}
|
||||
obj[tlid].data.remote = true
|
||||
var json = JSON.stringify(obj)
|
||||
localStorage.setItem('column', json)
|
||||
$('#sta-remote-' + tlid).text('On')
|
||||
$('#sta-remote-' + tlid).css('color', 'red')
|
||||
}
|
||||
columnReload(tlid, type)
|
||||
}
|
||||
function remoteOnlyCk(tlid) {
|
||||
var multi = localStorage.getItem('column')
|
||||
var obj = JSON.parse(multi)
|
||||
if (obj[tlid].data) {
|
||||
if (obj[tlid].data.remote) {
|
||||
$('#sta-remote-' + tlid).text('On')
|
||||
$('#sta-remote-' + tlid).css('color', 'red')
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
//各TL上方のBT[BTOnly/BTExc/Off]
|
||||
function ebtToggle(tlid) {
|
||||
var ebt = localStorage.getItem('ebt_' + tlid)
|
||||
@@ -141,7 +102,7 @@ function delreset(tlid) {
|
||||
}
|
||||
/*ワードフィルター機能*/
|
||||
function filterMenu() {
|
||||
$('#left-menu a').removeClass('active')
|
||||
$('#left-menu div').removeClass('active')
|
||||
$('#filterMenu').addClass('active')
|
||||
$('.menu-content').addClass('hide')
|
||||
$('#filter-box').removeClass('hide')
|
||||
@@ -157,26 +118,26 @@ function filter() {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
Authorization: 'Bearer ' + at,
|
||||
},
|
||||
Authorization: 'Bearer ' + at
|
||||
}
|
||||
})
|
||||
.then(function (response) {
|
||||
.then(function(response) {
|
||||
if (!response.ok) {
|
||||
response.text().then(function (text) {
|
||||
response.text().then(function(text) {
|
||||
setLog(response.url, response.status, text)
|
||||
})
|
||||
}
|
||||
return response.json()
|
||||
})
|
||||
.catch(function (error) {
|
||||
.catch(function(error) {
|
||||
todo(error)
|
||||
setLog(start, 'JSON', error)
|
||||
console.error(error)
|
||||
})
|
||||
.then(function (json) {
|
||||
.then(function(json) {
|
||||
if (json) {
|
||||
var filters = ''
|
||||
Object.keys(json).forEach(function (key) {
|
||||
Object.keys(json).forEach(function(key) {
|
||||
var filterword = json[key]
|
||||
var context = filterword.context.join(',')
|
||||
filters =
|
||||
@@ -220,9 +181,6 @@ function makeNewFilter() {
|
||||
if ($('#conv_filter:checked').val()) {
|
||||
cont.push('thread')
|
||||
}
|
||||
if ($('#prof_filter:checked').val()) {
|
||||
cont.push('profiles')
|
||||
}
|
||||
if (!cont.length) {
|
||||
$('#filtered-words').html('Error:' + lang.lang_filter_errordegree)
|
||||
}
|
||||
@@ -231,7 +189,10 @@ function makeNewFilter() {
|
||||
if (!who) {
|
||||
who = false
|
||||
}
|
||||
var time = $('#days_filter').val() * 24 * 60 * 60 + $('#hours_filter').val() * 60 * 60 + $('#mins_filter').val() * 60
|
||||
var time =
|
||||
$('#days_filter').val() * 24 * 60 * 60 +
|
||||
$('#hours_filter').val() * 60 * 60 +
|
||||
$('#mins_filter').val() * 60
|
||||
var domain = localStorage.getItem('domain_' + acct_id)
|
||||
var at = localStorage.getItem('acct_' + acct_id + '_at')
|
||||
if ($('#filter-edit-id').val()) {
|
||||
@@ -253,10 +214,10 @@ function makeNewFilter() {
|
||||
context: cont,
|
||||
irreversible: exc,
|
||||
whole_word: who,
|
||||
expires_in: time,
|
||||
expires_in: time
|
||||
})
|
||||
)
|
||||
httpreq.onreadystatechange = function () {
|
||||
httpreq.onreadystatechange = function() {
|
||||
if (httpreq.readyState === 4) {
|
||||
var json = httpreq.response
|
||||
if (this.status !== 200) {
|
||||
@@ -269,7 +230,6 @@ function makeNewFilter() {
|
||||
$('#local_filter').prop('checked', false)
|
||||
$('#notf_filter').prop('checked', false)
|
||||
$('#conv_filter').prop('checked', false)
|
||||
$('#prof_filter').prop('checked', false)
|
||||
$('#except_filter').prop('checked', false)
|
||||
$('#wholeword_filter').prop('checked', false)
|
||||
$('#days_filter').val('0')
|
||||
@@ -300,29 +260,29 @@ function filterEdit(id, acct_id) {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
Authorization: 'Bearer ' + at,
|
||||
},
|
||||
Authorization: 'Bearer ' + at
|
||||
}
|
||||
})
|
||||
.then(function (response) {
|
||||
.then(function(response) {
|
||||
if (!response.ok) {
|
||||
response.text().then(function (text) {
|
||||
response.text().then(function(text) {
|
||||
setLog(response.url, response.status, text)
|
||||
})
|
||||
}
|
||||
return response.json()
|
||||
})
|
||||
.catch(function (error) {
|
||||
.catch(function(error) {
|
||||
todo(error)
|
||||
setLog(start, 'JSON', error)
|
||||
console.error(error)
|
||||
})
|
||||
.then(function (json) {
|
||||
.then(function(json) {
|
||||
if (json) {
|
||||
var now = new Date()
|
||||
now = now.getTime()
|
||||
var now = Math.floor(now / 1000)
|
||||
$('#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]
|
||||
$('[value=' + context + ']').prop('checked', true)
|
||||
})
|
||||
@@ -352,7 +312,7 @@ function filterDel(id, acct_id) {
|
||||
httpreq.setRequestHeader('Authorization', 'Bearer ' + at)
|
||||
httpreq.responseType = 'json'
|
||||
httpreq.send()
|
||||
httpreq.onreadystatechange = function () {
|
||||
httpreq.onreadystatechange = function() {
|
||||
if (httpreq.readyState === 4) {
|
||||
var json = httpreq.response
|
||||
if (this.status !== 200) {
|
||||
@@ -372,23 +332,23 @@ function getFilter(acct_id) {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
Authorization: 'Bearer ' + at,
|
||||
},
|
||||
Authorization: 'Bearer ' + at
|
||||
}
|
||||
})
|
||||
.then(function (response) {
|
||||
.then(function(response) {
|
||||
if (!response.ok) {
|
||||
response.text().then(function (text) {
|
||||
response.text().then(function(text) {
|
||||
setLog(response.url, response.status, text)
|
||||
})
|
||||
}
|
||||
return response.json()
|
||||
})
|
||||
.catch(function (error) {
|
||||
.catch(function(error) {
|
||||
todo(error)
|
||||
setLog(start, 'JSON', error)
|
||||
console.error(error)
|
||||
})
|
||||
.then(function (json) {
|
||||
.then(function(json) {
|
||||
localStorage.setItem('filter_' + acct_id, JSON.stringify(json))
|
||||
})
|
||||
} else {
|
||||
@@ -407,13 +367,13 @@ function getFilterType(json, type) {
|
||||
type = 'notifi'
|
||||
}
|
||||
var mutedfilters = []
|
||||
Object.keys(json).forEach(function (key) {
|
||||
Object.keys(json).forEach(function(key) {
|
||||
var filterword = json[key]
|
||||
var phrases = filterword.phrase
|
||||
var arr = filterword.context
|
||||
if (arr.join(',').indexOf(type) !== -1) {
|
||||
mutedfilters.push(phrases)
|
||||
} else if (type == 'mix') {
|
||||
} else if (type == 'mix'){
|
||||
if (arr.indexOf('home') !== -1 || arr.indexOf('public') !== -1) {
|
||||
mutedfilters.push(phrases)
|
||||
}
|
||||
@@ -437,23 +397,23 @@ function filterUpdate(acct_id) {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
Authorization: 'Bearer ' + at,
|
||||
},
|
||||
Authorization: 'Bearer ' + at
|
||||
}
|
||||
})
|
||||
.then(function (response) {
|
||||
.then(function(response) {
|
||||
if (!response.ok) {
|
||||
response.text().then(function (text) {
|
||||
response.text().then(function(text) {
|
||||
setLog(response.url, response.status, text)
|
||||
})
|
||||
}
|
||||
return response.json()
|
||||
})
|
||||
.catch(function (error) {
|
||||
.catch(function(error) {
|
||||
todo(error)
|
||||
setLog(start, 'JSON', error)
|
||||
console.error(error)
|
||||
})
|
||||
.then(function (json) {
|
||||
.then(function(json) {
|
||||
localStorage.setItem('filter_' + acct_id, JSON.stringify(json))
|
||||
filterUpdateInternal(json, 'home')
|
||||
filterUpdateInternal(json, 'local')
|
||||
@@ -469,11 +429,13 @@ function filterUpdateInternal(json, type) {
|
||||
home = home.concat(wordmute)
|
||||
}
|
||||
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')
|
||||
$('[toot-id=' + id + ']').removeClass('hide')
|
||||
var text = $(elem).find('.toot').html()
|
||||
Object.keys(home).forEach(function (key8) {
|
||||
var text = $(elem)
|
||||
.find('.toot')
|
||||
.html()
|
||||
Object.keys(home).forEach(function(key8) {
|
||||
var word = home[key8]
|
||||
var regExp = new RegExp(word.replace(/[.*+?^=!:${}()|[\]\/\\]/g, '\\$&'), 'g')
|
||||
if ($.strip_tags(text).match(regExp)) {
|
||||
|
@@ -1,5 +1,6 @@
|
||||
'use strict'
|
||||
function listMenu() {
|
||||
$('#left-menu a').removeClass('active')
|
||||
$('#left-menu div').removeClass('active')
|
||||
$('#listMenu').addClass('active')
|
||||
$('.menu-content').addClass('hide')
|
||||
$('#list-box').removeClass('hide')
|
||||
|
@@ -1,3 +1,4 @@
|
||||
'use strict'
|
||||
//Integrated TL
|
||||
async function mixtl(acct_id, tlid, type, delc, voice) {
|
||||
localStorage.setItem('now', type)
|
||||
@@ -19,22 +20,7 @@ async function mixtl(acct_id, tlid, type, delc, voice) {
|
||||
additional(acct_id, tlid)
|
||||
jQuery('time.timeago').timeago()
|
||||
todc()
|
||||
if(mastodonBaseWsStatus[domain] == 'cannnotopen') {
|
||||
mixre(acct_id, tlid, 'mix', mute, voice, '')
|
||||
} else if(mastodonBaseWs[domain] == 'undetected') {
|
||||
const mbws = setInterval(function () {
|
||||
if(mastodonBaseWsStatus[domain] == 'cannnotopen') {
|
||||
mixre(acct_id, tlid, 'mix', mute, voice, '')
|
||||
clearInterval(mbws)
|
||||
} else if(mastodonBaseWsStatus[domain] == 'available') {
|
||||
mastodonBaseWs[domain].send(`{"type":"subscribe","stream":"public:local"}`)
|
||||
clearInterval(mbws)
|
||||
}
|
||||
}, 1000)
|
||||
} else if(mastodonBaseWsStatus[domain] == 'available') {
|
||||
mastodonBaseWs[domain].send(`{"type":"subscribe","stream":"public:local"}`)
|
||||
}
|
||||
|
||||
$(window).scrollTop(0)
|
||||
lastId = integrated[0].id
|
||||
beforeLastId = integrated[1].id
|
||||
|
@@ -1,3 +1,4 @@
|
||||
'use strict'
|
||||
//通知
|
||||
//取得+Streaming接続
|
||||
function notf(acct_id, tlid, sys) {
|
||||
@@ -69,20 +70,17 @@ function notfColumn(acct_id, tlid, sys) {
|
||||
var n = new Notification('TheDesk:' + domain, options)
|
||||
}
|
||||
var mute = getFilterTypeByAcct(acct_id, 'notif')
|
||||
//Pleromaにはmoveというtypeがあるらしい。何が互換APIじゃ
|
||||
if (obj.type != 'follow' && obj.type != 'move' && obj.type != 'follow_request') {
|
||||
if (obj.type != 'follow') {
|
||||
if (misskey) {
|
||||
templete = templete + misskeyParse([obj], 'notf', acct_id, tlid, -1, mute)
|
||||
} else {
|
||||
templete = templete + parse([obj], 'notf', acct_id, tlid, -1, mute)
|
||||
}
|
||||
} else if (obj.type == 'follow_request') {
|
||||
templete = templete + userparse([obj.account], 'request', acct_id, tlid, -1)
|
||||
} else {
|
||||
if (misskey) {
|
||||
templete = templete + misskeyUserparse([obj], 'notf', acct_id, tlid, -1, mute)
|
||||
} else {
|
||||
templete = templete + userparse([obj.account], obj.type, acct_id, tlid, -1)
|
||||
templete = templete + userparse([obj.account], 'notf', acct_id, tlid, -1)
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -182,8 +180,7 @@ function notfCommon(acct_id, tlid, sys) {
|
||||
var n = new Notification('TheDesk:' + domain, options)
|
||||
}
|
||||
var mute = getFilterTypeByAcct(acct_id, 'notif')
|
||||
//Pleromaにはmoveというtypeがあるらしい。何が互換APIじゃ
|
||||
if (obj.type != 'follow' && obj.type != 'move') {
|
||||
if (obj.type != 'follow') {
|
||||
if (misskey) {
|
||||
templete = templete + misskeyParse([obj], 'notf', acct_id, 'notf', -1, mute)
|
||||
} else {
|
||||
@@ -193,7 +190,7 @@ function notfCommon(acct_id, tlid, sys) {
|
||||
if (misskey) {
|
||||
templete = templete + misskeyUserparse([obj], 'notf', acct_id, 'notf', -1, mute)
|
||||
} else {
|
||||
templete = templete + userparse([obj.account], obj.type, acct_id, 'notf', -1)
|
||||
templete = templete + userparse([obj.account], 'notf', acct_id, 'notf', -1)
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -239,12 +236,10 @@ function notfWS(misskey, acct_id, tlid, domain, at) {
|
||||
localStorage.setItem('lastnotf_' + acct_id, obj.id)
|
||||
if (!$('#unread_' + tlid + ' .material-icons').hasClass('teal-text')) {
|
||||
//markers show中はダメ
|
||||
if (obj.type != 'follow' && obj.type != 'follow_request') {
|
||||
if (obj.type != 'follow') {
|
||||
templete = parse([obj], 'notf', acct_id, 'notf', popup)
|
||||
} else if (obj.type == 'follow_request') {
|
||||
templete = userparse([obj.account], 'request', acct_id, 'notf', -1)
|
||||
} else {
|
||||
templete = userparse([obj], obj.type, 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)
|
||||
@@ -344,7 +339,7 @@ function notfmore(tlid) {
|
||||
if (misskey) {
|
||||
templete = templete + misskeyUserparse([obj], 'notf', acct_id, 'notf', -1, mute)
|
||||
} else {
|
||||
templete = templete + userparse([obj.account], obj.type, acct_id, 'notf', -1)
|
||||
templete = templete + userparse([obj.account], 'notf', acct_id, 'notf', -1)
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -408,11 +403,6 @@ function notfCanceler(acct) {
|
||||
localStorage.removeItem('notf-follow_' + acct)
|
||||
$('.notf-follow_' + acct).addClass('hide')
|
||||
$('.notf-icon_' + acct).removeClass('red-text')
|
||||
var id = $('#announce_' + acct + ' .announcement').first().attr('data-id')
|
||||
$('.notf-announ_' + acct + '_ct').text("")
|
||||
if(id) {
|
||||
localStorage.setItem('announ_' + acct, id)
|
||||
}
|
||||
}
|
||||
function allNotfRead() {
|
||||
var multi = localStorage.getItem('multi')
|
||||
|
@@ -1,3 +1,4 @@
|
||||
'use strict'
|
||||
//Integrated TL
|
||||
function mixtl(acct_id, tlid, type, delc, voice) {
|
||||
localStorage.removeItem('morelock')
|
||||
|
@@ -1,3 +1,4 @@
|
||||
'use strict'
|
||||
//アンケートのトグル
|
||||
function pollToggle() {
|
||||
if ($('#poll').hasClass('hide')) {
|
||||
@@ -49,25 +50,30 @@ function pollCalc() {
|
||||
return days * 86400 + hrs * 3600 + mins * 60
|
||||
}
|
||||
//Vote
|
||||
function voteSelMastodon(acct_id, id, to, mul, elem) {
|
||||
if ($(elem).hasClass('sel')) {
|
||||
$(elem).css('background-color', 'transparent')
|
||||
$(elem).removeClass('sel')
|
||||
function voteSelMastodon(acct_id, id, to, mul) {
|
||||
if ($('.vote_' + acct_id + '_' + id + '_' + to).hasClass('sel')) {
|
||||
$('.vote_' + acct_id + '_' + id + '_' + to).css('background-color', 'transparent')
|
||||
$('.vote_' + acct_id + '_' + id + '_' + to).removeClass('sel')
|
||||
} else {
|
||||
if (!mul) {
|
||||
$('.vote_' + acct_id + '_' + id + ' div').css('background-color', 'transparent')
|
||||
$('.vote_' + acct_id + '_' + id + ' div').removeClass('sel')
|
||||
$(elem).css('background-color', 'var(--emphasized)')
|
||||
$(elem).addClass('sel')
|
||||
$('.vote_' + acct_id + '_' + id + ' div').each(function(i, elem) {
|
||||
if (i == to) {
|
||||
$(this).css('background-color', 'var(--emphasized)')
|
||||
$(this).addClass('sel')
|
||||
} else {
|
||||
$(elem).css('background-color', 'var(--emphasized)')
|
||||
$(elem).addClass('sel')
|
||||
$(this).css('background-color', 'transparent')
|
||||
$(this).removeClass('sel')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
$('.vote_' + acct_id + '_' + id + '_' + to).css('background-color', 'var(--emphasized)')
|
||||
$('.vote_' + acct_id + '_' + id + '_' + to).addClass('sel')
|
||||
}
|
||||
}
|
||||
}
|
||||
function voteMastodon(acct_id, id, target) {
|
||||
function voteMastodon(acct_id, id) {
|
||||
var choice = []
|
||||
$(`#vote${target} div`).each(function(i, elem) {
|
||||
$('.vote_' + acct_id + '_' + id + ' div').each(function(i, elem) {
|
||||
if ($(this).hasClass('sel')) {
|
||||
choice.push(i + '')
|
||||
}
|
||||
@@ -85,13 +91,13 @@ function voteMastodon(acct_id, id, target) {
|
||||
httpreq.responseType = 'json'
|
||||
httpreq.send(JSON.stringify({ choices: choice }))
|
||||
httpreq.onreadystatechange = function() {
|
||||
voteMastodonrefresh(acct_id, id, target)
|
||||
voteMastodonrefresh(acct_id, id)
|
||||
}
|
||||
}
|
||||
function showResult(acct_id, id) {
|
||||
$('.vote_' + acct_id + '_' + id + '_result').toggleClass('hide')
|
||||
}
|
||||
function voteMastodonrefresh(acct_id, id, target) {
|
||||
function voteMastodonrefresh(acct_id, id) {
|
||||
var datetype = localStorage.getItem('datetype')
|
||||
if (!datetype) {
|
||||
datetype = 'absolute'
|
||||
@@ -115,8 +121,8 @@ function voteMastodonrefresh(acct_id, id, target) {
|
||||
if (!json) {
|
||||
return false
|
||||
}
|
||||
var poll = pollParse(json, acct_id, json.emojis)
|
||||
$(`#vote${target}`).html(poll)
|
||||
var poll = pollParse(json, acct_id)
|
||||
$('.vote_' + acct_id + '_' + json.id).html(poll)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,8 +1,9 @@
|
||||
$voise = null
|
||||
isBouyomi = localStorage.getItem('voice_bouyomi')
|
||||
$voiseName = lang.lang_speech
|
||||
$voices = speechSynthesis.getVoices()
|
||||
$synthes = new SpeechSynthesisUtterance()
|
||||
'use strict'
|
||||
var $voise = null
|
||||
var isBouyomi = localStorage.getItem('voice_bouyomi')
|
||||
var $voiseName = lang.lang_speech
|
||||
var $voices = speechSynthesis.getVoices()
|
||||
var $synthes = new SpeechSynthesisUtterance()
|
||||
$voise = $.grep($voices, function(n, i) {
|
||||
return n.name == $voiseName
|
||||
})[0]
|
||||
@@ -12,14 +13,14 @@ speechSynthesis.cancel()
|
||||
if (!localStorage.getItem('voice_vol')) {
|
||||
localStorage.setItem('voice_vol', 1)
|
||||
}
|
||||
voiceRate = localStorage.getItem('voice_speed')
|
||||
var voiceRate = localStorage.getItem('voice_speed')
|
||||
$synthes.rate = voiceRate
|
||||
voicePitch = localStorage.getItem('voice_pitch')
|
||||
var voicePitch = localStorage.getItem('voice_pitch')
|
||||
$synthes.pitch = voicePitch
|
||||
voiceVol = localStorage.getItem('voice_vol')
|
||||
var voiceVol = localStorage.getItem('voice_vol')
|
||||
$synthes.volume = voiceVol
|
||||
function say(msgr) {
|
||||
msg = voiceParse(msgr)
|
||||
var msg = voiceParse(msgr)
|
||||
var voice = localStorage.getItem('voicebank')
|
||||
var obj = JSON.parse(voice)
|
||||
if (!obj) {
|
||||
@@ -31,7 +32,7 @@ function say(msgr) {
|
||||
localStorage.setItem('voicebank', json)
|
||||
}
|
||||
}
|
||||
$repeat = setInterval(function() {
|
||||
var $repeat = setInterval(function() {
|
||||
if (!speechSynthesis.speaking) {
|
||||
var voice = localStorage.getItem('voicebank')
|
||||
if (voice) {
|
||||
@@ -72,7 +73,7 @@ $repeat = setInterval(function() {
|
||||
}
|
||||
}, 300)
|
||||
function voiceParse(msg) {
|
||||
msg = $.strip_tags(msg)
|
||||
var msg = $.strip_tags(msg)
|
||||
msg = msg.replace(/#/g, '')
|
||||
msg = msg.replace(/'/g, '')
|
||||
msg = msg.replace(/"/g, '')
|
||||
|
133
app/js/tl/src.js
@@ -1,9 +1,10 @@
|
||||
'use strict'
|
||||
//検索
|
||||
//検索ボックストグル
|
||||
function searchMenu() {
|
||||
$('#src-contents').html('')
|
||||
trend()
|
||||
$('#left-menu a').removeClass('active')
|
||||
$('#left-menu div').removeClass('active')
|
||||
$('#searchMenu').addClass('active')
|
||||
$('.menu-content').addClass('hide')
|
||||
$('#src-box').removeClass('hide')
|
||||
@@ -36,7 +37,7 @@ function src(mode, offset) {
|
||||
var user = $('#his-data').attr('user-id')
|
||||
}
|
||||
if (!mode) {
|
||||
var start = 'https://' + domain + '/api/v2/search?resolve=true&q=' + encodeURIComponent(q) + add
|
||||
var start = 'https://' + domain + '/api/v2/search?q=' + q + add
|
||||
} else {
|
||||
var start = 'https://' + domain + '/api/v1/search?q=' + q
|
||||
}
|
||||
@@ -116,11 +117,8 @@ function tsAdd(q) {
|
||||
parseColumn('add')
|
||||
}
|
||||
function tootsearch(tlid, q) {
|
||||
if(!q || q=='undefined') {
|
||||
return false
|
||||
}
|
||||
var start = 'https://tootsearch.chotto.moe/api/v1/search?from=0&sort=created_at%3Adesc&q=' + q
|
||||
console.log('Toot search at ' + start)
|
||||
console.log('Toot srrach at ' + start)
|
||||
$('#notice_' + tlid).text('tootsearch(' + q + ')')
|
||||
$('#notice_icon_' + tlid).text('search')
|
||||
fetch(start, {
|
||||
@@ -219,9 +217,6 @@ function moreTs(tlid, q) {
|
||||
function graphDraw(tag, acct_id) {
|
||||
var tags = ''
|
||||
var his = tag.history
|
||||
return graphDrawCore(his, tag)
|
||||
}
|
||||
function graphDrawCore(his, tag) {
|
||||
var max = Math.max.apply(null, [
|
||||
his[0].uses,
|
||||
his[1].uses,
|
||||
@@ -238,34 +233,36 @@ function graphDrawCore(his, tag) {
|
||||
var two = 50 - (his[2].uses / max) * 50
|
||||
var one = 50 - (his[1].uses / max) * 50
|
||||
var zero = 50 - (his[0].uses / max) * 50
|
||||
return `<div class="tagComp">
|
||||
<div class="tagCompSvg">
|
||||
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>
|
||||
toot(s)
|
||||
<a onclick=\"tl('tag','${escapeHTML(tag.name)}','${acct_id}','add')" class="pointer">
|
||||
#${escapeHTML(tag.name)}
|
||||
</a> ` +
|
||||
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} 61,61 0,61"
|
||||
<path d="M0,${six} L10,${five} 20,${four} 30,${three} 40,${two} 50,${one} 60,${zero}"
|
||||
style="stroke: #0f8c0c;fill: rgba(13,113,19,.25); stroke-width: 1;">
|
||||
</path>
|
||||
</g>
|
||||
</svg>
|
||||
</div>
|
||||
<div class="tagCompToot">
|
||||
<span style="font-size:200%">${his[0].uses}</span>
|
||||
</div>
|
||||
<div class="tagCompToots">
|
||||
toot
|
||||
</div>
|
||||
<div class="tagCompTag">
|
||||
<a onclick="tl('tag','${escapeHTML(
|
||||
tag.name
|
||||
)}','${acct_id}','add')" class="pointer" title="${escapeHTML(tag.name)}">
|
||||
toot
|
||||
<a onclick="tl('tag','${escapeHTML(tag.name)}','${acct_id}','add')" class="pointer">
|
||||
#${escapeHTML(tag.name)}
|
||||
</a>
|
||||
</div>
|
||||
<div class="tagCompUser">
|
||||
${his[0].accounts}
|
||||
${lang.lang_src_people}
|
||||
</div>
|
||||
</div>`
|
||||
</a> ` +
|
||||
his[0].accounts +
|
||||
lang.lang_src_people
|
||||
}
|
||||
|
||||
return tags
|
||||
}
|
||||
/*
|
||||
<svg version="1.1" viewbox="0 0 50 300" width="100%" height="50">
|
||||
@@ -307,54 +304,40 @@ function trend() {
|
||||
Object.keys(json).forEach(function(keye) {
|
||||
var tag = json[keye]
|
||||
var his = tag.history
|
||||
tags = graphDrawCore(his, tag)
|
||||
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
|
||||
tags =
|
||||
`<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: #0f8c0c;fill: rgba(13,113,19,.25); stroke-width: 1;">
|
||||
</path>
|
||||
</g>
|
||||
</svg>
|
||||
<span style="font-size:200%">${his[0].uses}</span>
|
||||
toot
|
||||
<a onclick="tl('tag','${escapeHTML(tag.name)}','${acct_id}','add')" class="pointer">
|
||||
#${escapeHTML(tag.name)}
|
||||
</a> ` +
|
||||
his[0].accounts +
|
||||
lang.lang_src_people +
|
||||
'<br><br>'
|
||||
|
||||
$('#src-contents').append(tags)
|
||||
})
|
||||
})
|
||||
}
|
||||
function srcBox(mode) {
|
||||
var selectedText = window.getSelection().toString()
|
||||
if (mode == 'open') {
|
||||
$('#pageSrc').removeClass('hide')
|
||||
} else if (mode == 'close') {
|
||||
if(!selectedText) {
|
||||
$('#pageSrc').addClass('hide')
|
||||
$('#pageSrc').removeClass('keep')
|
||||
}
|
||||
} else {
|
||||
$('#pageSrc').toggleClass('hide')
|
||||
}
|
||||
if(!$('#pageSrc').hasClass('keep')) {
|
||||
$('#pageSrcInput').val(selectedText)
|
||||
}
|
||||
}
|
||||
$('#pageSrcInput').click(function() {
|
||||
$('#pageSrc').addClass('keep')
|
||||
})
|
||||
$('#pageSrcInput').on('input', function(evt) {
|
||||
if(!$('#pageSrcInput').val()) {
|
||||
$('#pageSrc').removeClass('keep')
|
||||
}
|
||||
})
|
||||
document.addEventListener('selectionchange', function() {
|
||||
var selectedText = window.getSelection().toString()
|
||||
if (selectedText && !$('input').is(':focus') && !$('textarea').is(':focus')) {
|
||||
srcBox('open')
|
||||
}
|
||||
})
|
||||
function doSrc(type) {
|
||||
$('#pageSrc').addClass('hide')
|
||||
$('#pageSrc').removeClass('keep')
|
||||
var q = $('#pageSrcInput').val()
|
||||
if(type == 'web') {
|
||||
var start = localStorage.getItem('srcUrl')
|
||||
if(!start) {
|
||||
start = 'https://google.com/search?q={q}'
|
||||
}
|
||||
start = start.replace(/{q}/, q)
|
||||
postMessage(["openUrl", start], "*")
|
||||
} else if(type == 'ts') {
|
||||
tsAdd(q)
|
||||
}
|
||||
}
|
@@ -1,3 +1,4 @@
|
||||
'use strict'
|
||||
//タグ表示
|
||||
if (location.search) {
|
||||
var m = location.search.match(/\?mode=([a-zA-Z-0-9]+)\&code=(.+)/)
|
||||
@@ -198,28 +199,3 @@ function tagFeature(name, acct_id) {
|
||||
M.toast({ html: 'Complete: ' + escapeHTML(name), displayLength: 3000 })
|
||||
})
|
||||
}
|
||||
//タグのフィルタ
|
||||
function addTag(id) {
|
||||
var columns = JSON.parse(localStorage.getItem('column'))
|
||||
var column = columns[id]
|
||||
if(!column.data.name) {
|
||||
var name = column.data
|
||||
} else {
|
||||
var name = column.data.name
|
||||
}
|
||||
var col = localStorage.getItem('column')
|
||||
var o = JSON.parse(col)
|
||||
var obj = o[id]
|
||||
obj.data = {
|
||||
'name': name,
|
||||
'all': $(`#all_tm-${id}`).val(),
|
||||
'any': $(`#any_tm-${id}`).val(),
|
||||
'none': $(`#none_tm-${id}`).val(),
|
||||
}
|
||||
o[id] = obj
|
||||
var json = JSON.stringify(o)
|
||||
console.log(json)
|
||||
localStorage.setItem('column',json)
|
||||
columnReload(id, 'tag')
|
||||
}
|
||||
|
||||
|
564
app/js/tl/tl.js
@@ -1,3 +1,4 @@
|
||||
'use strict'
|
||||
/*イメージビューワー*/
|
||||
//postのimg.jsとは異なります。
|
||||
function imgv(id, key, acct_id) {
|
||||
@@ -53,7 +54,7 @@ function imgCont(type) {
|
||||
$('#imagemodal').attr('data-image', murl)
|
||||
//表示はリモートを使うか(どちらにしろコピーはオリジナル)
|
||||
var remote_img = localStorage.getItem('remote_img')
|
||||
if (remote_img == 'yes' && ourl != 'null') {
|
||||
if (remote_img == 'yes') {
|
||||
murl = ourl
|
||||
}
|
||||
if (murl) {
|
||||
@@ -76,7 +77,7 @@ function imgCont(type) {
|
||||
}
|
||||
function imageXhr(id, key, murl) {
|
||||
var startTime = new Date()
|
||||
xhr = new XMLHttpRequest()
|
||||
var xhr = new XMLHttpRequest()
|
||||
xhr.open('GET', murl, true)
|
||||
xhr.responseType = 'arraybuffer'
|
||||
xhr.addEventListener(
|
||||
@@ -95,23 +96,16 @@ function imageXhr(id, key, murl) {
|
||||
'loadend',
|
||||
function(event) {
|
||||
var total = event.total
|
||||
$('#imgbyte').text(Math.floor(total / 1024))
|
||||
$('#imgbyte').text(Math.floor(total/1024))
|
||||
var now = event.loaded
|
||||
var per = (now / total) * 100
|
||||
$('#imgprog').text(Math.floor(per))
|
||||
},
|
||||
false
|
||||
)
|
||||
xhr.addEventListener(
|
||||
'error',
|
||||
function(event) {
|
||||
$('#imgmodal').attr('src', murl)
|
||||
},
|
||||
false
|
||||
)
|
||||
xhr.onreadystatechange = function() {
|
||||
if (this.readyState == 4 && this.status == 200) {
|
||||
r = new FileReader()
|
||||
var r = new FileReader()
|
||||
r.readAsDataURL(this.response)
|
||||
r.onload = function() {
|
||||
var b64 = r.result
|
||||
@@ -119,22 +113,19 @@ function imageXhr(id, key, murl) {
|
||||
var width
|
||||
element.onload = function() {
|
||||
var width = element.naturalWidth
|
||||
if(width < 650) {
|
||||
width = 650
|
||||
}
|
||||
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 + 100 + 'px')
|
||||
$('#imagemodal img').css('height', height + 'px')
|
||||
$('#imagemodal').css('height', height + 60 + 'px')
|
||||
$('#imagemodal img').css('height', '100%')
|
||||
if (width > windowW * 0.8) {
|
||||
$('#imagemodal').css('width', '80vw')
|
||||
$('#imagemodal img').css('width', 'auto')
|
||||
$('#imagemodal img').css('width', '100%')
|
||||
var heightS = ((windowW * 0.8) / width) * height
|
||||
$('#imagemodal').css('height', heightS + 100 + 'px')
|
||||
$('#imagemodal').css('height', heightS + 60 + 'px')
|
||||
} else {
|
||||
$('#imagemodal').css('width', width + 'px')
|
||||
}
|
||||
@@ -182,7 +173,7 @@ function zoom(z) {
|
||||
$('#imagewrap img').css('height', hgt + 'px')
|
||||
}
|
||||
//スマホ対応ドラッグ移動システム
|
||||
(function() {
|
||||
;(function() {
|
||||
$.fn.dragScroll = function() {
|
||||
var target = this
|
||||
$(this)
|
||||
@@ -276,8 +267,9 @@ function dlImg() {
|
||||
if (remote_img == 'yes') {
|
||||
murl = ourl
|
||||
}
|
||||
if (localStorage.getItem('savefolder')) {
|
||||
var save = localStorage.getItem('savefolder')
|
||||
if (!save || save == 'null') {
|
||||
} else {
|
||||
var save = ''
|
||||
}
|
||||
postMessage(['generalDL', [murl, save, false]], '*')
|
||||
|
@@ -1,3 +1,4 @@
|
||||
'use strict'
|
||||
//レイアウトの設定
|
||||
|
||||
var websocketOld = []
|
||||
@@ -8,13 +9,13 @@ var websocketNotf = []
|
||||
|
||||
//カラム追加ボックストグル
|
||||
function addColumnMenu() {
|
||||
$('#left-menu a').removeClass('active')
|
||||
$('#left-menu div').removeClass('active')
|
||||
$('#addColumnMenu').addClass('active')
|
||||
$('.menu-content').addClass('hide')
|
||||
$('#add-box').removeClass('hide')
|
||||
addselCk()
|
||||
}
|
||||
$('.type').click(function () {
|
||||
$('.type').click(function() {
|
||||
$('.type').removeClass('active')
|
||||
$(this).addClass('active')
|
||||
$('#type-sel').val($(this).attr('data-type'))
|
||||
@@ -42,16 +43,18 @@ function parseColumn(target, dontclose) {
|
||||
var multi = localStorage.getItem('multi')
|
||||
if (multi) {
|
||||
var obj = JSON.parse(multi)
|
||||
|
||||
var templete
|
||||
Object.keys(obj).forEach(function (key) {
|
||||
Object.keys(obj).forEach(function(key) {
|
||||
var acct = obj[key]
|
||||
|
||||
localStorage.setItem('name_' + key, acct.name)
|
||||
localStorage.setItem('user_' + key, acct.user)
|
||||
localStorage.setItem('user-id_' + key, acct.id)
|
||||
localStorage.setItem('prof_' + key, acct.prof)
|
||||
localStorage.setItem('domain_' + key, acct.domain)
|
||||
localStorage.setItem('acct_' + key + '_at', acct.at)
|
||||
if(!target) mastodonBaseStreaming(key)
|
||||
notf(key, 0)
|
||||
ckdb(key)
|
||||
//フィルターデータ読もう
|
||||
getFilter(key)
|
||||
@@ -74,11 +77,7 @@ function parseColumn(target, dontclose) {
|
||||
var obj = [
|
||||
{
|
||||
domain: 0,
|
||||
type: 'home',
|
||||
},
|
||||
{
|
||||
domain: 0,
|
||||
type: 'local',
|
||||
type: 'local'
|
||||
}
|
||||
]
|
||||
var json = JSON.stringify(obj)
|
||||
@@ -124,7 +123,10 @@ function parseColumn(target, dontclose) {
|
||||
var if_notf = ''
|
||||
}
|
||||
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 {
|
||||
if (lang.language == 'ja') {
|
||||
var notflocale = '通知'
|
||||
@@ -160,21 +162,15 @@ function parseColumn(target, dontclose) {
|
||||
} else {
|
||||
localStorage.removeItem('hasNotfC_' + acct.domain)
|
||||
}
|
||||
var css = ''
|
||||
var width = localStorage.getItem('width')
|
||||
if (width) {
|
||||
css = ' min-width:' + width + 'px;'
|
||||
}
|
||||
var maxWidth = localStorage.getItem('max-width')
|
||||
if (maxWidth) {
|
||||
css = css +'max-width:' + maxWidth + 'px;'
|
||||
}
|
||||
var margin = localStorage.getItem('margin')
|
||||
if (margin) {
|
||||
css = css +'margin-right:' + margin + 'px;'
|
||||
var css = ' min-width:' + width + 'px;'
|
||||
}
|
||||
if (acct.width) {
|
||||
css = css + ' min-width:' + acct.width + 'px !important;max-width:' + acct.width + 'px !important;'
|
||||
var css = ' min-width:' + acct.width + 'px;max-width:' + acct.width + 'px;'
|
||||
}
|
||||
if (!css) {
|
||||
var css = ''
|
||||
}
|
||||
if (acct.type == 'webview') {
|
||||
if (localStorage.getItem('fixwidth')) {
|
||||
@@ -196,7 +192,17 @@ function parseColumn(target, dontclose) {
|
||||
} else {
|
||||
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 if (acct.type == 'bookmark') {
|
||||
if (!acct.left_fold) {
|
||||
basekey = key
|
||||
@@ -208,19 +214,17 @@ function parseColumn(target, dontclose) {
|
||||
} else {
|
||||
var animecss = ''
|
||||
}
|
||||
unstreamingTL(acct.type, key, basekey, insert, icnsert, acct.left_fold, css, animecss, acct.domain)
|
||||
} else if (acct.type == 'utl') {
|
||||
if (!acct.left_fold) {
|
||||
basekey = key
|
||||
}
|
||||
|
||||
var anime = localStorage.getItem('animation')
|
||||
if (anime == 'yes' || !anime) {
|
||||
var animecss = 'box-anime'
|
||||
} else {
|
||||
var animecss = ''
|
||||
}
|
||||
unstreamingTL(acct.type, key, basekey, insert, icnsert, acct.left_fold, css, animecss, { acct: acct.domain, data: acct.data })
|
||||
unstreamingTL(
|
||||
acct.type,
|
||||
key,
|
||||
basekey,
|
||||
insert,
|
||||
icnsert,
|
||||
acct.left_fold,
|
||||
css,
|
||||
animecss,
|
||||
acct.domain
|
||||
)
|
||||
} else {
|
||||
var anime = localStorage.getItem('animation')
|
||||
if (anime == 'yes' || !anime) {
|
||||
@@ -231,7 +235,7 @@ function parseColumn(target, dontclose) {
|
||||
var unread = `<a id="unread_${key}" onclick="showUnread('${key}','${acct.type}','${acct.domain}')"
|
||||
class="setting nex" title="${lang.lang_layout_unread}">
|
||||
<i class="material-icons waves-effect nex">more</i>
|
||||
</a>${lang.lang_layout_unread}<br>`
|
||||
</a>`
|
||||
var notfDomain = acct.domain
|
||||
var notfKey = key
|
||||
var if_tag = ''
|
||||
@@ -289,33 +293,16 @@ function parseColumn(target, dontclose) {
|
||||
${lang.lang_layout_excludingbt}
|
||||
<br>`
|
||||
} else if (acct.type == 'tag') {
|
||||
if (acct.data.name) {
|
||||
var name = acct.data.name
|
||||
var all = acct.data.all
|
||||
var any = acct.data.any
|
||||
var none = acct.data.none
|
||||
} else {
|
||||
var name = acct.data
|
||||
var all = ''
|
||||
var any = ''
|
||||
var none = ''
|
||||
}
|
||||
if_tag = `<div class="column-hide notf-indv-box" id="tag-box_${key}" style="padding:5px;">
|
||||
Base: ${name}<br>
|
||||
<div id="tagManager-${key}">
|
||||
all: <input type="text" id="all_tm-${key}"" value="${all}">
|
||||
any: <input type="text" id="any_tm-${key}" value="${any}">
|
||||
none: <input type="text" id="none_tm-${key}"" value="${none}">
|
||||
</div>
|
||||
<button onclick="addTag('${key}')" class="btn waves-effect" style="width: 100%">Refresh</button>
|
||||
Base: ${acct.data}<br>
|
||||
<div id="tagManager-${key}"></div>
|
||||
<button onclick="addTag('${key}')" class="btn waves-effect" style="width: 100%">Add</button>
|
||||
</div>`
|
||||
if_tag_btn = `<a onclick="setToggleTag('${key}')" class="setting nex"
|
||||
title="${lang.lang_layout_tagManager}" style="width:30px">
|
||||
<i class="material-icons waves-effect nex">note_add</i>
|
||||
</a>`
|
||||
unread = ''
|
||||
var exclude = ''
|
||||
var if_notf = 'hide'
|
||||
} else {
|
||||
var exclude = ''
|
||||
unread = ''
|
||||
@@ -349,7 +336,9 @@ function parseColumn(target, dontclose) {
|
||||
if (key === 0) {
|
||||
left_hold = ''
|
||||
}
|
||||
if (localStorage.getItem('mode_' + localStorage.getItem('domain_' + acct.domain)) == 'misskey') {
|
||||
if (
|
||||
localStorage.getItem('mode_' + localStorage.getItem('domain_' + acct.domain)) == 'misskey'
|
||||
) {
|
||||
var isMisRed = ''
|
||||
exclude = ''
|
||||
var if_misskey_hide = 'hide'
|
||||
@@ -362,26 +351,14 @@ function parseColumn(target, dontclose) {
|
||||
} else {
|
||||
var addHeight = ''
|
||||
}
|
||||
if (acct.type != 'pub' && acct.type != 'pub-media') {
|
||||
console.log(acct.type, key)
|
||||
var mediaFil = `<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}`
|
||||
} else {
|
||||
var mediaFil = `<a onclick="remoteOnly('${key}','${acct.type}')" class="setting nex">
|
||||
<i class="material-icons waves-effect nex" title="${lang.lang_layout_remoteOnly}">perm_media</i>
|
||||
<span id="sta-remote-${key}">Off</span>
|
||||
</a>${lang.lang_layout_remoteOnly}`
|
||||
}
|
||||
var html = `
|
||||
<div class="boxIn" id="timeline_box_${key}_box" tlid="${key}" data-acct="${acct.domain}" style="${addHeight}">
|
||||
<div class="notice-box z-depth-2" id="menu_${key}" style="${insert}">
|
||||
<div class="area-notice">
|
||||
<i class="material-icons waves-effect ${isMisRed} notice_icon_acct_${acct.domain}" id="notice_icon_${key}" ${notf_attr}
|
||||
<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}" aria-hidden="true">
|
||||
title="${lang.lang_layout_gotop}">
|
||||
</i>
|
||||
</div>
|
||||
<div class="area-notice_name">
|
||||
@@ -390,45 +367,39 @@ function parseColumn(target, dontclose) {
|
||||
<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}" aria-hidden="true">notifications</i>
|
||||
<span class="voice">${unique_notf}</span>
|
||||
<i class="material-icons waves-effect nex notf-icon_${acct.domain}">notifications</i>
|
||||
</a>
|
||||
<span class="cbadge hide notf-announ_${acct.domain}" style="margin-right:0"
|
||||
onclick="notfToggle('${acct.domain}','${key}')" title="${lang.lang_layout_announ}">
|
||||
<i class="fas fa-bullhorn"></i>
|
||||
<span class="notf-announ_${acct.domain}_ct"></span>
|
||||
<span class="voice">${lang.lang_layout_announ}</span>
|
||||
</span>
|
||||
${unread}
|
||||
${if_tag_btn}
|
||||
</div>
|
||||
<div class="area-sta">
|
||||
<span class="new badge teal notf-reply_${acct.domain} hide" data-badge-caption="Reply" aria-hidden="true">0</span>
|
||||
<span class="new badge yellow black-text notf-fav_${acct.domain} hide" data-badge-caption="Fav" aria-hidden="true">0</span>
|
||||
<span class="new badge blue notf-bt_${acct.domain} hide" data-badge-caption="BT" aria-hidden="true">0</span>
|
||||
<span class="new badge orange notf-follow_${acct.domain} hide" data-badge-caption="Follow" aria-hidden="true">0</span>
|
||||
<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>
|
||||
</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} aria-hidden="true">cancel</i>
|
||||
<span class="voice">${lang.lang_layout_delthis}</span>
|
||||
<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" aria-hidden="true">settings</i>
|
||||
<span class="voice">${lang.lang_layout_setthis}</span>
|
||||
<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_${notfKey}">
|
||||
<div class="announce_${acct.domain}" style="border: 1px solid"></div>
|
||||
<div id="notifications_${notfKey}" data-notf="${notfDomain}" data-type="notf" class="notf-timeline">
|
||||
</div>
|
||||
</div>
|
||||
<div class="column-hide notf-indv-box" id="util-box_${key}" style="padding:5px;">
|
||||
${unread}
|
||||
${exclude}${left_hold}
|
||||
${mediaFil}<br>
|
||||
<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>
|
||||
@@ -520,13 +491,13 @@ function parseColumn(target, dontclose) {
|
||||
minHeight: 50,
|
||||
minWidth: 50,
|
||||
grid: 50,
|
||||
resize: function (event, ui) {
|
||||
resize: function(event, ui) {
|
||||
$(this).css('min-width', ui.size.width + 'px')
|
||||
$(this).css('max-width', ui.size.width + 'px')
|
||||
$(this).css('min-height', ui.size.height + 'px')
|
||||
$(this).css('max-height', ui.size.height + 'px')
|
||||
},
|
||||
stop: function (event, ui) {
|
||||
stop: function(event, ui) {
|
||||
var col = localStorage.getItem('column')
|
||||
var o = JSON.parse(col)
|
||||
var width = ui.size.width
|
||||
@@ -541,14 +512,16 @@ function parseColumn(target, dontclose) {
|
||||
} else {
|
||||
//横幅。その縦幅を持つカラムのidは
|
||||
console.log('yoko')
|
||||
var key = $(this).find('.boxIn').attr('tlid')
|
||||
var key = $(this)
|
||||
.find('.boxIn')
|
||||
.attr('tlid')
|
||||
var obj = o[key]
|
||||
obj.width = width
|
||||
o[key] = obj
|
||||
}
|
||||
var json = JSON.stringify(o)
|
||||
localStorage.setItem('column', json)
|
||||
},
|
||||
}
|
||||
})
|
||||
}
|
||||
function checkStr(type, data, acct_id, key, delc, voice) {
|
||||
@@ -598,7 +571,7 @@ function addColumn() {
|
||||
}
|
||||
var add = {
|
||||
domain: acct,
|
||||
type: type,
|
||||
type: type
|
||||
}
|
||||
var multi = localStorage.getItem('column')
|
||||
var obj = JSON.parse(multi)
|
||||
@@ -632,7 +605,9 @@ function addselCk() {
|
||||
$('#webview-add').addClass('hide')
|
||||
}
|
||||
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 {
|
||||
$('#direct-add').remove()
|
||||
}
|
||||
@@ -649,21 +624,17 @@ function removeColumn(tlid) {
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: lang.lang_yesno,
|
||||
cancelButtonText: lang.lang_no,
|
||||
}).then((result) => {
|
||||
cancelButtonText: lang.lang_no
|
||||
}).then(result => {
|
||||
if (result.value) {
|
||||
var multi = localStorage.getItem('column')
|
||||
var obj = JSON.parse(multi)
|
||||
var data = obj[tlid]
|
||||
obj.splice(tlid, 1)
|
||||
var json = JSON.stringify(obj)
|
||||
localStorage.setItem('column', json)
|
||||
sortLoad()
|
||||
$('#timeline_box_' + tlid + '_box').remove()
|
||||
if (!data.left_fold) {
|
||||
$('#timeline_box_' + tlid + '_parentBox').remove()
|
||||
}
|
||||
}
|
||||
$('#sort-box').removeClass('hide')
|
||||
$('#sort-box').addClass('show')
|
||||
})
|
||||
@@ -676,28 +647,28 @@ function setToggle(tlid) {
|
||||
$('#util-box_' + tlid).css('display', 'block')
|
||||
$('#util-box_' + tlid).animate(
|
||||
{
|
||||
height: '200px',
|
||||
height: '200px'
|
||||
},
|
||||
{
|
||||
duration: 300,
|
||||
complete: function () {
|
||||
complete: function() {
|
||||
$('#util-box_' + tlid).css('overflow-y', 'scroll')
|
||||
$('#util-box_' + tlid).removeClass('column-hide')
|
||||
},
|
||||
}
|
||||
}
|
||||
)
|
||||
} else {
|
||||
$('#util-box_' + tlid).css('overflow-y', 'hidden')
|
||||
$('#util-box_' + tlid).animate(
|
||||
{
|
||||
height: '0',
|
||||
height: '0'
|
||||
},
|
||||
{
|
||||
duration: 300,
|
||||
complete: function () {
|
||||
complete: function() {
|
||||
$('#util-box_' + tlid).addClass('column-hide')
|
||||
$('#util-box_' + tlid).css('display', 'none')
|
||||
},
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
@@ -709,34 +680,34 @@ function setToggleTag(tlid) {
|
||||
$('#tag-box_' + tlid).css('display', 'block')
|
||||
$('#tag-box_' + tlid).animate(
|
||||
{
|
||||
height: '200px',
|
||||
height: '200px'
|
||||
},
|
||||
{
|
||||
duration: 300,
|
||||
complete: function () {
|
||||
complete: function() {
|
||||
$('#tag-box_' + tlid).css('overflow-y', 'scroll')
|
||||
$('#tag-box_' + tlid).removeClass('column-hide')
|
||||
},
|
||||
}
|
||||
}
|
||||
)
|
||||
} else {
|
||||
$('#tag-box_' + tlid).css('overflow-y', 'hidden')
|
||||
$('#tag-box_' + tlid).animate(
|
||||
{
|
||||
height: '0',
|
||||
height: '0'
|
||||
},
|
||||
{
|
||||
duration: 300,
|
||||
complete: function () {
|
||||
complete: function() {
|
||||
$('#tag-box_' + tlid).addClass('column-hide')
|
||||
$('#tag-box_' + tlid).css('display', 'none')
|
||||
},
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
function colorpicker(key) {
|
||||
temp = `<div onclick="coloradd('${key}','def','def')" class="pointer">Default</div>
|
||||
var temp = `<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}','e91e63','white')" class="pink white-text pointer">Pink</div>
|
||||
<div onclick="coloradd('${key}','9c27b0','white')" class="purple white-text pointer">Purple</div>
|
||||
@@ -794,8 +765,7 @@ function webviewParse(url, key, insert, icnsert, css) {
|
||||
<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-sta">
|
||||
</div>
|
||||
<div class="area-sta"></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>
|
||||
@@ -838,16 +808,11 @@ function unstreamingTL(type, key, basekey, insert, icnsert, left_fold, css, anim
|
||||
${lang.lang_layout_leftUnfold}
|
||||
</span><br>`
|
||||
}
|
||||
if (type == 'utl') {
|
||||
var dataHtml = false
|
||||
} else {
|
||||
var dataHtml = data
|
||||
}
|
||||
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="area-notice">
|
||||
<i class="material-icons waves-effect" id="notice_icon_${key}" style="font-size:40px; padding-top:25%;"
|
||||
onclick="${type}('${key}','${dataHtml}');" title="${lang.lang_layout_gotop}"></i>
|
||||
onclick="${type}('${key}','${data}');" title="${lang.lang_layout_gotop}"></i>
|
||||
</div>
|
||||
<div class="area-notice_name">
|
||||
<span id="notice_${key}" class="tl-title"></span>
|
||||
@@ -888,8 +853,6 @@ function unstreamingTL(type, key, basekey, insert, icnsert, left_fold, css, anim
|
||||
} else if (type == 'bookmark') {
|
||||
console.log(key, data)
|
||||
bookmark(key, data)
|
||||
} else if (type == 'utl') {
|
||||
utl(key, data.acct, data.data)
|
||||
}
|
||||
cardCheck(key)
|
||||
ebtCheck(key)
|
||||
@@ -907,22 +870,6 @@ function bookmark(key, data) {
|
||||
}
|
||||
tl('bookmark', '', data, key, 'false', voice, '')
|
||||
}
|
||||
function utl(key, acct_id, data) {
|
||||
if (!data) {
|
||||
var multi = localStorage.getItem('column')
|
||||
var obj = JSON.parse(multi)
|
||||
data = obj[key].data
|
||||
acct_id = obj[key].domain
|
||||
}
|
||||
|
||||
console.log(key, data)
|
||||
if (localStorage.getItem('voice_' + key)) {
|
||||
var voice = true
|
||||
} else {
|
||||
var voice = false
|
||||
}
|
||||
tl('utl', data, acct_id, key, 'false', voice, '')
|
||||
}
|
||||
function leftFoldSet(key) {
|
||||
var multi = localStorage.getItem('column')
|
||||
var obj = JSON.parse(multi)
|
||||
|
@@ -1,24 +1,25 @@
|
||||
'use strict'
|
||||
function menu() {
|
||||
localStorage.setItem("menu-done", true)
|
||||
localStorage.setItem("menu-done", true);
|
||||
$("#fukidashi").addClass("hide")
|
||||
if (!$("#menu").hasClass("appear")) {
|
||||
$("#menu").addClass("appear")
|
||||
var left = localStorage.getItem("menu-left")
|
||||
var left = localStorage.getItem("menu-left");
|
||||
if (left > $('body').width() - $('#menu').width()) {
|
||||
left = $('body').width() - $('#menu').width()
|
||||
left = $('body').width() - $('#menu').width();
|
||||
} else if (left < 0) {
|
||||
left = 0
|
||||
left = 0;
|
||||
}
|
||||
var top = localStorage.getItem("menu-top")
|
||||
var top = localStorage.getItem("menu-top");
|
||||
if (top > $('body').height() - $('#menu').height()) {
|
||||
top = $('body').height() - $('#menu').height()
|
||||
top = $('body').height() - $('#menu').height();
|
||||
} else if (top < 0) {
|
||||
top = 0
|
||||
top = 0;
|
||||
}
|
||||
$('#menu').css("left", left + "px")
|
||||
$('#menu').css("top", top + "px")
|
||||
var height = localStorage.getItem("menu-height")
|
||||
var width = localStorage.getItem("menu-width")
|
||||
var height = localStorage.getItem("menu-height");
|
||||
var width = localStorage.getItem("menu-width");
|
||||
if(height){
|
||||
$('#menu').css("height", height + "px")
|
||||
}else{
|
||||
@@ -27,13 +28,12 @@ function menu() {
|
||||
if(width){
|
||||
$('#menu').css("width", width + "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")
|
||||
$("#addColumnMenu").click()
|
||||
$('#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")
|
||||
@@ -44,35 +44,35 @@ $(function () {
|
||||
$("#menu").draggable({
|
||||
handle: "#menu-bar",
|
||||
stop: function () {
|
||||
var left = $('#menu').offset().left
|
||||
var left = $('#menu').offset().left;
|
||||
if (left > $('body').width() - $('#menu').width()) {
|
||||
left = $('body').width() - $('#menu').width()
|
||||
left = $('body').width() - $('#menu').width();
|
||||
} else if (left < 0) {
|
||||
left = 0
|
||||
left = 0;
|
||||
}
|
||||
var top = $('#menu').offset().top
|
||||
var top = $('#menu').offset().top;
|
||||
if (top > $('body').height() - $('#menu').height()) {
|
||||
top = $('body').height() - $('#menu').height()
|
||||
top = $('body').height() - $('#menu').height();
|
||||
} else if (top < 0) {
|
||||
top = 0
|
||||
top = 0;
|
||||
}
|
||||
localStorage.setItem("menu-left", left)
|
||||
localStorage.setItem("menu-top", top)
|
||||
localStorage.setItem("menu-left", left);
|
||||
localStorage.setItem("menu-top", top);
|
||||
}
|
||||
})
|
||||
});
|
||||
$("#menu").resizable({
|
||||
minHeight: 150,
|
||||
minWidth: 200,
|
||||
stop: function (event, ui) {
|
||||
localStorage.setItem("menu-height", ui.size.height)
|
||||
localStorage.setItem("menu-width", ui.size.width)
|
||||
localStorage.setItem("menu-height", ui.size.height);
|
||||
localStorage.setItem("menu-width", ui.size.width);
|
||||
}
|
||||
})
|
||||
})
|
||||
});
|
||||
});
|
||||
function help() {
|
||||
$("#left-menu a").removeClass("active")
|
||||
$("#helpMenu").addClass("active")
|
||||
$(".menu-content").addClass("hide")
|
||||
$("#help-box").removeClass("hide")
|
||||
$("#left-menu div").removeClass("active");
|
||||
$("#helpMenu").addClass("active");
|
||||
$(".menu-content").addClass("hide");
|
||||
$("#help-box").removeClass("hide");
|
||||
postMessage(["sendSinmpleIpc", "getLogs"], "*")
|
||||
}
|
@@ -1,32 +1,33 @@
|
||||
'use strict'
|
||||
function pip(id) {
|
||||
$("#pip-content").html($("[toot-id=" + id + "] .additional").html())
|
||||
$("#pip").removeClass("hide")
|
||||
$("#pip-content").html($("[toot-id=" + id + "] .additional").html());
|
||||
$("#pip").removeClass("hide");
|
||||
}
|
||||
function endPip() {
|
||||
$("#pip-content").html("")
|
||||
$("#pip").addClass("hide")
|
||||
$("#pip-content").html("");
|
||||
$("#pip").addClass("hide");
|
||||
}
|
||||
|
||||
function pipHoriz() {
|
||||
if ($("#pip").hasClass("pip-left")) {
|
||||
$("#pip").removeClass("pip-left")
|
||||
$(".pip-horiz").text("chevron_left")
|
||||
$("#pip").addClass("pip-right")
|
||||
$("#pip").removeClass("pip-left");
|
||||
$(".pip-horiz").text("chevron_left");
|
||||
$("#pip").addClass("pip-right");
|
||||
} else {
|
||||
$("#pip").addClass("pip-left")
|
||||
$("#pip").removeClass("pip-right")
|
||||
$(".pip-horiz").text("chevron_right")
|
||||
$("#pip").addClass("pip-left");
|
||||
$("#pip").removeClass("pip-right");
|
||||
$(".pip-horiz").text("chevron_right");
|
||||
}
|
||||
}
|
||||
|
||||
function pipVert() {
|
||||
if ($("#pip").hasClass("pip-top")) {
|
||||
$("#pip").removeClass("pip-top")
|
||||
$("#pip").addClass("pip-bottom")
|
||||
$(".pip-vert").text("expand_less")
|
||||
$("#pip").removeClass("pip-top");
|
||||
$("#pip").addClass("pip-bottom");
|
||||
$(".pip-vert").text("expand_less");
|
||||
} else {
|
||||
$("#pip").addClass("pip-top")
|
||||
$("#pip").removeClass("pip-bottom")
|
||||
$(".pip-vert").text("expand_more")
|
||||
$("#pip").addClass("pip-top");
|
||||
$("#pip").removeClass("pip-bottom");
|
||||
$(".pip-vert").text("expand_more");
|
||||
}
|
||||
}
|
@@ -1,3 +1,4 @@
|
||||
'use strict'
|
||||
/*ささやきボックス(Cr民並感)*/
|
||||
//✕隠す
|
||||
function hide() {
|
||||
@@ -58,10 +59,10 @@ function show() {
|
||||
mdCheck()
|
||||
}
|
||||
|
||||
$(function () {
|
||||
$(function() {
|
||||
$('#post-box').draggable({
|
||||
handle: '#post-bar',
|
||||
stop: function () {
|
||||
stop: function() {
|
||||
var left = $('#post-box').offset().left
|
||||
if (left > $('body').width() - $('#post-box').width()) {
|
||||
left = $('body').width() - $('#post-box').width()
|
||||
@@ -76,15 +77,15 @@ $(function () {
|
||||
}
|
||||
localStorage.setItem('postbox-left', left)
|
||||
localStorage.setItem('postbox-top', top)
|
||||
},
|
||||
}
|
||||
})
|
||||
$('#post-box').resizable({
|
||||
minHeight: 150,
|
||||
minWidth: 100,
|
||||
stop: function (event, ui) {
|
||||
stop: function(event, ui) {
|
||||
$('#textarea').blur()
|
||||
localStorage.setItem('postbox-width', ui.size.width)
|
||||
},
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
@@ -101,9 +102,7 @@ if (location.search) {
|
||||
$('.mini-btn').text('expand_less')
|
||||
}
|
||||
}
|
||||
window.onload = initPostbox
|
||||
function initPostbox() {
|
||||
$('#posttgl').click(function (e) {
|
||||
$('#posttgl').click(function(e) {
|
||||
if (!$('#post-box').hasClass('appear')) {
|
||||
show()
|
||||
} else {
|
||||
@@ -112,9 +111,9 @@ function initPostbox() {
|
||||
$('.cvo').removeClass('selectedToot')
|
||||
selectedColumn = 0
|
||||
selectedToot = 0
|
||||
})
|
||||
})
|
||||
|
||||
$('#timeline-container,#group').click(function (e) {
|
||||
$('#timeline-container,#group').click(function(e) {
|
||||
if (localStorage.getItem('box') != 'absolute') {
|
||||
if ($('#post-box').hasClass('appear') && !localStorage.getItem('nohide')) {
|
||||
hide()
|
||||
@@ -124,21 +123,19 @@ function initPostbox() {
|
||||
selectedColumn = 0
|
||||
selectedToot = 0
|
||||
localStorage.removeItem('nohide')
|
||||
srcBox('close')
|
||||
})
|
||||
$('#contextWrap').click(function (e) {
|
||||
})
|
||||
$('#contextWrap').click(function(e) {
|
||||
$('#contextWrap').addClass('hide')
|
||||
$('.contextMenu').addClass('hide')
|
||||
$('.act-icon').text('expand_more')
|
||||
})
|
||||
$('#textarea,#cw-text').focusout(function (e) {
|
||||
})
|
||||
$('#textarea,#cw-text').focusout(function(e) {
|
||||
localStorage.setItem('nohide', true)
|
||||
var countup = function () {
|
||||
var countup = function() {
|
||||
localStorage.removeItem('nohide')
|
||||
}
|
||||
//setTimeout(remove, 100);
|
||||
$('.cvo').removeClass('selectedToot')
|
||||
selectedColumn = 0
|
||||
selectedToot = 0
|
||||
})
|
||||
}
|
||||
})
|
||||
|
@@ -1,38 +1,39 @@
|
||||
var r = document.getElementById("radio")
|
||||
'use strict'
|
||||
var r = document.getElementById("radio");
|
||||
function Rtoggle() {
|
||||
if ($("#radio").hasClass("play")) {
|
||||
Rstop()
|
||||
Rstop();
|
||||
} else {
|
||||
$("#radio-view").toggleClass("hide")
|
||||
$("#radio-view").toggleClass("show")
|
||||
$("#radio-input").addClass("hide")
|
||||
$("#radio-view").toggleClass("hide");
|
||||
$("#radio-view").toggleClass("show");
|
||||
$("#radio-input").addClass("hide");
|
||||
}
|
||||
}
|
||||
function Rplay(url, name) {
|
||||
$("#radio").attr('src', url)
|
||||
r.load()
|
||||
r.play()
|
||||
$("#radio").addClass("play")
|
||||
$("#radio-btn").addClass("teal-text")
|
||||
$("#radio-sta").html("<br>Now Playing:" + name)
|
||||
$("#radio").attr('src', url);
|
||||
r.load();
|
||||
r.play();
|
||||
$("#radio").addClass("play");
|
||||
$("#radio-btn").addClass("teal-text");
|
||||
$("#radio-sta").html("<br>Now Playing:" + name);
|
||||
}
|
||||
function Rstop() {
|
||||
$("#radio").attr("src", "")
|
||||
r.pause()
|
||||
$("#radio").removeClass("play")
|
||||
$("#radio-btn").removeClass("teal-text")
|
||||
$("#radio-sta").html("")
|
||||
$("#radio").attr("src", "");
|
||||
r.pause();
|
||||
$("#radio").removeClass("play");
|
||||
$("#radio-btn").removeClass("teal-text");
|
||||
$("#radio-sta").html("");
|
||||
}
|
||||
function Ryourself() {
|
||||
$("#radio-input").removeClass("hide")
|
||||
$("#radio-view").addClass("hide")
|
||||
$("#radio-input").removeClass("hide");
|
||||
$("#radio-view").addClass("hide");
|
||||
}
|
||||
function Rselect() {
|
||||
$("#radio-input").addClass("hide")
|
||||
$("#radio-view").removeClass("hide")
|
||||
$("#radio-input").addClass("hide");
|
||||
$("#radio-view").removeClass("hide");
|
||||
}
|
||||
function Rinput() {
|
||||
var url = $("#radio-url").val()
|
||||
var url = $("#radio-url").val();
|
||||
Rplay(url, url)
|
||||
}
|
||||
/*
|
||||
|
@@ -1,3 +1,4 @@
|
||||
'use strict'
|
||||
//スクロールで続きを読む
|
||||
function scrollevent() {
|
||||
$('.tl-box').scroll(function() {
|
||||
|
@@ -1,44 +1,45 @@
|
||||
'use strict'
|
||||
//ソートデータ読み込み
|
||||
function sortLoad () {
|
||||
$("#sort").html("")
|
||||
var col = localStorage.getItem("column")
|
||||
$("#sort").html("");
|
||||
var col = localStorage.getItem("column");
|
||||
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"
|
||||
var acct = obj[key];
|
||||
var flag = "false";
|
||||
if (localStorage.getItem("card_" + key) == "true") {
|
||||
flag = "true"
|
||||
}
|
||||
var insert = ""
|
||||
var insert = "";
|
||||
|
||||
if (acct.background) {
|
||||
if (acct.text == "def") {
|
||||
|
||||
} else {
|
||||
if (acct.text == "black") {
|
||||
var txhex = "000000"
|
||||
var txhex = "000000";
|
||||
} 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 domain = localStorage.getItem("domain_" + acct.domain)
|
||||
var user = localStorage.getItem("user_" + acct.domain);
|
||||
var domain = localStorage.getItem("domain_" + acct.domain);
|
||||
if (!user || !domain) {
|
||||
var acctdata = ""
|
||||
var acctdata = "";
|
||||
} 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, 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="このカラムを削除">cancel</i></a></div><div class="sortacct">' + acctdata + '</div></li>'
|
||||
$("#sort").append(html)
|
||||
})
|
||||
drag()
|
||||
')" class="setting nex"><i class="material-icons waves-effect nex" title="このカラムを削除">cancel</i></a></div><div class="sortacct">' + acctdata + '</div></li>';
|
||||
$("#sort").append(html);
|
||||
});
|
||||
drag();
|
||||
}
|
||||
|
||||
//TLのタイトル
|
||||
@@ -62,59 +63,59 @@ function Scap(type, data) {
|
||||
} else if (type == "tootsearch") {
|
||||
return "tootsearch(" + data + ")"
|
||||
} else {
|
||||
console.error("unknown timeline type: " + type)
|
||||
console.error("unknown timeline type: " + type);
|
||||
}
|
||||
}
|
||||
|
||||
//jquery-ui依存
|
||||
function drag() {
|
||||
$('#sort').sortable()
|
||||
$('#sort').disableSelection()
|
||||
$('#sort').sortable();
|
||||
$('#sort').disableSelection();
|
||||
}
|
||||
|
||||
//ソート指定
|
||||
function sort() {
|
||||
var arr = []
|
||||
var flags = []
|
||||
var arr = [];
|
||||
var flags = [];
|
||||
$(".drag-content").each(function (i, elem) {
|
||||
var id = $(this).attr("data-id")
|
||||
var flag = $(this).attr("data-flag")
|
||||
var id = $(this).attr("data-id");
|
||||
var flag = $(this).attr("data-flag");
|
||||
arr.push(id)
|
||||
flags.push(flag)
|
||||
})
|
||||
var col = localStorage.getItem("column")
|
||||
var obj = JSON.parse(col)
|
||||
var newobj = []
|
||||
flags.push(flag);
|
||||
});
|
||||
var col = localStorage.getItem("column");
|
||||
var obj = JSON.parse(col);
|
||||
var newobj = [];
|
||||
for (i = 0; i < arr.length; i++) {
|
||||
var data = obj[arr[i]]
|
||||
var data = obj[arr[i]];
|
||||
var add = {
|
||||
domain: data.domain,
|
||||
type: data.type,
|
||||
data: data.data,
|
||||
background: data.background,
|
||||
text: data.text
|
||||
}
|
||||
newobj.push(add)
|
||||
};
|
||||
newobj.push(add);
|
||||
if (flags[i] == "true") {
|
||||
localStorage.setItem("card_" + i, "true")
|
||||
localStorage.setItem("card_" + i, "true");
|
||||
} else {
|
||||
localStorage.removeItem("card_" + i)
|
||||
localStorage.removeItem("card_" + i);
|
||||
}
|
||||
}
|
||||
var json = JSON.stringify(newobj)
|
||||
localStorage.setItem("column", json)
|
||||
$("#sort").html("")
|
||||
var json = JSON.stringify(newobj);
|
||||
localStorage.setItem("column", json);
|
||||
$("#sort").html("");
|
||||
M.toast({ html: "Sorted", displayLength: 3000 })
|
||||
sortLoad()
|
||||
parseColumn()
|
||||
sortLoad();
|
||||
parseColumn();
|
||||
sortMenu()
|
||||
}
|
||||
//ソートボタントグル
|
||||
function sortMenu() {
|
||||
$("#left-menu a").removeClass("active")
|
||||
$("#sortMenu").addClass("active")
|
||||
$(".menu-content").addClass("hide")
|
||||
$("#sort-box").removeClass("hide")
|
||||
$("#sort").html("")
|
||||
sortLoad()
|
||||
$("#left-menu div").removeClass("active");
|
||||
$("#sortMenu").addClass("active");
|
||||
$(".menu-content").addClass("hide");
|
||||
$("#sort-box").removeClass("hide");
|
||||
$("#sort").html("");
|
||||
sortLoad();
|
||||
}
|
@@ -1,310 +1,190 @@
|
||||
'use strict'
|
||||
function spotifyConnect() {
|
||||
var auth = 'https://spotify.thedesk.top/connect'
|
||||
$('#spotify-code-show').removeClass('hide')
|
||||
postMessage(['openUrl', auth], '*')
|
||||
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 platform = localStorage.getItem("platform");
|
||||
if (platform == "win32") {
|
||||
postMessage(["openUrl", auth], "*");
|
||||
postMessage(["sendSinmpleIpc", "quit"], "*");
|
||||
} else {
|
||||
auth = auth + "&state=code";
|
||||
$("#spotify-code-show").removeClass("hide");
|
||||
postMessage(["openUrl", auth], "*");
|
||||
}
|
||||
}
|
||||
function spotifyAuth() {
|
||||
var code = $('#spotify-code').val()
|
||||
localStorage.setItem('spotify-token', code)
|
||||
$('#spotify-code-show').addClass('hide')
|
||||
$('#spotify-enable').addClass('disabled')
|
||||
$('#spotify-disable').removeClass('disabled')
|
||||
var code = $("#spotify-code").val();
|
||||
localStorage.setItem("spotify", "code");
|
||||
localStorage.setItem("spotify-refresh", code);
|
||||
$("#spotify-code-show").addClass("hide");
|
||||
$("#spotify-enable").addClass("disabled");
|
||||
$("#spotify-disable").removeClass("disabled");
|
||||
}
|
||||
function spotifyDisconnect() {
|
||||
var start = 'https://spotify.thedesk.top/disconnect?code=' + localStorage.getItem('spotify-token')
|
||||
fetch(start, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
},
|
||||
})
|
||||
.then(function (response) {
|
||||
if (!response.ok) {
|
||||
response.text().then(function (text) {
|
||||
setLog(response.url, response.status, text)
|
||||
})
|
||||
}
|
||||
return response.json()
|
||||
})
|
||||
.catch(function (error) {
|
||||
todo(error)
|
||||
setLog(start, 'JSON', error)
|
||||
console.error(error)
|
||||
})
|
||||
.then(function (json) {
|
||||
if (!json.success) alert('error')
|
||||
localStorage.removeItem('spotify-token')
|
||||
checkSpotify()
|
||||
})
|
||||
localStorage.removeItem("spotify");
|
||||
localStorage.removeItem("spotify-refresh");
|
||||
checkSpotify();
|
||||
}
|
||||
function checkSpotify() {
|
||||
if (localStorage.getItem('spotify-token')) {
|
||||
$('#spotify-enable').addClass('disabled')
|
||||
$('#spotify-disable').removeClass('disabled')
|
||||
if (localStorage.getItem("spotify")) {
|
||||
$("#spotify-enable").addClass("disabled");
|
||||
$("#spotify-disable").removeClass("disabled");
|
||||
} else {
|
||||
$('#spotify-enable').removeClass('disabled')
|
||||
$('#spotify-disable').addClass('disabled')
|
||||
$("#spotify-enable").removeClass("disabled");
|
||||
$("#spotify-disable").addClass("disabled");
|
||||
}
|
||||
var content = localStorage.getItem('np-temp')
|
||||
if (!content || content == '' || content == 'null') {
|
||||
var content = '#NowPlaying {song} / {album} / {artist}\n{url} #SpotifyWithTheDesk'
|
||||
var content = localStorage.getItem("np-temp");
|
||||
if (!content || content == "" || content == "null") {
|
||||
var content = "#NowPlaying {song} / {album} / {artist}\n{url} #SpotifyWithTheDesk";
|
||||
}
|
||||
$('#np-temp').val(content)
|
||||
var flag = localStorage.getItem('artwork')
|
||||
$("#np-temp").val(content);
|
||||
var flag = localStorage.getItem("artwork");
|
||||
if (flag) {
|
||||
$('#awk_yes').prop('checked', true)
|
||||
$("#awk_yes").prop("checked", true);
|
||||
} else {
|
||||
$('#awk_no').prop('checked', true)
|
||||
}
|
||||
var flag2 = localStorage.getItem('complete-artwork')
|
||||
if (flag2) {
|
||||
$('#amw_yes').prop('checked', true)
|
||||
} else {
|
||||
$('#amw_no').prop('checked', true)
|
||||
$("#awk_no").prop("checked", true);
|
||||
}
|
||||
}
|
||||
function spotifyFlagSave() {
|
||||
var awk = $('[name=awk]:checked').val()
|
||||
if (awk == 'yes') {
|
||||
localStorage.setItem('artwork', 'yes')
|
||||
M.toast({ html: lang.lang_spotify_img, displayLength: 3000 })
|
||||
var awk = $("[name=awk]:checked").val();
|
||||
if (awk == "yes") {
|
||||
localStorage.setItem("artwork", "yes");
|
||||
M.toast({ html: lang.lang_spotify_img, displayLength: 3000 });
|
||||
} else {
|
||||
localStorage.removeItem('artwork')
|
||||
M.toast({ html: lang.lang_spotify_imgno, displayLength: 3000 })
|
||||
}
|
||||
}
|
||||
function aMusicFlagSave() {
|
||||
var awk = $('[name=amw]:checked').val()
|
||||
if (awk == 'yes') {
|
||||
localStorage.setItem('complete-artwork', 'yes')
|
||||
M.toast({ html: lang.lang_spotify_img, displayLength: 3000 })
|
||||
} else {
|
||||
localStorage.removeItem('complete-artwork')
|
||||
M.toast({ html: lang.lang_spotify_imgno, displayLength: 3000 })
|
||||
localStorage.removeItem("artwork");
|
||||
M.toast({ html: lang.lang_spotify_imgno, displayLength: 3000 });
|
||||
}
|
||||
}
|
||||
function nowplaying(mode) {
|
||||
if (mode == 'spotify') {
|
||||
var start = 'https://spotify.thedesk.top/current-playing?code=' + localStorage.getItem('spotify-token')
|
||||
var at = localStorage.getItem('spotify-token')
|
||||
if (mode == "spotify") {
|
||||
var start = "https://thedesk.top/now-playing?at=" + localStorage.getItem("spotify") + "&rt=" + localStorage.getItem("spotify-refresh");
|
||||
var at = localStorage.getItem("spotify");
|
||||
if (at) {
|
||||
fetch(start, {
|
||||
method: 'GET',
|
||||
method: "GET",
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
},
|
||||
})
|
||||
.then(function (response) {
|
||||
if (!response.ok) {
|
||||
response.text().then(function (text) {
|
||||
setLog(response.url, response.status, text)
|
||||
})
|
||||
"content-type": "application/json"
|
||||
}
|
||||
return response.json()
|
||||
})
|
||||
.catch(function (error) {
|
||||
todo(error)
|
||||
setLog(start, 'JSON', error)
|
||||
console.error(error)
|
||||
.then(function(response) {
|
||||
if (!response.ok) {
|
||||
response.text().then(function(text) {
|
||||
setLog(response.url, response.status, text);
|
||||
});
|
||||
}
|
||||
return response.json();
|
||||
})
|
||||
.then(function (jsonRaw) {
|
||||
var code = jsonRaw.token
|
||||
localStorage.setItem('spotify-token', code)
|
||||
var json = jsonRaw.data
|
||||
console.table(json)
|
||||
.catch(function(error) {
|
||||
todo(error);
|
||||
setLog(start, "JSON", error);
|
||||
console.error(error);
|
||||
})
|
||||
.then(function(json) {
|
||||
console.table(json);
|
||||
if (json.length < 1) {
|
||||
return false
|
||||
return false;
|
||||
}
|
||||
var item = json.item
|
||||
var img = item.album.images[0].url
|
||||
var flag = localStorage.getItem('artwork')
|
||||
var item = json.item;
|
||||
var img = item.album.images[0].url;
|
||||
var flag = localStorage.getItem("artwork");
|
||||
if (flag) {
|
||||
postMessage(['bmpImage', [img, 0]], '*')
|
||||
postMessage(["bmpImage", [img, 0]], "*");
|
||||
}
|
||||
var content = localStorage.getItem('np-temp')
|
||||
if (!content || content == '' || content == 'null') {
|
||||
var content = '#NowPlaying {song} / {album} / {artist}\n{url}'
|
||||
var content = localStorage.getItem("np-temp");
|
||||
if (!content || content == "" || content == "null") {
|
||||
var content = "#NowPlaying {song} / {album} / {artist}\n{url}";
|
||||
}
|
||||
var regExp = new RegExp('{song}', 'g')
|
||||
content = content.replace(regExp, item.name)
|
||||
var regExp = new RegExp('{album}', 'g')
|
||||
content = content.replace(regExp, item.album.name)
|
||||
var regExp = new RegExp('{artist}', 'g')
|
||||
content = content.replace(regExp, item.artists[0].name)
|
||||
var regExp = new RegExp('{url}', 'g')
|
||||
content = content.replace(regExp, item.external_urls.spotify)
|
||||
var regExp = new RegExp('{composer}', 'g')
|
||||
content = content.replace(regExp, '')
|
||||
var regExp = new RegExp('{hz}', 'g')
|
||||
content = content.replace(regExp, '')
|
||||
var regExp = new RegExp('{bitRate}', 'g')
|
||||
content = content.replace(regExp, '')
|
||||
var regExp = new RegExp('{lyricist}', 'g')
|
||||
content = content.replace(regExp, '')
|
||||
var regExp = new RegExp('{bpm}', 'g')
|
||||
content = content.replace(regExp, '')
|
||||
var regExp = new RegExp('{genre}', 'g')
|
||||
content = content.replace(regExp, '')
|
||||
$('#textarea').val(content)
|
||||
})
|
||||
var regExp = new RegExp("{song}", "g");
|
||||
content = content.replace(regExp, item.name);
|
||||
var regExp = new RegExp("{album}", "g");
|
||||
content = content.replace(regExp, item.album.name);
|
||||
var regExp = new RegExp("{artist}", "g");
|
||||
content = content.replace(regExp, item.artists[0].name);
|
||||
var regExp = new RegExp("{url}", "g");
|
||||
content = content.replace(regExp, item.external_urls.spotify);
|
||||
var regExp = new RegExp("{composer}", "g");
|
||||
content = content.replace(regExp, "");
|
||||
var regExp = new RegExp("{hz}", "g");
|
||||
content = content.replace(regExp, "");
|
||||
var regExp = new RegExp("{bitRate}", "g");
|
||||
content = content.replace(regExp, "");
|
||||
var regExp = new RegExp("{lyricist}", "g");
|
||||
content = content.replace(regExp, "");
|
||||
var regExp = new RegExp("{bpm}", "g");
|
||||
content = content.replace(regExp, "");
|
||||
var regExp = new RegExp("{genre}", "g");
|
||||
content = content.replace(regExp, "");
|
||||
$("#textarea").val(content);
|
||||
});
|
||||
} else {
|
||||
Swal.fire({
|
||||
type: 'info',
|
||||
title: lang.lang_spotify_acct,
|
||||
})
|
||||
}
|
||||
} else if (mode == 'itunes') {
|
||||
postMessage(['itunes', ''], '*')
|
||||
} else if (mode == 'lastFm') {
|
||||
var user = localStorage.getItem('lastFmUser')
|
||||
var start = 'https://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=' + user + '&limit=1&api_key=8f113803bfea951b6dde9e56d32458b2&format=json'
|
||||
|
||||
if (user) {
|
||||
fetch(start, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
},
|
||||
})
|
||||
.then(function (response) {
|
||||
if (!response.ok) {
|
||||
response.text().then(function (text) {
|
||||
setLog(response.url, response.status, text)
|
||||
})
|
||||
}
|
||||
return response.json()
|
||||
})
|
||||
.catch(function (error) {
|
||||
todo(error)
|
||||
setLog(start, 'JSON', error)
|
||||
console.error(error)
|
||||
})
|
||||
.then(function (json) {
|
||||
console.table(json)
|
||||
if (!json || !json.recenttracks) {
|
||||
console.error('no data')
|
||||
return false
|
||||
}
|
||||
var item = json.recenttracks.track[0]
|
||||
if (!item['@attr']) return false
|
||||
var img = item.image[3]['#text']
|
||||
var flag = localStorage.getItem('artwork')
|
||||
if (flag && img != 'https://lastfm.freetls.fastly.net/i/u/300x300/2a96cbd8b46e442fc41c2b86b821562f.png' && img) {
|
||||
postMessage(['bmpImage', [img, 0]], '*')
|
||||
}
|
||||
var content = localStorage.getItem('np-temp')
|
||||
if (!content || content == '' || content == 'null') {
|
||||
var content = '#NowPlaying {song} / {album} / {artist}\n{url}'
|
||||
}
|
||||
var regExp = new RegExp('{song}', 'g')
|
||||
content = content.replace(regExp, item.name)
|
||||
var regExp = new RegExp('{album}', 'g')
|
||||
content = content.replace(regExp, item.album['#text'])
|
||||
var regExp = new RegExp('{artist}', 'g')
|
||||
content = content.replace(regExp, item.artist['#text'])
|
||||
var regExp = new RegExp('{url}', 'g')
|
||||
content = content.replace(regExp, '')
|
||||
var regExp = new RegExp('{composer}', 'g')
|
||||
content = content.replace(regExp, '')
|
||||
var regExp = new RegExp('{hz}', 'g')
|
||||
content = content.replace(regExp, '')
|
||||
var regExp = new RegExp('{bitRate}', 'g')
|
||||
content = content.replace(regExp, '')
|
||||
var regExp = new RegExp('{lyricist}', 'g')
|
||||
content = content.replace(regExp, '')
|
||||
var regExp = new RegExp('{bpm}', 'g')
|
||||
content = content.replace(regExp, '')
|
||||
var regExp = new RegExp('{genre}', 'g')
|
||||
content = content.replace(regExp, '')
|
||||
$('#textarea').val(content)
|
||||
})
|
||||
} else {
|
||||
Swal.fire({
|
||||
type: 'info',
|
||||
title: lang.lang_spotify_acct,
|
||||
})
|
||||
type: "info",
|
||||
title: lang.lang_spotify_acct
|
||||
});
|
||||
}
|
||||
} else if (mode == "itunes") {
|
||||
postMessage(["itunes", ""], "*");
|
||||
}
|
||||
}
|
||||
async function npCore(arg) {
|
||||
console.table(arg)
|
||||
var content = localStorage.getItem('np-temp')
|
||||
if (!content || content == '' || content == 'null') {
|
||||
var content = '#NowPlaying {song} / {album} / {artist}\n{url}'
|
||||
function npCore(arg) {
|
||||
if (arg.cmd) {
|
||||
console.error(arg);
|
||||
return;
|
||||
}
|
||||
var flag = localStorage.getItem('artwork')
|
||||
var platform = localStorage.getItem('platform')
|
||||
var aaw = { aaw: '', album: '' }
|
||||
if (platform == 'win32') {
|
||||
console.table(arg);
|
||||
var content = localStorage.getItem("np-temp");
|
||||
if (!content || content == "" || content == "null") {
|
||||
var content = "#NowPlaying {song} / {album} / {artist}\n{url}";
|
||||
}
|
||||
var flag = localStorage.getItem("artwork");
|
||||
var platform = localStorage.getItem("platform");
|
||||
if (platform == "win32") {
|
||||
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.artwork) {
|
||||
media(arg.artwork, 'image/png', 'new')
|
||||
} else if (flag && localStorage.getItem('complete-artwork')) {
|
||||
var q = arg.artist + ' ' + arg.album.name + ' ' + arg.name
|
||||
aaw = await getUnknownAA(q)
|
||||
postMessage(['bmpImage', [aaw.aaw, 0]], '*')
|
||||
media(arg.artwork, "image/png", "new");
|
||||
}
|
||||
}
|
||||
var regExp = new RegExp('{song}', 'g')
|
||||
content = content.replace(regExp, arg.name)
|
||||
var regExp = new RegExp('{album}', 'g')
|
||||
var regExp = new RegExp("{song}", "g");
|
||||
content = content.replace(regExp, arg.name);
|
||||
var regExp = new RegExp("{album}", "g");
|
||||
if (arg.album) {
|
||||
if (arg.album.name) {
|
||||
content = content.replace(regExp, arg.album.name)
|
||||
} else {
|
||||
if (aaw.album) content = content.replace(regExp, aaw.album)
|
||||
content = content.replace(regExp, '-')
|
||||
content = content.replace(regExp, arg.album.name);
|
||||
}
|
||||
} else {
|
||||
if (aaw.album) content = content.replace(regExp, aaw.album)
|
||||
content = content.replace(regExp, '-')
|
||||
}
|
||||
var regExp = new RegExp('{artist}', 'g')
|
||||
content = content.replace(regExp, arg.artist)
|
||||
var regExp = new RegExp('{url}', 'g')
|
||||
content = content.replace(regExp, '')
|
||||
var regExp = new RegExp('{composer}', 'g')
|
||||
content = content.replace(regExp, arg.composer)
|
||||
var regExp = new RegExp('{hz}', 'g')
|
||||
content = content.replace(regExp, arg.sampleRate / 1000 + 'kHz')
|
||||
var regExp = new RegExp('{lyricist}', 'g')
|
||||
content = content.replace(regExp, '')
|
||||
var regExp = new RegExp('{bpm}', 'g')
|
||||
content = content.replace(regExp, '')
|
||||
var regExp = new RegExp('{bitRate}', 'g')
|
||||
content = content.replace(regExp, arg.bitRate + 'kbps')
|
||||
var regExp = new RegExp('{genre}', 'g')
|
||||
content = content.replace(regExp, arg.genre)
|
||||
$('#textarea').val(content)
|
||||
var regExp = new RegExp("{artist}", "g");
|
||||
content = content.replace(regExp, arg.artist);
|
||||
var regExp = new RegExp("{url}", "g");
|
||||
content = content.replace(regExp, "");
|
||||
var regExp = new RegExp("{composer}", "g");
|
||||
content = content.replace(regExp, arg.composer);
|
||||
var regExp = new RegExp("{hz}", "g");
|
||||
content = content.replace(regExp, arg.sampleRate / 1000 + "kHz");
|
||||
var regExp = new RegExp("{lyricist}", "g");
|
||||
content = content.replace(regExp, "");
|
||||
var regExp = new RegExp("{bpm}", "g");
|
||||
content = content.replace(regExp, "");
|
||||
var regExp = new RegExp("{bitRate}", "g");
|
||||
content = content.replace(regExp, arg.bitRate + "kbps");
|
||||
var regExp = new RegExp("{genre}", "g");
|
||||
content = content.replace(regExp, arg.genre);
|
||||
$("#textarea").val(content);
|
||||
}
|
||||
function spotifySave() {
|
||||
var temp = $('#np-temp').val()
|
||||
localStorage.setItem('np-temp', temp)
|
||||
M.toast({ html: lang.lang_spotify_np, displayLength: 3000 })
|
||||
var temp = $("#np-temp").val();
|
||||
localStorage.setItem("np-temp", temp);
|
||||
M.toast({ html: lang.lang_spotify_np, displayLength: 3000 });
|
||||
}
|
||||
if (location.search) {
|
||||
var m = location.search.match(/\?mode=([a-zA-Z-0-9]+)\&code=(.+)/)
|
||||
var mode = m[1]
|
||||
var codex = m[2]
|
||||
if (mode == 'spotify') {
|
||||
var coder = codex.split(':')
|
||||
localStorage.setItem('spotify', coder[0])
|
||||
localStorage.setItem('spotify-refresh', coder[1])
|
||||
var m = location.search.match(/\?mode=([a-zA-Z-0-9]+)\&code=(.+)/);
|
||||
var mode = m[1];
|
||||
var codex = m[2];
|
||||
if (mode == "spotify") {
|
||||
var coder = codex.split(":");
|
||||
localStorage.setItem("spotify", coder[0]);
|
||||
localStorage.setItem("spotify-refresh", coder[1]);
|
||||
} else {
|
||||
}
|
||||
}
|
||||
async function getUnknownAA(q) {
|
||||
const start = 'https://itunes.apple.com/search?term=' + q + '&country=JP&entity=song'
|
||||
let promise = await fetch(start, {
|
||||
method: 'GET',
|
||||
})
|
||||
const json = await promise.json()
|
||||
if (!json.resultCount) {
|
||||
return []
|
||||
}
|
||||
const data = json.results[0].artworkUrl100
|
||||
return { aaw: data.replace(/100x100/, '512x512'), album: json.results[0].collectionName }
|
||||
}
|
||||
|
@@ -1,35 +1,33 @@
|
||||
'use strict'
|
||||
//テーマ適用
|
||||
function themes(theme) {
|
||||
if (!theme) {
|
||||
var theme = localStorage.getItem('theme')
|
||||
var theme = localStorage.getItem("theme");
|
||||
if (!theme) {
|
||||
var theme = 'black'
|
||||
localStorage.setItem('theme', 'black')
|
||||
var theme = "black";
|
||||
localStorage.setItem("theme", "black");
|
||||
}
|
||||
}
|
||||
var el = document.getElementsByTagName('html')[0]
|
||||
var el = document.getElementsByTagName("html")[0]
|
||||
|
||||
el.classList.remove('indigotheme')
|
||||
el.classList.remove('greentheme')
|
||||
el.classList.remove('browntheme')
|
||||
el.classList.remove('blacktheme')
|
||||
el.classList.remove('bluetheme')
|
||||
el.classList.remove('polartheme')
|
||||
el.classList.remove('snowtheme')
|
||||
el.classList.remove('customtheme')
|
||||
el.classList.add(theme + 'theme')
|
||||
var font = localStorage.getItem('font')
|
||||
el.classList.remove('indigotheme');
|
||||
el.classList.remove('greentheme');
|
||||
el.classList.remove('browntheme');
|
||||
el.classList.remove('blacktheme');
|
||||
el.classList.remove('bluetheme');
|
||||
el.classList.remove('customtheme');
|
||||
el.classList.add(theme + "theme");
|
||||
var font = localStorage.getItem("font");
|
||||
if (font) {
|
||||
font = font.replace(/"(.+)"/, '$1')
|
||||
el.style.fontFamily = '"' + font + '"'
|
||||
el.style.fontFamily = font;
|
||||
} else {
|
||||
el.style.fontFamily = ''
|
||||
el.style.fontFamily = "";
|
||||
}
|
||||
if (theme == 'custom') {
|
||||
if (localStorage.getItem('customtheme-id')) {
|
||||
postMessage(['themeCSSRequest', localStorage.getItem('customtheme-id')], '*')
|
||||
if (theme == "custom") {
|
||||
if (localStorage.getItem("customtheme-id")) {
|
||||
postMessage(["themeCSSRequest", localStorage.getItem("customtheme-id")], "*")
|
||||
}
|
||||
}
|
||||
el.style.backgroundColor = 'var(--bg)'
|
||||
el.style.backgroundColor = "var(--bg)";
|
||||
}
|
||||
themes()
|
||||
themes();
|
||||
|
@@ -1,3 +1,4 @@
|
||||
'use strict'
|
||||
//左下のメッセージ
|
||||
var todcTrigger = null
|
||||
function todo(mes) {
|
||||
@@ -30,7 +31,7 @@ function tips(mode) {
|
||||
localStorage.getItem('ver') +
|
||||
' git: ' +
|
||||
gitHash +
|
||||
'\')"> ' +
|
||||
'\')">TheDesk ' +
|
||||
localStorage.getItem('ver') +
|
||||
' {' +
|
||||
gitHash.slice(0, 7) +
|
||||
@@ -128,11 +129,15 @@ function trendTagonTip() {
|
||||
})
|
||||
}
|
||||
//Spotify
|
||||
spotint = null
|
||||
var spotint = null
|
||||
function spotifytips() {
|
||||
if (spotint) clearInterval(spotint)
|
||||
var start = 'https://spotify.thedesk.top/current-playing?code=' + localStorage.getItem('spotify-token')
|
||||
var at = localStorage.getItem('spotify-token')
|
||||
var start =
|
||||
'https://thedesk.top/now-playing?at=' +
|
||||
localStorage.getItem('spotify') +
|
||||
'&rt=' +
|
||||
localStorage.getItem('spotify-refresh')
|
||||
var at = localStorage.getItem('spotify')
|
||||
if (at) {
|
||||
fetch(start, {
|
||||
method: 'GET',
|
||||
@@ -153,15 +158,8 @@ function spotifytips() {
|
||||
setLog(start, 'JSON', error)
|
||||
console.error(error)
|
||||
})
|
||||
.then(function(jsonRaw) {
|
||||
var code = jsonRaw.token
|
||||
localStorage.setItem('spotify-token', code)
|
||||
var json = jsonRaw.data
|
||||
.then(function(json) {
|
||||
var ms = json.progress_ms
|
||||
if(!ms) {
|
||||
tips('ver')
|
||||
return false
|
||||
}
|
||||
var last = 1000 - (ms % 1000)
|
||||
var item = json.item
|
||||
var img = item.album.images[0].url
|
||||
@@ -221,8 +219,6 @@ function spotifytips() {
|
||||
type: 'info',
|
||||
title: lang.lang_spotify_acct
|
||||
})
|
||||
tips('ver')
|
||||
return false
|
||||
}
|
||||
}
|
||||
function spotStart() {
|
||||
@@ -293,4 +289,6 @@ function tipsToggle() {
|
||||
$('#tips').toggleClass('hide')
|
||||
$('#tips-menu').toggleClass('hide')
|
||||
}
|
||||
|
||||
if (localStorage.getItem('tips')) {
|
||||
tips(localStorage.getItem('tips'))
|
||||
}
|
||||
|
@@ -1,65 +1,66 @@
|
||||
'use strict'
|
||||
//プロフ編集
|
||||
//文字系
|
||||
function profedit() {
|
||||
var acct_id = $('#his-data').attr("use-acct")
|
||||
todo("Updating...")
|
||||
var domain = localStorage.getItem("domain_" + acct_id)
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at")
|
||||
var start = "https://" + domain + "/api/v1/accounts/update_credentials"
|
||||
var name = $("#his-name-val").val()
|
||||
var des = $("#his-des-val").val()
|
||||
var httpreq = new XMLHttpRequest()
|
||||
httpreq.open('PATCH', start, true)
|
||||
httpreq.setRequestHeader('Content-Type', 'application/json')
|
||||
httpreq.setRequestHeader('Authorization', 'Bearer ' + at)
|
||||
httpreq.responseType = "json"
|
||||
var acct_id = $('#his-data').attr("use-acct");
|
||||
todo("Updating...");
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
var start = "https://" + domain + "/api/v1/accounts/update_credentials";
|
||||
var name = $("#his-name-val").val();
|
||||
var des = $("#his-des-val").val();
|
||||
var httpreq = new XMLHttpRequest();
|
||||
httpreq.open('PATCH', start, true);
|
||||
httpreq.setRequestHeader('Content-Type', 'application/json');
|
||||
httpreq.setRequestHeader('Authorization', 'Bearer ' + at);
|
||||
httpreq.responseType = "json";
|
||||
httpreq.send(JSON.stringify({
|
||||
display_name: name,
|
||||
note: des,
|
||||
}))
|
||||
}));
|
||||
httpreq.onreadystatechange = function () {
|
||||
if (httpreq.readyState === 4) {
|
||||
$('#his-data').modal('close')
|
||||
todc()
|
||||
$('#his-data').modal('close');
|
||||
todc();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//画像系
|
||||
function imgChange(imgfile, target) {
|
||||
var acct_id = $('#his-data').attr("use-acct")
|
||||
var acct_id = $('#his-data').attr("use-acct");
|
||||
todo("アップロードしています")
|
||||
if (!imgfile.files.length) {
|
||||
console.warn("No Image to upload")
|
||||
return
|
||||
console.warn("No Image to upload");
|
||||
return;
|
||||
}
|
||||
var file = imgfile.files[0]
|
||||
var fr = new FileReader()
|
||||
var file = imgfile.files[0];
|
||||
var fr = new FileReader();
|
||||
fr.onload = function (evt) {
|
||||
var b64 = this.result
|
||||
var blob = toBlob(b64, 'image/png')
|
||||
var fd = new FormData()
|
||||
fd.append(target, blob)
|
||||
var domain = localStorage.getItem("domain_" + acct_id)
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at")
|
||||
var start = "https://" + domain + "/api/v1/accounts/update_credentials"
|
||||
var httpreq = new XMLHttpRequest()
|
||||
httpreq.open('PATCH', start, true)
|
||||
httpreq.upload.addEventListener("progress", progshow, false)
|
||||
httpreq.setRequestHeader('Authorization', 'Bearer ' + at)
|
||||
httpreq.responseType = "json"
|
||||
httpreq.send(fd)
|
||||
var b64 = this.result;
|
||||
var blob = toBlob(b64, 'image/png');
|
||||
var fd = new FormData();
|
||||
fd.append(target, blob);
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
var start = "https://" + domain + "/api/v1/accounts/update_credentials";
|
||||
var httpreq = new XMLHttpRequest();
|
||||
httpreq.open('PATCH', start, true);
|
||||
httpreq.upload.addEventListener("progress", progshow, false);
|
||||
httpreq.setRequestHeader('Authorization', 'Bearer ' + at);
|
||||
httpreq.responseType = "json";
|
||||
httpreq.send(fd);
|
||||
httpreq.onreadystatechange = function () {
|
||||
if (httpreq.readyState === 4) {
|
||||
var json = httpreq.response
|
||||
if(this.status!==200){ setLog(start, this.status, this.response) }
|
||||
$('#his-data').modal('close')
|
||||
todc()
|
||||
localStorage.removeItem("image")
|
||||
var json = httpreq.response;
|
||||
if(this.status!==200){ setLog(start, this.status, this.response); }
|
||||
$('#his-data').modal('close');
|
||||
todc();
|
||||
localStorage.removeItem("image");
|
||||
}
|
||||
}
|
||||
}
|
||||
$("#prof-change").html($("#prof-change").html())
|
||||
$("#header-change").html($("#header-change").html())
|
||||
fr.readAsDataURL(file)
|
||||
$("#prof-change").html($("#prof-change").html());
|
||||
$("#header-change").html($("#header-change").html());
|
||||
fr.readAsDataURL(file);
|
||||
}
|
||||
|
@@ -1,31 +1,32 @@
|
||||
'use strict'
|
||||
//ユーザーデータ表示
|
||||
localStorage.removeItem("history")
|
||||
localStorage.removeItem("history");
|
||||
//コード受信
|
||||
if (location.search) {
|
||||
var m = location.search.match(/\?mode=([a-zA-Z-0-9]+)\&code=(.+)/)
|
||||
var mode = m[1]
|
||||
var codex = m[2]
|
||||
var m = location.search.match(/\?mode=([a-zA-Z-0-9]+)\&code=(.+)/);
|
||||
var mode = m[1];
|
||||
var codex = m[2];
|
||||
if (mode == "user") {
|
||||
udgEx(codex, "main")
|
||||
udgEx(codex, "main");
|
||||
}
|
||||
}
|
||||
function udgEx(user, acct_id) {
|
||||
if (user == "selector") {
|
||||
user = $("#his-acct").attr("fullname")
|
||||
user = $("#his-acct").attr("fullname");
|
||||
}
|
||||
if (acct_id == "selector") {
|
||||
acct_id = $("#user-acct-sel").val()
|
||||
acct_id = $("#user-acct-sel").val();
|
||||
}
|
||||
if (acct_id == "main") {
|
||||
acct_id = localStorage.getItem("main")
|
||||
acct_id = localStorage.getItem("main");
|
||||
}
|
||||
console.log("Get user data of " + user)
|
||||
var domain = localStorage.getItem("domain_" + acct_id)
|
||||
console.log("Get user data of " + user);
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
if (localStorage.getItem("mode_" + domain) == "misskey") {
|
||||
return false
|
||||
return false;
|
||||
}
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at")
|
||||
var start = "https://" + domain + "/api/v2/search?resolve=true&q=" + encodeURIComponent(user)
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
var start = "https://" + domain + "/api/v2/search?resolve=true&q=" + encodeURIComponent(user);
|
||||
fetch(start, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
@@ -36,39 +37,39 @@ function udgEx(user, acct_id) {
|
||||
.then(function(response) {
|
||||
if (!response.ok) {
|
||||
response.text().then(function(text) {
|
||||
setLog(response.url, response.status, text)
|
||||
})
|
||||
setLog(response.url, response.status, text);
|
||||
});
|
||||
}
|
||||
return response.json()
|
||||
return response.json();
|
||||
})
|
||||
.catch(function(error) {
|
||||
todo(error)
|
||||
setLog(start, "JSON", error)
|
||||
console.error(error)
|
||||
todo(error);
|
||||
setLog(start, "JSON", error);
|
||||
console.error(error);
|
||||
})
|
||||
.then(function(json) {
|
||||
if (json.accounts[0]) {
|
||||
var id = json.accounts[0].id
|
||||
udg(id, acct_id)
|
||||
var id = json.accounts[0].id;
|
||||
udg(id, acct_id);
|
||||
} else {
|
||||
postMessage(["openUrl", user], "*")
|
||||
postMessage(["openUrl", user], "*");
|
||||
}
|
||||
})
|
||||
return true
|
||||
});
|
||||
return true;
|
||||
}
|
||||
function udg(user, acct_id) {
|
||||
reset()
|
||||
reset();
|
||||
if (!user) {
|
||||
user = localStorage.getItem("user-id_" + acct_id)
|
||||
user = localStorage.getItem("user-id_" + acct_id);
|
||||
}
|
||||
todo("User Data Loading...")
|
||||
var domain = localStorage.getItem("domain_" + acct_id)
|
||||
todo("User Data Loading...");
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
if (localStorage.getItem("mode_" + domain) == "misskey") {
|
||||
misskeyUdg(user, acct_id)
|
||||
return
|
||||
misskeyUdg(user, acct_id);
|
||||
return;
|
||||
}
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at")
|
||||
var start = "https://" + domain + "/api/v1/accounts/" + user
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
var start = "https://" + domain + "/api/v1/accounts/" + user;
|
||||
fetch(start, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
@@ -79,188 +80,183 @@ function udg(user, acct_id) {
|
||||
.then(function(response) {
|
||||
if (!response.ok) {
|
||||
response.text().then(function(text) {
|
||||
setLog(response.url, response.status, text)
|
||||
})
|
||||
setLog(response.url, response.status, text);
|
||||
});
|
||||
}
|
||||
return response.json()
|
||||
return response.json();
|
||||
})
|
||||
.catch(function(error) {
|
||||
todo(error)
|
||||
setLog(start, "JSON", error)
|
||||
console.error(error)
|
||||
todo(error);
|
||||
setLog(start, "JSON", error);
|
||||
console.error(error);
|
||||
})
|
||||
.then(function(json) {
|
||||
//一つ前のユーザーデータ
|
||||
if (!localStorage.getItem("history")) {
|
||||
$("#his-history-btn").prop("disabled", true)
|
||||
$("#his-history-btn").prop("disabled", true);
|
||||
} else {
|
||||
$("#his-history-btn").prop("disabled", false)
|
||||
$("#his-data").attr("history", localStorage.getItem("history"))
|
||||
$("#his-history-btn").prop("disabled", false);
|
||||
$("#his-data").attr("history", localStorage.getItem("history"));
|
||||
}
|
||||
//moved設定時
|
||||
if (json.moved) {
|
||||
M.toast({
|
||||
html: lang.lang_showontl_movetxt + '<button class="btn-flat toast-action" onclick="udg(\'' + json.moved.id + "','" + acct_id + "')\">" + lang.lang_showontl_movebtn + "</button>",
|
||||
displayLength: 4000
|
||||
})
|
||||
});
|
||||
}
|
||||
$("#his-data").modal("open")
|
||||
$("#his-data").attr("user-id", user)
|
||||
$("#his-data").attr("use-acct", acct_id)
|
||||
$("#his-data").modal("open");
|
||||
$("#his-data").attr("user-id", user);
|
||||
$("#his-data").attr("use-acct", acct_id);
|
||||
if (json.username != json.acct) {
|
||||
//Remote
|
||||
$("#his-data").attr("remote", "true")
|
||||
var fullname = json.acct
|
||||
$("#his-data").attr("remote", "true");
|
||||
var fullname = json.acct;
|
||||
} else {
|
||||
$("#his-data").attr("remote", "false")
|
||||
var fullname = json.acct + "@" + domain
|
||||
$("#his-data").attr("remote", "false");
|
||||
var fullname = json.acct + "@" + domain;
|
||||
}
|
||||
utlShow(json.id, "", acct_id)
|
||||
flw(json.id, "", acct_id)
|
||||
fer(json.id, "", acct_id)
|
||||
var dis_name = escapeHTML(json.display_name)
|
||||
dis_name = twemoji.parse(dis_name)
|
||||
utl(json.id, "", acct_id);
|
||||
flw(json.id, "", acct_id);
|
||||
fer(json.id, "", acct_id);
|
||||
var dis_name = escapeHTML(json.display_name);
|
||||
dis_name = twemoji.parse(dis_name);
|
||||
|
||||
var note = json.note
|
||||
var note = json.note;
|
||||
if (json.emojis) {
|
||||
var actemojick = json.emojis[0]
|
||||
var actemojick = json.emojis[0];
|
||||
} else {
|
||||
var actemojick = false
|
||||
var actemojick = false;
|
||||
}
|
||||
//絵文字があれば
|
||||
if (actemojick) {
|
||||
Object.keys(json.emojis).forEach(function(key5) {
|
||||
var emoji = json.emojis[key5]
|
||||
var shortcode = emoji.shortcode
|
||||
var emoji_url = '<img src="' + emoji.url + '" class="emoji-img" data-emoji="' + shortcode + '" draggable="false">'
|
||||
var regExp = new RegExp(":" + shortcode + ":", "g")
|
||||
dis_name = dis_name.replace(regExp, emoji_url)
|
||||
note = note.replace(regExp, emoji_url)
|
||||
})
|
||||
var emoji = json.emojis[key5];
|
||||
var shortcode = emoji.shortcode;
|
||||
var emoji_url = '<img src="' + emoji.url + '" class="emoji-img" data-emoji="' + shortcode + '" draggable="false">';
|
||||
var regExp = new RegExp(":" + shortcode + ":", "g");
|
||||
dis_name = dis_name.replace(regExp, emoji_url);
|
||||
note = note.replace(regExp, emoji_url);
|
||||
});
|
||||
}
|
||||
//noteの解析
|
||||
//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>';
|
||||
//note=note.replace(/#(\S+)/gi, tags)
|
||||
//note=note.replace(/\s@([a-zA-Z_0-9@.-]+)/gi, mens)
|
||||
$("#his-name").html(dis_name)
|
||||
$("#his-acct").text(json.acct)
|
||||
$("#his-acct").attr("fullname", fullname)
|
||||
$("#his-prof").attr("src", json.avatar)
|
||||
$("#his-data").css("background-image", "url(" + json.header + ")")
|
||||
$("#his-sta").text(json.statuses_count)
|
||||
$("#his-follow").text(json.following_count)
|
||||
var flerc = json.followers_count
|
||||
$("#his-name").html(dis_name);
|
||||
$("#his-acct").text(json.acct);
|
||||
$("#his-acct").attr("fullname", fullname);
|
||||
$("#his-prof").attr("src", json.avatar);
|
||||
$("#his-data").css("background-image", "url(" + json.header + ")");
|
||||
$("#his-sta").text(json.statuses_count);
|
||||
$("#his-follow").text(json.following_count);
|
||||
var flerc = json.followers_count;
|
||||
if (flerc < 0) {
|
||||
flerc = "-"
|
||||
flerc = "-";
|
||||
}
|
||||
$("#his-follower").text(flerc)
|
||||
$("#his-since").text(crat(json.created_at))
|
||||
$("#his-openin").attr("data-href", json.url)
|
||||
$("#his-follower").text(flerc);
|
||||
$("#his-since").text(crat(json.created_at));
|
||||
$("#his-openin").attr("data-href", json.url);
|
||||
if (json.fields) {
|
||||
var table = ""
|
||||
var table = "";
|
||||
if (json.fields.length > 0) {
|
||||
$("#his-des").css("max-height", "250px")
|
||||
table = '<table id="his-field">'
|
||||
$("#his-des").css("max-height", "250px");
|
||||
table = '<table id="his-field">';
|
||||
for (var i = 0; i < json.fields.length; i++) {
|
||||
var fname = json.fields[i].name
|
||||
var fval = json.fields[i].value
|
||||
var fname = json.fields[i].name;
|
||||
var fval = json.fields[i].value;
|
||||
if (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 when = lang.lang_showontl_verified + ":" + crat(json.fields[i].verified_at);
|
||||
var color = "rgba(121,189,154,.25);";
|
||||
} else {
|
||||
var when = ""
|
||||
var color = "inherit"
|
||||
var when = "";
|
||||
var color = "inherit";
|
||||
}
|
||||
table = table + '<tr><td class="his-field-title">' + escapeHTML(fname) + '</td><td class="his-field-content" title="' + when + '" style="background-color:' + color + '">' + fval + "</td></tr>"
|
||||
table = table + '<tr><td class="his-field-title">' + escapeHTML(fname) + '</td><td class="his-field-content" title="' + when + '" style="background-color:' + color + '">' + fval + "</td></tr>";
|
||||
}
|
||||
table = table + "</table>"
|
||||
$("#his-des").html(twemoji.parse(note))
|
||||
table = table + "</table>";
|
||||
$("#his-des").html(twemoji.parse(note));
|
||||
} else {
|
||||
$("#his-des").css("max-height", "400px")
|
||||
$("#his-des").css("max-height", "400px");
|
||||
}
|
||||
$("#his-table").html(twemoji.parse(table))
|
||||
$("#his-table").html(twemoji.parse(table));
|
||||
} else {
|
||||
$("#his-des").css("max-height", "400px")
|
||||
$("#his-des").css("max-height", "400px");
|
||||
}
|
||||
$("#his-des").html(twemoji.parse(note))
|
||||
$("#his-des").html(twemoji.parse(note));
|
||||
if (json.bot) {
|
||||
$("#his-bot").html(lang.lang_showontl_botacct)
|
||||
$("#his-bot").html(lang.lang_showontl_botacct);
|
||||
}
|
||||
$("#his-des").attr("data-acct", acct_id)
|
||||
$("#his-data").css("background-size", "cover")
|
||||
$("#his-float-timeline").css("height", $("#his-data-show").height() + "px")
|
||||
localStorage.setItem("history", user)
|
||||
$("#his-des").attr("data-acct", acct_id);
|
||||
$("#his-data").css("background-size", "cover");
|
||||
$("#his-float-timeline").css("height", $("#his-data-show").height() + "px");
|
||||
localStorage.setItem("history", user);
|
||||
//自分の時
|
||||
if (json.acct == localStorage.getItem("user_" + acct_id)) {
|
||||
showFav("", acct_id)
|
||||
showBlo("", acct_id)
|
||||
showMut("", acct_id)
|
||||
showDom("", acct_id)
|
||||
showReq("", acct_id)
|
||||
showFrl("", acct_id)
|
||||
$("#his-name-val").val(json.display_name)
|
||||
showFav("", acct_id);
|
||||
showBlo("", acct_id);
|
||||
showMut("", acct_id);
|
||||
showDom("", acct_id);
|
||||
showReq("", acct_id);
|
||||
showFrl("", acct_id);
|
||||
$("#his-name-val").val(json.display_name);
|
||||
if (json.fields.length > 0) {
|
||||
if (json.fields[0]) {
|
||||
$("#his-f1-name").val(json.fields[0].name)
|
||||
$("#his-f1-val").val($.strip_tags(json.fields[0].value))
|
||||
$("#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))
|
||||
$("#his-f2-name").val(json.fields[1].name);
|
||||
$("#his-f2-val").val($.strip_tags(json.fields[1].value));
|
||||
}
|
||||
if (json.fields[2]) {
|
||||
$("#his-f3-name").val(json.fields[2].name)
|
||||
$("#his-f3-val").val($.strip_tags(json.fields[2].value))
|
||||
$("#his-f3-name").val(json.fields[2].name);
|
||||
$("#his-f3-val").val($.strip_tags(json.fields[2].value));
|
||||
}
|
||||
if (json.fields[3]) {
|
||||
$("#his-f4-name").val(json.fields[3].name)
|
||||
$("#his-f4-val").val($.strip_tags(json.fields[3].value))
|
||||
$("#his-f4-name").val(json.fields[3].name);
|
||||
$("#his-f4-val").val($.strip_tags(json.fields[3].value));
|
||||
}
|
||||
}
|
||||
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()
|
||||
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();
|
||||
if (localStorage.getItem("main") == acct_id) {
|
||||
$("#his-main-acct").hide()
|
||||
$("#his-main-acct").hide();
|
||||
}
|
||||
} else {
|
||||
relations(user, acct_id)
|
||||
$(".only-my-data").hide()
|
||||
$(".only-his-data").show()
|
||||
}
|
||||
todc()
|
||||
if(json.locked) {
|
||||
$('#his-data').addClass('locked')
|
||||
} else {
|
||||
$('#his-data').removeClass('locked')
|
||||
relations(user, acct_id);
|
||||
$(".only-my-data").hide();
|
||||
$(".only-his-data").show();
|
||||
}
|
||||
todc();
|
||||
//外部データ取得(死かもしれないので)
|
||||
udAdd(acct_id, user, json.url)
|
||||
})
|
||||
udAdd(acct_id, user, json.url);
|
||||
});
|
||||
}
|
||||
function misskeyUdg(user, acct_id) {
|
||||
reset()
|
||||
reset();
|
||||
if (!user) {
|
||||
user = localStorage.getItem("user-id_" + acct_id)
|
||||
user = localStorage.getItem("user-id_" + acct_id);
|
||||
}
|
||||
todo("User Data Loading...")
|
||||
var domain = localStorage.getItem("domain_" + acct_id)
|
||||
todo("User Data Loading...");
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
if (localStorage.getItem("mode_" + domain) != "misskey") {
|
||||
udg(user, acct_id)
|
||||
return
|
||||
udg(user, acct_id);
|
||||
return;
|
||||
}
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at")
|
||||
var start = "https://" + domain + "/api/users/show"
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
var start = "https://" + domain + "/api/users/show";
|
||||
fetch(start, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
@@ -274,127 +270,127 @@ function misskeyUdg(user, acct_id) {
|
||||
.then(function(response) {
|
||||
if (!response.ok) {
|
||||
response.text().then(function(text) {
|
||||
setLog(response.url, response.status, text)
|
||||
})
|
||||
setLog(response.url, response.status, text);
|
||||
});
|
||||
}
|
||||
return response.json()
|
||||
return response.json();
|
||||
})
|
||||
.catch(function(error) {
|
||||
todo(error)
|
||||
setLog(start, "JSON", error)
|
||||
console.error(error)
|
||||
todo(error);
|
||||
setLog(start, "JSON", error);
|
||||
console.error(error);
|
||||
})
|
||||
.then(function(json) {
|
||||
//一つ前のユーザーデータ
|
||||
if (!localStorage.getItem("history")) {
|
||||
$("#his-history-btn").prop("disabled", true)
|
||||
$("#his-history-btn").prop("disabled", true);
|
||||
} else {
|
||||
$("#his-history-btn").prop("disabled", false)
|
||||
$("#his-data").attr("history", localStorage.getItem("history"))
|
||||
$("#his-history-btn").prop("disabled", false);
|
||||
$("#his-data").attr("history", localStorage.getItem("history"));
|
||||
}
|
||||
$("#his-data").modal("open")
|
||||
$("#his-data").attr("user-id", user)
|
||||
$("#his-data").attr("use-acct", acct_id)
|
||||
$("#his-data").modal("open");
|
||||
$("#his-data").attr("user-id", user);
|
||||
$("#his-data").attr("use-acct", acct_id);
|
||||
if (json.host) {
|
||||
//Remote
|
||||
$("#his-data").attr("remote", "false")
|
||||
var fullname = json.username + "@" + json.host
|
||||
$("#his-data").attr("remote", "false");
|
||||
var fullname = json.username + "@" + json.host;
|
||||
} else {
|
||||
$("#his-data").attr("remote", "false")
|
||||
var fullname = json.acct + "@" + domain
|
||||
$("#his-data").attr("remote", "false");
|
||||
var fullname = json.acct + "@" + domain;
|
||||
}
|
||||
utlShow(json.id, "", acct_id)
|
||||
flw(json.id, "", acct_id)
|
||||
fer(json.id, "", acct_id)
|
||||
utl(json.id, "", acct_id);
|
||||
flw(json.id, "", acct_id);
|
||||
fer(json.id, "", acct_id);
|
||||
if (json.name) {
|
||||
var dis_name = escapeHTML(json.name)
|
||||
dis_name = twemoji.parse(dis_name)
|
||||
var dis_name = escapeHTML(json.name);
|
||||
dis_name = twemoji.parse(dis_name);
|
||||
} else {
|
||||
var dis_name = json.name
|
||||
var dis_name = json.name;
|
||||
}
|
||||
$("#his-name").html(dis_name)
|
||||
$("#his-acct").text(json.username)
|
||||
$("#his-acct").attr("fullname", fullname)
|
||||
$("#his-prof").attr("src", json.avatarUrl)
|
||||
$("#his-data").css("background-image", "url(" + json.bannerUrl + ")")
|
||||
$("#his-sta").text(json.notesCount)
|
||||
$("#his-follow").text(json.followingCount)
|
||||
$("#his-follower").text(json.followersCount)
|
||||
$("#his-since").text(crat(json.createdAt))
|
||||
var note = escapeHTML(json.description)
|
||||
$("#his-des").html(twemoji.parse(note))
|
||||
$("#his-name").html(dis_name);
|
||||
$("#his-acct").text(json.username);
|
||||
$("#his-acct").attr("fullname", fullname);
|
||||
$("#his-prof").attr("src", json.avatarUrl);
|
||||
$("#his-data").css("background-image", "url(" + json.bannerUrl + ")");
|
||||
$("#his-sta").text(json.notesCount);
|
||||
$("#his-follow").text(json.followingCount);
|
||||
$("#his-follower").text(json.followersCount);
|
||||
$("#his-since").text(crat(json.createdAt));
|
||||
var note = escapeHTML(json.description);
|
||||
$("#his-des").html(twemoji.parse(note));
|
||||
if (json.isCat) {
|
||||
$("#his-bot").html("Cat" + twemoji.parse("😺"))
|
||||
$("#his-bot").html("Cat" + twemoji.parse("😺"));
|
||||
}
|
||||
$("#his-data").css("background-size", "cover")
|
||||
localStorage.setItem("history", user)
|
||||
$("#his-data").css("background-size", "cover");
|
||||
localStorage.setItem("history", user);
|
||||
//自分の時
|
||||
if (json.username == localStorage.getItem("user_" + acct_id) && !json.host) {
|
||||
//showFav('', acct_id);
|
||||
//showMut('', acct_id);
|
||||
//showReq('', acct_id);
|
||||
showFrl("", acct_id)
|
||||
$("#his-name-val").val(json.name)
|
||||
var des = json.note
|
||||
des = nl2br(des)
|
||||
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()
|
||||
showFrl("", acct_id);
|
||||
$("#his-name-val").val(json.name);
|
||||
var des = json.note;
|
||||
des = nl2br(des);
|
||||
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();
|
||||
if (localStorage.getItem("main") == acct_id) {
|
||||
$("#his-main-acct").hide()
|
||||
$("#his-main-acct").hide();
|
||||
}
|
||||
} else {
|
||||
if (json.isFollowing) {
|
||||
//自分がフォローしている
|
||||
$("#his-data").addClass("following")
|
||||
$("#his-follow-btn-text").text(lang.lang_status_unfollow)
|
||||
hisList(user, acct_id)
|
||||
$("#his-data").addClass("following");
|
||||
$("#his-follow-btn-text").text(lang.lang_status_unfollow);
|
||||
hisList(user, acct_id);
|
||||
} else {
|
||||
$("#his-follow-btn-text").text(lang.lang_status_follow)
|
||||
$("#his-follow-btn-text").text(lang.lang_status_follow);
|
||||
}
|
||||
if (json.isFollowed) {
|
||||
//フォローされてる
|
||||
$("#his-relation").text(lang.lang_showontl_followed)
|
||||
$("#his-relation").text(lang.lang_showontl_followed);
|
||||
}
|
||||
$("#his-block-btn").hide()
|
||||
$("#his-block-btn").hide();
|
||||
if (json.isMuted) {
|
||||
$("#his-data").addClass("muting")
|
||||
$("#his-mute-btn-text").text(lang.lang_status_unmute)
|
||||
$("#his-data").addClass("muting");
|
||||
$("#his-mute-btn-text").text(lang.lang_status_unmute);
|
||||
} else {
|
||||
$("#his-mute-btn-text").text(lang.lang_status_mute)
|
||||
$("#his-mute-btn-text").text(lang.lang_status_mute);
|
||||
}
|
||||
$(".only-my-data").hide()
|
||||
$(".only-his-data").show()
|
||||
$(".only-my-data").hide();
|
||||
$(".only-his-data").show();
|
||||
}
|
||||
todc()
|
||||
})
|
||||
todc();
|
||||
});
|
||||
}
|
||||
//一つ前のユーザーデータ表示
|
||||
function historyShow() {
|
||||
var acct_id = $("#his-data").attr("use-acct")
|
||||
var user = $("#his-data").attr("history")
|
||||
udg(user, acct_id, "true")
|
||||
var acct_id = $("#his-data").attr("use-acct");
|
||||
var user = $("#his-data").attr("history");
|
||||
udg(user, acct_id, "true");
|
||||
}
|
||||
//選択アカウントのプロフ
|
||||
function profShow() {
|
||||
var acct_id = $("#post-acct-sel").val()
|
||||
var user = localStorage.getItem("user-id_" + acct_id)
|
||||
udg(user, acct_id)
|
||||
hide()
|
||||
var acct_id = $("#post-acct-sel").val();
|
||||
var user = localStorage.getItem("user-id_" + acct_id);
|
||||
udg(user, acct_id);
|
||||
hide();
|
||||
}
|
||||
|
||||
//FF関係取得
|
||||
function relations(user, acct_id) {
|
||||
var domain = localStorage.getItem("domain_" + acct_id)
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at")
|
||||
var start = "https://" + domain + "/api/v1/accounts/relationships?id=" + user
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
var start = "https://" + domain + "/api/v1/accounts/relationships?id=" + user;
|
||||
fetch(start, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
@@ -405,158 +401,151 @@ function relations(user, acct_id) {
|
||||
.then(function(response) {
|
||||
if (!response.ok) {
|
||||
response.text().then(function(text) {
|
||||
setLog(response.url, response.status, text)
|
||||
})
|
||||
setLog(response.url, response.status, text);
|
||||
});
|
||||
}
|
||||
return response.json()
|
||||
return response.json();
|
||||
})
|
||||
.catch(function(error) {
|
||||
todo(error)
|
||||
setLog(start, "JSON", error)
|
||||
console.error(error)
|
||||
todo(error);
|
||||
setLog(start, "JSON", error);
|
||||
console.error(error);
|
||||
})
|
||||
.then(function(json) {
|
||||
var json = json[0]
|
||||
if(json.requested) {
|
||||
//フォロリク中
|
||||
$('#his-data').addClass('following')
|
||||
$("#his-follow-btn-text").text(lang.lang_status_requesting)
|
||||
}
|
||||
var json = json[0];
|
||||
if (json.following) {
|
||||
//自分がフォローしている
|
||||
$("#his-data").addClass("following")
|
||||
$("#his-follow-btn-text").text(lang.lang_status_unfollow)
|
||||
hisList(user, acct_id)
|
||||
$("#his-data").addClass("following");
|
||||
$("#his-follow-btn-text").text(lang.lang_status_unfollow);
|
||||
hisList(user, acct_id);
|
||||
} else {
|
||||
$("#his-follow-btn-text").text(lang.lang_status_follow)
|
||||
$("#his-follow-btn-text").text(lang.lang_status_follow);
|
||||
}
|
||||
if (json.followed_by) {
|
||||
//フォローされてる
|
||||
$("#his-relation").text(lang.lang_showontl_followed)
|
||||
$("#his-relation").text(lang.lang_showontl_followed);
|
||||
}
|
||||
if (json.blocking) {
|
||||
$("#his-data").addClass("blocking")
|
||||
$("#his-block-btn-text").text(lang.lang_status_unblock)
|
||||
$("#his-data").addClass("blocking");
|
||||
$("#his-block-btn-text").text(lang.lang_status_unblock);
|
||||
} else {
|
||||
$("#his-block-btn-text").text(lang.lang_status_block)
|
||||
$("#his-block-btn-text").text(lang.lang_status_block);
|
||||
}
|
||||
if (json.muting) {
|
||||
$("#his-data").addClass("muting")
|
||||
$("#his-mute-btn-text").text(lang.lang_status_unmute)
|
||||
$("#his-data").addClass("muting");
|
||||
$("#his-mute-btn-text").text(lang.lang_status_unmute);
|
||||
} else {
|
||||
$("#his-mute-btn-text").text(lang.lang_status_mute)
|
||||
$("#his-mute-btn-text").text(lang.lang_status_mute);
|
||||
}
|
||||
if (json.muting_notifications) {
|
||||
$("#his-data").addClass("mutingNotf")
|
||||
$("#his-notf-btn-text").text(lang.lang_showontl_notf + lang.lang_status_unmute)
|
||||
$("#his-data").addClass("mutingNotf");
|
||||
$("#his-notf-btn-text").text(lang.lang_showontl_notf + lang.lang_status_unmute);
|
||||
} else {
|
||||
$("#his-notf-btn-text").text(lang.lang_showontl_notf + lang.lang_status_mute)
|
||||
$("#his-notf-btn-text").text(lang.lang_showontl_notf + lang.lang_status_mute);
|
||||
}
|
||||
if (json.domain_blocking) {
|
||||
$("#his-data").addClass("blockingDom")
|
||||
$("#his-domain-btn-text").text(lang.lang_showontl_domain + lang.lang_status_unblock)
|
||||
$("#his-data").addClass("blockingDom");
|
||||
$("#his-domain-btn-text").text(lang.lang_showontl_domain + lang.lang_status_unblock);
|
||||
} else {
|
||||
$("#his-domain-btn-text").text(lang.lang_showontl_domain + lang.lang_status_block)
|
||||
$("#his-domain-btn-text").text(lang.lang_showontl_domain + lang.lang_status_block);
|
||||
}
|
||||
//Endorsed
|
||||
if (json.endorsed) {
|
||||
$("#his-end-btn").addClass("endorsed")
|
||||
$("#his-end-btn-text").text(lang.lang_status_unendorse)
|
||||
$("#his-end-btn").addClass("endorsed");
|
||||
$("#his-end-btn-text").text(lang.lang_status_unendorse);
|
||||
} else {
|
||||
$("#his-end-btn").removeClass("endorsed")
|
||||
$("#his-end-btn-text").text(lang.lang_status_endorse)
|
||||
$("#his-end-btn").removeClass("endorsed");
|
||||
$("#his-end-btn-text").text(lang.lang_status_endorse);
|
||||
}
|
||||
//Blocked
|
||||
if (json.blocked_by) {
|
||||
$("#my-data-nav .btn").addClass("disabled")
|
||||
$(".his-var-content").hide()
|
||||
$("#his-float-blocked").show()
|
||||
$("#his-follow-btn").hide()
|
||||
$("#my-data-nav .btn").addClass("disabled");
|
||||
$(".his-var-content").hide();
|
||||
$("#his-float-blocked").show();
|
||||
$("#his-follow-btn").hide();
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
function profbrws() {
|
||||
var url = $("#his-openin").attr("data-href")
|
||||
postMessage(["openUrl", url], "*")
|
||||
var url = $("#his-openin").attr("data-href");
|
||||
postMessage(["openUrl", url], "*");
|
||||
}
|
||||
function setMain() {
|
||||
var acct_id = $("#his-data").attr("use-acct")
|
||||
localStorage.setItem("main", acct_id)
|
||||
multiSelector(true)
|
||||
M.toast({ html: lang.lang_manager_mainAcct, displayLength: 3000 })
|
||||
var acct_id = $("#his-data").attr("use-acct");
|
||||
localStorage.setItem("main", acct_id);
|
||||
multiSelector(true);
|
||||
M.toast({ html: lang.lang_manager_mainAcct, displayLength: 3000 });
|
||||
}
|
||||
//オールリセット
|
||||
function hisclose() {
|
||||
$("#his-data").modal("close")
|
||||
reset()
|
||||
$("#his-data").attr("history", "")
|
||||
localStorage.removeItem("history")
|
||||
$("#his-data").modal("close");
|
||||
reset();
|
||||
$("#his-data").attr("history", "");
|
||||
localStorage.removeItem("history");
|
||||
}
|
||||
function reset() {
|
||||
$(".his-var-content:eq(0)").show()
|
||||
$(".his-var-content:gt(0)").hide()
|
||||
$("#my-data-nav .btn").removeClass("disabled")
|
||||
$(".active-back").removeClass("active-back")
|
||||
$(".column-first").addClass("active-back")
|
||||
$("#his-name").text("Loading")
|
||||
$("#his-acct").text("")
|
||||
$("#his-prof").attr("src", "../../img/loading.svg")
|
||||
$("#his-data").css("background-image", "url(../../img/loading.svg)")
|
||||
$("#his-sta").text("")
|
||||
$("#his-follow").text("")
|
||||
$("#his-follower").text("")
|
||||
$("#his-des").html("")
|
||||
$("#his-data").css("background-size", "cover")
|
||||
$("#his-since").text("")
|
||||
$("#his-data").removeClass("following")
|
||||
$("#his-data").removeClass("muting")
|
||||
$("#his-data").removeClass("blocking")
|
||||
$("#his-data").removeClass("mutingNotf")
|
||||
$("#his-data").removeClass("blockingDom")
|
||||
$("#his-end-btn").removeClass("endorsed")
|
||||
$("#his-des").css("max-height", "250px")
|
||||
$("#his-bot").html("")
|
||||
$("#his-follow-btn").show()
|
||||
$("#his-block-btn").show()
|
||||
$("#his-mute-btn").show()
|
||||
$("#his-notf-btn").show()
|
||||
$("#his-domain-btn").show()
|
||||
$("#his-emp-btn").show()
|
||||
$("#his-follow-btn-text").text(lang.lang_status_follow)
|
||||
$("#his-mute-btn-text").text(lang.lang_status_mute)
|
||||
$("#his-block-btn-text").text(lang.lang_status_block)
|
||||
$("#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-relation").text("")
|
||||
$(".cont-series").html("")
|
||||
$("#domainblock").val("")
|
||||
$("#his-lists-a").html(lang.lang_showontl_listwarn)
|
||||
$("#his-lists-b").html("")
|
||||
$("#his-name-val").val("")
|
||||
$("#his-des-val").val("")
|
||||
$("#his-f1-name").val("")
|
||||
$("#his-f1-val").val("")
|
||||
$("#his-f2-name").val("")
|
||||
$("#his-f2-val").val("")
|
||||
$("#his-f3-name").val("")
|
||||
$("#his-f3-val").val("")
|
||||
$("#his-f4-name").val("")
|
||||
$("#his-f4-val").val("")
|
||||
$("#his-endorse").html("")
|
||||
$("#his-openin").attr("data-href", "")
|
||||
$("#his-float-timeline").show()
|
||||
$("#his-float-blocked").hide()
|
||||
$("#his-main-acct").show()
|
||||
$("#his-proof-prof").html("")
|
||||
$('#his-data').removeClass('locked')
|
||||
$('#his-data').removeClass('requesting')
|
||||
$(".his-var-content:eq(0)").show();
|
||||
$(".his-var-content:gt(0)").hide();
|
||||
$("#my-data-nav .btn").removeClass("disabled");
|
||||
$(".active-back").removeClass("active-back");
|
||||
$(".column-first").addClass("active-back");
|
||||
$("#his-name").text("Loading");
|
||||
$("#his-acct").text("");
|
||||
$("#his-prof").attr("src", "../../img/loading.svg");
|
||||
$("#his-data").css("background-image", "url(../../img/loading.svg)");
|
||||
$("#his-sta").text("");
|
||||
$("#his-follow").text("");
|
||||
$("#his-follower").text("");
|
||||
$("#his-des").html("");
|
||||
$("#his-data").css("background-size", "cover");
|
||||
$("#his-since").text("");
|
||||
$("#his-data").removeClass("following");
|
||||
$("#his-data").removeClass("muting");
|
||||
$("#his-data").removeClass("blocking");
|
||||
$("#his-data").removeClass("mutingNotf");
|
||||
$("#his-data").removeClass("blockingDom");
|
||||
$("#his-end-btn").removeClass("endorsed");
|
||||
$("#his-des").css("max-height", "250px");
|
||||
$("#his-bot").html("");
|
||||
$("#his-follow-btn").show();
|
||||
$("#his-block-btn").show();
|
||||
$("#his-mute-btn").show();
|
||||
$("#his-notf-btn").show();
|
||||
$("#his-domain-btn").show();
|
||||
$("#his-emp-btn").show();
|
||||
$("#his-follow-btn-text").text(lang.lang_status_follow);
|
||||
$("#his-mute-btn-text").text(lang.lang_status_mute);
|
||||
$("#his-block-btn-text").text(lang.lang_status_block);
|
||||
$("#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-relation").text("");
|
||||
$(".cont-series").html("");
|
||||
$("#domainblock").val("");
|
||||
$("#his-lists-a").html(lang.lang_showontl_listwarn);
|
||||
$("#his-lists-b").html("");
|
||||
$("#his-name-val").val("");
|
||||
$("#his-des-val").val("");
|
||||
$("#his-f1-name").val("");
|
||||
$("#his-f1-val").val("");
|
||||
$("#his-f2-name").val("");
|
||||
$("#his-f2-val").val("");
|
||||
$("#his-f3-name").val("");
|
||||
$("#his-f3-val").val("");
|
||||
$("#his-f4-name").val("");
|
||||
$("#his-f4-val").val("");
|
||||
$("#his-endorse").html("");
|
||||
$("#his-openin").attr("data-href", "");
|
||||
$("#his-float-timeline").show();
|
||||
$("#his-float-blocked").hide();
|
||||
$("#his-main-acct").show();
|
||||
$("#his-proof-prof").html("");
|
||||
}
|
||||
$("#my-data-nav .anc-link").on("click", function() {
|
||||
var target = $(this).attr("go")
|
||||
var target = $(this).attr("go");
|
||||
if (target) {
|
||||
$("#my-data-nav .anc-link").removeClass("active-back")
|
||||
$(this).addClass("active-back")
|
||||
$(target).show()
|
||||
$(".his-var-content:not(" + target + ")").hide()
|
||||
$("#my-data-nav .anc-link").removeClass("active-back");
|
||||
$(this).addClass("active-back");
|
||||
$(target).show();
|
||||
$(".his-var-content:not(" + target + ")").hide();
|
||||
}
|
||||
})
|
||||
});
|
||||
|
238
app/main.js
@@ -3,10 +3,6 @@ var dir = 'file://' + __dirname
|
||||
var base = dir + '/view/'
|
||||
// Electronのモジュール
|
||||
const electron = require('electron')
|
||||
// アプリケーションをコントロールするモジュール
|
||||
const app = electron.app
|
||||
// Electronの初期化完了後に実行
|
||||
app.on('ready', createWindow)
|
||||
const fs = require('fs')
|
||||
const language = require('./main/language.js')
|
||||
const css = require('./main/css.js')
|
||||
@@ -16,6 +12,9 @@ const np = require('./main/np.js')
|
||||
const systemFunc = require('./main/system.js')
|
||||
const Menu = electron.Menu
|
||||
const join = require('path').join
|
||||
|
||||
// アプリケーションをコントロールするモジュール
|
||||
const app = electron.app
|
||||
// ウィンドウを作成するモジュール
|
||||
const BrowserWindow = electron.BrowserWindow
|
||||
// メインウィンドウはGCされないようにグローバル宣言
|
||||
@@ -37,70 +36,9 @@ if (!gotTheLock) {
|
||||
})
|
||||
}
|
||||
|
||||
// 全てのウィンドウが閉じたら終了
|
||||
app.on('window-all-closed', function () {
|
||||
electron.session.defaultSession.clearCache(() => {})
|
||||
app.quit()
|
||||
})
|
||||
function isFile(file) {
|
||||
try {
|
||||
fs.statSync(file)
|
||||
return true
|
||||
} catch (err) {
|
||||
if (err.code === 'ENOENT') return false
|
||||
}
|
||||
}
|
||||
function createWindow() {
|
||||
var lang_path = join(app.getPath('userData'), 'language')
|
||||
if (isFile(lang_path)) {
|
||||
var lang = fs.readFileSync(lang_path, 'utf8')
|
||||
} else {
|
||||
var langs = app.getLocale()
|
||||
console.log(langs)
|
||||
if (~langs.indexOf('ja')) {
|
||||
lang = 'ja'
|
||||
} else if (~langs.indexOf('de')) {
|
||||
lang = 'de'
|
||||
} else if (~langs.indexOf('cs')) {
|
||||
lang = 'cs'
|
||||
} else if (~langs.indexOf('bg')) {
|
||||
lang = 'bg'
|
||||
} else {
|
||||
lang = 'en'
|
||||
}
|
||||
fs.mkdir(app.getPath('userData'), function (err) {
|
||||
fs.writeFileSync(lang_path, lang)
|
||||
})
|
||||
}
|
||||
if (!packaged) console.log('your lang:' + app.getLocale())
|
||||
if (!packaged) console.log('launch:' + lang)
|
||||
//Opening
|
||||
const package = fs.readFileSync(__dirname + '/package.json')
|
||||
if(lang == 'ja') {
|
||||
const maxims = JSON.parse(fs.readFileSync(__dirname + '/maxim.ja.json'))
|
||||
var show = maxims[Math.floor(Math.random() * maxims.length)]
|
||||
} else if(lang == 'ja-KS') {
|
||||
//ja-KSも作れたらいいね
|
||||
const maxims = JSON.parse(fs.readFileSync(__dirname + '/maxim.ja.json'))
|
||||
var show = maxims[Math.floor(Math.random() * maxims.length)]
|
||||
} else{
|
||||
var show = 'TheDesk 2018'
|
||||
}
|
||||
const data = JSON.parse(package)
|
||||
const version = data.version
|
||||
const codename = data.codename
|
||||
var openingWindow = new BrowserWindow({
|
||||
width: 300,
|
||||
height: 400,
|
||||
transparent: false,
|
||||
frame: false,
|
||||
resizable: false,
|
||||
})
|
||||
openingWindow.loadURL(`${__dirname}/opening.html?ver=${version}&codename=${codename}&maxim=${encodeURI(show)}`)
|
||||
|
||||
if (process.argv.indexOf('--dev') === -1) {
|
||||
if (process.argv.indexOf('--dev') === -1) {
|
||||
var packaged = true
|
||||
} else {
|
||||
} else {
|
||||
var packaged = false
|
||||
console.log(
|
||||
'||\\\\\\ \n' +
|
||||
@@ -117,85 +55,128 @@ function createWindow() {
|
||||
'|||| /////\n' +
|
||||
'||||//////'
|
||||
)
|
||||
console.log('If it does not show the window, you might forget `npm run construct`.')
|
||||
}
|
||||
|
||||
var info_path = join(app.getPath('userData'), 'window-size.json')
|
||||
var max_info_path = join(app.getPath('userData'), 'max-window-size.json')
|
||||
var ha_path = join(app.getPath('userData'), 'hardwareAcceleration')
|
||||
var ua_path = join(app.getPath('userData'), 'useragent')
|
||||
var frame_path = join(app.getPath('userData'), 'frame')
|
||||
try {
|
||||
console.log('Welcome!')
|
||||
}
|
||||
var info_path = join(app.getPath('userData'), 'window-size.json')
|
||||
var max_info_path = join(app.getPath('userData'), 'max-window-size.json')
|
||||
var lang_path = join(app.getPath('userData'), 'language')
|
||||
var ha_path = join(app.getPath('userData'), 'hardwareAcceleration')
|
||||
var ua_path = join(app.getPath('userData'), 'useragent')
|
||||
try {
|
||||
fs.readFileSync(ha_path, 'utf8')
|
||||
app.disableHardwareAcceleration()
|
||||
if (!packaged) console.log('disabled: Hardware Acceleration')
|
||||
} catch {
|
||||
} catch {
|
||||
if (!packaged) console.log('enabled: Hardware Acceleration')
|
||||
}
|
||||
var window_size
|
||||
try {
|
||||
}
|
||||
var window_size
|
||||
try {
|
||||
window_size = JSON.parse(fs.readFileSync(info_path, 'utf8'))
|
||||
} catch (e) {
|
||||
} catch (e) {
|
||||
window_size = {
|
||||
width: 1000,
|
||||
height: 750,
|
||||
height: 750
|
||||
} // デフォルトバリュー
|
||||
}
|
||||
var max_window_size
|
||||
try {
|
||||
}
|
||||
var max_window_size
|
||||
try {
|
||||
max_window_size = JSON.parse(fs.readFileSync(max_info_path, 'utf8'))
|
||||
} catch (e) {
|
||||
} catch (e) {
|
||||
max_window_size = {
|
||||
width: 'string',
|
||||
height: 'string',
|
||||
x: 'string',
|
||||
y: 'string',
|
||||
y: 'string'
|
||||
} // デフォルトバリュー
|
||||
}
|
||||
|
||||
}
|
||||
function isFile(file) {
|
||||
try {
|
||||
var frameRaw = fs.readFileSync(frame_path, 'utf8')
|
||||
if (frameRaw == 'false') {
|
||||
var frame = false
|
||||
var frameTitle = 'hidden'
|
||||
fs.statSync(file)
|
||||
return true
|
||||
} catch (err) {
|
||||
if (err.code === 'ENOENT') return false
|
||||
}
|
||||
}
|
||||
// 全てのウィンドウが閉じたら終了
|
||||
app.on('window-all-closed', function() {
|
||||
electron.session.defaultSession.clearCache(() => {})
|
||||
app.quit()
|
||||
})
|
||||
function createWindow() {
|
||||
if (isFile(lang_path)) {
|
||||
var lang = fs.readFileSync(lang_path, 'utf8')
|
||||
} else {
|
||||
var frame = true
|
||||
var frameTitle = 'default'
|
||||
var langs = app.getLocale()
|
||||
console.log(langs)
|
||||
if (~langs.indexOf('ja')) {
|
||||
lang = 'ja'
|
||||
} else if (~langs.indexOf('de')) {
|
||||
lang = 'de'
|
||||
} else if (~langs.indexOf('cs')) {
|
||||
lang = 'cs'
|
||||
} else if (~langs.indexOf('bg')) {
|
||||
lang = 'bg'
|
||||
} else {
|
||||
lang = 'en'
|
||||
}
|
||||
} catch {
|
||||
var frame = true
|
||||
fs.mkdir(app.getPath('userData'), function(err) {
|
||||
fs.writeFileSync(lang_path, lang)
|
||||
})
|
||||
}
|
||||
if (!packaged) console.log('your lang:' + app.getLocale())
|
||||
if (!packaged) console.log('launch:' + lang)
|
||||
// メイン画面の表示。ウィンドウの幅、高さを指定できる
|
||||
var platform = process.platform
|
||||
var bit = process.arch
|
||||
if (platform == 'linux') {
|
||||
var arg = {
|
||||
webPreferences: {
|
||||
webviewTag: true,
|
||||
nodeIntegration: false,
|
||||
contextIsolation: true,
|
||||
preload: join(__dirname, 'js', 'platform', 'preload.js'),
|
||||
preload: join(__dirname, 'js', 'platform', 'preload.js')
|
||||
},
|
||||
width: window_size.width,
|
||||
height: window_size.height,
|
||||
x: window_size.x,
|
||||
y: window_size.y,
|
||||
show: false,
|
||||
frame: frame,
|
||||
icon: __dirname + '/desk.png',
|
||||
show: false
|
||||
}
|
||||
if (platform == 'linux') {
|
||||
arg.resizable = true
|
||||
arg.icon = __dirname + '/desk.png'
|
||||
} else if (platform == 'win32') {
|
||||
arg.simpleFullscreen = true
|
||||
var arg = {
|
||||
webPreferences: {
|
||||
webviewTag: true,
|
||||
nodeIntegration: false,
|
||||
contextIsolation: true,
|
||||
preload: join(__dirname, 'js', 'platform', 'preload.js')
|
||||
},
|
||||
width: window_size.width,
|
||||
height: window_size.height,
|
||||
x: window_size.x,
|
||||
y: window_size.y,
|
||||
simpleFullscreen: true,
|
||||
show: false
|
||||
}
|
||||
} else if (platform == 'darwin') {
|
||||
arg.simpleFullscreen = true
|
||||
arg.titleBarStyle = frameTitle
|
||||
var arg = {
|
||||
webPreferences: {
|
||||
webviewTag: true,
|
||||
nodeIntegration: false,
|
||||
contextIsolation: true,
|
||||
preload: join(__dirname, 'js', 'platform', 'preload.js')
|
||||
},
|
||||
width: window_size.width,
|
||||
height: window_size.height,
|
||||
x: window_size.x,
|
||||
y: window_size.y,
|
||||
simpleFullscreen: true,
|
||||
show: false
|
||||
}
|
||||
}
|
||||
mainWindow = new BrowserWindow(arg)
|
||||
mainWindow.once('page-title-updated', () => {
|
||||
openingWindow.close()
|
||||
mainWindow.show()
|
||||
console.log('Accessibility: ' + app.accessibilitySupportEnabled)
|
||||
if (window_size.max) {
|
||||
mainWindow.maximize()
|
||||
}
|
||||
@@ -226,35 +207,40 @@ function createWindow() {
|
||||
// Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) thedesk/18.11.3 Chrome/76.0.3809.146 Electron/6.0.12 Safari/537.36
|
||||
const crypto = require('crypto')
|
||||
const N = 100
|
||||
var ua = 'Mastodon client: ' + crypto.randomBytes(N).toString('base64').substring(0, N)
|
||||
var ua =
|
||||
'Mastodon client: ' +
|
||||
crypto
|
||||
.randomBytes(N)
|
||||
.toString('base64')
|
||||
.substring(0, N)
|
||||
}
|
||||
mainWindow.loadURL(base + lang + '/index.html' + plus, { userAgent: ua })
|
||||
if (!window_size.x && !window_size.y) {
|
||||
mainWindow.center()
|
||||
}
|
||||
// ウィンドウが閉じられたらアプリも終了
|
||||
mainWindow.on('closed', function () {
|
||||
mainWindow.on('closed', function() {
|
||||
electron.ipcMain.removeAllListeners()
|
||||
mainWindow = null
|
||||
})
|
||||
closeArg = false
|
||||
mainWindow.on('close', function (e, arg) {
|
||||
mainWindow.on('close', function(e, arg) {
|
||||
writePos(mainWindow)
|
||||
if (!closeArg) {
|
||||
e.preventDefault()
|
||||
}
|
||||
const promise = new Promise(function (resolve) {
|
||||
const promise = new Promise(function(resolve) {
|
||||
mainWindow.webContents.send('asReadEnd', '')
|
||||
setTimeout(function () {
|
||||
setTimeout(function() {
|
||||
resolve()
|
||||
}, 3000)
|
||||
})
|
||||
promise.then(function (response) {
|
||||
promise.then(function(response) {
|
||||
closeArg = true
|
||||
mainWindow.close()
|
||||
})
|
||||
})
|
||||
electron.ipcMain.on('sendMarkersComplete', function (e, arg) {
|
||||
electron.ipcMain.on('sendMarkersComplete', function(e, arg) {
|
||||
closeArg = true
|
||||
mainWindow.close()
|
||||
})
|
||||
@@ -270,33 +256,32 @@ function createWindow() {
|
||||
height: mainWindow.getBounds().height,
|
||||
x: mainWindow.getBounds().x,
|
||||
y: mainWindow.getBounds().y,
|
||||
max: true,
|
||||
max: true
|
||||
}
|
||||
} else {
|
||||
var size = {
|
||||
width: mainWindow.getBounds().width,
|
||||
height: mainWindow.getBounds().height,
|
||||
x: mainWindow.getBounds().x,
|
||||
y: mainWindow.getBounds().y,
|
||||
y: mainWindow.getBounds().y
|
||||
}
|
||||
}
|
||||
fs.writeFileSync(info_path, JSON.stringify(size))
|
||||
}
|
||||
mainWindow.on('maximize', function () {
|
||||
mainWindow.on('maximize', function() {
|
||||
writePos(mainWindow)
|
||||
fs.writeFileSync(max_info_path, JSON.stringify(mainWindow.getBounds()))
|
||||
})
|
||||
mainWindow.on('minimize', function () {
|
||||
mainWindow.on('minimize', function() {
|
||||
writePos(mainWindow)
|
||||
mainWindow.webContents.send('asRead', '')
|
||||
})
|
||||
|
||||
var platform = process.platform
|
||||
var bit = process.arch
|
||||
Menu.setApplicationMenu(Menu.buildFromTemplate(language.template(lang, mainWindow, packaged, dir, dirname, frame)))
|
||||
if (!frame) {
|
||||
mainWindow.setMenu(null)
|
||||
}
|
||||
Menu.setApplicationMenu(
|
||||
Menu.buildFromTemplate(language.template(lang, mainWindow, packaged, dir, dirname))
|
||||
)
|
||||
//CSS
|
||||
css.css(mainWindow)
|
||||
//アップデータとダウンロード
|
||||
@@ -307,7 +292,7 @@ function createWindow() {
|
||||
np.TheDeskNowPlaying(mainWindow)
|
||||
//その他system
|
||||
systemFunc.system(mainWindow, dir, lang, dirname)
|
||||
setInterval(function () {
|
||||
setInterval(function() {
|
||||
mouseTrack(mainWindow)
|
||||
}, 1000)
|
||||
}
|
||||
@@ -333,5 +318,10 @@ function mouseTrack(mainWindow) {
|
||||
x = xNow
|
||||
y = yNow
|
||||
}
|
||||
// Electronの初期化完了後に実行
|
||||
app.on('ready', createWindow)
|
||||
var onError = function(err, response) {
|
||||
console.error(err, response)
|
||||
}
|
||||
|
||||
app.setAsDefaultProtocolClient('thedesk')
|
||||
|
156
app/main/dl.js
@@ -1,138 +1,126 @@
|
||||
function dl(mainWindow, lang_path, base, dirname) {
|
||||
const electron = require('electron')
|
||||
const shell = electron.shell
|
||||
const fs = require('fs')
|
||||
const { download } = require('electron-dl')
|
||||
const BrowserWindow = electron.BrowserWindow
|
||||
const dialog = electron.dialog
|
||||
var updatewin = null
|
||||
var ipc = electron.ipcMain
|
||||
const app = electron.app
|
||||
const join = require('path').join
|
||||
ipc.on('update', function(e, x, y) {
|
||||
var platform = process.platform
|
||||
var bit = process.arch
|
||||
if (platform != 'others') {
|
||||
const electron = require("electron");
|
||||
const shell = electron.shell;
|
||||
const fs = require("fs");
|
||||
const { download } = require('electron-dl');
|
||||
const BrowserWindow = electron.BrowserWindow;
|
||||
const dialog = electron.dialog;
|
||||
var updatewin = null;
|
||||
var ipc = electron.ipcMain;
|
||||
const app = electron.app;
|
||||
const join = require('path').join;
|
||||
ipc.on('update', function (e, x, y) {
|
||||
|
||||
var platform = process.platform;
|
||||
var bit = process.arch;
|
||||
if (platform != "others") {
|
||||
updatewin = new BrowserWindow({
|
||||
webPreferences: {
|
||||
webviewTag: false,
|
||||
nodeIntegration: false,
|
||||
contextIsolation: true,
|
||||
preload: join(dirname, 'js', 'platform', 'preload.js')
|
||||
preload: join(dirname,"js", "platform", "preload.js")
|
||||
},
|
||||
width: 600,
|
||||
height: 400,
|
||||
transparent: false, // ウィンドウの背景を透過
|
||||
frame: false, // 枠の無いウィンドウ
|
||||
resizable: false,
|
||||
show: false
|
||||
"transparent": false, // ウィンドウの背景を透過
|
||||
"frame": false, // 枠の無いウィンドウ
|
||||
"resizable": false
|
||||
})
|
||||
var lang = fs.readFileSync(lang_path, 'utf8')
|
||||
//updatewin.toggleDevTools()
|
||||
updatewin.loadURL(base + lang + '/update.html')
|
||||
updatewin.webContents.once('dom-ready', () => {
|
||||
updatewin.show()
|
||||
})
|
||||
return 'true'
|
||||
var lang = fs.readFileSync(lang_path, 'utf8');
|
||||
updatewin.loadURL(base + lang + '/update.html');
|
||||
return "true"
|
||||
} else {
|
||||
return false
|
||||
return false;
|
||||
}
|
||||
})
|
||||
//アプデDL
|
||||
ipc.on('download-btn', async (e, args) => {
|
||||
ipc.on('download-btn', (e, args) => {
|
||||
function dl(url, file, dir, e) {
|
||||
e.sender.webContents.send('mess', 'Start...')
|
||||
|
||||
e.sender.webContents.send('mess', "ダウンロードを開始します。");
|
||||
const opts = {
|
||||
directory: dir,
|
||||
filename: file,
|
||||
openFolderWhenDone: true,
|
||||
onProgress: function(event) {
|
||||
e.sender.webContents.send('prog', [event, args[2]])
|
||||
onProgress: function (event) {
|
||||
e.sender.webContents.send('prog', event);
|
||||
},
|
||||
saveAs: false
|
||||
}
|
||||
download(updatewin, url, opts)
|
||||
};
|
||||
download(updatewin,
|
||||
url, opts)
|
||||
.then(dl => {
|
||||
e.sender.webContents.send('mess', 'ダウンロードが完了しました。')
|
||||
app.quit()
|
||||
e.sender.webContents.send('mess', "ダウンロードが完了しました。");
|
||||
app.quit();
|
||||
})
|
||||
.catch(console.error)
|
||||
.catch(console.error);
|
||||
}
|
||||
var platform = process.platform
|
||||
var bit = process.arch
|
||||
var options = {
|
||||
var platform = process.platform;
|
||||
var bit = process.arch;
|
||||
dialog.showSaveDialog(null, {
|
||||
title: 'Save',
|
||||
defaultPath: app.getPath('home') + '/' + args[1]
|
||||
}
|
||||
const file = await dialog.showSaveDialog(null, options)
|
||||
const savedFiles = file.filePath
|
||||
console.log(savedFiles)
|
||||
defaultPath: app.getPath('home') + "/" + args[1]
|
||||
}, (savedFiles) => {
|
||||
console.log(savedFiles);
|
||||
if (!savedFiles) {
|
||||
return false
|
||||
return false;
|
||||
}
|
||||
if (platform == 'win32') {
|
||||
var m = savedFiles.match(/(.+)\\(.+)$/)
|
||||
if (platform == "win32") {
|
||||
var m = savedFiles.match(/(.+)\\(.+)$/);
|
||||
} else {
|
||||
var m = savedFiles.match(/(.+)\/(.+)$/)
|
||||
var m = savedFiles.match(/(.+)\/(.+)$/);
|
||||
}
|
||||
//console.log(m);
|
||||
if (isExistFile(savedFiles)) {
|
||||
fs.unlinkSync(savedFiles)
|
||||
fs.unlinkSync(savedFiles);
|
||||
}
|
||||
console.log(m)
|
||||
dl(args[0], m[2], m[1], e)
|
||||
})
|
||||
dl(args[0], args[1], m[1], e);
|
||||
});
|
||||
});
|
||||
|
||||
function isExistFile(file) {
|
||||
try {
|
||||
fs.statSync(file)
|
||||
fs.statSync(file);
|
||||
return true
|
||||
} catch (err) {
|
||||
if (err.code === 'ENOENT') return false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ipc.on('general-dl', (event, args) => {
|
||||
var name = ''
|
||||
var platform = process.platform
|
||||
var bit = process.arch
|
||||
const filename = args[0].match(/https:\/\/.+\/(.+\..+)$/)
|
||||
if (args[1] == '') {
|
||||
if (platform == 'win32') {
|
||||
var dir = app.getPath('home') + '\\Pictures\\TheDesk'
|
||||
} else if (platform == 'linux' || platform == 'darwin') {
|
||||
var dir = app.getPath('home') + '/Pictures/TheDesk'
|
||||
|
||||
var name = "";
|
||||
var platform = process.platform;
|
||||
var bit = process.arch;
|
||||
if (args[1] == "") {
|
||||
if (platform == "win32") {
|
||||
var dir = app.getPath('home') + "\\Pictures\\TheDesk";
|
||||
} else if (platform == "linux" || platform == "darwin") {
|
||||
var dir = app.getPath('home') + "/Pictures/TheDesk";
|
||||
}
|
||||
} else {
|
||||
var dir = args[1]
|
||||
var dir = args[1];
|
||||
}
|
||||
const opts = {
|
||||
directory: dir,
|
||||
filename: name,
|
||||
openFolderWhenDone: false,
|
||||
onProgress: function(e) {
|
||||
event.sender.webContents.send('general-dl-prog', e)
|
||||
onProgress: function (e) {
|
||||
event.sender.webContents.send('general-dl-prog', e);
|
||||
},
|
||||
saveAs: false
|
||||
}
|
||||
download(BrowserWindow.getFocusedWindow(), args[0], opts)
|
||||
};
|
||||
download(BrowserWindow.getFocusedWindow(),
|
||||
args[0], opts)
|
||||
.then(dl => {
|
||||
if(filename[1]) {
|
||||
if (platform == 'win32') {
|
||||
var name = dir + '\\' + filename[1]
|
||||
} else if (platform == 'linux' || platform == 'darwin') {
|
||||
var name = dir + '/' + filename[1]
|
||||
}
|
||||
} else {
|
||||
var name = dir
|
||||
}
|
||||
event.sender.webContents.send('general-dl-message', name)
|
||||
event.sender.webContents.send('general-dl-message', dir);
|
||||
})
|
||||
.catch(console.error)
|
||||
})
|
||||
ipc.on('openFinder', (e, folder) => {
|
||||
console.log(folder)
|
||||
.catch(console.error);
|
||||
});
|
||||
ipc.on('open-finder', (e, folder) => {
|
||||
|
||||
shell.showItemInFolder(folder)
|
||||
})
|
||||
});
|
||||
}
|
||||
exports.dl = dl
|
||||
exports.dl = dl;
|
||||
|
@@ -1,87 +1,43 @@
|
||||
function img(mainWindow, dir) {
|
||||
const electron = require('electron')
|
||||
const dialog = electron.dialog
|
||||
const fs = require('fs')
|
||||
var Jimp = require('jimp')
|
||||
var ipc = electron.ipcMain
|
||||
const BrowserWindow = electron.BrowserWindow
|
||||
const electron = require("electron");
|
||||
const dialog = electron.dialog;
|
||||
const fs = require("fs");
|
||||
var Jimp = require("jimp");
|
||||
var ipc = electron.ipcMain;
|
||||
const BrowserWindow = electron.BrowserWindow;
|
||||
ipc.on('file-select', (e, args) => {
|
||||
let fileNames = dialog.showOpenDialogSync(mainWindow, {
|
||||
|
||||
dialog.showOpenDialog(null, {
|
||||
properties: ['openFile', 'multiSelections'],
|
||||
title: '添付ファイルを選択',
|
||||
defaultPath: '.',
|
||||
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: ['mp4', 'webm'] },
|
||||
{ name: '全てのファイル', extensions: ['*'] },
|
||||
],
|
||||
})
|
||||
{ name: '全てのファイル', extensions: ['*'] }
|
||||
]
|
||||
}, (fileNames) => {
|
||||
if (!fileNames) {
|
||||
return false
|
||||
return false;
|
||||
}
|
||||
for (var i = 0; i < fileNames.length; i++) {
|
||||
var path = fileNames[i]
|
||||
var bin = fs.readFileSync(path, 'base64')
|
||||
e.sender.webContents.send('resizeJudgement', [bin, 'new'])
|
||||
var path = fileNames[i];
|
||||
var bin = fs.readFileSync(path, 'base64');
|
||||
e.sender.webContents.send('bmp-img-comp', [bin, 'new']);
|
||||
}
|
||||
})
|
||||
});
|
||||
});
|
||||
ipc.on('bmp-image', (e, args) => {
|
||||
|
||||
var m = args[0].match(/(.+)\\(.+)\.(.+)$/);
|
||||
Jimp.read(args[0], function (err, lenna) {
|
||||
if (err) throw err
|
||||
if (err) throw err;
|
||||
lenna.getBase64(Jimp.MIME_PNG, function (err, src) {
|
||||
e.sender.webContents.send('bmp-img-comp', [src, args[1]])
|
||||
})
|
||||
})
|
||||
})
|
||||
ipc.on('resize-image', (e, args) => {
|
||||
var ext = args[0].toString().slice(args[0].indexOf('/') + 1, args[0].indexOf(';'))
|
||||
if (ext == 'jpeg') {
|
||||
var use = 'MIME_JPEG'
|
||||
} else {
|
||||
var use = 'MIME_PNG'
|
||||
}
|
||||
var b64 = args[0].replace(/^data:\w+\/\w+;base64,/, '')
|
||||
var decodedFile = new Buffer(b64, 'base64')
|
||||
Jimp.read(decodedFile, function (err, lenna) {
|
||||
if (err) throw err
|
||||
lenna.scaleToFit(args[1], args[1]).getBase64(Jimp[use], function (err, src) {
|
||||
e.sender.webContents.send('bmp-img-comp', [src, args[1]])
|
||||
})
|
||||
})
|
||||
})
|
||||
ipc.on('stamp-image', (e, args) => {
|
||||
var text = args[1]
|
||||
var b64 = args[0].replace(/^data:\w+\/\w+;base64,/, '')
|
||||
var decodedFile = new Buffer(b64, 'base64')
|
||||
console.log(text)
|
||||
Jimp.read(decodedFile, function (err, image) {
|
||||
if (err) throw err
|
||||
Jimp.loadFont(Jimp.FONT_SANS_16_BLACK).then((font) => {
|
||||
var evWidth = Jimp.measureText(font, text)
|
||||
var width = image.bitmap.width
|
||||
var height = image.bitmap.height
|
||||
var left = width - evWidth - 10
|
||||
var top = height - 30
|
||||
var color = Jimp.intToRGBA(image.getPixelColor(left, top))
|
||||
console.log(left, top, color)
|
||||
var ave = (color.r + color.g + color.b) / 3
|
||||
if (ave > 128) {
|
||||
image.print(font, left, top, args[1]).getBase64(Jimp.MIME_PNG, function (err, src) {
|
||||
e.sender.webContents.send('bmp-img-comp', [src, args[1], true])
|
||||
})
|
||||
} else {
|
||||
Jimp.loadFont(Jimp.FONT_SANS_16_WHITE).then((font) => {
|
||||
image.print(font, left, top, args[1]).getBase64(Jimp.MIME_PNG, function (err, src) {
|
||||
e.sender.webContents.send('bmp-img-comp', [src, args[1], true])
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
e.sender.webContents.send('bmp-img-comp', [src, args[1]]);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
exports.img = img
|
||||
exports.img = img;
|