Compare commits

..

9 Commits

Author SHA1 Message Date
cutls
8eadb8287d today shinchoku 2020-08-31 00:23:55 +09:00
cutls
541ebbbb19 today shinchoku 2020-07-21 12:44:53 +09:00
cutls
d92a9ae1ae today shinchoku 2020-07-21 09:06:58 +09:00
cutls
47749dde7b readme 2020-07-12 03:49:48 +09:00
cutls
78a8c2bdce Today shinchoku 2020-07-12 00:48:15 +09:00
cutls
2c54e43e37 Shinchoku 2020-07-10 22:33:12 +09:00
cutls
fba3b99b54 it 2020-07-10 14:22:26 +09:00
cutls
489d95f23f fix 2020-07-10 14:21:24 +09:00
cutls
5d01dafeb3 WIP: ditch jQuery and duplicated funcs 2020-07-10 14:16:39 +09:00
196 changed files with 15480 additions and 12571 deletions

2
.github/FUNDING.yml vendored
View File

@@ -5,4 +5,4 @@ patreon: cutls
open_collective: # Replace with a single Open Collective username open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 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
View File

@@ -20,7 +20,6 @@ app/view/bg
app/view/cs app/view/cs
app/view/ps app/view/ps
app/view/es-AR app/view/es-AR
app/view/it-IT
app/git app/git
*.code-workspace *.code-workspace
releasenote.md releasenote.md

View File

@@ -6,7 +6,7 @@ language: node_js
env: env:
- YARN_GPG=no - YARN_GPG=no
node_js: node_js:
- '12.17.0' - '10.15.2'
cache: cache:
yarn: true yarn: true
script: node -v script: node -v
@@ -15,20 +15,6 @@ before_deploy:
- cd app - cd app
- VERSION=$(cat package.json | grep version | head -1 | awk -F= "{ print $2 }" | sed 's/[version:,\",]//g' | tr -d '[[:space:]]') - VERSION=$(cat package.json | grep version | head -1 | awk -F= "{ print $2 }" | sed 's/[version:,\",]//g' | tr -d '[[:space:]]')
- yarn install --no-lockfile --prod - yarn install --no-lockfile --prod
- yarn construct:store
- if [ "$TRAVIS_OS_NAME" = "osx" ];then electron-builder --mac -p never;else :;fi
- if [ "$TRAVIS_OS_NAME" = "osx" ];then cd ../build;else :;fi
- if [ "$TRAVIS_OS_NAME" = "osx" ];then mv *.dmg TheDesk-$VERSION-store.dmg;else :;fi
- if [ "$TRAVIS_OS_NAME" = "osx" ];then cd ../app;else :;fi
- if [ "$TRAVIS_OS_NAME" = "linux" ];then electron-builder --linux snap:x64 -p never;else :;fi
- if [ "$TRAVIS_OS_NAME" = "linux" ];then cd ../build;else :;fi
- if [ "$TRAVIS_OS_NAME" = "linux" ];then mv *.snap TheDesk-$VERSION-store.snap;else :;fi
- if [ "$TRAVIS_OS_NAME" = "linux" ];then cd ../app;else :;fi
- if [ "$TRAVIS_OS_NAME" = "windows" ];then yarn add electron-builder;else :;fi
- if [ "$TRAVIS_OS_NAME" = "windows" ];then electron-builder --win appx:x64 -p never ;else :;fi
- if [ "$TRAVIS_OS_NAME" = "windows" ];then cd ../build;else :;fi
- if [ "$TRAVIS_OS_NAME" = "windows" ];then mv *.appx TheDesk-$VERSION-store.appx;else :;fi
- if [ "$TRAVIS_OS_NAME" = "windows" ];then cd ../app;else :;fi
- yarn construct - yarn construct
- if [ "$TRAVIS_OS_NAME" = "osx" ];then electron-builder --mac -p never;else :;fi - if [ "$TRAVIS_OS_NAME" = "osx" ];then electron-builder --mac -p never;else :;fi
- if [ "$TRAVIS_OS_NAME" = "linux" ];then electron-builder --linux --x64 -p never;else :;fi - if [ "$TRAVIS_OS_NAME" = "linux" ];then electron-builder --linux --x64 -p never;else :;fi
@@ -36,6 +22,7 @@ before_deploy:
- if [ "$TRAVIS_OS_NAME" = "linux" ];then ls;else :;fi - if [ "$TRAVIS_OS_NAME" = "linux" ];then ls;else :;fi
- if [ "$TRAVIS_OS_NAME" = "linux" ];then mv thedesk-*.zip thedesk.zip;else :;fi - if [ "$TRAVIS_OS_NAME" = "linux" ];then mv thedesk-*.zip thedesk.zip;else :;fi
- if [ "$TRAVIS_OS_NAME" = "linux" ];then cd ../app;else :;fi - if [ "$TRAVIS_OS_NAME" = "linux" ];then cd ../app;else :;fi
- if [ "$TRAVIS_OS_NAME" = "windows" ];then yarn add electron-builder;else :;fi
- if [ "$TRAVIS_OS_NAME" = "windows" ];then electron-builder --win --ia32 -p never;else :;fi - if [ "$TRAVIS_OS_NAME" = "windows" ];then electron-builder --win --ia32 -p never;else :;fi
- if [ "$TRAVIS_OS_NAME" = "windows" ];then cd ../build;else :;fi - if [ "$TRAVIS_OS_NAME" = "windows" ];then cd ../build;else :;fi
- if [ "$TRAVIS_OS_NAME" = "windows" ];then ls;else :;fi - if [ "$TRAVIS_OS_NAME" = "windows" ];then ls;else :;fi

View File

@@ -1,3 +1,18 @@
# rewrite-overallブランチへようこそ🎃
このブランチはコードを最初から全部読み直して書き直そうという途方もなく壮大なプロジェクトです。
1周目では、
* 脱jQuery
* 脱onclick
* 脱コールバック地獄
* 重複してるやつや使ってないやつを消す
という極めて当たり前のやつをやっていきます。
# 以下いつものREADME
<img src="https://thedesk.top/img/top.png" width="300" align="left"> <img src="https://thedesk.top/img/top.png" width="300" align="left">
<img src="https://thedesk.top/img/desk.png" width="150" align="right"> <img src="https://thedesk.top/img/desk.png" width="150" align="right">
@@ -11,10 +26,7 @@
Mastodon/Misskey client for PC(Windows/Linux/macOS) Mastodon/Misskey client for PC(Windows/Linux/macOS)
オープンソースSNSマストドン/MisskeyのPC向けクライアント[日本語はこちら](README_ja.md) オープンソースSNSマストドン/MisskeyのPC向けクライアント[日本語はこちら](README_ja.md)
Download:[TheDesk](https://thedesk.top) [![check](https://status.cutls.com/badge/?site=thedesk.top)](https://status.cutls.com) Download:[TheDesk](https://thedesk.top) [![check](https://status.cutls.com/badge/?site=thedesk.top)](https://status.cutls.com)
On GitHub Releases, `-store.*` assets are made for some application store or manager(Snapcraft, Homebrew, Microsoft Store).
They do not check the latest version(Which you can get the latest ver or not depends on the store)
<a href="https://www.patreon.com/cutls"><img src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png" alt="Become a Patron!" width="160"></a> <a href="https://www.patreon.com/cutls"><img src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png" alt="Become a Patron!" width="160"></a>
<a href="https://liberapay.com/cutls/donate"><img alt="Donate using Liberapay" src="https://liberapay.com/assets/widgets/donate.svg"></a> <a href="https://liberapay.com/cutls/donate"><img alt="Donate using Liberapay" src="https://liberapay.com/assets/widgets/donate.svg"></a>
@@ -150,7 +162,7 @@ macOS
### PWA support ### PWA support
TheDesk is a web-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. 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 can run `npm run build:pwa` to build as PWA, including `manifest.json` and the ServiceWorker.

View File

@@ -14,8 +14,6 @@ Download:[TheDesk](https://thedesk.top) [![check](https://status.cutls.com/badge
[Pixiv FANBOX](https://www.pixiv.net/fanbox/creator/28105985) [Pixiv FANBOX](https://www.pixiv.net/fanbox/creator/28105985)
`-store.*`とあるアセットはストアやパッケージマネージャ向けのもので、アップデートの確認をソフト本体で行いません。
![Screenshots1](https://thedesk.top/img/scr1.png) ![Screenshots1](https://thedesk.top/img/scr1.png)
## ライセンス ## ライセンス

View File

@@ -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

View File

@@ -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
}
}

View File

@@ -21,15 +21,6 @@ html {
align-items: flex-start; align-items: flex-start;
} }
#acct-list .btn-flat.white-text {
color: inherit !important;
}
#acct-list .btn-flat.red-text {
background-color: white !important;
}
.lts { .lts {
font-size: 150%; font-size: 150%;
} }

View File

@@ -6,7 +6,7 @@ body {
user-select: none; user-select: none;
cursor: default; cursor: default;
height: 100vh; height: 100vh;
color: var(--text); color: var(--color);
} }
html { html {
font-size: 13px; font-size: 13px;
@@ -14,15 +14,14 @@ html {
.titlebar, .titlebar,
.menubar-menu-container, .menubar-menu-container,
.action-menu-item { .action-menu-item {
background-color: var(--subcolor) !important; background-color: var(--notfbox) !important;
filter: brightness(110%) !important; filter: brightness(110%) !important;
color: var(--text) !important; color: var(--color) !important;
} }
.action-menu-item:hover { .action-menu-item:hover {
filter: brightness(80%) !important; filter: brightness(80%) !important;
} }
.btn, .btn, .btn-flat {
.btn-flat {
font-size: 1.1rem; font-size: 1.1rem;
margin: 0.4rem; margin: 0.4rem;
text-transform: none; text-transform: none;
@@ -232,8 +231,7 @@ blockquote:before,
width: 100vw; width: 100vw;
height: calc(100vh - 3rem); height: calc(100vh - 3rem);
background-color: var(--bg); background-color: var(--bg);
filter: brightness(50%); color: var(--color);
color: var(--text);
z-index: 99999; z-index: 99999;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
@@ -244,7 +242,7 @@ blockquote:before,
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
background-color: var(--bg); background-color: var(--bg);
color: var(--text); color: var(--color);
z-index: 99999; z-index: 99999;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
@@ -255,7 +253,7 @@ blockquote:before,
#pip { #pip {
z-index: 504; z-index: 504;
width: 418px; width: 418px;
background-color: var(--thirdColor); background-color: var(--subcolor);
position: absolute; position: absolute;
} }
.pip-bottom { .pip-bottom {
@@ -316,10 +314,10 @@ blockquote:before,
} }
.collapsible-header, .collapsible-header,
.tabs { .tabs {
background-color: var(--thirdColor); background-color: var(--subcolor);
} }
.collapsible-header:focus { .collapsible-header:focus {
background-color: var(--thirdColor) !important; background-color: var(--subcolor) !important;
} }
.modal-footer { .modal-footer {
background-color: var(--modalfooter) !important; background-color: var(--modalfooter) !important;
@@ -333,29 +331,16 @@ blockquote:before,
} }
.release-do { .release-do {
border: solid 2px; border: solid 2px;
border-color: var(--text); border-color: var(--color);
padding: 5px; padding: 5px;
} }
#pickers { #pickers {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
flex-direction: column;
}
input[type='color'] {
-webkit-appearance: none;
border: none;
width: 32px;
height: 32px;
}
input[type='color']::-webkit-color-swatch-wrapper {
padding: 0;
}
input[type='color']::-webkit-color-swatch {
border: none;
} }
#menu { #menu {
position: fixed; position: fixed;
z-index: 999; z-index: 9999;
background-color: var(--postbox); background-color: var(--postbox);
width: 540px; width: 540px;
top: calc(50% - 150px); top: calc(50% - 150px);
@@ -381,7 +366,7 @@ input[type='color']::-webkit-color-swatch {
display: flex; display: flex;
align-items: center; align-items: center;
cursor: pointer; cursor: pointer;
color: var(--text); color: var(--color);
} }
#left-menu a:hover { #left-menu a:hover {
background-color: var(--beforehover); background-color: var(--beforehover);
@@ -392,9 +377,6 @@ input[type='color']::-webkit-color-swatch {
#left-menu a.active { #left-menu a.active {
background-color: var(--emphasized); background-color: var(--emphasized);
} }
#left-menu a.active span {
text-decoration: underline;
}
#right-menu { #right-menu {
width: 100%; width: 100%;
overflow-y: scroll; overflow-y: scroll;
@@ -412,7 +394,7 @@ input[type='color']::-webkit-color-swatch {
width: 13rem; width: 13rem;
height: 3.1rem; height: 3.1rem;
cursor: pointer; cursor: pointer;
color: var(--text); color: var(--color);
} }
#tltype .type span { #tltype .type span {
width: calc(100% - 2.3rem); width: calc(100% - 2.3rem);
@@ -439,7 +421,7 @@ input[type='color']::-webkit-color-swatch {
text-align: center; text-align: center;
width: calc(100% + 0.8rem); width: calc(100% + 0.8rem);
border-radius: 5px; border-radius: 5px;
background-color: var(--subcolor); background-color: var(--box);
filter: brightness(80%); filter: brightness(80%);
margin-left: -0.4rem; margin-left: -0.4rem;
margin-right: -0.4rem; margin-right: -0.4rem;
@@ -460,7 +442,7 @@ input[type='color']::-webkit-color-swatch {
position: fixed; position: fixed;
bottom: -300px; bottom: -300px;
width: 100vw; width: 100vw;
background-color: var(--subcolor); background-color: var(--box);
z-index: 9999; z-index: 9999;
padding: 0.8rem; padding: 0.8rem;
display: grid; display: grid;
@@ -486,16 +468,16 @@ input[type='color']::-webkit-color-swatch {
} }
input, input,
textarea { textarea {
color: var(--text); color: var(--color);
font-size: 1rem !important; font-size: 1rem !important;
font-family: inherit; font-family: inherit;
} }
.swal2-popup { .swal2-popup {
background-color: var(--subcolor) !important; background-color: var(--notfbox) !important;
} }
.swal2-title, .swal2-title,
.swal2-content { .swal2-content {
color: var(--text) !important; color: var(--color) !important;
} }
#src-contents svg { #src-contents svg {
margin-right: 0.4rem; margin-right: 0.4rem;
@@ -544,7 +526,7 @@ textarea {
left: calc(50vw - 11.53rem); left: calc(50vw - 11.53rem);
width: 23rem; width: 23rem;
max-width: 100%; max-width: 100%;
background-color: var(--subcolor); background-color: var(--box);
z-index: 501; z-index: 501;
padding: 0.4rem; padding: 0.4rem;
} }
@@ -623,33 +605,4 @@ textarea {
.linux .win, .linux .win,
.darwin .win { .darwin .win {
display: none; display: none;
} }
.dropdown-content.header:hover {
background-color: white;
}
button {
font-family: inherit !important;
}
.via-dropdown {
text-overflow: ellipsis;
white-space: nowrap;
overflow-x: hidden;
}
#re-online {
background-color: rgb(38, 92, 153);
position: fixed;
width: 100vw;
height: 2rem;
padding: 0.25rem;
color: white;
z-index: 1000;
}
#offline {
background-color: rgb(153, 38, 38);
position: fixed;
width: 100vw;
height: 2rem;
padding: 0.25rem;
color: white;
z-index: 999;
}

View File

@@ -64,10 +64,9 @@ textarea {
} }
#emoji { #emoji {
} }
#suggest, #draft { #suggest {
max-height: 23rem; max-height: 23rem;
overflow-y: scroll; overflow-y: scroll;
overflow-x: hidden;
} }
#emoji-list { #emoji-list {
width: 100%; width: 100%;
@@ -87,7 +86,7 @@ textarea {
max-height: 7.7rem; max-height: 7.7rem;
} }
#default-emoji a { #default-emoji a {
color: var(--text); color: var(--color);
margin-right: 0.15rem; margin-right: 0.15rem;
} }
.character-counter { .character-counter {
@@ -127,8 +126,8 @@ textarea {
} }
#posttgl, #posttgl,
#toot-post-btn { #toot-post-btn {
background-color: var(--active); background-color: var(--accentbtn);
color: var(--text); color: var(--color);
} }
/*mini*/ /*mini*/
.mini-post .mize { .mini-post .mize {

View File

@@ -5,7 +5,7 @@
background-color: var(--modalfooter); background-color: var(--modalfooter);
margin: 0.4rem; margin: 0.4rem;
border-radius: 0.4rem; border-radius: 0.4rem;
color: var(--text); color: var(--color);
padding: 3px; padding: 3px;
display: grid; display: grid;
grid-template-columns: 3.3rem 1fr 4.6rem; grid-template-columns: 3.3rem 1fr 4.6rem;

View File

@@ -1,22 +1,192 @@
:root { :root {
--bg: white;
--drag: rgba(255, 255, 255, 0.8);
--color: black;
--beforehover: #757575;
--modal: white;
--subcolor: #e0e0e0;
--box: white;
--sidebar: #eeeeee;
--shared: #cfd8dc;
--notfbox: white;
--emphasized: #81c784;
--his-data: rgba(255, 255, 255, 0.9);
--active: #e6ee9c;
--postbox: white;
--modalfooter: #fafafa;
--accentbtn: #009688;
--selected: #c0c0c0;
--selectedWithShare: #b2babd;
--gray: #757575;
}
#imagemodal {
background: url("../img/pixel.white.svg");
}
.blacktheme {
--bg: #212121; --bg: #212121;
--drag: rgba(0, 0, 0, 0.8); --drag: rgba(0, 0, 0, 0.8);
--text: white; --color: white;
--beforehover: #9e9e9e; --beforehover: #9e9e9e;
--modal: black; --modal: black;
--thirdColor: #212121; --subcolor: #212121;
--bottom: #424242; --box: #424242;
--accent: #004d40; --sidebar: #424242;
--subcolor: #333333; --shared: #004d40;
--notfbox: #333333;
--emphasized: #4e342e; --emphasized: #4e342e;
--his-data: rgba(0, 0, 0, 0.8); --his-data: rgba(0, 0, 0, 0.8);
--active: #757575;
--postbox: #424242; --postbox: #424242;
--modalfooter: #212121; --modalfooter: #212121;
--active: #3f51b5; --accentbtn: #3f51b5;
--selected: #3f3f3f; --selected: #3f3f3f;
--selectedWithShare: #003a30; --selectedWithShare: #003a30;
--gray: #cccccc; --gray: #cccccc;
} }
#imagemodal { .blacktheme #imagemodal {
background: url("../img/pixel.svg"); background: url("../img/pixel.svg");
}
.indigotheme {
--bg: #031833;
--drag: rgba(0, 0, 0, 0.8);
--color: white;
--beforehover: #9e9e9e;
--modal: #0d1351;
--subcolor: #0d1351;
--shared: #004d40;
--box: #0d1351;
--sidebar: #0d1351;
--notfbox: #0d47a1;
--emphasized: #4e342e;
--his-data: rgba(13, 19, 81, 0.8);
--active: #757575;
--postbox: #1a237e;
--modalfooter: #031833;
--accentbtn: #00acc1;
--selected: #214f8a;
--selectedWithShare: #003a30;
--gray: #cccccc ;
}
.indigotheme #imagemodal {
background: url("../img/pixel.svg");
}
.browntheme {
--bg: #261411;
--drag: rgba(0, 0, 0, 0.8);
--color: white;
--beforehover: #9e9e9e;
--modal: #261411;
--subcolor: #4e342e;
--shared: #004d40;
--box: #4e342e;
--sidebar: #4e342e;
--notfbox: #4e342e;
--emphasized: #0d47a1;
--his-data: rgba(62, 39, 35, 0.8);
--active: #757575;
--postbox: #4e342e;
--modalfooter: #261411;
--accentbtn: #827717;
--selected: #6d352b;
--selectedWithShare: #003a30;
--gray: #cccccc;
}
.browntheme #imagemodal {
background: url("../img/pixel.svg");
}
.greentheme {
--bg: #c8e6c9;
--drag: rgba(255, 255, 255, 0.8);
--color: black;
--beforehover: #757575;
--modal: #81c784;
--subcolor: #a5d6a7;
--box: #81c784;
--sidebar: #c5e1a5;
--shared: #ffcc80;
--notfbox: #a5d6a7;
--emphasized: #9e9d24;
--his-data: rgba(255, 255, 255, 0.9);
--active: #e6ee9c;
--postbox: #a5d6a7;
--modalfooter: #81c784;
--accentbtn: #33691e;
--selected: #78c17a;
--selectedWithShare: #caa266;
--gray: #757575;
}
.greentheme #imagemodal {
background: url("../img/pixel.white.svg");
}
.bluetheme {
--bg: #c9e1ec;
--drag: rgba(255, 255, 255, 0.8);
--color: black;
--beforehover: #757575;
--modal: #b2ebf2;
--subcolor: #90caf9;
--box: #90caf9;
--sidebar: #b6e6f5;
--shared: #e0ffe4;
--notfbox: #90caf9;
--emphasized: #c5e1a5;
--his-data: rgba(255, 255, 255, 0.9);
--active: #b39ddb;
--postbox: #dff1ff;
--modalfooter: #2196f3;
--accentbtn: #2f7bb7;
--selected: #9dcade;
--selectedWithShare: #c1dac4;
--gray: #757575;
}
.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");
} }

View File

@@ -18,7 +18,7 @@
padding: 0.23rem; padding: 0.23rem;
padding-right: 0; padding-right: 0;
padding-left: 3rem; padding-left: 3rem;
background-color: var(--bottom); background-color: var(--sidebar);
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
flex-wrap: wrap; flex-wrap: wrap;
@@ -62,7 +62,7 @@
} }
#bottom a, #bottom a,
#demogroup a { #demogroup a {
color: var(--text); color: var(--color);
} }
#bottom i { #bottom i {
font-size: 2.3rem; font-size: 2.3rem;
@@ -93,7 +93,7 @@
display: grid; display: grid;
grid-template-columns: 3rem 2.3rem 2.5fr 1fr 4.6rem; grid-template-columns: 3rem 2.3rem 2.5fr 1fr 4.6rem;
grid-template-rows: 1.7rem 1.5rem; grid-template-rows: 1.7rem 1.5rem;
grid-template-areas: 'cover name name name refresh' 'cover progress progress progress time'; grid-template-areas: 'cover name name artist refresh' 'cover progress progress progress time';
} }
#spot-refresh { #spot-refresh {
grid-area: refresh; grid-area: refresh;
@@ -108,12 +108,18 @@
overflow: hidden; overflow: hidden;
line-height: 1.92rem; line-height: 1.92rem;
} }
#spot-artist {
grid-area: artist;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
line-height: 1.92rem;
}
#spot-img { #spot-img {
width: 90%; width: 90%;
} }
#spot-time { #spot-time {
grid-area: time; grid-area: time;
line-height: 0.5rem;
} }
.progress { .progress {
grid-area: progress; grid-area: progress;
@@ -151,8 +157,7 @@ iframe,
} }
.box { .box {
overflow: hidden; overflow: hidden;
min-width: 300px; min-width: 23rem;
max-width: 600px;
flex: 1; flex: 1;
border-top: none; border-top: none;
display: flex; display: flex;
@@ -212,14 +217,10 @@ iframe,
.emoji, .emoji,
.emoji-img { .emoji-img {
width: 1.153rem; width: 1.153rem;
height: 1.153rem;
object-fit: cover;
} }
.area-toot .emoji, .area-toot .emoji,
.area-toot .emoji-img { .area-toot .emoji-img {
width: 1.538rem; width: 1.538rem;
height: 1.538rem;
object-fit: cover;
vertical-align: middle; vertical-align: middle;
margin: -1px 0; margin: -1px 0;
} }
@@ -237,7 +238,6 @@ iframe,
flex: 1; flex: 1;
overflow-y: scroll; overflow-y: scroll;
overflow-x: hidden; overflow-x: hidden;
background-color: var(--bg);
} }
.additional { .additional {
overflow-x: scroll; overflow-x: scroll;
@@ -430,7 +430,7 @@ iframe,
} }
.btn-flat { .btn-flat {
color: var(--text); color: var(--color);
} }
.area-side i { .area-side i {
margin-left: 0.75rem; margin-left: 0.75rem;
@@ -449,15 +449,44 @@ iframe,
color: var(--beforehover); color: var(--beforehover);
} }
.actct:hover { .actct:hover {
color: var(--text); color: var(--color);
transition: 0.5s; transition: 0.5s;
} }
.contextMenu.dropdown-content { #contextWrap {
padding-top: 5px; position: fixed;
overflow-y: hidden; width: 199vw;
left: calc(100% - 200px) !important; height: 100vh;
width: 200px !important; z-index: 100;
} }
.contextMenu {
position: fixed;
background-color: var(--box);
z-index: 9999;
border-radius: 0.4rem;
padding: 0.4rem;
}
.contextMenu.bottom:before {
content: '';
position: absolute;
top: 100%;
right: 2rem;
border: 1.2rem solid transparent;
border-top: 1.2rem 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);
}
.contextMenu .btn-flat {
text-transform: none !important;
width: 100%;
text-align: left;
}
.gray { .gray {
color: var(--gray); color: var(--gray);
} }
@@ -496,7 +525,7 @@ iframe,
user-select: none; user-select: none;
} }
.cbadge-hover { .cbadge-hover {
color: var(--text); color: var(--color);
background-color: transparent; background-color: transparent;
} }
.cbadge-hover:hover { .cbadge-hover:hover {
@@ -512,7 +541,7 @@ p:not(:last-child) {
margin-bottom: 0.76rem; margin-bottom: 0.76rem;
} }
.shared { .shared {
background-color: var(--accent); background-color: var(--shared);
} }
.emphasized { .emphasized {
background-color: var(--emphasized); background-color: var(--emphasized);
@@ -522,7 +551,7 @@ p:not(:last-child) {
} }
.notice-box { .notice-box {
top: 0; top: 0;
background-color: var(--subcolor); background-color: var(--notfbox);
filter: brightness(110%); filter: brightness(110%);
position: relative; position: relative;
margin-right: 0.7rem; margin-right: 0.7rem;
@@ -591,7 +620,7 @@ p:not(:last-child) {
.notf-box { .notf-box {
position: fixed; position: fixed;
right: 5.4rem; right: 5.4rem;
background-color: var(--subcolor); background-color: var(--box);
border: thin solid gray; border: thin solid gray;
z-index: 501; z-index: 501;
width: 30rem; width: 30rem;
@@ -628,29 +657,14 @@ p:not(:last-child) {
box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12), box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12),
0 5px 5px -3px rgba(0, 0, 0, 0.3), 0px -10px 10px 0px rgba(0, 0, 0, 0.3) inset; 0 5px 5px -3px rgba(0, 0, 0, 0.3), 0px -10px 10px 0px rgba(0, 0, 0, 0.3) inset;
} }
.notf-indv-box label span {
padding-left: 23px !important;
margin-right: 5px;
}
.notf-indv-box .setting {
font-size: 1rem;
width: calc(25% - 3px);
text-align: left;
padding: 5px;
height: 70px;
}
.notf-exclude-btn:hover {
background-color: inherit !important;
border: 1px solid;
}
.type-b { .type-b {
display: none; display: none;
} }
.modal-footer { .modal-footer {
background-color: var(--subcolor); background-color: var(--box);
} }
.ballons { .ballons {
background-color: var(--subcolor); background-color: var(--box);
position: absolute; position: absolute;
bottom: 0px; bottom: 0px;
right: 0px; right: 0px;
@@ -708,11 +722,11 @@ p:not(:last-child) {
transition-duration: 0.5s; transition-duration: 0.5s;
} }
.votebtn:hover { .votebtn:hover {
background-color: var(--text); background-color: var(--color);
} }
.leadPoll { .leadPoll {
position: absolute; position: absolute;
background-color: var(--subcolor); background-color: var(--box);
height: 1.5rem; height: 1.5rem;
border-radius: 0.23rem; border-radius: 0.23rem;
} }
@@ -774,11 +788,11 @@ audio {
.cw_btn { .cw_btn {
margin: 0.23rem; margin: 0.23rem;
background-color: var(--emphasized); background-color: var(--emphasized);
color: var(--text); color: var(--color);
padding-left: 0.23rem; padding-left: 0.23rem;
padding-right: 0.23rem; padding-right: 0.23rem;
border-radius: 0.23rem; border-radius: 0.23rem;
border: 1px solid var(--text); border: 1px solid var(--color);
user-select: none; user-select: none;
} }
.vis-data { .vis-data {
@@ -868,7 +882,7 @@ audio {
cursor: pointer; cursor: pointer;
border: solid 1px; border: solid 1px;
padding-left: 0.15rem; padding-left: 0.15rem;
background-color: var(--subcolor); background-color: var(--notfbox);
border-radius: 0.15rem; border-radius: 0.15rem;
} }
.announReaction img { .announReaction img {

View File

@@ -1,162 +1,147 @@
/*アイコンをクリックした時とかにでてくるユーザーデータ*/ /*アイコンをクリックした時とかにでてくるユーザーデータ*/
#his-data { #his-data {
background-repeat: no-repeat; background-repeat: no-repeat;
background-image: url('../img/loading.svg'); background-image: url("../img/loading.svg");
overflow-y: hidden; overflow-y: hidden;
} }
#his-data .btn .material-icons { #his-data .btn .material-icons{
float: left; float:left;
} }
#his-data-content { #his-data-content {
display: flex; display: flex;
justify-content: center; justify-content: center;
} }
#his-name { #his-name {
font-size: 1.5rem; font-size: 1.5rem;
} }
#his-prof { #his-prof {
width: 7.7rem; float: left;
margin-right: 0.4rem; width: 7.7rem;
margin-right: 0.4rem;
} }
.his-float { .his-float {
overflow-y: scroll; overflow-y: scroll;
padding: 0.4rem; padding: 0.4rem;
} }
#his-float-data { #his-float-data {
height: 100%; height: 100%;
overflow-y: hidden; overflow-y: hidden;
} }
#his-leftside { #his-leftside {
width: 28.4rem; width: 38.4rem;
max-width: 30vw;
} }
#his-float-timeline { #his-float-timeline {
max-width: 47.5rem; max-width: 59.6rem;
min-width: calc(100% - 29.4rem); height: 100%;
height: 100%; overflow-y: hidden;
overflow-y: hidden;
} }
#his-basic-prof { #his-basic-prof {
display: flex; min-height: 10rem;
min-height: 10rem;
} }
#his-field { #his-field {
vertical-align: baseline; vertical-align: baseline;
text-align: center; text-align: center;
padding: 0; padding: 0;
} }
#his-field tr { #his-field tr {
height: 1.5rem; height: 1.5rem;
} }
.his-field-title { .his-field-title {
height: 1.5rem; height: 1.5rem;
padding: 0; padding: 0;
background-color: #757575; background-color: #757575;
text-align: center; text-align: center;
padding: 0.4rem; padding: 0.4rem;
margin-bottom: 1px; margin-bottom: 1px;
width: 30%; width: 30%;
} }
.his-field-content { .his-field-content {
height: 1.5rem; height: 1.5rem;
padding: 0; padding: 0;
padding-left: 0.4rem; padding-left: 0.4rem;
} }
.his-var-content a span.ellipsis:after { .his-var-content a span.ellipsis:after {
content: '...'; content: "...";
} }
.his-var-content a:not(.mention) span:last-of-type { .his-var-content a:not(.mention) span:last-of-type {
display: none; display: none;
} }
#his-data a .rep_ct, #his-data a .rep_ct,
#his-data a .rt_ct, #his-data a .rt_ct,
#his-data a .fav_ct { #his-data a .fav_ct {
display: inline !important; display: inline !important;
} }
#his-data-show { #his-data-show {
margin: 1.5rem; margin: 1.5rem;
margin-left: 3.8rem; margin-left: 3.8rem;
margin-right: 3.8rem; margin-right: 3.8rem;
background-color: var(--his-data); background-color: var(--his-data);
height: calc(100% - 1.5rem); height: calc(100% - 1.5rem);
margin-bottom: 0; margin-bottom: 0;
padding: 0.4rem; padding: 0.4rem;
} }
#his-data-wrap { #his-data-wrap {
display: flex; display: flex;
} }
.his-var-content { .his-var-content {
overflow-y: scroll; overflow-y: scroll;
overflow-x: hidden; overflow-x: hidden;
height: calc(100% - 3.4rem); height: calc(100% - 3.4rem);
padding-bottom: 60px;
} }
#my-data-nav .btn { #my-data-nav .btn {
width: 10.6rem; width: 10.7rem;
} }
#my-data-nav .active-back { .active-back {
display: none; background-color: var(--active);
} }
#his-name .emojione, #his-name .emojione,
#his-name .emoji-img { #his-name .emoji-img {
width: 1.538rem; width: 1.538rem;
} }
#his-plus-action .btn { #his-plus-action .btn {
padding-right: 0.4rem; padding-right: 0.4rem;
padding-left: 0.4rem; padding-left: 0.4rem;
} }
.tabs { .tabs {
display: flex; display: flex;
} }
.tabs .tab a { .tabs .tab a {
padding: 0.6rem 0.9rem; padding: 0.6rem 0.9rem;
} }
#his-des { #his-des {
max-height: 17.7rem; max-height: 17.7rem;
overflow-y: scroll; overflow-y: scroll;
} }
#his-sign-action { #his-sign-action {
border: 1px solid; border: 1px solid;
border-radius: 0.4rem; border-radius: 0.4rem;
display: flex; display: flex;
align-items: center; align-items: center;
padding-left: 0.75rem; padding-left: 0.75rem;
padding-right: 0.75rem; padding-right: 0.75rem;
flex-wrap: wrap; flex-wrap: wrap;
} }
#his-sign-action .btn { #his-sign-action .btn {
flex-basis: calc(50% - 10.6px); flex-basis: 31.2%;
}
#his-sign-action .dropdown-trigger {
flex-basis: 100%;
} }
#his-des .mention { #his-des .mention {
color: #039be5; color: #039be5;
cursor: pointer; cursor: pointer;
} }
#his-table { #his-table{
max-height: 11.538rem; max-height: 11.538rem;
overflow-y: scroll; overflow-y: scroll;
} }
#his-float-blocked { #his-float-blocked {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
font-size: 2rem; font-size: 2rem;
height: 100%; height: 100%;
} }
#hisdropdown { #hisdropdown{
background-color: var(--bg); background-color: var(--bg);
}
#hisdropdown li a {
color: white;
}
#hisdropdown li:hover {
background-color: var(--active);
}
#his-data-title {
width: 100%;
text-align: center;
font-size: 1.5rem;
} }
#hisdropdown li:hover{
background-color: var(--active);
}

View File

@@ -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

View File

@@ -1,5 +1,5 @@
//@ts-check
//このソフトについて //このソフトについて
function about() { function about() {
postMessage(["sendSinmpleIpc", "about"], "*") postMessage(["sendSinmpleIpc", "about"], "*")
} }
document.getElementById('onClickAbout').addEventListener('click', about)

38
app/js/common/api.js Normal file
View File

@@ -0,0 +1,38 @@
async function getApi(start, at) {
let json = {}
let response = null
response = await fetch(start, {
method: 'GET',
headers: {
'content-type': 'application/json',
'Authorization': `Bearer ${at}`
}
})
if (!response.ok) {
response.text().then(function (text) {
setLog(response.url, response.status, text)
})
}
json = await response.json()
return json
}
async function postApi(url, body, at, ideKey) {
let json = {}
let response = null
response = await fetch(url, {
method: 'POST',
headers: {
'content-type': 'application/json',
'Authorization': `Bearer ${at}`,
'Idempotency-Key': ideKey
},
body: JSON.stringify(body)
})
if (!response.ok) {
response.text().then(function (text) {
setLog(response.url, response.status, text)
})
}
json = await response.json()
return json
}

View File

@@ -1,4 +1,4 @@
var digitCharacters = [ const digitCharacters = [
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J",
"K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T",
@@ -10,16 +10,16 @@ var digitCharacters = [
"|", "}", "~", "|", "}", "~",
]; ];
function decode83(str) { function decode83(str) {
var value = 0; let value = 0;
for (var i = 0; i < str.length; i++) { for (let i = 0; i < str.length; i++) {
var c = str[i]; const c = str[i];
var digit = digitCharacters.indexOf(c); const digit = digitCharacters.indexOf(c);
value = value * 83 + digit; value = value * 83 + digit;
} }
return value; return value;
} }
function linearTosRGB(value) { function linearTosRGB(value) {
var v = Math.max(0, Math.min(1, value)); const v = Math.max(0, Math.min(1, value));
if (v <= 0.0031308) { if (v <= 0.0031308) {
return Math.round(v * 12.92 * 255 + 0.5); return Math.round(v * 12.92 * 255 + 0.5);
} }
@@ -28,7 +28,7 @@ function linearTosRGB(value) {
} }
} }
function sRGBToLinear(value) { function sRGBToLinear(value) {
var v = value / 255; const v = value / 255;
if (v <= 0.04045) { if (v <= 0.04045) {
return v / 12.92; return v / 12.92;
} }
@@ -37,18 +37,18 @@ function sRGBToLinear(value) {
} }
} }
function decodeDC(value) { function decodeDC(value) {
var intR = value >> 16; const intR = value >> 16;
var intG = (value >> 8) & 255; const intG = (value >> 8) & 255;
var intB = value & 255; const intB = value & 255;
return [sRGBToLinear(intR), sRGBToLinear(intG), sRGBToLinear(intB)]; return [sRGBToLinear(intR), sRGBToLinear(intG), sRGBToLinear(intB)];
}; };
function sign(n) { return (n < 0 ? -1 : 1); } function sign(n) { return (n < 0 ? -1 : 1); }
function signPow(val, exp) { return sign(val) * Math.pow(Math.abs(val), exp); } function signPow(val, exp) { return sign(val) * Math.pow(Math.abs(val), exp); }
function decodeDC2(value, maximumValue) { function decodeDC2(value, maximumValue) {
var quantR = Math.floor(value / (19 * 19)); const quantR = Math.floor(value / (19 * 19));
var quantG = Math.floor(value / 19) % 19; const quantG = Math.floor(value / 19) % 19;
var quantB = value % 19; const quantB = value % 19;
var rgb = [ const rgb = [
signPow((quantR - 9) / 9, 2.0) * maximumValue, signPow((quantR - 9) / 9, 2.0) * maximumValue,
signPow((quantG - 9) / 9, 2.0) * maximumValue, signPow((quantG - 9) / 9, 2.0) * maximumValue,
signPow((quantB - 9) / 9, 2.0) * maximumValue, signPow((quantB - 9) / 9, 2.0) * maximumValue,
@@ -61,45 +61,45 @@ function decodeblur(blurhash, width, height, punch) {
console.error('too short blurhash'); console.error('too short blurhash');
return null; return null;
} }
var sizeFlag = decode83(blurhash[0]); const sizeFlag = decode83(blurhash[0]);
var numY = Math.floor(sizeFlag / 9) + 1; const numY = Math.floor(sizeFlag / 9) + 1;
var numX = (sizeFlag % 9) + 1; const numX = (sizeFlag % 9) + 1;
var quantisedMaximumValue = decode83(blurhash[1]); const quantisedMaximumValue = decode83(blurhash[1]);
var maximumValue = (quantisedMaximumValue + 1) / 166; const maximumValue = (quantisedMaximumValue + 1) / 166;
if (blurhash.length !== 4 + 2 * numX * numY) { if (blurhash.length !== 4 + 2 * numX * numY) {
console.error('blurhash length mismatch', blurhash.length, 4 + 2 * numX * numY); console.error('blurhash length mismatch', blurhash.length, 4 + 2 * numX * numY);
return null; return null;
} }
var colors = new Array(numX * numY); let colors = new Array(numX * numY);
for (var i = 0; i < colors.length; i++) { for (let i = 0; i < colors.length; i++) {
if (i === 0) { if (i === 0) {
var value = decode83(blurhash.substring(2, 6)); const value = decode83(blurhash.substring(2, 6));
colors[i] = decodeDC(value); colors[i] = decodeDC(value);
} }
else { else {
var value = decode83(blurhash.substring(4 + i * 2, 6 + i * 2)); const value = decode83(blurhash.substring(4 + i * 2, 6 + i * 2));
colors[i] = decodeDC2(value, maximumValue * punch); colors[i] = decodeDC2(value, maximumValue * punch);
} }
} }
var bytesPerRow = width * 4; const bytesPerRow = width * 4;
var pixels = new Uint8ClampedArray(bytesPerRow * height); let pixels = new Uint8ClampedArray(bytesPerRow * height);
for (var y = 0; y < height; y++) { for (var y = 0; y < height; y++) {
for (var x = 0; x < width; x++) { for (var x = 0; x < width; x++) {
var r = 0; var r = 0;
var g = 0; var g = 0;
var b = 0; var b = 0;
for (var j = 0; j < numY; j++) { for (let j = 0; j < numY; j++) {
for (var i = 0; i < numX; i++) { for (let i = 0; i < numX; i++) {
var basis = Math.cos(Math.PI * x * i / width) * Math.cos(Math.PI * y * j / height); let basis = Math.cos(Math.PI * x * i / width) * Math.cos(Math.PI * y * j / height);
var color = colors[i + j * numX]; let color = colors[i + j * numX];
r += color[0] * basis; r += color[0] * basis;
g += color[1] * basis; g += color[1] * basis;
b += color[2] * basis; b += color[2] * basis;
} }
} }
var intR = linearTosRGB(r); const intR = linearTosRGB(r);
var intG = linearTosRGB(g); const intG = linearTosRGB(g);
var intB = linearTosRGB(b); const intB = linearTosRGB(b);
pixels[4 * x + 0 + y * bytesPerRow] = intR; pixels[4 * x + 0 + y * bytesPerRow] = intR;
pixels[4 * x + 1 + y * bytesPerRow] = intG; pixels[4 * x + 1 + y * bytesPerRow] = intG;
pixels[4 * x + 2 + y * bytesPerRow] = intB; pixels[4 * x + 2 + y * bytesPerRow] = intB;
@@ -109,9 +109,9 @@ function decodeblur(blurhash, width, height, punch) {
return pixels; return pixels;
} }
function parseBlur(blur) { function parseBlur(blur) {
var canvas = document.getElementById('canvas'); const canvas = document.getElementById('canvas');
var ctx = canvas.getContext('2d'); const ctx = canvas.getContext('2d');
var pixels = decodeblur(blur, 32, 32) const pixels = decodeblur(blur, 32, 32)
const imageData = new ImageData(pixels, 32, 32); const imageData = new ImageData(pixels, 32, 32);
ctx.putImageData(imageData, 0, 0); ctx.putImageData(imageData, 0, 0);

View File

@@ -1,26 +1,19 @@
selectedColumn = 0 let selectedColumn = 0
selectedToot = 0 let selectedToot = 0
$(function($) { $(function ($) {
//キーボードショートカット //キーボードショートカット
$(window).keydown(function(e) { $(window).keydown(function (e) {
var hasFocus = $('input').is(':focus') const hasFocus = isFocused('input')
var hasFocus2 = $('textarea').is(':focus') const hasFocus2 = isFocused('textarea')
if (document.getElementById('webview')) { const postBox = document.querySelector('#textarea')
if ($('#webviewsel:checked').val()) { let wv = false
var wv = false
} else {
var wv = true
}
} else {
var wv = true
}
//Enter //Enter
if (e.keyCode === 13) { if (e.keyCode === 13) {
if ($('#src').is(':focus')) { if (isFocused('#src')) {
src() src()
return false return false
} }
if ($('#list-add').is(':focus')) { if (isFocused('#list-add')) {
makeNewList() makeNewList()
return false return false
} }
@@ -92,7 +85,7 @@ $(function($) {
} }
//X:開閉 //X:開閉
if (e.keyCode === 88) { if (e.keyCode === 88) {
if (!$('#post-box').hasClass('appear')) { if (!document.querySelector('#post-box').classList.contains('appear')) {
show() show()
$('textarea').focus() $('textarea').focus()
} else { } else {
@@ -102,10 +95,10 @@ $(function($) {
} }
//N:新トゥート //N:新トゥート
if (e.keyCode === 78) { if (e.keyCode === 78) {
if (!$('#post-box').hasClass('appear')) { if (!document.querySelector('#post-box').classList.contains('appear')) {
show() show()
} }
$('textarea').focus() postBox.focus()
return false return false
} }
//Ctrl+E:全ての通知未読を既読にする //Ctrl+E:全ての通知未読を既読にする
@@ -153,7 +146,7 @@ $(function($) {
//数字:TL //数字:TL
if (event.metaKey || event.ctrlKey) { if (event.metaKey || event.ctrlKey) {
if (e.keyCode >= 49 && e.keyCode <= 57) { if (e.keyCode >= 49 && e.keyCode <= 57) {
var kz = e.keyCode - 49 const kz = e.keyCode - 49
goColumn(kz) goColumn(kz)
return false return false
} }
@@ -161,7 +154,7 @@ $(function($) {
//矢印:選択 //矢印:選択
if (e.code == 'ArrowLeft') { if (e.code == 'ArrowLeft') {
//left //left
if ($('#imagemodal').hasClass('open')) { if (document.querySelector('#imagemodal').classList.contains('open')) {
imgCont('prev') imgCont('prev')
return false return false
} }
@@ -172,7 +165,7 @@ $(function($) {
return false return false
} else if (e.code == 'ArrowUp') { } else if (e.code == 'ArrowUp') {
//up //up
if ($('#imagemodal').hasClass('open')) { if (document.querySelector('#imagemodal').classList.contains('open')) {
return false return false
} }
if (selectedToot > 0) { if (selectedToot > 0) {
@@ -182,7 +175,7 @@ $(function($) {
return false return false
} else if (e.code == 'ArrowRight') { } else if (e.code == 'ArrowRight') {
//right //right
if ($('#imagemodal').hasClass('open')) { if (document.querySelector('#imagemodal').classList.contains('open')) {
imgCont('next') imgCont('next')
return false return false
} }
@@ -193,7 +186,7 @@ $(function($) {
return false return false
} else if (e.code == 'ArrowDown') { } else if (e.code == 'ArrowDown') {
//down //down
if ($('#imagemodal').hasClass('open')) { if (document.querySelector('#imagemodal').classList.contains('open')) {
return false return false
} }
selectedToot++ selectedToot++
@@ -210,25 +203,21 @@ $(function($) {
} }
} }
//選択時 //選択時
const selectedId = document.querySelector('.selectedToot').getAttribute('unique-id')
const selectedAcctIds = document.querySelector(`#timeline_${selectedColumn}`).getAttribute('data-acct')
if (e.keyCode == 70) { if (e.keyCode == 70) {
var id = $('.selectedToot').attr('unique-id') fav(selectedId, selectedAcctIds, false)
var acct_id = $('#timeline_' + selectedColumn).attr('data-acct')
fav(id, acct_id, false)
return false return false
} }
if (e.keyCode == 66) { if (e.keyCode == 66) {
var id = $('.selectedToot').attr('unique-id') rt(selectedId, selectedAcctIds, false)
var acct_id = $('#timeline_' + selectedColumn).attr('data-acct')
rt(id, acct_id, false)
return false return false
} }
if (e.keyCode == 82) { if (e.keyCode == 82) {
var id = $('.selectedToot').attr('unique-id') const target = document.querySelector('.selectedToot .rep-btn')
var acct_id = $('#timeline_' + selectedColumn).attr('data-acct') const ats_cm = target.getAttribute('data-men')
var ats_cm = $('.selectedToot .rep-btn').attr('data-men') const mode = target.getAttribute('data-visen')
var mode = $('.selectedToot .rep-btn').attr('data-visen') re(selectedId, ats_cm, selectedAcctIds, mode)
var cwTxt = $('#cw-text').val()
re(id, ats_cm, acct_id, mode, cwTxt)
return false return false
} }
} }
@@ -238,9 +227,10 @@ $(function($) {
//C+S+(No):ワンクリ //C+S+(No):ワンクリ
if ((event.metaKey || event.ctrlKey) && event.shiftKey) { if ((event.metaKey || event.ctrlKey) && event.shiftKey) {
if (e.keyCode >= 49 && e.keyCode <= 51) { if (e.keyCode >= 49 && e.keyCode <= 51) {
var no = e.keyCode - 48 const no = e.keyCode - 48
if (localStorage.getItem('oks-' + no)) { const oks = localStorage.getItem('oks-' + no)
$('#textarea').val($('#textarea').val() + localStorage.getItem('oks-' + no)) if (oks) {
postBox.value = postBox.value + oks
} }
return false return false
} }
@@ -249,28 +239,29 @@ $(function($) {
} }
}) })
//クリアボタン //クリアボタン
$('#clear').click(function() { document.getElementById('clear').addEventListener('click', clear)
clear()
})
}) })
//選択する //選択する
function tootSelector(column, toot) { function tootSelector(column, toot) {
$('.cvo').removeClass('selectedToot') const selectedToot = document.querySelector('.selectedToot')
$('#timeline_' + column + ' .cvo') let rect = {top: 0}
.eq(toot) if (selectedToot) {
.addClass('selectedToot') selectedToot.classList.remove('selectedToot')
var scr = $('.tl-box[tlid=' + column + ']').scrollTop() rect = selectedToot.getBoundingClientRect()
var elem = $('.selectedToot').offset().top }
var top = elem - $('.tl-box').height() + scr document.querySelectorAll(`#timeline_${column} .cvo`)[toot].classList.add('selectedToot')
const scr = document.querySelector(`#tlBox${column}`).scrollTop
const elem = rect.top + document.body.scrollTop
let top = elem - getHeight('.tl-box') + scr
if (top > 0) { if (top > 0) {
top = top + $('.selectedToot').height() top = top + getHeight('.selectedToot')
if (top > scr) { if (top > scr) {
$('.tl-box[tlid=' + column + ']').animate({ scrollTop: top }) $(`#tlBox${column}`).animate({ scrollTop: top })
} }
} else if (elem < 0) { } else if (elem < 0) {
var to = scr + elem - $('.selectedToot').height() const to = scr + elem - getHeight('.selectedToot')
if (to < scr) { if (to < scr) {
$('.tl-box[tlid=' + column + ']').animate({ scrollTop: to }) $(`#tlBox${column}`).animate({ scrollTop: to })
} }
} }
} }

View File

@@ -1,7 +1,8 @@
//モーダル・ドロップダウンの各種設定 //モーダル・ドロップダウンの各種設定
$(document).ready(function () { $(document).ready(function () {
// the "href" attribute of the modal trigger must specify the modal ID that wants to be triggered // the "href" attribute of the modal trigger must specify the modal ID that wants to be triggered
$('.modal').modal({ const modals = document.querySelectorAll('.modal')
M.Modal.init(modals, {
inDuration: 300, inDuration: 300,
outDuration: 225, outDuration: 225,
constrainWidth: false, // Does not change width of dropdown to that of the activator constrainWidth: false, // Does not change width of dropdown to that of the activator
@@ -11,7 +12,8 @@ $(document).ready(function () {
alignment: 'left', // Displays dropdown with edge aligned to the left of button alignment: 'left', // Displays dropdown with edge aligned to the left of button
stopPropagation: false stopPropagation: false
}) })
$('.dropdown-trigger').dropdown({ const dropdown = document.querySelectorAll('.modal')
M.Dropdown.init(dropdown, {
inDuration: 300, inDuration: 300,
outDuration: 225, outDuration: 225,
constrainWidth: false, // Does not change width of dropdown to that of the activator constrainWidth: false, // Does not change width of dropdown to that of the activator
@@ -20,10 +22,10 @@ $(document).ready(function () {
belowOrigin: false, // Displays dropdown below the button belowOrigin: false, // Displays dropdown below the button
alignment: 'left', // Displays dropdown with edge aligned to the left of button alignment: 'left', // Displays dropdown with edge aligned to the left of button
stopPropagation: false // Stops event propagation stopPropagation: false // Stops event propagation
} })
) M.Collapsible.init(document.querySelectorAll('.collapsible'));
$('.collapsible').collapsible() const videoModal = document.querySelectorAll('#videomodal')
$('#videomodal').modal({ M.Modal.init(videoModal, {
onCloseEnd: stopVideo onCloseEnd: stopVideo
}) })
}) })

View File

@@ -1,31 +1,31 @@
var sha256 = function sha256(ascii) { const sha256 = function sha256(ascii) {
function rightRotate(value, amount) { function rightRotate(value, amount) {
return (value >>> amount) | (value << (32 - amount)); return (value >>> amount) | (value << (32 - amount));
}; };
var mathPow = Math.pow; const mathPow = Math.pow;
var maxWord = mathPow(2, 32); const maxWord = mathPow(2, 32);
var lengthProperty = 'length' const lengthProperty = 'length'
var i, j; // Used as a counter across the whole file let i, j; // Used as a counter across the whole file
var result = '' let result = ''
var words = []; let words = [];
var asciiBitLength = ascii[lengthProperty] * 8; const asciiBitLength = ascii[lengthProperty] * 8;
//* caching results is optional - remove/add slash from front of this line to toggle //* caching results is optional - remove/add slash from front of this line to toggle
// Initial hash value: first 32 bits of the fractional parts of the square roots of the first 8 primes // Initial hash value: first 32 bits of the fractional parts of the square roots of the first 8 primes
// (we actually calculate the first 64, but extra values are just ignored) // (we actually calculate the first 64, but extra values are just ignored)
var hash = sha256.h = sha256.h || []; let hash = sha256.h = sha256.h || [];
// Round constants: first 32 bits of the fractional parts of the cube roots of the first 64 primes // Round constants: first 32 bits of the fractional parts of the cube roots of the first 64 primes
var k = sha256.k = sha256.k || []; let k = sha256.k = sha256.k || [];
var primeCounter = k[lengthProperty]; let primeCounter = k[lengthProperty];
/*/ /*/
var hash = [], k = []; var hash = [], k = [];
var primeCounter = 0; var primeCounter = 0;
//*/ //*/
var isComposite = {}; let isComposite = {};
for (var candidate = 2; primeCounter < 64; candidate++) { for (let candidate = 2; primeCounter < 64; candidate++) {
if (!isComposite[candidate]) { if (!isComposite[candidate]) {
for (i = 0; i < 313; i += candidate) { for (i = 0; i < 313; i += candidate) {
isComposite[i] = candidate; isComposite[i] = candidate;
@@ -47,21 +47,21 @@ var sha256 = function sha256(ascii) {
// process each chunk // process each chunk
for (j = 0; j < words[lengthProperty];) { for (j = 0; j < words[lengthProperty];) {
var w = words.slice(j, j += 16); // The message is expanded into 64 words as part of the iteration let w = words.slice(j, j += 16); // The message is expanded into 64 words as part of the iteration
var oldHash = hash; const oldHash = hash;
// This is now the undefinedworking hash", often labelled as variables a...g // This is now the undefinedworking hash", often labelled as variables a...g
// (we have to truncate as well, otherwise extra entries at the end accumulate // (we have to truncate as well, otherwise extra entries at the end accumulate
hash = hash.slice(0, 8); hash = hash.slice(0, 8);
for (i = 0; i < 64; i++) { for (i = 0; i < 64; i++) {
var i2 = i + j; const i2 = i + j;
// Expand the message into 64 words // Expand the message into 64 words
// Used below if // Used below if
var w15 = w[i - 15], w2 = w[i - 2]; const w15 = w[i - 15], w2 = w[i - 2];
// Iterate // Iterate
var a = hash[0], e = hash[4]; const a = hash[0], e = hash[4];
var temp1 = hash[7] const temp1 = hash[7]
+ (rightRotate(e, 6) ^ rightRotate(e, 11) ^ rightRotate(e, 25)) // S1 + (rightRotate(e, 6) ^ rightRotate(e, 11) ^ rightRotate(e, 25)) // S1
+ ((e & hash[5]) ^ ((~e) & hash[6])) // ch + ((e & hash[5]) ^ ((~e) & hash[6])) // ch
+ k[i] + k[i]
@@ -74,7 +74,7 @@ var sha256 = function sha256(ascii) {
) | 0 ) | 0
); );
// This is only used once, so *could* be moved below, but it only saves 4 bytes and makes things unreadble // This is only used once, so *could* be moved below, but it only saves 4 bytes and makes things unreadble
var temp2 = (rightRotate(a, 2) ^ rightRotate(a, 13) ^ rightRotate(a, 22)) // S0 const temp2 = (rightRotate(a, 2) ^ rightRotate(a, 13) ^ rightRotate(a, 22)) // S0
+ ((a & hash[1]) ^ (a & hash[2]) ^ (hash[1] & hash[2])); // maj + ((a & hash[1]) ^ (a & hash[2]) ^ (hash[1] & hash[2])); // maj
hash = [(temp1 + temp2) | 0].concat(hash); // We don't bother trimming off the extra ones, they're harmless as long as we're truncating when we do the slice() hash = [(temp1 + temp2) | 0].concat(hash); // We don't bother trimming off the extra ones, they're harmless as long as we're truncating when we do the slice()
@@ -88,7 +88,7 @@ var sha256 = function sha256(ascii) {
for (i = 0; i < 8; i++) { for (i = 0; i < 8; i++) {
for (j = 3; j + 1; j--) { for (j = 3; j + 1; j--) {
var b = (hash[i] >> (j * 8)) & 255; const b = (hash[i] >> (j * 8)) & 255;
result += ((b < 16) ? 0 : '') + b.toString(16); result += ((b < 16) ? 0 : '') + b.toString(16);
} }
} }

View File

@@ -17,26 +17,26 @@
(function (factory) { (function (factory) {
if (typeof define === 'function' && define.amd) { if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module. // AMD. Register as an anonymous module.
define(['jquery'], factory) define(['jquery'], factory);
} else if (typeof module === 'object' && typeof module.exports === 'object') { } else if (typeof module === 'object' && typeof module.exports === 'object') {
factory(require('jquery')) factory(require('jquery'));
} else { } else {
// Browser globals // Browser globals
factory(jQuery) factory(jQuery);
} }
}(function ($) { }(function ($) {
$.timeago = function (timestamp) { $.timeago = function (timestamp) {
if (timestamp instanceof Date) { if (timestamp instanceof Date) {
return inWords(timestamp) return inWords(timestamp);
} else if (typeof timestamp === "string") { } else if (typeof timestamp === "string") {
return inWords($.timeago.parse(timestamp)) return inWords($.timeago.parse(timestamp));
} else if (typeof timestamp === "number") { } else if (typeof timestamp === "number") {
return inWords(new Date(timestamp)) return inWords(new Date(timestamp));
} else { } else {
return inWords($.timeago.datetime(timestamp)) return inWords($.timeago.datetime(timestamp));
} }
} };
var $t = $.timeago const $t = $.timeago;
$.extend($.timeago, { $.extend($.timeago, {
settings: { settings: {
refreshMillis: 60000, refreshMillis: 60000,
@@ -69,36 +69,36 @@
inWords: function (distanceMillis) { inWords: function (distanceMillis) {
if (!this.settings.allowPast && !this.settings.allowFuture) { if (!this.settings.allowPast && !this.settings.allowFuture) {
throw 'timeago allowPast and allowFuture settings can not both be set to false.' throw 'timeago allowPast and allowFuture settings can not both be set to false.';
} }
var $l = this.settings.strings const $l = this.settings.strings;
var prefix = $l.prefixAgo let prefix = $l.prefixAgo;
var suffix = $l.suffixAgo let suffix = $l.suffixAgo;
if (this.settings.allowFuture) { if (this.settings.allowFuture) {
if (distanceMillis < 0) { if (distanceMillis < 0) {
prefix = $l.prefixFromNow prefix = $l.prefixFromNow;
suffix = $l.suffixFromNow suffix = $l.suffixFromNow;
} }
} }
if (!this.settings.allowPast && distanceMillis >= 0) { if (!this.settings.allowPast && distanceMillis >= 0) {
return this.settings.strings.inPast return this.settings.strings.inPast;
} }
var seconds = Math.abs(distanceMillis) / 1000 const seconds = Math.abs(distanceMillis) / 1000;
var minutes = seconds / 60 const minutes = seconds / 60;
var hours = minutes / 60 const hours = minutes / 60;
var days = hours / 24 const days = hours / 24;
var years = days / 365 const years = days / 365;
function substitute(stringOrFunction, number) { function substitute(stringOrFunction, number) {
var string = $.isFunction(stringOrFunction) ? stringOrFunction(number, distanceMillis) : stringOrFunction const string = $.isFunction(stringOrFunction) ? stringOrFunction(number, distanceMillis) : stringOrFunction;
var value = ($l.numbers && $l.numbers[number]) || number const value = ($l.numbers && $l.numbers[number]) || number;
return string.replace(/%d/i, value) return string.replace(/%d/i, value);
} }
var words = seconds < 45 && substitute($l.seconds, Math.round(seconds)) || const words = seconds < 45 && substitute($l.seconds, Math.round(seconds)) ||
seconds < 90 && substitute($l.minute, 1) || seconds < 90 && substitute($l.minute, 1) ||
minutes < 45 && substitute($l.minutes, Math.round(minutes)) || minutes < 45 && substitute($l.minutes, Math.round(minutes)) ||
minutes < 90 && substitute($l.hour, 1) || minutes < 90 && substitute($l.hour, 1) ||
@@ -108,124 +108,124 @@
days < 45 && substitute($l.month, 1) || days < 45 && substitute($l.month, 1) ||
days < 365 && substitute($l.months, Math.round(days / 30)) || days < 365 && substitute($l.months, Math.round(days / 30)) ||
years < 1.5 && substitute($l.year, 1) || years < 1.5 && substitute($l.year, 1) ||
substitute($l.years, Math.round(years)) substitute($l.years, Math.round(years));
var separator = $l.wordSeparator || "" const separator = $l.wordSeparator || "";
if ($l.wordSeparator === undefined) { separator = " " } if ($l.wordSeparator === undefined) { separator = " "; }
return $.trim([prefix, words, suffix].join(separator)) return $.trim([prefix, words, suffix].join(separator));
}, },
parse: function (iso8601) { parse: function (iso8601) {
var s = $.trim(iso8601) let s = $.trim(iso8601);
s = s.replace(/\.\d+/, "") // remove milliseconds s = s.replace(/\.\d+/, ""); // remove milliseconds
s = s.replace(/-/, "/").replace(/-/, "/") s = s.replace(/-/, "/").replace(/-/, "/");
s = s.replace(/T/, " ").replace(/Z/, " UTC") s = s.replace(/T/, " ").replace(/Z/, " UTC");
s = s.replace(/([\+\-]\d\d)\:?(\d\d)/, " $1$2") // -04:00 -> -0400 s = s.replace(/([\+\-]\d\d)\:?(\d\d)/, " $1$2"); // -04:00 -> -0400
s = s.replace(/([\+\-]\d\d)$/, " $100") // +09 -> +0900 s = s.replace(/([\+\-]\d\d)$/, " $100"); // +09 -> +0900
return new Date(s) return new Date(s);
}, },
datetime: function (elem) { datetime: function (elem) {
var iso8601 = $t.isTime(elem) ? $(elem).attr("datetime") : $(elem).attr("title") const iso8601 = $t.isTime(elem) ? $(elem).attr("datetime") : $(elem).attr("title");
return $t.parse(iso8601) return $t.parse(iso8601);
}, },
isTime: function (elem) { isTime: function (elem) {
// jQuery's `is()` doesn't play well with HTML5 in IE // jQuery's `is()` doesn't play well with HTML5 in IE
return $(elem).get(0).tagName.toLowerCase() === "time" // $(elem).is("time"); return $(elem).get(0).tagName.toLowerCase() === "time"; // $(elem).is("time");
} }
}) });
// functions that can be called via $(el).timeago('action') // functions that can be called via $(el).timeago('action')
// init is default when no action is given // init is default when no action is given
// functions are called with context of a single element // functions are called with context of a single element
var functions = { const functions = {
init: function () { init: function () {
functions.dispose.call(this) functions.dispose.call(this);
var refresh_el = $.proxy(refresh, this) const refresh_el = $.proxy(refresh, this);
refresh_el() refresh_el();
var $s = $t.settings const $s = $t.settings;
if ($s.refreshMillis > 0) { if ($s.refreshMillis > 0) {
this._timeagoInterval = setInterval(refresh_el, $s.refreshMillis) this._timeagoInterval = setInterval(refresh_el, $s.refreshMillis);
} }
}, },
update: function (timestamp) { update: function (timestamp) {
var date = (timestamp instanceof Date) ? timestamp : $t.parse(timestamp) const date = (timestamp instanceof Date) ? timestamp : $t.parse(timestamp);
$(this).data('timeago', { datetime: date }) $(this).data('timeago', { datetime: date });
if ($t.settings.localeTitle) { if ($t.settings.localeTitle) {
$(this).attr("title", date.toLocaleString()) $(this).attr("title", date.toLocaleString());
} }
refresh.apply(this) refresh.apply(this);
}, },
updateFromDOM: function () { updateFromDOM: function () {
$(this).data('timeago', { datetime: $t.parse($t.isTime(this) ? $(this).attr("datetime") : $(this).attr("title")) }) $(this).data('timeago', { datetime: $t.parse($t.isTime(this) ? $(this).attr("datetime") : $(this).attr("title")) });
refresh.apply(this) refresh.apply(this);
}, },
dispose: function () { dispose: function () {
if (this._timeagoInterval) { if (this._timeagoInterval) {
window.clearInterval(this._timeagoInterval) window.clearInterval(this._timeagoInterval);
this._timeagoInterval = null this._timeagoInterval = null;
} }
} }
} };
$.fn.timeago = function (action, options) { $.fn.timeago = function (action, options) {
var fn = action ? functions[action] : functions.init const fn = action ? functions[action] : functions.init;
if (!fn) { if (!fn) {
throw new Error("Unknown function name '" + action + "' for timeago") throw new Error("Unknown function name '" + action + "' for timeago");
} }
// each over objects here and call the requested function // each over objects here and call the requested function
this.each(function () { this.each(function () {
fn.call(this, options) fn.call(this, options);
}) });
return this return this;
} };
function refresh() { function refresh() {
var $s = $t.settings const $s = $t.settings;
//check if it's still visible //check if it's still visible
if ($s.autoDispose && !$.contains(document.documentElement, this)) { if ($s.autoDispose && !$.contains(document.documentElement, this)) {
//stop if it has been removed //stop if it has been removed
$(this).timeago("dispose") $(this).timeago("dispose");
return this return this;
} }
var data = prepareData(this) const data = prepareData(this);
if (!isNaN(data.datetime)) { if (!isNaN(data.datetime)) {
if ($s.cutoff === 0 || Math.abs(distance(data.datetime)) < $s.cutoff) { if ($s.cutoff === 0 || Math.abs(distance(data.datetime)) < $s.cutoff) {
$(this).text(inWords(data.datetime)) $(this).text(inWords(data.datetime));
} else { } else {
if ($(this).attr('title').length > 0) { if ($(this).attr('title').length > 0) {
$(this).text($(this).attr('title')) $(this).text($(this).attr('title'));
} }
} }
} }
return this return this;
} }
function prepareData(element) { function prepareData(element) {
element = $(element) element = $(element);
if (!element.data("timeago")) { if (!element.data("timeago")) {
element.data("timeago", { datetime: $t.datetime(element) }) element.data("timeago", { datetime: $t.datetime(element) });
var text = $.trim(element.text()) const text = $.trim(element.text());
if ($t.settings.localeTitle) { 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"))) { } 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) { function inWords(date) {
return $t.inWords(distance(date)) return $t.inWords(distance(date));
} }
function distance(date) { function distance(date) {
return (new Date().getTime() - date.getTime()) return (new Date().getTime() - date.getTime());
} }
// fix for IE6 suckage // fix for IE6 suckage
document.createElement("abbr") document.createElement("abbr");
document.createElement("time") document.createElement("time");
})) }));

View File

@@ -1,45 +1,15 @@
//バージョンチェッカー //バージョンチェッカー
function verck(ver, jp) { async function verck(ver) {
if (store) return false
console.log('%c Welcome😊 ' + ver, 'color: red;font-size:200%;') console.log('%c Welcome😊 ' + ver, 'color: red;font-size:200%;')
$('body').addClass(localStorage.getItem('platform')) document.querySelector('body').classList.add(localStorage.getItem('platform'))
var date = new Date() const date = new Date()
var showVer = false let 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)
if (localStorage.getItem('ver') != ver && localStorage.getItem('winstore')) { if (localStorage.getItem('ver') != ver && localStorage.getItem('winstore')) {
showVer = true showVer = true
console.log('%c Thank you for your update🎉', 'color: red;font-size:200%;') console.log('%c Thank you for your update🎉', 'color: red;font-size:200%;')
$(document).ready(function() { if (localStorage.getItem('winstore') && !pwa) {
if (localStorage.getItem('winstore') && !pwa) { openRN()
$('#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()
}
})
} }
localStorage.setItem('ver', ver) localStorage.setItem('ver', ver)
if (!showVer) { if (!showVer) {
@@ -49,287 +19,260 @@ function verck(ver, jp) {
!localStorage.getItem('showSupportMe') !localStorage.getItem('showSupportMe')
) { ) {
if (date.getMonth() == 11) { if (date.getMonth() == 11) {
var yrs = date.getFullYear() + 1 yrs = date.getFullYear() + 1
var nextmonth = yrs * 100 + 1 nextmonth = yrs * 100 + 1
} else { } else {
var yrs = date.getFullYear() yrs = date.getFullYear()
var nextmonth = yrs * 100 + date.getMonth() + 2 nextmonth = yrs * 100 + date.getMonth() + 2
} }
if (lang.language != 'ja') { if (lang.language != 'ja') {
$('#support-btm-ja').addClass('hide') document.querySelector('#support-btm-ja').classList.add('hide')
$('#support-btm-en').removeClass('hide') document.querySelector('#support-btm-en').classList.remove('hide')
} }
localStorage.setItem('showSupportMe', nextmonth) localStorage.setItem('showSupportMe', nextmonth)
$('#support-btm').removeClass('hide') document.querySelector('#support-btm').classList.remove('hide')
$('#support-btm').animate( document.querySelector('#support-btm').animate([
{ {
bottom: '0' bottom: '-500px'
}, },
{ {
duration: 300 bottom: '0'
} }
) ], 300);
} }
} }
var platform = localStorage.getItem('platform') const platform = localStorage.getItem('platform')
console.log('Your platform:' + platform) console.log('Your platform:' + platform)
if (!localStorage.getItem('winstore') && !pwa) { if (!localStorage.getItem('winstore') && !pwa) {
$('#start').css('display', 'flex') document.querySelector('#start').style.display = 'flex'
} }
let winstore = false
if ( if (
localStorage.getItem('winstore') == 'brewcask' || localStorage.getItem('winstore') == 'brewcask' ||
localStorage.getItem('winstore') == 'snapcraft' || localStorage.getItem('winstore') == 'snapcraft' ||
localStorage.getItem('winstore') == 'winstore' localStorage.getItem('winstore') == 'winstore'
) { ) {
var winstore = true winstore = true
} else { } else {
var winstore = false winstore = false
} }
var l = 5 const l = 5
// 生成する文字列に含める文字セット // 生成する文字列に含める文字セット
var c = 'abcdefghijklmnopqrstuvwxyz0123456789' const c = 'abcdefghijklmnopqrstuvwxyz0123456789'
var cl = c.length const cl = c.length
var r = '' let r = ''
for (var i = 0; i < l; i++) { for (var i = 0; i < l; i++) {
r += c[Math.floor(Math.random() * cl)] r += c[Math.floor(Math.random() * cl)]
} }
var start = 'https://thedesk.top/ver.json' const start = 'https://thedesk.top/ver.json'
fetch(start, { let mess
method: 'GET' try {
}) mess = await getApi(start, null)
.then(function(response) { } catch {
if (!response.ok) { return false
response.text().then(function(text) {
setLog(response.url, response.status, text)
})
}
return response.json()
})
.catch(function(error) {
todo(error)
setLog(start, 'JSON', error)
setLog(start, 'JSON', error)
console.error(error)
})
.then(function(mess) {
console.table(mess)
if (mess) {
//askjp_jp_ua: 2019年10月24日、mstdn.jpによるユーザーエージェントアクセス制限
if (jp && mess.jp_ua && !localStorage.getItem('askjp_jp_ua')) {
localStorage.setItem('askjp_jp_ua', true)
$('#askjp_jp_ua').removeClass('hide')
}
var platform = localStorage.getItem('platform')
if (platform == 'darwin') {
var newest = mess.desk_mac
} else {
var newest = mess.desk
}
if (newest == ver) {
todo(lang.lang_version_usever.replace('{{ver}}', mess.desk))
//betaかWinstoreならアプデチェックしない
} else if (ver.indexOf('beta') != -1 || winstore) {
} else {
localStorage.removeItem('instance')
if (localStorage.getItem('new-ver-skip')) {
if (localStorage.getItem('next-ver') != newest) {
postMessage(['sendSinmpleIpc', 'update'], '*')
} else {
console.warn(lang.lang_version_skipver)
todo(lang.lang_version_skipver)
}
} else {
postMessage(['sendSinmpleIpc', 'update'], '*')
}
}
}
})
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') console.table(mess)
fetch(start, { if (mess) {
method: 'GET', let newest = null
cors: true if (platform == 'darwin') {
}) newest = mess.desk_mac
.then(function(response) { } else {
if (!response.ok) { newest = mess.desk
response.text().then(function(text) { }
setLog(response.url, response.status, text) if (newest == ver) {
}) todo(lang.lang_version_usever.replace('{{ver}}', mess.desk))
} //betaかWinstoreならアプデチェックしない
return response.json() } else if (ver.indexOf('beta') != -1 || winstore) {
}) //skipped
.catch(function(error) { } else {
todo(error) if (localStorage.getItem('new-ver-skip')) {
setLog(start, 'JSON', error) if (localStorage.getItem('next-ver') != newest) {
console.error(error) postMessage(['sendSinmpleIpc', 'update'], '*')
}) } else {
.then(function(mess) { console.warn(lang.lang_version_skipver)
if (mess.length < 1) { todo(lang.lang_version_skipver)
return false
} else {
var last = localStorage.getItem('last-notice-id')
localStorage.setItem('last-notice-id', mess[0].ID)
for (i = 0; i < mess.length; i++) {
var obj = mess[i]
if (obj.ID * 1 <= last) {
break
} else {
if (obj.type == 'textv2') {
if (~obj.languages.indexOf(lang.language)) {
var showVer = true
if (obj.toot != '') {
var toot =
'<button class="btn-flat toast-action" onclick="detEx(\'' +
obj.toot +
"','main')\">Show</button>"
} else {
var toot = ''
}
if (obj.ver != '') {
if (obj.ver == ver) {
showVer = true
} else {
showVer = false
}
}
if (obj.domain != '') {
var multi = localStorage.getItem('multi')
if (multi) {
showVer = false
var accts = JSON.parse(multi)
Object.keys(accts).forEach(function(key) {
var acct = accts[key]
if (acct.domain == obj.domain) {
showVer = true
}
})
}
}
if (showVer) {
M.toast({
html:
escapeHTML(obj.text) +
toot +
'<span class="sml grey-text">(スライドして消去)</span>',
displayLength: 86400
})
}
}
}
}
} }
} else {
postMessage(['sendSinmpleIpc', 'update'], '*')
} }
}) }
}
let lni = localStorage.getItem('last-notice-id')
if (!lni) {
localStorage.setItem('last-notice-id', 0)
lni = 0
}
const getNotice = 'https://thedesk.top/notice/index.php?since_id=' + lni
let notices
try {
notices = await getApi(getNotice, null)
} catch {
return false
}
if (notices.length < 1) {
return false
} else {
localStorage.setItem('last-notice-id', notices[0].ID)
for (i = 0; i < notices.length; i++) {
var obj = notices[i]
if (obj.ID * 1 <= lni) {
break
} else {
toastInterpret(obj)
}
}
}
} }
var infostreaming = false let infostreaming = false
function infowebsocket() { function infowebsocket() {
infows = new WebSocket('wss://thedesk.top/ws/') infows = new WebSocket('wss://thedesk.top/ws/')
infows.onopen = function(mess) { infows.onopen = function (mess) {
console.log([tlid, ':Connect Streaming Info:', mess]) console.log([tlid, ':Connect Streaming Info:', mess])
infostreaming = true infostreaming = true
} }
infows.onmessage = function(mess) { infows.onmessage = function (mess) {
console.log([tlid, ':Receive Streaming:', JSON.parse(mess.data)]) console.log([tlid, ':Receive Streaming:', JSON.parse(mess.data)])
var obj = JSON.parse(mess.data) const obj = JSON.parse(mess.data)
localStorage.setItem('last-notice-id', obj.id)
if (obj.type != 'counter') { if (obj.type != 'counter') {
if (obj.type == 'textv2') { toastInterpret(obj)
if (~obj.languages.indexOf(lang.language)) {
localStorage.setItem('last-notice-id', obj.id)
var showVer = true
if (obj.toot != '') {
var toot =
'<button class="btn-flat toast-action" onclick="detEx(\'' +
obj.toot +
"','main')\">Show</button>"
} else {
var toot = ''
}
if (obj.ver != '') {
if (obj.ver == ver) {
showVer = true
} else {
showVer = false
}
}
if (obj.domain != '') {
var multi = localStorage.getItem('multi')
if (multi) {
showVer = false
var accts = JSON.parse(multi)
Object.keys(accts).forEach(function(key) {
var acct = accts[key]
if (acct.domain == obj.domain) {
showVer = true
}
})
}
}
if (showVer) {
console.log(obj.text)
console.log(escapeHTML(obj.text))
M.toast({
html:
escapeHTML(obj.text) +
toot +
'<span class="sml grey-text">(スライドして消去)</span>',
displayLength: 86400
})
}
}
}
} else { } else {
$('#persons').text(obj.text) const people = document.querySelector('#persons')
if(people) {
people.innerText = obj.text
}
} }
} }
infows.onerror = function(error) { infows.onerror = function (error) {
infostreaming = false infostreaming = false
console.error('Error closing:info') console.error('Error closing:info')
console.error(error) console.error(error)
return false return false
} }
infows.onclose = function() { infows.onclose = function () {
infostreaming = false infostreaming = false
console.error('Closing:info') console.error('Closing:info')
} }
} }
setInterval(function() { setInterval(function () {
if (!infostreaming) { if (!infostreaming) {
console.log('try to connect to base-streaming') console.log('try to connect to base-streaming')
infowebsocket() infowebsocket()
} }
}, 10000) }, 10000)
function openRN() { async function toastInterpret(obj) {
$('#releasenote').modal('open') if (obj.type == 'textv2') {
if (lang.language == 'ja') { if (~obj.languages.indexOf(lang.language)) {
verp = ver.replace('(', '') let showVer = true
verp = verp.replace('.', '-') let toot = null
verp = verp.replace('.', '-') if (obj.toot != '') {
verp = verp.replace('[', '-') toot = `<button class="btn-flat toast-action" data-toot="${obj.toot}">Show</button>`
verp = verp.replace(']', '') }
verp = verp.replace(')', '') if (obj.ver == ver) {
verp = verp.replace(' ', '_') showVer = true
$('#release-' + verp).show() } else {
} else { showVer = false
$('#release-en').show() }
} if (obj.domain != '') {
} const multi = localStorage.getItem('multi')
function closeSupport() { if (multi) {
$('#support-btm').animate( showVer = false
{ const accts = JSON.parse(multi)
bottom: '-300px' const keys = Object.keys(accts)
}, for (let i = 0; i < accts.length; i++) {
{ const key = keys[i]
duration: 300, const acct = accts[key]
complete: function() { if (acct.domain == obj.domain) {
$('#support-btm').addClass('hide') showVer = true
break
}
}
}
}
if (showVer) {
M.toast({
html: `${escapeHTML(obj.text)} ${toot} <span class="sml grey-text">(スライドして消去)</span>`,
displayLength: 86400
})
await sleep(500)
const targets = document.querySelectorAll('.toast-action')
for (let j = 0; j < targets.length; j++) {
const target = targets[j]
const toot = target.getAttribute('data-toot')
target.addEventListener('click', () => detEx(toot, 'main'))
}
} }
} }
) }
}
function openRN() {
console.log(kirishima)
M.Modal.getInstance(document.querySelector('#releasenote')).open()
if (lang.language == 'ja') {
verp = ver.replace('(', '').replace('.', '-').replace('.', '-').replace('[', '-').replace(']', '').replace(')', '').replace(' ', '_')
showElm(`#release-${verp}`)
} else {
showElm('#release-en')
}
}
async function closeSupport() {
document.querySelector('#support-btm').animate([
{
bottom: '0'
},
{
bottom: '-300px'
}
], 300);
await sleep(300)
document.querySelector('#support-btm').classList.add('hide')
}
function storeDialog(platform, ver) {
if (document.querySelector('body').classList.contain('accessibility')) return false
let mes = false
if (platform == 'win32') {
mes = lang.lang_version_platform
} else if (platform == 'linux') {
mes = lang.lang_version_platform_linux
} else if (platform == 'darwin') {
mes = lang.lang_version_platform_mac
}
if (mes) {
Swal.fire({
title: 'Select your platform',
text: mes,
type: 'info',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#3085d6',
confirmButtonText: lang.lang_no,
cancelButtonText: lang.lang_yesno
}).then(result => {
//逆にしてる
if (!result.value) {
localStorage.setItem('winstore', 'winstore')
} else {
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%;')
openRN()
})
} else {
localStorage.setItem('ver', ver)
showVer = true
console.log('%c Thank you for your update🎉', 'color: red;font-size:200%;')
openRN()
}
} }
function closeStart() { function closeStart() {
$('#start').css('display', 'none') $('#start').css('display', 'none')
var platform = localStorage.getItem('platform') document.querySelector('#start').style.display = 'none'
var ver = localStorage.getItem('ver') const platform = localStorage.getItem('platform')
const ver = localStorage.getItem('ver')
storeDialog(platform, ver)
} }

View File

@@ -1,5 +1,5 @@
var defaultemojiList = ['activity', 'flag', 'food', 'nature', 'object', 'people', 'place', 'symbol'] const defaultemojiList = ['activity', 'flag', 'food', 'nature', 'object', 'people', 'place', 'symbol']
var defaultemoji = { const defaultemoji = {
activity: activity, activity: activity,
flag: flag, flag: flag,
food: food, food: food,
@@ -9,8 +9,18 @@ var defaultemoji = {
place: place, place: place,
symbol: symbol symbol: symbol
} }
let defaultemojiname = {
activity: 'Activities',
flag: 'Flags',
food: 'Foods',
nature: 'Nature',
object: 'Tools',
people: 'People',
place: 'Places',
symbol: 'Symbols'
}
if (lang == 'ja') { if (lang == 'ja') {
var defaultemojiname = { defaultemojiname = {
activity: '活動', activity: '活動',
flag: '国旗', flag: '国旗',
food: '食べ物', food: '食べ物',
@@ -20,33 +30,23 @@ if (lang == 'ja') {
place: '場所', place: '場所',
symbol: '記号' symbol: '記号'
} }
} else {
var defaultemojiname = {
activity: 'Activities',
flag: 'Flags',
food: 'Foods',
nature: 'Nature',
object: 'Tools',
people: 'People',
place: 'Places',
symbol: 'Symbols'
}
} }
function defaultEmoji(target) { function defaultEmoji(target) {
var announcement = false let announcement = false
if ($('#media').val() == 'announcement') { if (document.querySelector('#media').value == 'announcement') {
announcement = true announcement = true
} }
var json = defaultemoji[target] const json = defaultemoji[target]
var emojis = '' const keymap = Object.keys(json)
Object.keys(json).forEach(function(key) { let emojis = ''
var emoji = json[key] for (let i = 0; i < json.length; i++) {
if (announcement) { const key = keymap[i]
var def = `<a onclick="emojiReactionDef('${emoji['shortcode']}')" class="pointer">` const emoji = json[key]
} else { let def = `<a data-shortcode="${emoji['shortcode']}" class="pointer defEmoji">`
var def = `<a onclick="defEmoji('${emoji['shortcode']}')" class="pointer">` if (announcement) {
} def = `<a data-shortcode="${emoji['shortcode']}" class="pointer defEmoji">`
}
emojis = emojis =
emojis + emojis +
`${def} `${def}
@@ -54,52 +54,39 @@ function defaultEmoji(target) {
width: 20px; height: 20px; display: inline-block; background-image: url('../../img/sheet.png'); background-size: 4900%; width: 20px; height: 20px; display: inline-block; background-image: url('../../img/sheet.png'); background-size: 4900%;
background-position:${emoji['css']};"></span> background-position:${emoji['css']};"></span>
</a>` </a>`
}) }
$('#emoji-list').html(emojis) document.querySelector('#emoji-list').innerHTML = emojis
$('#now-emoji').text(lang.lang_defaultemojis_text.replace('{{cat}}', defaultemojiname[target])) document.querySelector('#now-emoji').innerText = lang.lang_defaultemojis_text.replace('{{cat}}', defaultemojiname[target])
$('.emoji-control').addClass('hide') document.querySelector('.emoji-control').classList.add('hide')
const targets = document.querySelectorAll('.defEmoji')
for (let j = 0; j < targets.length; j++) {
const target = targets[j]
const sc = target.getAttribute('data-shortcode')
target.addEventListener('click', () => defEmoji(sc))
}
} }
function customEmoji() { function customEmoji() {
$('#emoji-suggest').val('') document.querySelector('#emoji-suggest').value = ''
$('.emoji-control').removeClass('hide') document.querySelector('.emoji-control').classList.remove('hide')
emojiList('home') emojiList('home')
} }
function defEmoji(target) { function defEmoji(target) {
var selin = $('#textarea').prop('selectionStart') const textarea = document.querySelector('#textarea')
let selin = textarea.selectionStart
if (!selin) { if (!selin) {
selin = 0 selin = 0
} }
var emojiraw = newpack.filter(function(item, index) { const hex = emojipack[target].unified.split('-')
if (item.short_name == target) return true let emoji = twemoji.convert.fromCodePoint(hex[0])
})
var hex = emojiraw[0].unified.split('-')
if (hex.length === 2) { if (hex.length === 2) {
emoji = twemoji.convert.fromCodePoint(hex[0]) + twemoji.convert.fromCodePoint(hex[1]) emoji = twemoji.convert.fromCodePoint(hex[0]) + twemoji.convert.fromCodePoint(hex[1])
} else {
emoji = twemoji.convert.fromCodePoint(hex[0])
} }
var now = $('#textarea').val() const now = textarea.value
var before = now.substr(0, selin) const before = now.substr(0, selin)
var after = now.substr(selin, now.length) const after = now.substr(selin, now.length)
newt = before + emoji + after const newt = before + emoji + after
$('#textarea').val(newt) textarea.value = newt
$('#textarea').focus() textarea.focus()
}
function faicon() {
var json = faicons
var emojis = ''
Object.keys(json).forEach(function(key) {
var emoji = json[key]
var eje = emoji.replace(/fa-/g, '')
emojis =
emojis +
'<a onclick="emojiInsert(\'[faicon]' +
eje +
'[/faicon]\')" class="pointer white-text" style="font-size:24px"><i class="fa ' +
emoji +
'"></i></a>'
})
$('#emoji-list').html(emojis)
$('#now-emoji').text('faicon')
$('.emoji-control').addClass('hide')
} }

File diff suppressed because one or more lines are too long

View File

@@ -1,5 +1,5 @@
//インスタンスリスト //インスタンスリスト
var idata = { const idata = {
"kirishima.cloud": "instance", "kirishima.cloud": "instance",
"kirishima.cloud_name": "アスタルテ", "kirishima.cloud_name": "アスタルテ",
"kirishima.cloud_letters": "6229", "kirishima.cloud_letters": "6229",
@@ -83,6 +83,4 @@ var idata = {
"nitiasa.com_quote":"enabled", "nitiasa.com_quote":"enabled",
"biwakodon.com_quote":"enabled", "biwakodon.com_quote":"enabled",
"comm.cx_quote":"enabled" "comm.cx_quote":"enabled"
} };
localStorage.setItem("instance", JSON.stringify(idata))

View File

@@ -1,618 +1,276 @@
/*ログイン処理・認証までのJS*/ /*ログイン処理・認証までのJS*/
//最初に読むやつ //最初に読むやつ
//アスタルテ判定初期化
localStorage.removeItem('kirishima') localStorage.removeItem('kirishima')
localStorage.removeItem('quoters') localStorage.removeItem('quoters')
localStorage.removeItem('imas') localStorage.removeItem('imas')
localStorage.removeItem('image') //stable, 固定タグのことらしい。ふざけるな。
localStorage.removeItem('stable') localStorage.removeItem('stable')
localStorage.setItem('mode_misskey.xyz', 'misskey') const acctList = JSON.parse(localStorage.getItem('multi'))
function ck() {
var main = localStorage.getItem('main') async function ck() {
const main = localStorage.getItem('main')
if (!main) { if (!main) {
localStorage.setItem('main', 0) localStorage.setItem('main', '0')
} }
//コード受信 //コード受信
if (location.search) { if (location.search) {
var m = location.search.match(/\?mode=([a-zA-Z-0-9]+)\&code=(.+)/) const m = location.search.match(/\?mode=([a-zA-Z-0-9]+)\&code=(.+)/)
var mode = m[1] const mode = m[1]
var codex = m[2] const codex = m[2]
if (mode == 'manager' || mode == 'login') { if (mode == 'manager' || mode == 'login') {
code(codex, mode) code(codex, mode)
} else { } else {
} }
} }
var multi = localStorage.getItem('multi') const multi = localStorage.getItem('multi')
if (!multi || multi == '[]') { if (!multi || multi == '[]') {
var date = new Date() const date = new Date()
localStorage.setItem('showSupportMe', date.getMonth() + 2) localStorage.setItem('showSupportMe', date.getMonth() + 2)
location.href = 'acct.html?mode=first&code=true' location.href = 'acct.html?mode=first&code=true'
} else { } else {
var obj = JSON.parse(multi) const obj = JSON.parse(multi)
var jp = false const keymap = Object.keys(obj)
Object.keys(obj).forEach(function(key) { let req = false
var acct = obj[key] for (let i = 0; i < keymap.length; i++) {
const key = keymap[i]
const acct = obj[key]
if (acct.domain) { if (acct.domain) {
refresh(key, true) let refreshed = await refresh(key, true)
if (refreshed) req = true
} }
if (acct.domain == 'mstdn.jp') { }
jp = true if (req) {
} Swal.fire({
}) title: 'Reload required',
text: lang.lang_login_changedData,
type: 'info',
showCancelButton: true,
confirmButtonText: lang.lang_no,
cancelButtonText: lang.lang_yesno
}).then(result => {
if (result) location.reload()
})
}
if (obj[0].domain) { if (obj[0].domain) {
$('#tl').show() showElm('#tl')
ticker() ticker()
multiSelector(false) parseColumn()
verck(ver, jp) verck(ver)
$('.stw').show() showElm('.stw')
if (localStorage.getItem('tips')) { const tipsType = localStorage.getItem('tips')
tips(localStorage.getItem('tips')) if (tipsType) {
tips(tipsType)
} }
$('#something-wrong img').attr('src', '../../img/thinking.svg') document.querySelector('#something-wrong img').setAttribute('src', '../../img/thinking.svg')
} }
} }
} }
ck() ck()
//ログインポップアップ
function login(url) {
if ($('#linux:checked').val() == 'on') {
var red = 'urn:ietf:wg:oauth:2.0:oob'
} else {
var red = 'thedesk://login'
}
localStorage.setItem('redirect', red)
var start = 'https://' + url + '/api/v1/apps'
var httpreq = new XMLHttpRequest()
httpreq.open('POST', start, true)
httpreq.setRequestHeader('Content-Type', 'application/json')
httpreq.responseType = 'json'
httpreq.send(
JSON.stringify({
scopes: 'read write follow',
client_name: 'TheDesk(PC)',
redirect_uris: red,
website: 'https://thedesk.top'
})
)
httpreq.onreadystatechange = function() {
if (httpreq.readyState === 4) {
var json = httpreq.response
if (this.status !== 200) {
setLog(start, this.status, json)
}
var auth =
'https://' +
url +
'/oauth/authorize?client_id=' +
json['client_id'] +
'&client_secret=' +
json['client_secret'] +
'&response_type=code&redirect_uri=' +
red +
'&scope=read+write+follow'
localStorage.setItem('domain_' + acct_id, url)
localStorage.setItem('client_id', json['client_id'])
localStorage.setItem('client_secret', json['client_secret'])
$('#auth').show()
$('#masara').hide()
postMessage(['openUrl', auth], '*')
if ($('#linux:checked').val() == 'on') {
} else {
postMessage(['sendSinmpleIpc', 'quit'], '*')
}
}
}
}
//テキストボックスにURL入れた
function instance() {
var url = $('#url').val()
login(url)
}
//コードを入れた後認証
function code(code, mode) {
var red = localStorage.getItem('redirect')
localStorage.removeItem('redirect')
if (!code) {
var code = $('#code').val()
}
if (localStorage.getItem('domain_tmp')) {
var url = localStorage.getItem('domain_tmp')
} else {
var url = localStorage.getItem('domain_' + acct_id)
}
var start = 'https://' + url + '/oauth/token'
var id = localStorage.getItem('client_id')
var secret = localStorage.getItem('client_secret')
fetch(start, {
method: 'POST',
headers: {
'content-type': 'application/json'
},
body: JSON.stringify({
grant_type: 'authorization_code',
redirect_uri: red,
client_id: id,
client_secret: secret,
code: code
})
})
.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) {
todo(json)
if (json['access_token']) {
localStorage.setItem(url + '_at', json['access_token'])
if (mode == 'manager') {
getdataAdv(url, json['access_token'])
} else {
getdata()
}
}
})
}
//ユーザーデータ取得(最初)
function getdata() {
var acct_id = 0
var domain = localStorage.getItem('domain_' + acct_id)
var at = localStorage.getItem('acct_' + acct_id + '_at')
var start = 'https://' + domain + '/api/v1/accounts/verify_credentials'
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) {
if (json.error) {
console.error('Error:' + json.error)
M.toast({ html: lang.lang_fatalerroroccured + 'Error:' + json.error, displayLength: 5000 })
return
}
var avatar = json['avatar']
//missingがmissingなやつ
if (avatar == '/avatars/original/missing.png') {
avatar = './img/missing.svg'
}
var obj = [
{
at: at,
name: json['display_name'],
domain: domain,
user: json['acct'],
prof: avatar,
id: json['id'],
vis: json['source']['privacy']
}
]
var json = JSON.stringify(obj)
localStorage.setItem('multi', json)
localStorage.setItem('name_' + acct_id, json['display_name'])
localStorage.setItem('user_' + acct_id, json['acct'])
localStorage.setItem('user-id_' + acct_id, json['id'])
localStorage.setItem('prof_' + acct_id, avatar)
$('#masara').hide()
$('#auth').hide()
$('#tl').show()
parseColumn()
ckdb()
})
}
//ユーザーデータ取得(追加)
function getdataAdv(domain, at) {
var start = 'https://' + domain + '/api/v1/accounts/verify_credentials'
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) {
if (json.error) {
console.error('Error:' + json.error)
M.toast({ html: lang.lang_fatalerroroccured + 'Error:' + json.error, displayLength: 5000 })
return
}
var avatar = json['avatar']
//missingがmissingなやつ
if (avatar == '/avatars/original/missing.png') {
avatar = '../../img/missing.svg'
}
if (json['source']['privacy']) {
var priv = json['source']['privacy']
} else {
var priv = 'public'
}
var add = {
at: at,
name: json['display_name'],
domain: domain,
user: json['acct'],
prof: avatar,
id: json['id'],
vis: priv
}
var multi = localStorage.getItem('multi')
var obj = JSON.parse(multi)
var target = obj.lengtth
obj.push(add)
localStorage.setItem('name_' + target, json['display_name'])
localStorage.setItem('user_' + target, json['acct'])
localStorage.setItem('user-id_' + target, json['id'])
localStorage.setItem('prof_' + target, avatar)
var json = JSON.stringify(obj)
localStorage.setItem('multi', json)
location.href = 'index.html'
})
}
//ユーザーデータ更新 //ユーザーデータ更新
function refresh(target, loadskip) { async function refresh(target, loadskip) {
var multi = localStorage.getItem('multi') let obj = acctList
var obj = JSON.parse(multi) let requireReload = false
if (obj[target].mode == 'misskey') { const { mode, domain, at, background, text, name, prof, vis } = obj[target]
if (mode == 'misskey') {
return return
} }
var start = 'https://' + obj[target].domain + '/api/v1/accounts/verify_credentials' const start = `https://${domain}/api/v1/accounts/verify_credentials`
fetch(start, { let json
method: 'GET', try {
headers: { json = await getApi(start, at)
'content-type': 'application/json', } catch {
Authorization: 'Bearer ' + obj[target].at return false
}
if (json.error) {
console.error('Error:' + json.error)
M.toast({ html: lang.lang_fatalerroroccured + 'Error:' + json.error, displayLength: 5000 })
return
}
if (!json) return false
let avatar = json['avatar']
//missingがmissingなやつ
if (avatar == '/avatars/original/missing.png' || !avatar) {
avatar = './img/missing.svg'
}
const newName = json.display_name
const newProf = avatar
const newVis = json.source.privacy
if (newName != name || newProf != prof || newVis != vis) {
let ref = {
at: at,
name: newName,
domain: domain,
user: json['acct'],
prof: avatar,
id: json['id'],
vis: newVis
} }
}) if (background) {
.then(function(response) { ref.background = background
if (!response.ok) { }
response.text().then(function(text) { if (text) {
setLog(response.url, response.status, text) ref.text = text
}) }
} if (json['source']['sensitive']) {
return response.json() localStorage.setItem('nsfw_' + target, true)
}) } else {
.catch(function(error) { localStorage.removeItem('nsfw_' + target)
todo(error) }
setLog(start, 'JSON', error) obj[target] = ref
console.error(error) const save = JSON.stringify(obj)
}) localStorage.setItem('multi', save)
.then(function(json) { requireReload = true
if (json.error) { }
console.error('Error:' + json.error) if (!loadskip) {
M.toast({ html: lang.lang_fatalerroroccured + 'Error:' + json.error, displayLength: 5000 }) load()
return } else {
} return requireReload
var avatar = json['avatar'] }
//missingがmissingなやつ
if (avatar == '/avatars/original/missing.png' || !avatar) {
avatar = './img/missing.svg'
}
var ref = {
at: obj[target].at,
name: json['display_name'],
domain: obj[target].domain,
user: json['acct'],
prof: avatar,
id: json['id'],
vis: json['source']['privacy']
}
if (obj[target].background) {
ref.background = obj[target].background
}
if (obj[target].text) {
ref.text = obj[target].text
}
localStorage.setItem('name_' + target, json['display_name'])
localStorage.setItem('user_' + target, json['acct'])
localStorage.setItem('user-id_' + target, json['id'])
localStorage.setItem('prof_' + target, avatar)
localStorage.setItem('follow_' + target, json['following_count'])
if (json['source']['sensitive']) {
localStorage.setItem('nsfw_' + target, 'true')
} else {
localStorage.removeItem('nsfw_' + target)
}
obj[target] = ref
var json = JSON.stringify(obj)
localStorage.setItem('multi', json)
if (!loadskip) {
load()
}
})
} }
//MarkdownやBBCodeの対応、文字数制限をチェック //MarkdownやBBCodeの対応、文字数制限をチェック
//絶対ストリーミングを閉じさせないマン //絶対ストリーミングを閉じさせないマン
function ckdb(acct_id) { async function ckdb(acct_id) {
var domain = localStorage.getItem('domain_' + acct_id) const domain = localStorage.getItem(`domain_${acct_id}`)
localStorage.removeItem('home_' + acct_id)
localStorage.removeItem('bb_' + acct_id)
localStorage.removeItem('md_' + acct_id)
localStorage.removeItem('local_' + acct_id)
localStorage.removeItem('public_' + acct_id)
localStorage.removeItem('notification_' + acct_id)
localStorage.removeItem('post_' + acct_id)
localStorage.removeItem('fav_' + acct_id)
localStorage.removeItem('bt_' + acct_id)
localStorage.removeItem('followlocale_' + acct_id)
if (domain == 'kirishima.cloud') { if (domain == 'kirishima.cloud') {
localStorage.setItem('kirishima', 'true') localStorage.setItem('kirishima', true)
} else if (domain == 'imastodon.net') { } else if (domain == 'imastodon.net') {
localStorage.setItem('imas', 'true') localStorage.setItem('imas', true)
$('.imasonly').show() showElm('.imasonly')
} }
var at = localStorage.getItem('acct_' + acct_id + '_at') const at = localStorage.getItem(`acct_${acct_id}_at`)
var bbcode = domain + '_bbcode' const letters = `${domain}_letters`
var letters = domain + '_letters' const quoteMarker = `${domain}_quote`
var quoteMarker = domain + '_quote'
if (localStorage.getItem('instance')) {
var json = JSON.parse(localStorage.getItem('instance'))
if (json[quoteMarker] == 'enabled') {
localStorage.setItem('quoters', 'true')
localStorage.setItem('quote_' + acct_id, 'true')
}
if (json[bbcode]) {
if (json[bbcode] == 'enabled') {
localStorage.setItem('bb_' + acct_id, 'true')
} else {
localStorage.removeItem('bb_' + acct_id)
$("[data-activates='bbcode']").addClass('disabled')
$("[data-activates='bbcode']").prop('disabled', true)
}
} else {
localStorage.removeItem('bb_' + acct_id)
$("[data-activates='bbcode']").addClass('disabled')
$("[data-activates='bbcode']").addClass('disabled', true)
}
if (json[domain + '_markdown'] == 'enabled') { if (idata) {
localStorage.setItem('md_' + acct_id, 'true') //check and replace json to idata
$('.markdown').show() const json = idata
} else { if (json[quoteMarker] == 'enabled') {
$('.anti-markdown').hide() localStorage.setItem('quoters', true)
$('.markdown').hide() localStorage.setItem(quoteMarker, true)
localStorage.removeItem('bb_' + acct_id)
}
if (json[domain + '_home']) {
localStorage.setItem('home_' + acct_id, json[domain + '_home'])
}
if (json[domain + '_local']) {
localStorage.setItem('local_' + acct_id, json[domain + '_local'])
}
if (json[domain + '_public']) {
localStorage.setItem('public_' + acct_id, json[domain + '_public'])
}
if (json[domain + '_notification']) {
localStorage.setItem('notification_' + acct_id, json[domain + '_notification'])
}
if (json[domain + '_post']) {
localStorage.setItem('post_' + acct_id, json[domain + '_post'])
}
if (json[domain + '_fav']) {
localStorage.setItem('fav_' + acct_id, json[domain + '_fav'])
}
if (json[domain + '_bt']) {
localStorage.setItem('bt_' + acct_id, json[domain + '_bt'])
}
if (json[domain + '_follow']) {
localStorage.setItem('followlocale_' + acct_id, json[domain + '_follow'])
} }
} }
if (localStorage.getItem('mode_' + domain) != 'misskey') { if (!isMisskey(domain)) {
var start = 'https://' + domain + '/api/v1/instance' const start = `https://${domain}/api/v1/instance`
fetch(start, { let json
method: 'GET', try {
headers: { json = await getApi(start, null)
'content-type': 'application/json' } catch {
} return null
}) }
.then(function(response) { if (!json || json.error) {
return response.json() return
}) }
.catch(function(error) { const mtc = json['max_toot_chars']
console.error(error) if (mtc) {
}) localStorage.setItem(letters, mtc)
.then(function(json) { }
if (json.error) { if (json['feature_quote']) {
console.error(json.error) localStorage.setItem(quoteMarker, true)
return }
} const str = json['urls']['streaming_api']
if (json) { if (str) {
if (json['max_toot_chars']) { localStorage.setItem(`streaming_${domain}`, str)
localStorage.setItem('letters_' + acct_id, json['max_toot_chars']) }
}
if (json['urls']['streaming_api']) {
localStorage.setItem('streaming_' + acct_id, json['urls']['streaming_api'])
} else {
localStorage.removeItem('streaming_' + acct_id)
}
}
})
} else {
} }
} }
//アカウントを選択…を実装 //アカウントを選択…を実装
function multiSelector(parseC) { function multiSelector() {
var multi = localStorage.getItem('multi') let obj = acctList
if (!multi) { //if (!obj) obj = JSON.parse(localStorage.getItem('multi'))
var obj = [] let template = ''
var json = JSON.stringify(obj) //StringなのはlocalStorageがStringしか返さないから
localStorage.setItem('multi', json) let lastUsed = '0'
} else {
var obj = JSON.parse(multi)
}
var templete
if (localStorage.getItem('mainuse') == 'main') { if (localStorage.getItem('mainuse') == 'main') {
var last = localStorage.getItem('main') lastUsed = localStorage.getItem('main')
} else if (localStorage.getItem('last-use')) { } else if (localStorage.getItem('last-use')) {
var last = localStorage.getItem('last-use') lastUsed = localStorage.getItem('last-use')
if (last == 'webview' || last == 'noauth') { if (lastUsed == 'webview' || lastUsed == 'noauth') {
last = '0' lastUsed = '0'
} }
} else { } else {
var last = '0' lastUsed = '0'
} }
last = last + '' let sel
var sel
if (obj.length < 1) { if (obj.length < 1) {
$('#src-acct-sel').html('<option value="tootsearch">Tootsearch</option>') document.querySelector('#src-acct-sel').innerHTML = '<option value="tootsearch">Tootsearch</option>'
$('#add-acct-sel').html('<option value="noauth">' + lang.lang_login_noauth + '</option>') document.querySelector('#add-acct-sel').innerHTML = `<option value="noauth">${lang.lang_login_noauth}</option>`
} else { } else {
Object.keys(obj).forEach(function(key) { for (let i = 0; i < obj.length; i++) {
var acct = obj[key] const acct = obj[i]
var list = key * 1 + 1 const strKey = i.toString()
if (key + '' === last) { if (strKey == lastUsed) {
sel = 'selected' sel = 'selected'
var domain = acct.domain const domain = acct.domain
localStorage.setItem('domain_' + key, domain) const letters = idata[`${domain}_letters`]
if (idata[domain + '_letters']) { const textarea = document.querySelector('#textarea')
$('#textarea').attr('data-length', idata[domain + '_letters']) if (letters) {
textarea.setAttribute('data-length', letters)
} else { } else {
var maxletters = localStorage.getItem('letters_' + key) //手動でアカマネで変えれちゃうから
if (maxletters > 0) { const maxLetters = localStorage.getItem(`${domain}_letters`)
$('#textarea').attr('data-length', maxletters) if (maxLetters > 0) {
textarea.setAttribute('data-length', maxLetters)
} else { } else {
$('#textarea').attr('data-length', 500) textarea.setAttribute('data-length', 500)
} }
} }
if (idata[domain + '_glitch']) { if (idata[`${domain}_glitch`]) {
$('#local-button').removeClass('hide') document.querySelector('#local-button').classList.remove('hide')
} }
var profimg = acct.prof let profimg = acct.prof
//localStorage.setItem("prof_" + key, profimg);
if (!profimg) { if (!profimg) {
profimg = '../../img/missing.svg' profimg = '../../img/missing.svg'
} }
$('#acct-sel-prof').attr('src', profimg) document.querySelector('#acct-sel-prof').setAttribute('src', profimg)
let cc = ''
if (domain) { if (domain) {
var cc = '(' + domain + ')' cc = `(${domain})`
} else {
var cc = ''
} }
$('#toot-post-btn').text(lang.lang_toot + cc) const tpb = document.querySelector('#toot-post-btn')
tpb.innerText = lang.lang_toot + cc
if (acct.background && acct.background != 'def' && acct.text && acct.text != 'def') { if (acct.background && acct.background != 'def' && acct.text && acct.text != 'def') {
$('#toot-post-btn').removeClass('indigo') tpb.classList.remove('indigo')
$('#toot-post-btn').css('background-color', '#' + acct.background) tpb.style.backgroundColor = `#${acct.background}`
$('#toot-post-btn').css('color', acct.text) tpb.style.color = `#${acct.text}`
} else {
}
if (domain == 'kirishima.cloud') {
$('#faicon-btn').show()
} else {
$('#faicon-btn').hide()
} }
if (domain == 'imastodon.net') { if (domain == 'imastodon.net') {
trendTag() trendTag()
} else { } else {
$('#trendtag').html('') if (document.querySelector('#trendtag')) document.querySelector('#trendtag').innerHTML = ''
} }
} else { } else {
sel = '' sel = ''
} }
templete = template = template + `
'<option value="' + <option value="${strKey}" data-icon="${acct.prof}" class="left circle" ${sel}>@${acct.user}@${acct.domain}
key + </option>
'" data-icon="' + `
acct.prof + }
'" class="left circle" ' + const forSrc = template + '<option value="tootsearch">Tootsearch</option>'
sel + const forAdd = template + `
'>' + <option value="noauth">${lang.lang_login_noauth}</option>
acct.user + <option value="webview">Twitter</option>
'@' + `
acct.domain + const forDir = template + `<option value="noauth">${lang.lang_login_noauth}</option>`
'</option>' document.querySelector('#post-acct-sel').innerHTML = template
$('.acct-sel').append(templete) document.querySelector('#list-acct-sel').innerHTML = template
}) document.querySelector('#filter-acct-sel').innerHTML = template
$('#src-acct-sel').append('<option value="tootsearch">Tootsearch</option>') document.querySelector('#src-acct-sel').innerHTML = forSrc
$('#add-acct-sel').append( document.querySelector('#add-acct-sel').innerHTML = forAdd
'<option value="noauth">' + document.querySelector('#dir-acct-sel').innerHTML = forDir
lang.lang_login_noauth +
'</option><option value="webview">Twitter</option>'
)
$('#dir-acct-sel').append('<option value="noauth">' + lang.lang_login_noauth + '</option>')
} }
$('select').formSelect() const elems = document.querySelectorAll('select')
if (!parseC) { M.FormSelect.init(elems, null)
parseColumn(null, true)
}
}
//バージョンエンコ
function enc(ver) {
var ver = ver.replace(/\s/g, '')
var ver = ver.replace(/\(/g, '-')
var ver = ver.replace(/\)/g, '')
var ver = ver.replace(/\[/g, '_')
var ver = ver.replace(/\]/g, '')
return ver
} }
//インスタンスティッカー //インスタンスティッカー
function ticker() { async function ticker() {
var start = 'https://s.0px.io/json' const start = 'https://toot-app.thedesk.top/toot/index.php'
fetch(start, { const json = await getApi(start, null)
method: 'GET', if (json) localStorage.setItem('ticker', JSON.stringify(json))
cors: true,
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) {
console.error(error)
})
.then(function(json) {
if (json) {
localStorage.removeItem('ticker')
localStorage.setItem('sticker', JSON.stringify(json))
}
})
} }
function isMisskey(domain) {
return localStorage.getItem(`mode_${domain}`) == 'misskey'
}

View File

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

File diff suppressed because it is too large Load Diff

View File

@@ -130,11 +130,17 @@ function playSound() {
volumeControl.gain.value = vol volumeControl.gain.value = vol
source.start(0) source.start(0)
soundFile = source soundFile = source
function newFunction() {
var source
return source
}
} }
function nano() { function nano() {
postMessage(['nano', null], '*') postMessage(['nano', null], '*')
} }
onmessage = function(e) { onmessage = function(e) {
console.log(e)
if (e.data[0] == 'details') { if (e.data[0] == 'details') {
details(e.data[1][0], e.data[1][1]) details(e.data[1][0], e.data[1][1])
} else if (e.data[0] == 'udg') { } else if (e.data[0] == 'udg') {
@@ -170,7 +176,7 @@ onmessage = function(e) {
} else if (e.data[0] == 'npCore') { } else if (e.data[0] == 'npCore') {
npCore(e.data[1]) npCore(e.data[1])
} else if (e.data[0] == 'renderMem') { } else if (e.data[0] == 'renderMem') {
renderMem(e.data[1][0], e.data[1][1], e.data[1][2], e.data[1][3], e.data[1][4]) renderMem(e.data[1][0], e.data[1][1], e.data[1][2])
} else if (e.data[0] == 'updateProg') { } else if (e.data[0] == 'updateProg') {
updateProg(e.data[1]) updateProg(e.data[1])
} else if (e.data[0] == 'updateMess') { } else if (e.data[0] == 'updateMess') {
@@ -215,16 +221,4 @@ if(pwa) {
} }
} }
} }
} }
const connection = function (event) {
console.log(navigator.onLine, 'network state')
if(!navigator.onLine) {
$('#re-online').addClass('hide')
$('#offline').removeClass('hide')
} else if(!$('#offline').hasClass('hide')) {
$('#offline').addClass('hide')
$('#re-online').removeClass('hide')
}
}
window.onoffline = connection
window.ononline = connection

View File

@@ -13,12 +13,7 @@ function escapeHTML(str) {
if (!str) { if (!str) {
return '' return ''
} }
return str return str.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;').replace(/'/g, '&#039;')
.replace(/&/g, '&amp;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;')
.replace(/'/g, '&#039;')
} }
//PHPのnl2brと同様 //PHPのnl2brと同様
function nl2br(str) { function nl2br(str) {
@@ -88,18 +83,18 @@ function formattimeutc(date) {
} }
postMessage(['sendSinmpleIpc', 'custom-css-request'], '*') postMessage(['sendSinmpleIpc', 'custom-css-request'], '*')
function makeCID() { function makeCID() {
let chars = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".split("") let chars = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.split('')
for (let i = 0, len = chars.length; i < len; i++) { for (let i = 0, len = chars.length; i < len; i++) {
switch (chars[i]) { switch (chars[i]) {
case "x": case 'x':
chars[i] = Math.floor(Math.random() * 16).toString(16) chars[i] = Math.floor(Math.random() * 16).toString(16)
break break
case "y": case 'y':
chars[i] = (Math.floor(Math.random() * 4) + 8).toString(16) chars[i] = (Math.floor(Math.random() * 4) + 8).toString(16)
break break
} }
} }
return chars.join("") return chars.join('')
} }
function randomStr(l) { function randomStr(l) {
// 生成する文字列に含める文字セット // 生成する文字列に含める文字セット
@@ -130,7 +125,7 @@ function rgbToHex(color) {
// RGBからHEXへ変換 // RGBからHEXへ変換
parseInt(regex[1]).toString(16), parseInt(regex[1]).toString(16),
parseInt(regex[2]).toString(16), parseInt(regex[2]).toString(16),
parseInt(regex[3]).toString(16) parseInt(regex[3]).toString(16),
] ]
for (var i = 0; i < rgb.length; ++i) { for (var i = 0; i < rgb.length; ++i) {
@@ -253,7 +248,7 @@ function statusModel(now) {
reblog: null, reblog: null,
application: { application: {
name: null, name: null,
website: null website: null,
}, },
account: { account: {
id: '', id: '',
@@ -274,12 +269,53 @@ function statusModel(now) {
statuses_count: 0, statuses_count: 0,
last_status_at: now, last_status_at: now,
emojis: [], emojis: [],
fields: [] fields: [],
}, },
media_attachments: [], media_attachments: [],
mentions: [], mentions: [],
tags: [], tags: [],
card: null, card: null,
poll: null poll: null,
} }
} }
function isFocused(query) {
const allTarget = document.querySelectorAll(query)
const active = document.activeElement
let is = false
for (let i = 0; i < allTarget.length; i++) {
if (allTarget[i] == active) {
is = true
break
}
}
return is
}
function getHeight(query) {
const elm = document.querySelector(query)
return parseFloat(getComputedStyle(elm, null).height.replace('px', ''))
}
function showElm(query) {
const allTarget = document.querySelectorAll(query)
for (let i = 0; i < allTarget.length; i++) {
const target = allTarget[i]
target.style.display = 'inherit'
}
}
function setAllClasses(query, className, action) {
const allTarget = document.querySelectorAll(query)
for (let i = 0; i < allTarget.length; i++) {
const target = allTarget[i]
if (action == 'add') target.classList.add(className)
if (action == 'remove') target.classList.remove(className)
}
}
function appendPrepend(query, elm, action) {
const allTarget = document.querySelectorAll(query)
for (let i = 0; i < allTarget.length; i++) {
const target = allTarget[i]
if (action == 'prepend') target.insertBefore(elm, target.firstChild)
if (action == 'append') target.appendChild(document.createTextNode(elm))
}
}
const sleep = (msec) => new Promise((resolve) => setTimeout(resolve, msec))

View File

@@ -2,9 +2,25 @@ var electron = require('electron')
const shell = electron.shell const shell = electron.shell
var ipc = electron.ipcRenderer var ipc = electron.ipcRenderer
//title bar //title bar
const customTitlebar = require('custom-electron-titlebar')
window.addEventListener('DOMContentLoaded', () => { window.addEventListener('DOMContentLoaded', () => {
document.title = 'TheDesk' document.title = 'TheDesk'
ipc.send('acsCheck', '') 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) { onmessage = function(e) {
@@ -191,7 +207,6 @@ ipc.on('theme-json-response', function(event, args) {
postMessage(['customConnect', args], '*') postMessage(['customConnect', args], '*')
}) })
ipc.on('theme-json-create-complete', function(event, args) { ipc.on('theme-json-create-complete', function(event, args) {
if(args != '') alert(args)
postMessage(['clearCustomImport', ''], '*') postMessage(['clearCustomImport', ''], '*')
postMessage(['ctLoad', ''], '*') postMessage(['ctLoad', ''], '*')
}) })
@@ -204,7 +219,7 @@ ipc.on('memory', function(event, arg) {
var use = arg[0] var use = arg[0]
var cpu = arg[1] var cpu = arg[1]
var total = arg[2] var total = arg[2]
postMessage(['renderMem', [use, cpu, total, arg[3], arg[4]]], '*') postMessage(['renderMem', [use, cpu, total]], '*')
}) })
//log //log
ipc.on('logData', function(event, args) { ipc.on('logData', function(event, args) {

View File

@@ -2,11 +2,12 @@
//アカウント変えた時にBBとかMDとか //アカウント変えた時にBBとかMDとか
function mdCheck() { function mdCheck() {
var acct_id = $('#post-acct-sel').val() var acct_id = $('#post-acct-sel').val()
var profimg = localStorage.getItem('prof_' + acct_id) /*var profimg = localStorage.getItem('prof_' + acct_id)
if (!profimg) { if (!profimg) {
profimg = '../../img/missing.svg' profimg = '../../img/missing.svg'
} }
$('#acct-sel-prof').attr('src', profimg) $('#acct-sel-prof').attr('src', profimg)
*/
if (localStorage.getItem('post_' + acct_id)) { if (localStorage.getItem('post_' + acct_id)) {
$('#toot-post-btn').text( $('#toot-post-btn').text(
localStorage.getItem('post_' + acct_id) + localStorage.getItem('post_' + acct_id) +
@@ -50,7 +51,7 @@ function mdCheck() {
if (idata[domain + '_letters']) { if (idata[domain + '_letters']) {
$('#textarea').attr('data-length', idata[domain + '_letters']) $('#textarea').attr('data-length', idata[domain + '_letters'])
} else { } else {
var maxletters = localStorage.getItem('letters_' + acct_id) var maxletters = localStorage.getItem(domain + 'letters_')
if (maxletters > 0) { if (maxletters > 0) {
$('#textarea').attr('data-length', maxletters) $('#textarea').attr('data-length', maxletters)
} else { } else {

View File

@@ -23,7 +23,6 @@ function emojiToggle(reaction) {
} }
$('#post-box').css('width', width + 'px') $('#post-box').css('width', width + 'px')
$('#suggest').html('') $('#suggest').html('')
$('#draft').html('')
if (!localStorage.getItem('emojis_' + acct_id)) { if (!localStorage.getItem('emojis_' + acct_id)) {
var html = `<button class="btn waves-effect green" style="width:100%; padding:0; margin-top:0;" onclick="emojiGet('true');">${lang.lang_emoji_get}</button>` var html = `<button class="btn waves-effect green" style="width:100%; padding:0; margin-top:0;" onclick="emojiGet('true');">${lang.lang_emoji_get}</button>`
$('#emoji-list').html(html) $('#emoji-list').html(html)
@@ -32,12 +31,10 @@ function emojiToggle(reaction) {
} }
} else { } else {
$('#poll').addClass('hide') $('#poll').addClass('hide')
$('#draft').addClass('hide')
$('#right-side').hide() $('#right-side').hide()
$('#right-side').css('width', '300px') $('#right-side').css('width', '300px')
$('#emoji').addClass('hide') $('#emoji').addClass('hide')
$('#suggest').html('') $('#suggest').html('')
$('#draft').html('')
$('#left-side').css('width', '100%') $('#left-side').css('width', '100%')
var width = localStorage.getItem('postbox-width') var width = localStorage.getItem('postbox-width')
if (width) { if (width) {

View File

@@ -108,7 +108,6 @@ async function media(b64, type, no, stamped) {
} }
$('.toot-btn-group').prop('disabled', true) $('.toot-btn-group').prop('disabled', true)
$('#post-acct-sel').prop('disabled', true) $('#post-acct-sel').prop('disabled', true)
localStorage.setItem('image', 'busy')
todo('Image Upload...') todo('Image Upload...')
var media = toBlob(b64, type) var media = toBlob(b64, type)
var fd = new FormData() var fd = new FormData()
@@ -159,7 +158,6 @@ async function media(b64, type, no, stamped) {
M.toast({ html: '<span>' + lang.lang_postimg_sync + '</span><button class="btn-flat toast-action" onclick="syncDetail()">Click</button>', displayLength: 3000 }) M.toast({ html: '<span>' + lang.lang_postimg_sync + '</span><button class="btn-flat toast-action" onclick="syncDetail()">Click</button>', displayLength: 3000 })
$('#imgup').text('') $('#imgup').text('')
$('#imgsel').show() $('#imgsel').show()
localStorage.removeItem('image')
} }
} catch { } catch {
var start = 'https://' + domain + '/api/v1/media' var start = 'https://' + domain + '/api/v1/media'

View File

@@ -9,16 +9,7 @@ function sec() {
} }
post(null, mode) post(null, mode)
} }
function post(mode, postvis, dry) { function post(mode, postvis) {
if(!navigator.onLine && !dry) {
draftToggle(true)
addToDraft()
M.toast({
html: lang.lang_post_offline,
displayLength: 3000
})
return false
}
if ($('#toot-post-btn').prop('disabled')) { if ($('#toot-post-btn').prop('disabled')) {
return false return false
} }
@@ -131,7 +122,7 @@ function post(mode, postvis, dry) {
console.log('This toot will be posted at:' + scheduled) console.log('This toot will be posted at:' + scheduled)
schedule() schedule()
toot.scheduled_at = scheduled toot.scheduled_at = scheduled
if ($('#sch-box').hasClass('expire')) { if($('#sch-box').hasClass('expire')) {
toot.scheduled_at = null toot.scheduled_at = null
toot.expires_at = scheduled toot.expires_at = scheduled
} }
@@ -140,7 +131,7 @@ function post(mode, postvis, dry) {
} }
if (!$('#poll').hasClass('hide')) { if (!$('#poll').hasClass('hide')) {
var options = [] var options = []
$('.mastodon-choice').map(function () { $('.mastodon-choice').map(function() {
var choice = $(this).val() var choice = $(this).val()
if (choice != '') { if (choice != '') {
options.push(choice) options.push(choice)
@@ -168,13 +159,6 @@ function post(mode, postvis, dry) {
} }
} }
console.table(toot) console.table(toot)
if (dry) {
$('#ideKey').val('')
$('.toot-btn-group').prop('disabled', false)
todc()
toot['TheDeskAcctId'] = acct_id
return toot
}
var httpreq = new XMLHttpRequest() var httpreq = new XMLHttpRequest()
httpreq.open('POST', start, true) httpreq.open('POST', start, true)
httpreq.setRequestHeader('Content-Type', 'application/json') httpreq.setRequestHeader('Content-Type', 'application/json')
@@ -182,11 +166,11 @@ function post(mode, postvis, dry) {
httpreq.setRequestHeader('Idempotency-Key', ideKey) httpreq.setRequestHeader('Idempotency-Key', ideKey)
httpreq.responseType = 'json' httpreq.responseType = 'json'
httpreq.send(JSON.stringify(toot)) httpreq.send(JSON.stringify(toot))
httpreq.onreadystatechange = function () { httpreq.onreadystatechange = function() {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
var json = httpreq.response var json = httpreq.response
if (this.status !== 200) { if (this.status !== 200) {
if (media && this.status == 422) { if(media && this.status == 422) {
$('#ideKey').val('') $('#ideKey').val('')
$('.toot-btn-group').prop('disabled', false) $('.toot-btn-group').prop('disabled', false)
alertProcessUnfinished() alertProcessUnfinished()
@@ -217,7 +201,7 @@ function post(mode, postvis, dry) {
} }
function expPostMode() { function expPostMode() {
$('#sch-box').toggleClass('expire') $('#sch-box').toggleClass('expire')
if ($('#sch-box').hasClass('expire')) { if($('#sch-box').hasClass('expire')) {
Swal.fire({ Swal.fire({
type: 'info', type: 'info',
title: 'Expiring toot On' title: 'Expiring toot On'
@@ -286,7 +270,7 @@ function misskeyPost() {
httpreq.setRequestHeader('Content-Type', 'application/json') httpreq.setRequestHeader('Content-Type', 'application/json')
httpreq.responseType = 'json' httpreq.responseType = 'json'
httpreq.send(JSON.stringify(toot)) httpreq.send(JSON.stringify(toot))
httpreq.onreadystatechange = function () { httpreq.onreadystatechange = function() {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
if (str.indexOf(localStorage.getItem('stable')) == -1) { if (str.indexOf(localStorage.getItem('stable')) == -1) {
localStorage.removeItem('stable') localStorage.removeItem('stable')
@@ -355,10 +339,9 @@ function clear() {
$('#mins_poll').val(6) $('#mins_poll').val(6)
$('#poll').addClass('hide') $('#poll').addClass('hide')
$('#pollsta').text(lang.lang_no) $('#pollsta').text(lang.lang_no)
$('.mastodon-choice').map(function () { $('.mastodon-choice').map(function() {
$(this).val('') $(this).val('')
}) })
localStorage.removeItem('image')
if (localStorage.getItem('mainuse') == 'main') { if (localStorage.getItem('mainuse') == 'main') {
$('#post-acct-sel').val(localStorage.getItem('main')) $('#post-acct-sel').val(localStorage.getItem('main'))
} }

View File

@@ -79,8 +79,8 @@ function loadVis() {
loadVis() loadVis()
//コンテントワーニング //コンテントワーニング
function cw(force) { function cw() {
if ($('#cw').hasClass('cw-avail') || !force) { if ($('#cw').hasClass('cw-avail')) {
$('#cw-text').val() $('#cw-text').val()
$('#cw-text').hide() $('#cw-text').hide()
$('#cw').removeClass('yellow-text') $('#cw').removeClass('yellow-text')
@@ -100,8 +100,8 @@ function cw_show(e) {
$(e).parent().parent().find('.cw_hide').toggleClass('cw') $(e).parent().parent().find('.cw_hide').toggleClass('cw')
$(e).parent().find('.cw_long').toggleClass('hide') $(e).parent().find('.cw_long').toggleClass('hide')
} }
$(function () { $(function() {
$('#cw-text').on('change', function (event) { $('#cw-text').on('change', function(event) {
var acct_id = $('#post-acct-sel').val() var acct_id = $('#post-acct-sel').val()
var domain = localStorage.getItem('domain_' + acct_id) var domain = localStorage.getItem('domain_' + acct_id)
var cwlen = $('#cw-text').val().length var cwlen = $('#cw-text').val().length
@@ -126,79 +126,3 @@ function schedule() {
$('#sch-box').addClass('sch-avail') $('#sch-box').addClass('sch-avail')
} }
} }
//下書き機能
function draftToggle(force) {
if ($('#draft').hasClass('hide') || force) {
$('#draft').removeClass('hide')
$('#right-side').show()
$('#right-side').css('width', '300px')
$('#left-side').css('width', 'calc(100% - 300px)')
var width = localStorage.getItem('postbox-width')
if (width) {
width = width.replace('px', '') * 1 + 300
} else {
width = 600
}
$('#post-box').css('width', width + 'px')
$('#suggest').html('')
$('#draft').html('')
draftDraw()
} else {
$('#poll').addClass('hide')
$('#draft').addClass('hide')
$('#right-side').hide()
$('#right-side').css('width', '300px')
$('#emoji').addClass('hide')
$('#suggest').html('')
$('#draft').html('')
$('#left-side').css('width', '100%')
var width = localStorage.getItem('postbox-width')
if (width) {
width = width.replace('px', '') * 1
} else {
width = 300
}
$('#post-box').css('width', width + 'px')
}
}
function draftDraw() {
var draft = localStorage.getItem('draft')
var html = `<button class="btn waves-effect green" style="width:100%; padding:0; margin-top:0;" onclick="addToDraft();">${lang.lang_secure_draft}</button>`
if (draft) {
var draftObj = JSON.parse(draft)
for (let i = 0; i < draftObj.length; i++) {
var toot = draftObj[i]
html = html + `<div class="tootInDraft">
<i class="waves-effect gray material-icons" onclick="useThisDraft(${i})" title="${lang.lang_secure_userThis}">reply</i>
<i class="waves-effect gray material-icons" onclick="deleteThisDraft(${i})" title="${lang.lang_secure_deleteThis}">cancel</i>
${escapeHTML(toot.status).replace(/\n/, '').substr(0, 10)}
</div>`
}
}
$('#draft').html(html)
}
function addToDraft() {
var json = post(null, null, true)
var draft = localStorage.getItem('draft')
var draftObj = []
if (draft) draftObj = JSON.parse(draft)
draftObj.push(json)
draft = JSON.stringify(draftObj)
localStorage.setItem('draft', draft)
draftDraw()
}
function useThisDraft(i) {
var draft = localStorage.getItem('draft')
var draftObj = JSON.parse(draft)
draftToPost(draftObj[i], draftObj[i]['TheDeskAcctId'], 0)
draftToggle()
}
function deleteThisDraft(i) {
var draft = localStorage.getItem('draft')
var draftObj = JSON.parse(draft)
draftObj.splice(i, 1)
draft = JSON.stringify(draftObj)
localStorage.setItem('draft', draft)
draftDraw()
}

View File

@@ -15,7 +15,7 @@ function fav(id, acct_id, remote) {
httpreq.setRequestHeader('Authorization', 'Bearer ' + at) httpreq.setRequestHeader('Authorization', 'Bearer ' + at)
httpreq.responseType = 'json' httpreq.responseType = 'json'
httpreq.send() httpreq.send()
httpreq.onreadystatechange = function () { httpreq.onreadystatechange = function() {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
var json = httpreq.response var json = httpreq.response
if (this.status !== 200) { if (this.status !== 200) {
@@ -75,7 +75,7 @@ function rt(id, acct_id, remote, vis) {
} else { } else {
httpreq.send() httpreq.send()
} }
httpreq.onreadystatechange = function () { httpreq.onreadystatechange = function() {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
var json = httpreq.response var json = httpreq.response
if (this.status !== 200) { if (this.status !== 200) {
@@ -131,7 +131,7 @@ function bkm(id, acct_id, tlid) {
httpreq.setRequestHeader('Authorization', 'Bearer ' + at) httpreq.setRequestHeader('Authorization', 'Bearer ' + at)
httpreq.responseType = 'json' httpreq.responseType = 'json'
httpreq.send() httpreq.send()
httpreq.onreadystatechange = function () { httpreq.onreadystatechange = function() {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
var json = httpreq.response var json = httpreq.response
if (this.status !== 200) { if (this.status !== 200) {
@@ -160,7 +160,7 @@ function bkm(id, acct_id, tlid) {
//フォロー //フォロー
async function follow(acct_id, resolve) { async function follow(acct_id, resolve) {
if ($('#his-data').hasClass('locked')) { if($('#his-data').hasClass('locked')) {
locked = true locked = true
} else { } else {
locked = false locked = false
@@ -178,7 +178,7 @@ async function follow(acct_id, resolve) {
var flag = 'follow' var flag = 'follow'
var flagm = 'create' var flagm = 'create'
} }
var id = $('#his-data').attr('user-id') var id = $('#his-data').attr('user-id')
if (resolve == 'selector') { if (resolve == 'selector') {
var fullacct = $('#his-acct').attr('fullname') var fullacct = $('#his-acct').attr('fullname')
@@ -200,7 +200,7 @@ async function follow(acct_id, resolve) {
httpreq.setRequestHeader('Authorization', 'Bearer ' + at) httpreq.setRequestHeader('Authorization', 'Bearer ' + at)
httpreq.responseType = 'json' httpreq.responseType = 'json'
httpreq.send(JSON.stringify(ent)) httpreq.send(JSON.stringify(ent))
httpreq.onreadystatechange = function () { httpreq.onreadystatechange = function() {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
var json = httpreq.response var json = httpreq.response
if (this.status !== 200) { if (this.status !== 200) {
@@ -212,7 +212,7 @@ async function follow(acct_id, resolve) {
$('#his-follow-btn-text').text(lang.lang_status_follow) $('#his-follow-btn-text').text(lang.lang_status_follow)
} else { } else {
$('#his-data').addClass('following') $('#his-data').addClass('following')
if (locked) { if(locked) {
$('#his-follow-btn-text').text(lang.lang_status_requesting) $('#his-follow-btn-text').text(lang.lang_status_requesting)
} else { } else {
$('#his-follow-btn-text').text(lang.lang_status_unfollow) $('#his-follow-btn-text').text(lang.lang_status_unfollow)
@@ -278,7 +278,7 @@ function block(acct_id) {
httpreq.setRequestHeader('Authorization', 'Bearer ' + at) httpreq.setRequestHeader('Authorization', 'Bearer ' + at)
httpreq.responseType = 'json' httpreq.responseType = 'json'
httpreq.send() httpreq.send()
httpreq.onreadystatechange = function () { httpreq.onreadystatechange = function() {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
if (this.status !== 200) { if (this.status !== 200) {
setLog(start, this.status, this.response) setLog(start, this.status, this.response)
@@ -338,7 +338,7 @@ function muteDo(acct_id) {
httpreq.setRequestHeader('Authorization', 'Bearer ' + at) httpreq.setRequestHeader('Authorization', 'Bearer ' + at)
httpreq.responseType = 'json' httpreq.responseType = 'json'
httpreq.send(rq) httpreq.send(rq)
httpreq.onreadystatechange = function () { httpreq.onreadystatechange = function() {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
if (this.status !== 200) { if (this.status !== 200) {
setLog(start, this.status, this.response) setLog(start, this.status, this.response)
@@ -378,7 +378,7 @@ function del(id, acct_id) {
httpreq.responseType = 'json' httpreq.responseType = 'json'
httpreq.send() httpreq.send()
} }
httpreq.onreadystatechange = function () { httpreq.onreadystatechange = function() {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
if (this.status !== 200) { if (this.status !== 200) {
setLog(start, this.status, this.response) setLog(start, this.status, this.response)
@@ -420,73 +420,69 @@ function redraft(id, acct_id) {
httpreq.responseType = 'json' httpreq.responseType = 'json'
httpreq.send() httpreq.send()
} }
httpreq.onreadystatechange = function () { httpreq.onreadystatechange = function() {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
if (this.status !== 200) { if (this.status !== 200) {
setLog(start, this.status, this.response) setLog(start, this.status, this.response)
} }
var json = httpreq.response var json = httpreq.response
draftToPost(json, acct_id, 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 html = $('[toot-id=' + id + '] .toot').html()
html = html.replace(/^<p>(.+)<\/p>$/, '$1')
html = html.replace(/<br\s?\/?>/, '\n')
html = html.replace(/<p>/, '\n')
html = html.replace(/<\/p>/, '\n')
html = html.replace(/<img[\s\S]*alt="(.+?)"[\s\S]*?>/g, '$1')
html = $.strip_tags(html)
}
$('#textarea').val(html)
if (json.spoiler_text) {
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)
}
} }
} }
} }
}) })
} }
function draftToPost(json, acct_id, id) {
$('#post-acct-sel').prop('disabled', true)
$('#post-acct-sel').val(acct_id)
$('select').formSelect()
mdCheck()
var medias = $('[toot-id=' + id + ']').attr('data-medias')
mediack = null
if(json.media_attachments) 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 = json.visibility
vis(vismode)
var medias = media_ids.join(',')
$('#media').val(medias)
localStorage.setItem('nohide', true)
show()
if (json.text) {
var html = json.text
} else {
var html = json.status
html = html.replace(/^<p>(.+)<\/p>$/, '$1')
html = html.replace(/<br\s?\/?>/, '\n')
html = html.replace(/<p>/, '\n')
html = html.replace(/<\/p>/, '\n')
html = html.replace(/<img[\s\S]*alt="(.+?)"[\s\S]*?>/g, '$1')
html = $.strip_tags(html)
}
$('#textarea').val(html)
if (json.spoiler_text) {
cw(true)
$('#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)
}
}
//ピン留め //ピン留め
function pin(id, acct_id) { function pin(id, acct_id) {
if ($(`.cvo[unique-id=${id}]`).hasClass('pined')) { if ($(`.cvo[unique-id=${id}]`).hasClass('pined')) {
@@ -503,7 +499,7 @@ function pin(id, acct_id) {
httpreq.setRequestHeader('Authorization', 'Bearer ' + at) httpreq.setRequestHeader('Authorization', 'Bearer ' + at)
httpreq.responseType = 'json' httpreq.responseType = 'json'
httpreq.send() httpreq.send()
httpreq.onreadystatechange = function () { httpreq.onreadystatechange = function() {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
var json = httpreq.response var json = httpreq.response
if (this.status !== 200) { if (this.status !== 200) {
@@ -534,7 +530,7 @@ function request(id, flag, acct_id) {
httpreq.setRequestHeader('Authorization', 'Bearer ' + at) httpreq.setRequestHeader('Authorization', 'Bearer ' + at)
httpreq.responseType = 'json' httpreq.responseType = 'json'
httpreq.send() httpreq.send()
httpreq.onreadystatechange = function () { httpreq.onreadystatechange = function() {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
var json = httpreq.response var json = httpreq.response
if (this.status !== 200) { if (this.status !== 200) {
@@ -560,7 +556,7 @@ function domainblock(add, flag, acct_id) {
httpreq.setRequestHeader('Authorization', 'Bearer ' + at) httpreq.setRequestHeader('Authorization', 'Bearer ' + at)
httpreq.responseType = 'json' httpreq.responseType = 'json'
httpreq.send() httpreq.send()
httpreq.onreadystatechange = function () { httpreq.onreadystatechange = function() {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
var json = httpreq.response var json = httpreq.response
if (this.status !== 200) { if (this.status !== 200) {
@@ -587,7 +583,7 @@ function empUser() {
M.toast({ html: id + lang.lang_status_emphas, displayLength: 4000 }) M.toast({ html: id + lang.lang_status_emphas, displayLength: 4000 })
} else { } else {
var can var can
Object.keys(obj).forEach(function (key) { Object.keys(obj).forEach(function(key) {
var usT = obj[key] var usT = obj[key]
if (usT != id && !can) { if (usT != id && !can) {
can = false can = false
@@ -619,7 +615,7 @@ function pinUser() {
httpreq.setRequestHeader('Authorization', 'Bearer ' + at) httpreq.setRequestHeader('Authorization', 'Bearer ' + at)
httpreq.responseType = 'json' httpreq.responseType = 'json'
httpreq.send() httpreq.send()
httpreq.onreadystatechange = function () { httpreq.onreadystatechange = function() {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
var json = httpreq.response var json = httpreq.response
if (this.status !== 200) { if (this.status !== 200) {
@@ -655,20 +651,20 @@ function staEx(mode) {
Authorization: 'Bearer ' + at Authorization: 'Bearer ' + at
} }
}) })
.then(function (response) { .then(function(response) {
if (!response.ok) { if (!response.ok) {
response.text().then(function (text) { 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) { .catch(function(error) {
todo(error) todo(error)
setLog(start, 'JSON', error) setLog(start, 'JSON', error)
console.error(error) console.error(error)
}) })
.then(function (json) { .then(function(json) {
if (json.statuses) { if (json.statuses) {
if (json.statuses[0]) { if (json.statuses[0]) {
var id = json.statuses[0].id var id = json.statuses[0].id
@@ -684,9 +680,35 @@ function staEx(mode) {
}) })
return return
} }
function toggleAction(id) { function toggleAction(elem, height) {
const elm = document.getElementById(id) var cont = elem.parents('.cvo').find('.contextMenu')
const instance = M.Dropdown.init(elm); if (cont.hasClass('hide')) {
console.log(instance.isOpen) $('#contextWrap').removeClass('hide')
instance.open() var left = elem.offset().left + 60
var top = elem.offset().top - height
if (top < 75) {
top = elem.offset().top + 45
cont.removeClass('bottom')
cont.addClass('top')
} else {
cont.removeClass('top')
cont.addClass('bottom')
}
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
}
cont.css('top', top + 'px')
cont.css('right', `calc(100vw - ${left}px)`)
cont.removeClass('hide')
elem
.parents('.cvo')
.find('.act-icon')
.text('expand_less')
} else {
$('#contextWrap').addClass('hide')
$('.contextMenu').addClass('hide')
$('.act-icon').text('expand_more')
}
} }

View File

@@ -18,7 +18,7 @@ input.addEventListener(
var new_val = input.value var new_val = input.value
if (new_val == '') { if (new_val == '') {
$('#suggest').html('') $('#suggest').html('')
if ($('#poll').hasClass('hide') && $('#emoji').hasClass('hide') && $('#draft').hasClass('hide')) { if ($('#poll').hasClass('hide') && $('#emoji').hasClass('hide')) {
$('#right-side').hide() $('#right-side').hide()
$('#right-side').css('width', '300px') $('#right-side').css('width', '300px')
$('#left-side').css('width', '100%') $('#left-side').css('width', '100%')
@@ -41,7 +41,7 @@ input.addEventListener(
var q = acct[1] var q = acct[1]
} else { } else {
$('#suggest').html('') $('#suggest').html('')
if ($('#poll').hasClass('hide') && $('#emoji').hasClass('hide') && $('#draft').hasClass('hide')) { if ($('#poll').hasClass('hide') && $('#emoji').hasClass('hide')) {
$('#right-side').hide() $('#right-side').hide()
$('#right-side').css('width', '300px') $('#right-side').css('width', '300px')
$('#left-side').css('width', '100%') $('#left-side').css('width', '100%')
@@ -138,7 +138,6 @@ input.addEventListener(
$('#post-box').css('width', width + 'px') $('#post-box').css('width', width + 'px')
$('#poll').addClass('hide') $('#poll').addClass('hide')
$('#emoji').addClass('hide') $('#emoji').addClass('hide')
$('#draft').addClass('hide')
} }
} else if (json.accounts[0] && acct[1]) { } else if (json.accounts[0] && acct[1]) {
var accts = '' var accts = ''
@@ -166,9 +165,8 @@ input.addEventListener(
$('#suggest').html(accts) $('#suggest').html(accts)
$('#poll').addClass('hide') $('#poll').addClass('hide')
$('#emoji').addClass('hide') $('#emoji').addClass('hide')
$('#draft').addClass('hide')
} else { } else {
if ($('#poll').hasClass('hide') && $('#emoji').hasClass('hide') && $('#draft').hasClass('hide')) { if ($('#poll').hasClass('hide') && $('#emoji').hasClass('hide')) {
$('#right-side').hide() $('#right-side').hide()
$('#right-side').css('width', '300px') $('#right-side').css('width', '300px')
$('#left-side').css('width', '100%') $('#left-side').css('width', '100%')
@@ -228,7 +226,7 @@ function tagInsert(code, del) {
} }
sentence = before + word + after sentence = before + word + after
textarea.value = sentence textarea.value = sentence
if ($('#poll').hasClass('hide') && $('#emoji').hasClass('hide') && $('#draft').hasClass('hide')) { if ($('#poll').hasClass('hide') && $('#emoji').hasClass('hide')) {
$('#right-side').hide() $('#right-side').hide()
$('#right-side').css('width', '300px') $('#right-side').css('width', '300px')
$('#left-side').css('width', '50%') $('#left-side').css('width', '50%')

View File

@@ -1,5 +1,5 @@
/*リプライ*/ /*リプライ*/
function re(id, ats_cm, acct_id, mode, cwTxt) { function re(id, ats_cm, acct_id, mode) {
clear() clear()
var ats = ats_cm.split(',') var ats = ats_cm.split(',')
localStorage.setItem('nohide', true) localStorage.setItem('nohide', true)
@@ -25,18 +25,13 @@ function re(id, ats_cm, acct_id, mode, cwTxt) {
} }
$('#acct-sel-prof').attr('src', profimg) $('#acct-sel-prof').attr('src', profimg)
vis(mode) vis(mode)
if(localStorage.getItem('cw-continue') == 'yes') {
cw(true)
$('#cw-text').val(cwTxt)
}
} }
function reEx(id) { function reEx(id) {
$('#tootmodal').modal('close') $('#tootmodal').modal('close')
var at = $('#tootmodal').attr('data-user') var at = $('#tootmodal').attr('data-user')
var acct_id = $('#status-acct-sel').val() var acct_id = $('#status-acct-sel').val()
var mode = $('#tootmodal .vis-data').attr('data-vis') var mode = $('#tootmodal .vis-data').attr('data-vis')
var cwTxt = $('#cw-text').val() re(id, at, acct_id, mode)
re(id, at, acct_id, mode, cwTxt)
} }
//引用 //引用
function qt(id, acct_id, at, url) { function qt(id, acct_id, at, url) {

View File

@@ -335,13 +335,6 @@ function cardCheck(tlid) {
} }
function mov(id, tlid, type) { function mov(id, tlid, type) {
const dropdownTrigger = `dropdown_${tlid}_${id}`
const elm = document.getElementById(dropdownTrigger)
const instance = M.Dropdown.getInstance(elm)
if(instance) {
if(instance.isOpen) return false
}
var click = false var click = false
if (tlid == 'notf') { if (tlid == 'notf') {
var tlide = '[data-notf=' + acct_id + ']' var tlide = '[data-notf=' + acct_id + ']'
@@ -368,9 +361,9 @@ function mov(id, tlid, type) {
} }
if (mouseover == 'hide') { if (mouseover == 'hide') {
if (click) { if (click) {
$(tlide + ' [unique-id=' + id + ']').toggleClass('hide-actions') $(tlide + ' [toot-id=' + id + ']').toggleClass('hide-actions')
} else { } else {
$(tlide + ' [unique-id=' + id + ']').removeClass('hide-actions') $(tlide + ' [toot-id=' + id + ']').removeClass('hide-actions')
} }
//$(tlide + " [toot-id=" + id + "] .area-vis").toggleClass("hide") //$(tlide + " [toot-id=" + id + "] .area-vis").toggleClass("hide")

View File

@@ -1,98 +1,95 @@
//日付パーサー //日付パーサー
function date(str, datetype, lastStatus) { function date(str, datetype) {
if (lastStatus) { if (datetype == "relative") {
var date = new Date(str) return '<time class="timeago" datetime="' + str + '"></time>';
return date.getFullYear() + "/" + (date.getMonth() + 1) + "/" + date.getDate()
} else if (datetype == "relative") {
return '<time class="timeago" datetime="' + str + '"></time>'
} else { } else {
var date = new Date(str) var date = new Date(str);
if (datetype == "unix") { if (datetype == "unix") {
var unixm = date.getTime() var unixm = date.getTime();
return Math.floor(unixm / 1000) return Math.floor(unixm / 1000);
} }
var now = new Date() var now = new Date();
var month = date.getMonth() + 1 var month = date.getMonth() + 1;
if (date.getMinutes() < 10) { if (date.getMinutes() < 10) {
var min = "0" + date.getMinutes() var min = "0" + date.getMinutes();
} else { } else {
var min = date.getMinutes() var min = date.getMinutes();
} }
var sec = null var sec = null;
if (date.getSeconds() < 10) { if (date.getSeconds() < 10) {
sec = "0" + date.getSeconds() sec = "0" + date.getSeconds();
} else { } else {
sec = date.getSeconds() sec = date.getSeconds();
} }
if (datetype == "full") { if (datetype == "full") {
var ret = date.getFullYear() + "/" + month + "/" + date.getDate() + "/ " + var ret = date.getFullYear() + "/" + month + "/" + date.getDate() + "/ " +
date.getHours() + ":" + min + ":" + sec date.getHours() + ":" + min + ":" + sec;
} }
if (date.getFullYear() == now.getFullYear()) { if (date.getFullYear() == now.getFullYear()) {
if (date.getMonth() == now.getMonth()) { if (date.getMonth() == now.getMonth()) {
if (date.getDate() == now.getDate()) { if (date.getDate() == now.getDate()) {
if (datetype == "medium") { if (datetype == "medium") {
var ret = '<time class="timeago" datetime="' + str + '"></time>' var ret = '<time class="timeago" datetime="' + str + '"></time>';
} else { } else {
var ret = date.getHours() + ":" + min + ":" + sec var ret = date.getHours() + ":" + min + ":" + sec;
} }
} else { } else {
var ret = month + "/" + date.getDate() + " " + date.getHours() + ":" + var ret = month + "/" + date.getDate() + " " + date.getHours() + ":" +
min + ":" + sec min + ":" + sec;
} }
} else { } else {
var ret = month + "/" + date.getDate() + " " + date.getHours() + ":" + min + var ret = month + "/" + date.getDate() + " " + date.getHours() + ":" + min +
":" + sec ":" + sec;
} }
} else { } else {
var ret = date.getFullYear() + "/" + month + "/" + date.getDate() + " " + var ret = date.getFullYear() + "/" + month + "/" + date.getDate() + " " +
date.getHours() + ":" + min + ":" + sec date.getHours() + ":" + min + ":" + sec;
} }
if (datetype == "double") { if (datetype == "double") {
return '<time class="timeago" datetime="' + str + '"></time>/' + ret return '<time class="timeago" datetime="' + str + '"></time>/' + ret;
} else { } else {
return ret return ret;
} }
} }
} }
//特殊フォーマット(インスタンス情報で利用) //特殊フォーマット(インスタンス情報で利用)
function crat(str) { function crat(str) {
var date = new Date(str) var date = new Date(str);
var mnt = null var mnt = null;
if (date.getMonth() < 9) { if (date.getMonth() < 9) {
mnt = "0" + (date.getMonth() + 1) mnt = "0" + (date.getMonth() + 1);
} else { } else {
mnt = date.getMonth() + 1 mnt = date.getMonth() + 1;
} }
if (date.getDate() < 10) { if (date.getDate() < 10) {
var dat = "0" + date.getDate() var dat = "0" + date.getDate();
} else { } else {
var dat = date.getDate() var dat = date.getDate();
} }
if (date.getHours() < 10) { if (date.getHours() < 10) {
var hrs = "0" + date.getHours() var hrs = "0" + date.getHours();
} else { } else {
var hrs = date.getHours() var hrs = date.getHours();
} }
if (date.getMinutes() < 10) { if (date.getMinutes() < 10) {
var mns = "0" + date.getMinutes() var mns = "0" + date.getMinutes();
} else { } else {
var mns = date.getMinutes() var mns = date.getMinutes();
} }
if (date.getSeconds() < 10) { if (date.getSeconds() < 10) {
var sec = "0" + date.getSeconds() var sec = "0" + date.getSeconds();
} else { } else {
var sec = date.getSeconds() var sec = date.getSeconds();
} }
format_str = 'YYYY-MM-DD hh:mm:ss' format_str = 'YYYY-MM-DD hh:mm:ss';
format_str = format_str.replace(/YYYY/g, date.getFullYear()) format_str = format_str.replace(/YYYY/g, date.getFullYear());
format_str = format_str.replace(/MM/g, mnt) format_str = format_str.replace(/MM/g, mnt);
format_str = format_str.replace(/DD/g, dat) format_str = format_str.replace(/DD/g, dat);
format_str = format_str.replace(/hh/g, hrs) format_str = format_str.replace(/hh/g, hrs);
format_str = format_str.replace(/mm/g, mns) format_str = format_str.replace(/mm/g, mns);
format_str = format_str.replace(/ss/g, sec) format_str = format_str.replace(/ss/g, sec);
return format_str return format_str;
} }

View File

@@ -1,49 +1,49 @@
//ディレクトリ //ディレクトリ
//ディレクトリトグル //ディレクトリトグル
function dirMenu() { function dirMenu() {
$("#dir-contents").html("") $("#dir-contents").html("");
directory() directory();
$("#left-menu a").removeClass("active") $("#left-menu a").removeClass("active");
$("#dirMenu").addClass("active") $("#dirMenu").addClass("active");
$(".menu-content").addClass("hide") $(".menu-content").addClass("hide");
$("#dir-box").removeClass("hide") $("#dir-box").removeClass("hide");
} }
function dirselCk() { function dirselCk() {
var acct = $("#dir-acct-sel").val() var acct = $("#dir-acct-sel").val();
if (acct == "noauth") { if (acct == "noauth") {
$("#dirNoAuth").removeClass("hide") $("#dirNoAuth").removeClass("hide");
} else { } else {
$("#dirNoAuth").addClass("hide") $("#dirNoAuth").addClass("hide");
directory() directory();
} }
} }
function directory(isMore) { function directory(isMore) {
var order = $("[name=sort]:checked").val() var order = $("[name=sort]:checked").val();
if (!order) { if (!order) {
order = "active" order = "active";
} }
var local_only = $("#local_only:checked").val() var local_only = $("#local_only:checked").val();
if (local_only) { if (local_only) {
local_only = "true" local_only = "true";
} else { } 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") { if (acct_id == "noauth") {
var domain = $("#dirNoAuth-url").val() var domain = $("#dirNoAuth-url").val();
var at = "" var at = "";
} else { } else {
var domain = localStorage.getItem("domain_" + acct_id) var domain = localStorage.getItem("domain_" + acct_id);
var at = localStorage.getItem("acct_" + acct_id + "_at") var at = localStorage.getItem("acct_" + acct_id + "_at");
} }
if (isMore) { if (isMore) {
var addOffset = $("#dir-contents .cvo").length var addOffset = $("#dir-contents .cvo").length;
} else { } else {
var addOffset = 0 var addOffset = 0;
$("#dir-contents").html("") $("#dir-contents").html("");
} }
var start = "https://" + domain + "/api/v1/directory?order=" + order + "&local=" + local_only + "&offset=" + addOffset var start = "https://" + domain + "/api/v1/directory?order=" + order + "&local=" + local_only + "&offset=" + addOffset;
console.log(start) console.log(start);
fetch(start, { fetch(start, {
method: "GET", method: "GET",
headers: { headers: {
@@ -54,23 +54,23 @@ function directory(isMore) {
.then(function(response) { .then(function(response) {
if (!response.ok) { if (!response.ok) {
response.text().then(function(text) { 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) { .catch(function(error) {
setLog(start, "JSON", error) setLog(start, "JSON", error);
console.error(error) console.error(error);
}) })
.then(function(json) { .then(function(json) {
if (json) { if (json) {
$("#moreDir").removeClass("disabled") $("#moreDir").removeClass("disabled");
var html = userparse(json, null, acct_id, "dir", null) var html = userparse(json, null, acct_id, "dir", null);
$("#dir-contents").append(html) $("#dir-contents").append(html);
jQuery("time.timeago").timeago() jQuery("time.timeago").timeago();
} else { } else {
$("#moreDir").addClass("disabled") $("#moreDir").addClass("disabled");
} }
}) });
} }

View File

@@ -1,8 +1,8 @@
//DM(Conv) TL //DM(Conv) TL
function dm(acct_id, tlid, type, delc, voice) { function dm(acct_id, tlid, type, delc, voice) {
var domain = localStorage.getItem("domain_" + acct_id) var domain = localStorage.getItem("domain_" + acct_id);
var at = localStorage.getItem("acct_" + acct_id + "_at") var at = localStorage.getItem("acct_" + acct_id + "_at");
var start = "https://" + domain + "/api/v1/conversations" var start = "https://" + domain + "/api/v1/conversations";
fetch(start, { fetch(start, {
method: "GET", method: "GET",
headers: { headers: {
@@ -13,38 +13,38 @@ function dm(acct_id, tlid, type, delc, voice) {
.then(function(response) { .then(function(response) {
if (!response.ok) { if (!response.ok) {
response.text().then(function(text) { 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) { .catch(function(error) {
todo(error) todo(error);
setLog(start, "JSON", error) setLog(start, "JSON", error);
console.error(error) console.error(error);
}) })
.then(function(json) { .then(function(json) {
var templete = '<div id="convList' + tlid + '">' + dmListParse(json, type, acct_id, tlid, "", mute) + "</div>" var templete = '<div id="convList' + tlid + '">' + dmListParse(json, type, acct_id, tlid, "", mute) + "</div>";
localStorage.setItem("lastobj_" + tlid, json[0].id) localStorage.setItem("lastobj_" + tlid, json[0].id);
$("#timeline_" + tlid).html(templete) $("#timeline_" + tlid).html(templete);
additional(acct_id, tlid) additional(acct_id, tlid);
jQuery("time.timeago").timeago() jQuery("time.timeago").timeago();
todc() todc();
//reload(type, '', acct_id, tlid, data, mute, delc,voice); //reload(type, '', acct_id, tlid, data, mute, delc,voice);
$(window).scrollTop(0) $(window).scrollTop(0);
}) });
} }
function dmmore(tlid) { function dmmore(tlid) {
var multi = localStorage.getItem("column") var multi = localStorage.getItem("column");
var obj = JSON.parse(multi) var obj = JSON.parse(multi);
var acct_id = obj[tlid].domain var acct_id = obj[tlid].domain;
var domain = localStorage.getItem("domain_" + acct_id) var domain = localStorage.getItem("domain_" + acct_id);
var at = localStorage.getItem("acct_" + acct_id + "_at") var at = localStorage.getItem("acct_" + acct_id + "_at");
var sid = $("#timeline_" + tlid + " .cvo") var sid = $("#timeline_" + tlid + " .cvo")
.last() .last()
.attr("unique-id") .attr("unique-id");
var start = "https://" + domain + "/api/v1/conversations?max_id=" + sid var start = "https://" + domain + "/api/v1/conversations?max_id=" + sid;
var type = "dm" var type = "dm";
fetch(start, { fetch(start, {
method: "GET", method: "GET",
headers: { headers: {
@@ -55,444 +55,444 @@ function dmmore(tlid) {
.then(function(response) { .then(function(response) {
if (!response.ok) { if (!response.ok) {
response.text().then(function(text) { 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) { .catch(function(error) {
todo(error) todo(error);
setLog(start, "JSON", error) setLog(start, "JSON", error);
console.error(error) console.error(error);
}) })
.then(function(json) { .then(function(json) {
var templete = '<div id="convList' + tlid + '">' + dmListParse(json, type, acct_id, tlid, "", mute) + "</div>" var templete = '<div id="convList' + tlid + '">' + dmListParse(json, type, acct_id, tlid, "", mute) + "</div>";
$("#timeline_" + tlid).append(templete) $("#timeline_" + tlid).append(templete);
additional(acct_id, tlid) additional(acct_id, tlid);
jQuery("time.timeago").timeago() jQuery("time.timeago").timeago();
moreloading = false moreloading = false;
}) });
} }
//DMオブジェクトパーサー(トゥート) //DMオブジェクトパーサー(トゥート)
function dmListParse(obj, mix, acct_id, tlid, popup, mutefilter) { function dmListParse(obj, mix, acct_id, tlid, popup, mutefilter) {
var templete = "" var templete = "";
if (obj[0]) { if (obj[0]) {
localStorage.setItem("lastunix_" + tlid, date(obj[0].created_at, "unix")) localStorage.setItem("lastunix_" + tlid, date(obj[0].created_at, "unix"));
} }
var actb = localStorage.getItem("action_btns") var actb = localStorage.getItem("action_btns");
var actb = "re,rt,fav,qt,del,pin,red" var actb = "re,rt,fav,qt,del,pin,red";
if (actb) { if (actb) {
var actb = actb.split(",") var actb = actb.split(",");
var disp = {} var disp = {};
for (var k = 0; k < actb.length; k++) { for (var k = 0; k < actb.length; k++) {
if (k < 4) { if (k < 4) {
var tp = "type-a" var tp = "type-a";
} else { } else {
var tp = "type-b" var tp = "type-b";
} }
disp[actb[k]] = tp disp[actb[k]] = tp;
} }
} }
var datetype = localStorage.getItem("datetype") var datetype = localStorage.getItem("datetype");
var nsfwtype = localStorage.getItem("nsfw") var nsfwtype = localStorage.getItem("nsfw");
var sent = localStorage.getItem("sentence") var sent = localStorage.getItem("sentence");
var ltr = localStorage.getItem("letters") var ltr = localStorage.getItem("letters");
var gif = localStorage.getItem("gif") var gif = localStorage.getItem("gif");
var imh = localStorage.getItem("img-height") var imh = localStorage.getItem("img-height");
//独自ロケール //独自ロケール
var locale = localStorage.getItem("locale") var locale = localStorage.getItem("locale");
if (locale == "yes") { if (locale == "yes") {
var locale = false var locale = false;
} }
//ネイティブ通知 //ネイティブ通知
var native = localStorage.getItem("nativenotf") var native = localStorage.getItem("nativenotf");
if (!native) { if (!native) {
native = "yes" native = "yes";
} }
//クライアント強調 //クライアント強調
var emp = localStorage.getItem("client_emp") var emp = localStorage.getItem("client_emp");
if (emp) { if (emp) {
var emp = JSON.parse(emp) var emp = JSON.parse(emp);
} }
//クライアントミュート //クライアントミュート
var mute = localStorage.getItem("client_mute") var mute = localStorage.getItem("client_mute");
if (mute) { if (mute) {
var mute = JSON.parse(mute) var mute = JSON.parse(mute);
} }
//ユーザー強調 //ユーザー強調
var useremp = localStorage.getItem("user_emp") var useremp = localStorage.getItem("user_emp");
if (useremp) { if (useremp) {
var useremp = JSON.parse(useremp) var useremp = JSON.parse(useremp);
} }
//ワード強調 //ワード強調
var wordemp = localStorage.getItem("word_emp") var wordemp = localStorage.getItem("word_emp");
if (wordemp) { if (wordemp) {
var wordemp = JSON.parse(wordemp) var wordemp = JSON.parse(wordemp);
} }
//ワードミュート //ワードミュート
var wordmute = localStorage.getItem("word_mute") var wordmute = localStorage.getItem("word_mute");
if (wordmute) { if (wordmute) {
var wordmute = JSON.parse(wordmute) var wordmute = JSON.parse(wordmute);
wordmute = wordmute.concat(mutefilter) wordmute = wordmute.concat(mutefilter);
} else { } else {
wordmute = mutefilter wordmute = mutefilter;
} }
//Ticker //Ticker
var tickerck = localStorage.getItem("ticker_ok") var tickerck = localStorage.getItem("ticker_ok");
if (tickerck) { if (tickerck) {
var ticker = true var ticker = true;
} else { } else {
var ticker = false var ticker = false;
} }
//Cards //Cards
var card = localStorage.getItem("card_" + tlid) var card = localStorage.getItem("card_" + tlid);
if (!sent) { if (!sent) {
var sent = 500 var sent = 500;
} }
if (!ltr) { if (!ltr) {
var ltr = 500 var ltr = 500;
} }
if (!nsfwtype || nsfwtype == "yes") { if (!nsfwtype || nsfwtype == "yes") {
var nsfw = "ok" var nsfw = "ok";
} else { } else {
var nsfw var nsfw;
} }
var cwtype = localStorage.getItem("cw") var cwtype = localStorage.getItem("cw");
if (!cwtype || cwtype == "yes") { if (!cwtype || cwtype == "yes") {
var cw = "ok" var cw = "ok";
} else { } else {
var cw var cw;
} }
if (!datetype) { if (!datetype) {
datetype = "absolute" datetype = "absolute";
} }
if (!gif) { if (!gif) {
var gif = "yes" var gif = "yes";
} }
if (!imh) { if (!imh) {
var imh = "200" var imh = "200";
} }
if (!emp) { if (!emp) {
var emp = [] var emp = [];
} }
if (!mute) { if (!mute) {
var mute = [] var mute = [];
} }
if (!useremp) { if (!useremp) {
var useremp = [] var useremp = [];
} }
if (!wordemp) { if (!wordemp) {
var wordemp = [] var wordemp = [];
} }
if (!wordmute) { if (!wordmute) {
var wordmute = [] var wordmute = [];
} }
//via通知 //via通知
var viashow = localStorage.getItem("viashow") var viashow = localStorage.getItem("viashow");
if (!viashow) { if (!viashow) {
viashow = "via-hide" viashow = "via-hide";
} }
if (viashow == "hide") { if (viashow == "hide") {
viashow = "via-hide" viashow = "via-hide";
} }
//認証なしTL //認証なしTL
if (mix == "noauth") { if (mix == "noauth") {
var noauth = "hide" var noauth = "hide";
var antinoauth = "" var antinoauth = "";
} else { } else {
var noauth = "" var noauth = "";
var antinoauth = "hide" var antinoauth = "hide";
} }
//マウスオーバーのみ //マウスオーバーのみ
var mouseover = localStorage.getItem("mouseover") var mouseover = localStorage.getItem("mouseover");
if (!mouseover) { if (!mouseover) {
mouseover = "" mouseover = "";
} else if (mouseover == "yes" || mouseover == "click") { } else if (mouseover == "yes" || mouseover == "click") {
mouseover = "hide" mouseover = "hide";
} else if (mouseover == "no") { } else if (mouseover == "no") {
mouseover = "" mouseover = "";
} }
var local = [] var local = [];
var times = [] var times = [];
Object.keys(obj).forEach(function(key) { Object.keys(obj).forEach(function(key) {
var conv_id = obj[key].id var conv_id = obj[key].id;
var toot = obj[key].last_status var toot = obj[key].last_status;
var dis_name = escapeHTML(toot.account.display_name) var dis_name = escapeHTML(toot.account.display_name);
if (toot.account.emojis) { if (toot.account.emojis) {
var actemojick = toot.account.emojis[0] var actemojick = toot.account.emojis[0];
} else { } else {
var actemojick = false var actemojick = false;
} }
//絵文字があれば //絵文字があれば
if (actemojick) { if (actemojick) {
Object.keys(toot.account.emojis).forEach(function(key5) { Object.keys(toot.account.emojis).forEach(function(key5) {
var emoji = toot.account.emojis[key5] var emoji = toot.account.emojis[key5];
var shortcode = emoji.shortcode var shortcode = emoji.shortcode;
var emoji_url = '<img src="' + emoji.url + '" class="emoji-img" data-emoji="' + shortcode + '" alt=" :' + shortcode + ': ">' var emoji_url = '<img src="' + emoji.url + '" class="emoji-img" data-emoji="' + shortcode + '" alt=" :' + shortcode + ': ">';
var regExp = new RegExp(":" + shortcode + ":", "g") var regExp = new RegExp(":" + shortcode + ":", "g");
dis_name = dis_name.replace(regExp, emoji_url) dis_name = dis_name.replace(regExp, emoji_url);
}) });
} }
var noticeavatar = "" var noticeavatar = "";
var if_notf = "" var if_notf = "";
var uniqueid = toot.id var uniqueid = toot.id;
var notice = "" var notice = "";
var boostback = "" var boostback = "";
//ユーザー強調 //ユーザー強調
if (toot.account.username != toot.account.acct) { if (toot.account.username != toot.account.acct) {
var fullname = toot.account.acct var fullname = toot.account.acct;
} else { } else {
var domain = localStorage.getItem("domain_" + acct_id) var domain = localStorage.getItem("domain_" + acct_id);
var fullname = toot.account.acct + "@" + domain var fullname = toot.account.acct + "@" + domain;
} }
if (useremp) { if (useremp) {
Object.keys(useremp).forEach(function(key10) { Object.keys(useremp).forEach(function(key10) {
var user = useremp[key10] var user = useremp[key10];
if (user == fullname) { if (user == fullname) {
boostback = "emphasized" boostback = "emphasized";
} }
}) });
} }
var id = toot.id var id = toot.id;
var home = "" var home = "";
if (toot.account.locked) { if (toot.account.locked) {
var locked = ' <i class="fas fa-lock red-text"></i>' var locked = ' <i class="fas fa-lock red-text"></i>';
} else { } else {
var locked = "" var locked = "";
} }
if (!toot.application) { if (!toot.application) {
var via = "" var via = "";
viashow = "hide" viashow = "hide";
} else { } else {
var via = escapeHTML(toot.application.name) var via = escapeHTML(toot.application.name);
//強調チェック //強調チェック
Object.keys(emp).forEach(function(key6) { Object.keys(emp).forEach(function(key6) {
var cli = emp[key6] var cli = emp[key6];
if (cli == via) { if (cli == via) {
boostback = "emphasized" boostback = "emphasized";
} }
}) });
//ミュートチェック //ミュートチェック
Object.keys(mute).forEach(function(key7) { Object.keys(mute).forEach(function(key7) {
var cli = mute[key7] var cli = mute[key7];
if (cli == via) { if (cli == via) {
boostback = "hide" boostback = "hide";
} }
}) });
} }
if (mix == "pinned") { if (mix == "pinned") {
boostback = "emphasized" boostback = "emphasized";
} }
if (toot.spoiler_text && cw) { if (toot.spoiler_text && cw) {
var content = toot.content var content = toot.content;
var spoil = escapeHTML(toot.spoiler_text) var spoil = escapeHTML(toot.spoiler_text);
var spoiler = "cw cw_hide_" + toot.id var spoiler = "cw cw_hide_" + toot.id;
var api_spoil = "gray" var api_spoil = "gray";
var spoiler_show = '<a href="#" onclick="cw_show(\'' + toot.id + '\')" class="nex parsed">' + lang.lang_parse_cwshow + "</a><br>" var spoiler_show = '<a href="#" onclick="cw_show(\'' + toot.id + '\')" class="nex parsed">' + lang.lang_parse_cwshow + "</a><br>";
} else { } else {
var ct1 = toot.content.split("</p>").length + toot.content.split("<br />").length - 2 var ct1 = toot.content.split("</p>").length + toot.content.split("<br />").length - 2;
var ct2 = toot.content.split("</p>").length + toot.content.split("<br>").length - 2 var ct2 = toot.content.split("</p>").length + toot.content.split("<br>").length - 2;
if (ct1 > ct2) { if (ct1 > ct2) {
var ct = ct1 var ct = ct1;
} else { } 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)) { if ((sent < ct && $.mb_strlen($.strip_tags(toot.content)) > 5) || ($.strip_tags(toot.content).length > ltr && $.mb_strlen($.strip_tags(toot.content)) > 5)) {
var content = '<span class="gray">' + lang.lang_parse_fulltext + "</span><br>" + toot.content var content = '<span class="gray">' + lang.lang_parse_fulltext + "</span><br>" + toot.content;
var spoil = '<span class="cw-long-' + toot.id + '">' + $.mb_substr($.strip_tags(toot.content), 0, 100) + '</span><span class="gray">' + lang.lang_parse_autofold + "</span>" 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 = "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 spoiler_show = '<a href="#" onclick="cw_show(\'' + toot.id + '\')" class="nex parsed">' + lang.lang_parse_more + "</a><br>";
} else { } else {
var content = toot.content var content = toot.content;
var spoil = escapeHTML(toot.spoiler_text) var spoil = escapeHTML(toot.spoiler_text);
var spoiler = "" var spoiler = "";
var spoiler_show = "" var spoiler_show = "";
} }
} }
var urls = $.strip_tags(content) var urls = $.strip_tags(content)
.replace(/\n/g, " ") .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) { 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 { } else {
var analyze = "" var analyze = "";
} }
var viewer = "" var viewer = "";
var hasmedia = "" var hasmedia = "";
var youtube = "" var youtube = "";
if (toot.emojis) { if (toot.emojis) {
var emojick = toot.emojis[0] var emojick = toot.emojis[0];
} else { } else {
var emojick = false var emojick = false;
} }
//絵文字があれば //絵文字があれば
if (emojick) { if (emojick) {
Object.keys(toot.emojis).forEach(function(key5) { Object.keys(toot.emojis).forEach(function(key5) {
var emoji = toot.emojis[key5] var emoji = toot.emojis[key5];
var shortcode = emoji.shortcode var shortcode = emoji.shortcode;
var emoji_url = '<img src="' + emoji.url + '" class="emoji-img" data-emoji="' + shortcode + '" alt=" :' + shortcode + ': ">' var emoji_url = '<img src="' + emoji.url + '" class="emoji-img" data-emoji="' + shortcode + '" alt=" :' + shortcode + ': ">';
var regExp = new RegExp(":" + shortcode + ":", "g") var regExp = new RegExp(":" + shortcode + ":", "g");
content = content.replace(regExp, emoji_url) content = content.replace(regExp, emoji_url);
spoil = spoil.replace(regExp, emoji_url) spoil = spoil.replace(regExp, emoji_url);
}) });
} }
//ニコフレ絵文字 //ニコフレ絵文字
if (toot.profile_emojis) { if (toot.profile_emojis) {
var nicoemojick = toot.profile_emojis[0] var nicoemojick = toot.profile_emojis[0];
} else { } else {
var nicoemojick = false var nicoemojick = false;
} }
//絵文字があれば //絵文字があれば
if (nicoemojick) { if (nicoemojick) {
Object.keys(toot.profile_emojis).forEach(function(keynico) { Object.keys(toot.profile_emojis).forEach(function(keynico) {
var emoji = toot.profile_emojis[keynico] var emoji = toot.profile_emojis[keynico];
var shortcode = emoji.shortcode var shortcode = emoji.shortcode;
var emoji_url = '<img src="' + emoji.url + '" class="emoji-img" data-emoji="' + shortcode + '" alt=" :' + shortcode + ': ">' var emoji_url = '<img src="' + emoji.url + '" class="emoji-img" data-emoji="' + shortcode + '" alt=" :' + shortcode + ': ">';
var regExp = new RegExp(":" + shortcode + ":", "g") var regExp = new RegExp(":" + shortcode + ":", "g");
content = content.replace(regExp, emoji_url) content = content.replace(regExp, emoji_url);
spoil = spoil.replace(regExp, emoji_url) spoil = spoil.replace(regExp, emoji_url);
}) });
} }
//デフォ絵文字 //デフォ絵文字
content = twemoji.parse(content) content = twemoji.parse(content);
if (dis_name) { if (dis_name) {
dis_name = twemoji.parse(dis_name) dis_name = twemoji.parse(dis_name);
} }
if (spoil) { if (spoil) {
spoil = twemoji.parse(spoil) spoil = twemoji.parse(spoil);
} }
var mediack = toot.media_attachments[0] var mediack = toot.media_attachments[0];
//メディアがあれば //メディアがあれば
var media_ids = "" var media_ids = "";
if (mediack) { if (mediack) {
hasmedia = "hasmedia" hasmedia = "hasmedia";
var cwdt = 100 / toot.media_attachments.length var cwdt = 100 / toot.media_attachments.length;
Object.keys(toot.media_attachments).forEach(function(key2) { Object.keys(toot.media_attachments).forEach(function(key2) {
var media = toot.media_attachments[key2] var media = toot.media_attachments[key2];
var purl = media.preview_url var purl = media.preview_url;
media_ids = media_ids + media.id + "," media_ids = media_ids + media.id + ",";
var url = media.url var url = media.url;
if (toot.sensitive && nsfw) { if (toot.sensitive && nsfw) {
var sense = "sensitive" var sense = "sensitive";
} else { } 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>' 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) media_ids = media_ids.slice(0, -1);
} else { } else {
viewer = "" viewer = "";
hasmedia = "nomedia" hasmedia = "nomedia";
} }
var menck = toot.mentions[0] var menck = toot.mentions[0];
var mentions = "" var mentions = "";
//メンションであれば //メンションであれば
if (menck) { if (menck) {
mentions = "" mentions = "";
Object.keys(toot.mentions).forEach(function(key3) { Object.keys(toot.mentions).forEach(function(key3) {
var mention = toot.mentions[key3] var mention = toot.mentions[key3];
mentions = mentions + "<a onclick=\"udg('" + mention.id + "'," + acct_id + ')" class="pointer">@' + mention.acct + "</a> " mentions = mentions + "<a onclick=\"udg('" + mention.id + "'," + acct_id + ')" class="pointer">@' + mention.acct + "</a> ";
}) });
mentions = '<div style="float:right">' + mentions + "</div>" mentions = '<div style="float:right">' + mentions + "</div>";
} }
var tagck = toot.tags[0] var tagck = toot.tags[0];
var tags = "" var tags = "";
//タグであれば //タグであれば
if (tagck) { if (tagck) {
Object.keys(toot.tags).forEach(function(key4) { Object.keys(toot.tags).forEach(function(key4) {
var tag = toot.tags[key4] var tag = toot.tags[key4];
tags = tags + '<span class="hide" data-tag="' + tag.name + '">#' + tag.name + ":<a onclick=\"tl('tag','" + tag.name + "'," + acct_id + ',\'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 = 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>" tags = '<div style="float:right">' + tags + "</div>";
} }
//アニメ再生 //アニメ再生
if (gif == "yes") { if (gif == "yes") {
var avatar = toot.account.avatar var avatar = toot.account.avatar;
} else { } else {
var avatar = toot.account.avatar_static var avatar = toot.account.avatar_static;
} }
//ワードミュート //ワードミュート
if (wordmute) { if (wordmute) {
Object.keys(wordmute).forEach(function(key8) { Object.keys(wordmute).forEach(function(key8) {
var worde = wordmute[key8] var worde = wordmute[key8];
if (worde) { if (worde) {
if (worde.tag) { if (worde.tag) {
var word = worde.tag var word = worde.tag;
} else { } else {
var word = worde var word = worde;
} }
var regExp = new RegExp(word, "g") var regExp = new RegExp(word, "g");
if ($.strip_tags(content).match(regExp)) { if ($.strip_tags(content).match(regExp)) {
boostback = "hide by_filter" boostback = "hide by_filter";
} }
} }
}) });
} }
//ワード強調 //ワード強調
if (wordemp) { if (wordemp) {
Object.keys(wordemp).forEach(function(key9) { Object.keys(wordemp).forEach(function(key9) {
var word = wordemp[key9] var word = wordemp[key9];
if (word) { if (word) {
var word = word.tag var word = word.tag;
var regExp = new RegExp(word, "g") var regExp = new RegExp(word, "g");
content = content.replace(regExp, '<span class="emp">' + escapeHTML(word) + "</span>") content = content.replace(regExp, '<span class="emp">' + escapeHTML(word) + "</span>");
} }
}) });
} }
//日本語じゃない //日本語じゃない
if (toot.language != "ja") { if (toot.language != "ja") {
var trans = '<div class="action pin"><a onclick="trans(\'' + toot.language + '\')" class="waves-effect waves-dark btn-flat" style="padding:0" title="' + lang.lang_parse_trans + '"><i class="material-icons">g_translate</i></a></div>' var trans = '<div class="action pin"><a onclick="trans(\'' + toot.language + '\')" class="waves-effect waves-dark btn-flat" style="padding:0" title="' + lang.lang_parse_trans + '"><i class="material-icons">g_translate</i></a></div>';
} else { } else {
var trans = "" var trans = "";
} }
if (toot.favourited) { if (toot.favourited) {
var if_fav = " yellow-text" var if_fav = " yellow-text";
var fav_app = "faved" var fav_app = "faved";
} else { } else {
var if_fav = "" var if_fav = "";
var fav_app = "" var fav_app = "";
} }
//Cards //Cards
if (!card && toot.card) { if (!card && toot.card) {
var cards = toot.card var cards = toot.card;
if (cards.provider_name == "Twitter") { if (cards.provider_name == "Twitter") {
if (cards.image) { if (cards.image) {
var twiImg = '<br><img src="' + cards.image + '">' var twiImg = '<br><img src="' + cards.image + '">';
} else { } else {
var twiImg = "" var twiImg = "";
} }
analyze = '<blockquote class="twitter-tweet"><b>' + escapeHTML(cards.author_name) + "</b><br>" + escapeHTML(cards.description) + twiImg + "</blockquote>" analyze = '<blockquote class="twitter-tweet"><b>' + escapeHTML(cards.author_name) + "</b><br>" + escapeHTML(cards.description) + twiImg + "</blockquote>";
} }
if (cards.title) { 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) { 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 //Ticker
var tickerdom = "" var tickerdom = "";
if (ticker) { if (ticker) {
var tickerdata = localStorage.getItem("ticker") var tickerdata = localStorage.getItem("ticker");
if (tickerdata) { if (tickerdata) {
var tickerdata = JSON.parse(tickerdata) var tickerdata = JSON.parse(tickerdata);
var thisdomain = toot.account.acct.split("@") var thisdomain = toot.account.acct.split("@");
if (thisdomain.length > 1) { if (thisdomain.length > 1) {
thisdomain = thisdomain[1] thisdomain = thisdomain[1];
} }
for (var i = 0; i < tickerdata.length; i++) { for (var i = 0; i < tickerdata.length; i++) {
var value = tickerdata[i] var value = tickerdata[i];
if (value.domain == thisdomain) { 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>" 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 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>" 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 return templete;
} }

File diff suppressed because it is too large Load Diff

View File

@@ -19,22 +19,7 @@ async function mixtl(acct_id, tlid, type, delc, voice) {
additional(acct_id, tlid) additional(acct_id, tlid)
jQuery('time.timeago').timeago() jQuery('time.timeago').timeago()
todc() todc()
if(mastodonBaseWsStatus[domain] == 'cannotuse') { mixre(acct_id, tlid, 'mix', mute, voice, '')
mixre(acct_id, tlid, 'mix', mute, voice, '')
} else if (mastodonBaseWsStatus[domain] == 'undetected' || mastodonBaseWsStatus[domain] == 'connecting') {
const mbws = setInterval(function () {
if(mastodonBaseWsStatus[domain] == 'cannotuse') {
mixre(acct_id, tlid, 'mix', mute, voice, '')
clearInterval(mbws)
} else if(mastodonBaseWsStatus[domain] == 'available') {
mastodonBaseWs[domain].send(JSON.stringify({type: 'subscribe', stream: 'public:local'}))
clearInterval(mbws)
}
}, 1000)
} else if(mastodonBaseWsStatus[domain] == 'available') {
mastodonBaseWs[domain].send(JSON.stringify({type: 'subscribe', stream: 'public:local'}))
}
$(window).scrollTop(0) $(window).scrollTop(0)
lastId = integrated[0].id lastId = integrated[0].id
beforeLastId = integrated[1].id beforeLastId = integrated[1].id

View File

@@ -116,7 +116,7 @@ function notfColumn(acct_id, tlid, sys) {
var start = 'wss://' + domain + '/?i=' + at var start = 'wss://' + domain + '/?i=' + at
} }
} }
function notfCommon(acct_id, tlid, sys, stream) { function notfCommon(acct_id, tlid, sys) {
todo('Notifications Loading...') todo('Notifications Loading...')
var native = localStorage.getItem('nativenotf') var native = localStorage.getItem('nativenotf')
var at = localStorage.getItem('acct_' + acct_id + '_at') var at = localStorage.getItem('acct_' + acct_id + '_at')
@@ -147,10 +147,6 @@ function notfCommon(acct_id, tlid, sys, stream) {
} }
} }
} }
if(stream == 'only') {
notfWS(misskey, acct_id, tlid, domain, at)
return false
}
fetch(start, i) fetch(start, i)
.then(function(response) { .then(function(response) {
console.log('header to get param:' + response.headers.get('link')) console.log('header to get param:' + response.headers.get('link'))
@@ -207,11 +203,10 @@ function notfCommon(acct_id, tlid, sys, stream) {
} }
$('#notf-box').addClass('fetched') $('#notf-box').addClass('fetched')
todc() todc()
if(stream != 'no') notfWS(misskey, acct_id, tlid, domain, at) notfWS(misskey, acct_id, tlid, domain, at)
}) })
} }
function notfWS(misskey, acct_id, tlid, domain, at) { function notfWS(misskey, acct_id, tlid, domain, at) {
if(mastodonBaseWsStatus[domain] == 'available') return false
if (!misskey) { if (!misskey) {
if (localStorage.getItem('streaming_' + acct_id)) { if (localStorage.getItem('streaming_' + acct_id)) {
var wss = localStorage.getItem('streaming_' + acct_id) var wss = localStorage.getItem('streaming_' + acct_id)
@@ -263,7 +258,7 @@ function notfWS(misskey, acct_id, tlid, domain, at) {
} }
} }
websocketNotf[acct_id].onerror = function(error) { websocketNotf[acct_id].onerror = function(error) {
console.error('WebSocket Error ', error) console.error('WebSocket Error ' + error)
errorct++ errorct++
console.log(errorct) console.log(errorct)
if (errorct < 3) { if (errorct < 3) {
@@ -271,7 +266,7 @@ function notfWS(misskey, acct_id, tlid, domain, at) {
} }
} }
websocketNotf[acct_id].onclose = function(error) { websocketNotf[acct_id].onclose = function(error) {
console.error('WebSocket Close ', error) console.error('WebSocket Close ' + error)
errorct++ errorct++
console.log(errorct) console.log(errorct)
if (errorct < 3) { if (errorct < 3) {

View File

@@ -194,7 +194,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
} }
var local = [] var local = []
var times = [] var times = []
Object.keys(obj).forEach(function (key) { Object.keys(obj).forEach(function(key) {
var domain = localStorage.getItem('domain_' + acct_id) var domain = localStorage.getItem('domain_' + acct_id)
var toot = obj[key] var toot = obj[key]
if (type == 'dm') { if (type == 'dm') {
@@ -214,7 +214,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
} }
//絵文字があれば //絵文字があれば
if (actemojick) { if (actemojick) {
Object.keys(toot.account.emojis).forEach(function (key5) { Object.keys(toot.account.emojis).forEach(function(key5) {
var emoji = toot.account.emojis[key5] var emoji = toot.account.emojis[key5]
var shortcode = emoji.shortcode var shortcode = emoji.shortcode
if (gif == 'yes') { if (gif == 'yes') {
@@ -224,7 +224,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
} }
var emoji_url = ` var emoji_url = `
<img draggable="false" src="${emoSource}" class="emoji-img" data-emoji="${shortcode}" <img draggable="false" src="${emoSource}" class="emoji-img" data-emoji="${shortcode}"
alt=" :${shortcode}: " title="${shortcode}" onclick="this.classList.toggle('bigemoji');" loading="lazy"> alt=" :${shortcode}: " title="${shortcode}" onclick="this.classList.toggle('bigemoji');">
` `
var regExp = new RegExp(':' + shortcode + ':', 'g') var regExp = new RegExp(':' + shortcode + ':', 'g')
dis_name = dis_name.replace(regExp, emoji_url) dis_name = dis_name.replace(regExp, emoji_url)
@@ -241,7 +241,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
noticeavatar = toot.account.avatar_static noticeavatar = toot.account.avatar_static
} }
noticeavatar = `<a onclick="udg('${toot.account.id}','${acct_id}');" user="${toot.account.acct}" class="udg"> noticeavatar = `<a onclick="udg('${toot.account.id}','${acct_id}');" user="${toot.account.acct}" class="udg">
<img draggable="false" src="${noticeavatar}" width="20" class="notf-icon prof-img" user="${toot.account.acct}" alt="" loading="lazy"> <img draggable="false" src="${noticeavatar}" width="20" class="notf-icon prof-img" user="${toot.account.acct}" alt="">
</a>` </a>`
if (toot.type == 'mention') { if (toot.type == 'mention') {
var what = lang.lang_parse_mentioned var what = lang.lang_parse_mentioned
@@ -273,7 +273,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
</i><span class="voice">${lang.lang_parse_notffilter}</span></span> </i><span class="voice">${lang.lang_parse_notffilter}</span></span>
<span class="cbadge cbadge-hover" title="${date(toot.created_at, 'absolute')}(${ <span class="cbadge cbadge-hover" title="${date(toot.created_at, 'absolute')}(${
lang.lang_parse_notftime lang.lang_parse_notftime
})" aria-hidden="true"><i class="far fa-clock"></i> })" aria-hidden="true"><i class="far fa-clock"></i>
${date(toot.created_at, datetype)} ${date(toot.created_at, datetype)}
</span> </span>
<span class="voice">${date(toot.created_at, 'absolute')}(${lang.lang_parse_notftime})</span> <span class="voice">${date(toot.created_at, 'absolute')}(${lang.lang_parse_notftime})</span>
@@ -369,7 +369,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
} }
//絵文字があれば //絵文字があれば
if (actemojick) { if (actemojick) {
Object.keys(toot.account.emojis).forEach(function (key5) { Object.keys(toot.account.emojis).forEach(function(key5) {
var emoji = toot.account.emojis[key5] var emoji = toot.account.emojis[key5]
var shortcode = emoji.shortcode var shortcode = emoji.shortcode
if (gif == 'yes') { if (gif == 'yes') {
@@ -379,7 +379,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
} }
var emoji_url = ` var emoji_url = `
<img draggable="false" src="${emoSource}" class="emoji-img" data-emoji="${shortcode}" <img draggable="false" src="${emoSource}" class="emoji-img" data-emoji="${shortcode}"
alt=" :${shortcode}: " title="${shortcode}" onclick="this.classList.toggle('bigemoji');" loading="lazy"> alt=" :${shortcode}: " title="${shortcode}" onclick="this.classList.toggle('bigemoji');">
` `
var regExp = new RegExp(':' + shortcode + ':', 'g') var regExp = new RegExp(':' + shortcode + ':', 'g')
dis_name = dis_name.replace(regExp, emoji_url) dis_name = dis_name.replace(regExp, emoji_url)
@@ -395,7 +395,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
} }
noticeavatar = `<a onclick="udg('${toot.account.id}','${acct_id}');" user="${toot.account.acct}" class="udg" aria-hidden="true"> noticeavatar = `<a onclick="udg('${toot.account.id}','${acct_id}');" user="${toot.account.acct}" class="udg" aria-hidden="true">
<img draggable="false" src="${noticeavatar}" width="20" class="notf-icon prof-img" <img draggable="false" src="${noticeavatar}" width="20" class="notf-icon prof-img"
user="${toot.account.acct}" onerror="this.src=\'../../img/loading.svg\'" loading="lazy"> user="${toot.account.acct}" onerror="this.src=\'../../img/loading.svg\'">
</a>` </a>`
var rebtxt = lang.lang_parse_btedsimple var rebtxt = lang.lang_parse_btedsimple
var rticon = 'fa-retweet light-blue-text' var rticon = 'fa-retweet light-blue-text'
@@ -426,7 +426,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
} }
//絵文字があれば //絵文字があれば
if (actemojick) { if (actemojick) {
Object.keys(toot.account.emojis).forEach(function (key5) { Object.keys(toot.account.emojis).forEach(function(key5) {
var emoji = toot.account.emojis[key5] var emoji = toot.account.emojis[key5]
var shortcode = emoji.shortcode var shortcode = emoji.shortcode
if (gif == 'yes') { if (gif == 'yes') {
@@ -436,7 +436,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
} }
var emoji_url = ` var emoji_url = `
<img draggable="false" src="${emoSource}" class="emoji-img" data-emoji="${shortcode}" <img draggable="false" src="${emoSource}" class="emoji-img" data-emoji="${shortcode}"
alt=" :${shortcode}: " title="${shortcode}" onclick="this.classList.toggle('bigemoji');" loading="lazy"> alt=" :${shortcode}: " title="${shortcode}" onclick="this.classList.toggle('bigemoji');">
` `
var regExp = new RegExp(':' + shortcode + ':', 'g') var regExp = new RegExp(':' + shortcode + ':', 'g')
dis_name = dis_name.replace(regExp, emoji_url) dis_name = dis_name.replace(regExp, emoji_url)
@@ -454,7 +454,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
var fullname = toot.account.acct + '@' + domain var fullname = toot.account.acct + '@' + domain
} }
if (useremp) { if (useremp) {
Object.keys(useremp).forEach(function (key10) { Object.keys(useremp).forEach(function(key10) {
var user = useremp[key10] var user = useremp[key10]
if (user == fullname) { if (user == fullname) {
boostback = 'emphasized' boostback = 'emphasized'
@@ -494,7 +494,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
var via = escapeHTML(toot.application.name) var via = escapeHTML(toot.application.name)
if (empCli) { if (empCli) {
//強調チェック //強調チェック
Object.keys(empCli).forEach(function (key6) { Object.keys(empCli).forEach(function(key6) {
var empCliList = empCli[key6] var empCliList = empCli[key6]
if (empCliList == via) { if (empCliList == via) {
boostback = 'emphasized' boostback = 'emphasized'
@@ -503,7 +503,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
} }
if (muteCli) { if (muteCli) {
//ミュートチェック //ミュートチェック
Object.keys(muteCli).forEach(function (key7) { Object.keys(muteCli).forEach(function(key7) {
var muteCliList = muteCli[key7] var muteCliList = muteCli[key7]
if (muteCliList == via) { if (muteCliList == via) {
boostback = 'hide' boostback = 'hide'
@@ -597,7 +597,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
if (mediack) { if (mediack) {
hasmedia = 'hasmedia' hasmedia = 'hasmedia'
var cwdt = 100 / toot.media_attachments.length var cwdt = 100 / toot.media_attachments.length
Object.keys(toot.media_attachments).forEach(function (key2) { Object.keys(toot.media_attachments).forEach(function(key2) {
var media = toot.media_attachments[key2] var media = toot.media_attachments[key2]
var purl = media.preview_url var purl = media.preview_url
media_ids = media_ids + media.id + ',' media_ids = media_ids + media.id + ','
@@ -628,7 +628,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
var mty = media.remote_url.match(/.+(\..+)$/)[1] var mty = media.remote_url.match(/.+(\..+)$/)[1]
viewer = viewer =
viewer + viewer +
`<a href="${media.url ? media.url : media.remote_url}" title="${media.remote_url} from ${media.url}">[${lang.lang_parse_unknown}(${mty})]</a> ` `<a href="${media.remote_url}" title="${media.remote_url}">[${lang.lang_parse_unknown}(${mty})]</a> `
} else if (media.type == 'audio') { } else if (media.type == 'audio') {
viewer = viewer =
viewer + viewer +
@@ -652,7 +652,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
id="${id}-image-${key2}" data-url="${url}" data-original="${remote_url}" data-type="${media.type}" id="${id}-image-${key2}" data-url="${url}" data-original="${remote_url}" data-type="${media.type}"
class="img-parsed img-link" style="width:calc(${cwdt}% - 1px); height:${imh};"> class="img-parsed img-link" style="width:calc(${cwdt}% - 1px); height:${imh};">
<img draggable="false" src="${purl}" class="${sense} toot-img pointer" <img draggable="false" src="${purl}" class="${sense} toot-img pointer"
onerror="this.src=\'../../img/loading.svg\'" title="${escapeHTML(desc)}" alt="${escapeHTML(desc)}" loading="lazy"> onerror="this.src=\'../../img/loading.svg\'" title="${escapeHTML(desc)}" alt="${escapeHTML(desc)}">
${nsfwmes} ${nsfwmes}
</a>` </a>`
} }
@@ -669,7 +669,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
if (menck) { if (menck) {
mentions = '' mentions = ''
var to_mention = [] var to_mention = []
Object.keys(toot.mentions).forEach(function (key3) { Object.keys(toot.mentions).forEach(function(key3) {
var mention = toot.mentions[key3] var mention = toot.mentions[key3]
//自分は除外 //自分は除外
//自インスタンスかどうかを確認し、IDの一致 //自インスタンスかどうかを確認し、IDの一致
@@ -704,19 +704,19 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
var tags = '' var tags = ''
//タグであれば //タグであれば
if (tagck) { if (tagck) {
Object.keys(toot.tags).forEach(function (key4) { Object.keys(toot.tags).forEach(function(key4) {
var tag = toot.tags[key4] var tag = toot.tags[key4]
var featured = ` <a onclick="tagFeature('${tag.name}','${acct_id}')" class="pointer" title="add it to Featured tags">Feature</a> ` var featured = ` <a onclick="tagFeature('${tag.name}','${acct_id}')" class="pointer" title="add it to Featured tags">Feature</a> `
tags = tags =
tags + tags +
`<span class="hide" data-tag="${tag.name}" data-regTag="${tag.name.toLowerCase()}">#${ `<span class="hide" data-tag="${tag.name}" data-regTag="${tag.name.toLowerCase()}">#${
tag.name tag.name
}: }:
<a onclick="tl('tag','${tag.name}','${acct_id}','add')" class="pointer" <a onclick="tl('tag','${tag.name}','${acct_id}','add')" class="pointer"
title="${lang.lang_parse_tagTL.replace( title="${lang.lang_parse_tagTL.replace(
'{{tag}}', '{{tag}}',
'#' + tag.name '#' + tag.name
)}">TL</a> <a onclick="brInsert('#${tag.name}')" )}">TL</a> <a onclick="brInsert('#${tag.name}')"
class="pointer" title="${lang.lang_parse_tagtoot.replace('{{tag}}', '#' + tag.name)}">Toot</a>  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( <a onclick="tagPin('${tag.name}')" class="pointer" title="${lang.lang_parse_tagpin.replace(
'{{tag}}', '{{tag}}',
@@ -812,7 +812,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
} }
//ワードミュート //ワードミュート
if (wordmuteList) { if (wordmuteList) {
Object.keys(wordmuteList).forEach(function (key8) { Object.keys(wordmuteList).forEach(function(key8) {
var worde = wordmuteList[key8] var worde = wordmuteList[key8]
if (worde) { if (worde) {
if (worde.tag) { if (worde.tag) {
@@ -829,7 +829,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
} }
//ワード強調 //ワード強調
if (wordempList) { if (wordempList) {
Object.keys(wordempList).forEach(function (key9) { Object.keys(wordempList).forEach(function(key9) {
var wordList = wordempList[key9] var wordList = wordempList[key9]
if (wordList) { if (wordList) {
var wordList = wordList.tag var wordList = wordList.tag
@@ -845,7 +845,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
} }
//絵文字があれば //絵文字があれば
if (emojick) { if (emojick) {
Object.keys(toot.emojis).forEach(function (key5) { Object.keys(toot.emojis).forEach(function(key5) {
var emoji = toot.emojis[key5] var emoji = toot.emojis[key5]
var shortcode = emoji.shortcode var shortcode = emoji.shortcode
if (gif == 'yes') { if (gif == 'yes') {
@@ -855,7 +855,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
} }
var emoji_url = ` var emoji_url = `
<img draggable="false" src="${emoSource}" class="emoji-img" data-emoji="${shortcode}" <img draggable="false" src="${emoSource}" class="emoji-img" data-emoji="${shortcode}"
alt=" :${shortcode}: " title="${shortcode}" onclick="this.classList.toggle('bigemoji');" loading="lazy"> alt=" :${shortcode}: " title="${shortcode}" onclick="this.classList.toggle('bigemoji');">
` `
var regExp = new RegExp(':' + shortcode + ':', 'g') var regExp = new RegExp(':' + shortcode + ':', 'g')
content = content.replace(regExp, emoji_url) content = content.replace(regExp, emoji_url)
@@ -871,11 +871,11 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
} }
//絵文字があれば(nico) //絵文字があれば(nico)
if (nicoemojick) { if (nicoemojick) {
Object.keys(toot.profile_emojis).forEach(function (keynico) { Object.keys(toot.profile_emojis).forEach(function(keynico) {
var emoji = toot.profile_emojis[keynico] var emoji = toot.profile_emojis[keynico]
var shortcode = emoji.shortcode var shortcode = emoji.shortcode
var emoji_url = `<img draggable="false" src="${emoji.url}" class="emoji-img" data-emoji="${shortcode}" alt=" :${shortcode}: " var emoji_url = `<img draggable="false" src="${emoji.url}" class="emoji-img" data-emoji="${shortcode}" alt=" :${shortcode}: "
title="${shortcode}" onclick="this.classList.toggle(\'bigemoji\');" loading="lazy">` title="${shortcode}" onclick="this.classList.toggle(\'bigemoji\');">`
var regExp = new RegExp(':' + shortcode + ':', 'g') var regExp = new RegExp(':' + shortcode + ':', 'g')
content = content.replace(regExp, emoji_url) content = content.replace(regExp, emoji_url)
spoil = spoil.replace(regExp, emoji_url) spoil = spoil.replace(regExp, emoji_url)
@@ -901,10 +901,12 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
} }
//日本語じゃない //日本語じゃない
if (toot.language != lang.language && toot.language) { if (toot.language != lang.language && toot.language) {
var trans = `<li onclick="trans('${toot.language}','${lang.language}', $(this))" var trans = `<div class="">
style="padding:0"> <a onclick="trans('${toot.language}','${lang.language}', $(this))"
class="waves-effect waves-dark btn-flat actct" style="padding:0">
<i class="material-icons" aria-hidden="true">g_translate</i>${lang.lang_parse_trans} <i class="material-icons" aria-hidden="true">g_translate</i>${lang.lang_parse_trans}
</li>` </a>
</div>`
} else { } else {
var trans = '' var trans = ''
} }
@@ -916,10 +918,9 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
//Ticker //Ticker
var tickerdom = '' var tickerdom = ''
if (ticker) { if (ticker) {
var tickerdata = localStorage.getItem('sticker') var tickerdata = localStorage.getItem('ticker')
if (tickerdata) { if (tickerdata) {
var tickerdataRaw = JSON.parse(tickerdata) var tickerdata = JSON.parse(tickerdata)
var tickerdata = tickerdataRaw.data
var thisdomain = toot.account.acct.split('@') var thisdomain = toot.account.acct.split('@')
if (thisdomain.length > 1) { if (thisdomain.length > 1) {
@@ -928,41 +929,14 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
for (var i = 0; i < tickerdata.length; i++) { for (var i = 0; i < tickerdata.length; i++) {
var value = tickerdata[i] var value = tickerdata[i]
if (value.domain == thisdomain) { if (value.domain == thisdomain) {
var bgColor = value.bgColor var tickerdom = `<div aria-hidden="true" style="user-select:none;cursor:default;background:linear-gradient(90deg, ${
var fontColor = value.fontColor value.bg
if (!value.bgColor || !value.fontColor) { }, transparent 96%) !important; color:${
if (value.type == 'mastodon') { value.text
if (!value.bgColor) bgColor = tickerdataRaw.default.mastodon.bgColor };width:100%; height:0.9rem; font-size:0.8rem;" class="tickers">
if (!value.fontColor) fontColor = tickerdataRaw.default.mastodon.fontColor
} else if (value.type == 'pleroma') {
if (!value.bgColor) bgColor = tickerdataRaw.default.pleroma.bgColor
if (!value.fontColor) fontColor = tickerdataRaw.default.pleroma.fontColor
} else if (value.type == 'misskey') {
if (!value.bgColor) bgColor = tickerdataRaw.default.misskey.bgColor
if (!value.fontColor) fontColor = tickerdataRaw.default.misskey.fontColor
} else if (value.type == 'misskeylegacy') {
if (!value.bgColor) bgColor = tickerdataRaw.default.misskeylegacy.bgColor
if (!value.fontColor) fontColor = tickerdataRaw.default.misskeylegacy.fontColor
} else if (value.type == 'pixelfed') {
if (!value.bgColor) bgColor = tickerdataRaw.default.pixelfed.bgColor
if (!value.fontColor) fontColor = tickerdataRaw.default.pixelfed.fontColor
}
} else {
var bgColor = value.bgColor
var fontColor = value.fontColor
}
bgColorCSS = ''
for (let j = 0; j < bgColor.length; j++) {
const bg = bgColor[j]
bgColorCSS = bgColorCSS + bg + ','
}
bgColorCSS = `linear-gradient(90deg, ${bgColorCSS} transparent)`
var tickerdom = `<div aria-hidden="true" style="user-select:none;cursor:default;background:${bgColorCSS} !important; color:${
fontColor
};width:100%; height:0.9rem; font-size:0.8rem;" class="tickers">
<img draggable="false" src="${ <img draggable="false" src="${
value.favicon value.image
}" style="height:100%;" onerror="this.src=\'../../img/loading.svg\'" loading="lazy"> }" style="height:100%;" onerror="this.src=\'../../img/loading.svg\'">
<span style="position:relative; top:-0.2rem;">${escapeHTML(value.name)}</span> <span style="position:relative; top:-0.2rem;">${escapeHTML(value.name)}</span>
</div>` </div>`
break break
@@ -976,15 +950,15 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
if (!quoteUser) { if (!quoteUser) {
quoteUser = toot.quote.account.acct quoteUser = toot.quote.account.acct
} }
if (!toot.quote.quote_muted) { if(!toot.quote.quote_muted) {
poll = poll =
poll + poll +
`<div class="quote-renote"> `<div class="quote-renote">
<div class="renote-icon"> <div class="renote-icon">
<a onclick="udg('${toot.quote.account.id}','${acct_id}');" user="${ <a onclick="udg('${toot.quote.account.id}','${acct_id}');" user="${
toot.quote.account.acct toot.quote.account.acct
}" class="udg"> }" class="udg">
<img draggable="false" src="${toot.quote.account.avatar}" loading="lazy"> <img draggable="false" src="${toot.quote.account.avatar}">
</a> </a>
</div> </div>
<div class="renote-user"> <div class="renote-user">
@@ -995,18 +969,18 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
</div> </div>
<div class="renote-details"> <div class="renote-details">
<a onclick="details('${ <a onclick="details('${
toot.quote.id toot.quote.id
}','${acct_id}','${tlid}','normal')" class="waves-effect waves-dark btn-flat details" style="padding:0"> }','${acct_id}','${tlid}','normal')" class="waves-effect waves-dark btn-flat details" style="padding:0">
<i class="text-darken-3 material-icons">more_vert</i> <i class="text-darken-3 material-icons">more_vert</i>
</a> </a>
</div> </div>
</div>` </div>`
} else { } else {
poll = poll =
poll + poll +
`<span class="gray sml">${lang.lang_parse_hidden}</span>` `<span class="gray sml">${lang.lang_parse_hidden}</span>`
} }
} }
//menuは何個 //menuは何個
var menuct = 2 var menuct = 2
@@ -1032,15 +1006,15 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
'unix' 'unix'
)}" )}"
${if_notf} ${if_notf}
onmouseover="mov('${uniqueid}','${tlid}','mv')" onmouseover="mov('${toot.id}','${tlid}','mv')"
onclick="mov('${uniqueid}','${tlid}','cl')" onclick="mov('${toot.id}','${tlid}','cl')"
onmouseout="resetmv('mv')" onmouseout="resetmv('mv')"
> >
<div class="area-notice grid"><span class="gray sharesta">${notice}${home}</span></div> <div class="area-notice grid"><span class="gray sharesta">${notice}${home}</span></div>
<div class="area-icon grid"> <div class="area-icon grid">
<a onclick="udg('${toot.account.id}','${acct_id}');" user="${toot.account.acct}" class="udg"> <a onclick="udg('${toot.account.id}','${acct_id}');" user="${toot.account.acct}" class="udg">
<img draggable="false" src="${avatar}" width="40" class="prof-img" <img draggable="false" src="${avatar}" width="40" class="prof-img"
user="${toot.account.acct}" onerror="this.src='../../img/loading.svg'" alt="" loading="lazy" /> user="${toot.account.acct}" onerror="this.src='../../img/loading.svg'" alt="" />
</a> </a>
${noticeavatar} ${noticeavatar}
</div> </div>
@@ -1085,7 +1059,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
</a> </a>
</div> </div>
<div class="action ${disp['re']} ${noauth}"> <div class="action ${disp['re']} ${noauth}">
<a onclick="re('${toot.id}','${to_mention}','${acct_id}','${visen}','${escapeHTML(toot.spoiler_text)}')" <a onclick="re('${toot.id}','${to_mention}','${acct_id}','${visen}')"
class="waves-effect waves-dark btn-flat actct rep-btn" class="waves-effect waves-dark btn-flat actct rep-btn"
data-men="${to_mention}" data-visen="${visen}" style="padding:0" title="${lang.lang_parse_replyto}"> data-men="${to_mention}" data-visen="${visen}" style="padding:0" title="${lang.lang_parse_replyto}">
<i class="fas fa-share"></i> <i class="fas fa-share"></i>
@@ -1095,8 +1069,8 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
</div> </div>
<div class="action ${can_rt} ${disp['rt']} ${noauth}"> <div class="action ${can_rt} ${disp['rt']} ${noauth}">
<a onclick="rt('${ <a onclick="rt('${
toot.id toot.id
}','${acct_id}','${tlid}')" class="waves-effect waves-dark btn-flat actct bt-btn" }','${acct_id}','${tlid}')" class="waves-effect waves-dark btn-flat actct bt-btn"
style="padding:0" title="${lang.lang_parse_bt}"> style="padding:0" title="${lang.lang_parse_bt}">
<i class="fas fa-retweet ${if_rt} rt_${toot.id}"></i> <i class="fas fa-retweet ${if_rt} rt_${toot.id}"></i>
<span class="voice">${lang.lang_parse_bt} </span> <span class="voice">${lang.lang_parse_bt} </span>
@@ -1130,8 +1104,8 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
</div> </div>
<div class="area-side"> <div class="area-side">
<div class="action ${noauth}"> <div class="action ${noauth}">
<a onclick="toggleAction('trigger_${tlid}_${uniqueid}')" data-target="dropdown_${tlid}_${uniqueid}" <a onclick="toggleAction($(this), ${menuct * 39 + 6})"
class="ctxMenu waves-effect waves-dark btn-flat" style="padding:0" id="trigger_${tlid}_${uniqueid}"> class="ctxMenu waves-effect waves-dark btn-flat" style="padding:0">
<i class="text-darken-3 material-icons act-icon" aria-hidden="true">expand_more</i> <i class="text-darken-3 material-icons act-icon" aria-hidden="true">expand_more</i>
<span class="voice">Other actions</span> <span class="voice">Other actions</span>
</a> </a>
@@ -1144,32 +1118,45 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
<span class="voice">${lang.lang_parse_detail}</span> <span class="voice">${lang.lang_parse_detail}</span>
</div> </div>
</div> </div>
<ul class="dropdown-content contextMenu" id="dropdown_${tlid}_${uniqueid}"> <div class="contextMenu hide z-depth-4">
<li class="${viashow} via-dropdown" onclick="client('${$.strip_tags(via)}')" title="${lang.lang_parse_clientop}"> <div class="${viashow}">
via ${escapeHTML(via)}</a> via ${escapeHTML(via)}<br>
</li> <a onclick="client('${$.strip_tags(via)}')" class="pointer">${lang.lang_parse_clientop}</a>
</div>
<div> <div>
<li onclick="bkm('${uniqueid}','${acct_id}','${tlid}')" <button onclick="bkm('${uniqueid}','${acct_id}','${tlid}')"
class="bkm-btn bkmStr_${uniqueid}" style="padding:0"> class="waves-effect waves-dark btn-flat actct bkm-btn" style="padding:0">
<i class="fas text-darken-3 fa-bookmark bkm_${toot.id} ${if_bkm}"></i>${bkmStr} <i class="fas text-darken-3 fa-bookmark bkm_${toot.id} ${if_bkm}"></i>
</li> <span class="bkmStr_${uniqueid}">${bkmStr}</span>
<li class="${if_mine}" onclick="del('${uniqueid}','${acct_id}')" </button>
</div>
<div class="${if_mine}">
<button onclick="del('${uniqueid}','${acct_id}')" class="waves-effect waves-dark btn-flat actct"
style="padding:0"> style="padding:0">
<i class="fas fa-trash"></i>${lang.lang_parse_del} <i class="fas fa-trash"></i>${lang.lang_parse_del}
</li> </button>
<li class="${if_mine}" onclick="pin('${uniqueid}','${acct_id}')" style="padding:0" class="pinStr_${uniqueid}"> </div>
<i class="fas fa-map-pin pin_${uniqueid} ${if_pin}"></i>${pinStr} <div class="${if_mine}">
</li> <button onclick="pin('${uniqueid}','${acct_id}')" class="waves-effect waves-dark btn-flat actct" style="padding:0">
<li class="${if_mine}" onclick="redraft('${uniqueid}','${acct_id}')" <i class="fas fa-map-pin pin_${uniqueid} ${if_pin}"></i>
<span class="pinStr_${uniqueid}">${pinStr}</span>
</button>
</div>
<div class="${if_mine}">
<button onclick="redraft('${uniqueid}','${acct_id}')" class="waves-effect waves-dark btn-flat actct"
style="padding:0"> style="padding:0">
<i class="material-icons" aria-hidden="true">redo</i>${lang.lang_parse_redraft} <i class="material-icons" aria-hidden="true">redo</i>${lang.lang_parse_redraft}
</li> </button>
</div>
${trans} ${trans}
<li onclick="postMessage(['openUrl', '${toot.url}'], '*')" <div>
style="padding:0"> <button onclick="postMessage(['openUrl', '${toot.url}'], '*')"
<i class="fas text-darken-3 fa-globe"></i>${lang.lang_parse_link} class="waves-effect waves-dark btn-flat actct" style="padding:0">
</li> <i class="fas text-darken-3 fa-globe"></i>
</ul> ${lang.lang_parse_link}
</button>
</div>
</div>
</div> </div>
` `
} }
@@ -1194,7 +1181,7 @@ function userparse(obj, auth, acct_id, tlid, popup) {
} }
var templete = '' var templete = ''
var datetype = localStorage.getItem('datetype') var datetype = localStorage.getItem('datetype')
Object.keys(obj).forEach(function (key) { Object.keys(obj).forEach(function(key) {
var toot = obj[key] var toot = obj[key]
if (toot) { if (toot) {
if (!toot.username) { if (!toot.username) {
@@ -1231,6 +1218,7 @@ function userparse(obj, auth, acct_id, tlid, popup) {
} else if (auth == 'request') { } else if (auth == 'request') {
var ftxt = lang.lang_parse_request var ftxt = lang.lang_parse_request
} }
console.log(auth, ftxt)
if (popup > 0 || popup == -1 || notf) { if (popup > 0 || popup == -1 || notf) {
var notftext = ftxt + '<br>' var notftext = ftxt + '<br>'
} else { } else {
@@ -1270,7 +1258,7 @@ function userparse(obj, auth, acct_id, tlid, popup) {
} }
//絵文字があれば //絵文字があれば
if (actemojick) { if (actemojick) {
Object.keys(toot.emojis).forEach(function (key5) { Object.keys(toot.emojis).forEach(function(key5) {
var emoji = toot.emojis[key5] var emoji = toot.emojis[key5]
var shortcode = emoji.shortcode var shortcode = emoji.shortcode
if (gif == 'yes') { if (gif == 'yes') {
@@ -1280,7 +1268,7 @@ function userparse(obj, auth, acct_id, tlid, popup) {
} }
var emoji_url = ` var emoji_url = `
<img draggable="false" src="${emoSource}" class="emoji-img" data-emoji="${shortcode}" <img draggable="false" src="${emoSource}" class="emoji-img" data-emoji="${shortcode}"
alt=" :${shortcode}: " title="${shortcode}" onclick="this.classList.toggle('bigemoji');" loading="lazy"> alt=" :${shortcode}: " title="${shortcode}" onclick="this.classList.toggle('bigemoji');">
` `
var regExp = new RegExp(':' + shortcode + ':', 'g') var regExp = new RegExp(':' + shortcode + ':', 'g')
dis_name = dis_name.replace(regExp, emoji_url) dis_name = dis_name.replace(regExp, emoji_url)
@@ -1303,7 +1291,7 @@ function userparse(obj, auth, acct_id, tlid, popup) {
} else { } else {
var udg = `<a onclick="udg('${toot.id}','${acct_id}');" user="${toot.acct}" class="udg">` var udg = `<a onclick="udg('${toot.id}','${acct_id}');" user="${toot.acct}" class="udg">`
} }
var latest = date(toot.last_status_at, 'relative', true) var latest = date(toot.last_status_at, 'relative')
if (toot.last_status_at) { if (toot.last_status_at) {
var latesthtml = `<div class="cbadge" style="width:100px;">Last <span class="voice">toot</span>: ${latest}</div>` var latesthtml = `<div class="cbadge" style="width:100px;">Last <span class="voice">toot</span>: ${latest}</div>`
} else { } else {
@@ -1323,7 +1311,6 @@ function userparse(obj, auth, acct_id, tlid, popup) {
user="${toot.acct}" user="${toot.acct}"
onerror="this.src='../../img/loading.svg'" onerror="this.src='../../img/loading.svg'"
alt="" alt=""
loading="lazy"
/> />
</a></div> </a></div>
<div class="area-display_name"> <div class="area-display_name">
@@ -1357,6 +1344,7 @@ function userparse(obj, auth, acct_id, tlid, popup) {
} }
//クライアントダイアログ //クライアントダイアログ
function client(name) { function client(name) {
$('#contextWrap').addClass('hide')
if (name != 'Unknown') { if (name != 'Unknown') {
//聞く //聞く
Swal.fire({ Swal.fire({
@@ -1381,7 +1369,7 @@ function client(name) {
M.toast({ html: escapeHTML(name) + lang.lang_status_emphas, displayLength: 2000 }) M.toast({ html: escapeHTML(name) + lang.lang_status_emphas, displayLength: 2000 })
} else { } else {
var can var can
Object.keys(obj).forEach(function (key) { Object.keys(obj).forEach(function(key) {
var cliT = obj[key] var cliT = obj[key]
if (cliT != name && !can) { if (cliT != name && !can) {
can = false can = false
@@ -1469,7 +1457,7 @@ function pollParse(poll, acct_id, emojis) {
var max = 0 var max = 0
} }
Object.keys(choices).forEach(function (keyc) { Object.keys(choices).forEach(function(keyc) {
var choice = choices[keyc] var choice = choices[keyc]
var voteit = '' var voteit = ''
for (var i = 0; i < minechoice.length; i++) { for (var i = 0; i < minechoice.length; i++) {
@@ -1504,7 +1492,7 @@ function pollParse(poll, acct_id, emojis) {
var choiceText = escapeHTML(choice.title) var choiceText = escapeHTML(choice.title)
if (emojis) { if (emojis) {
//絵文字があれば //絵文字があれば
Object.keys(emojis).forEach(function (key5) { Object.keys(emojis).forEach(function(key5) {
var emoji = emojis[key5] var emoji = emojis[key5]
var shortcode = emoji.shortcode var shortcode = emoji.shortcode
if (gif == 'yes') { if (gif == 'yes') {
@@ -1514,7 +1502,7 @@ function pollParse(poll, acct_id, emojis) {
} }
var emoji_url = ` var emoji_url = `
<img draggable="false" src="${emoSource}" class="emoji-img" data-emoji="${shortcode}" <img draggable="false" src="${emoSource}" class="emoji-img" data-emoji="${shortcode}"
alt=" :${shortcode}: " title="${shortcode}" onclick="this.classList.toggle('bigemoji');" loading="lazy"> alt=" :${shortcode}: " title="${shortcode}" onclick="this.classList.toggle('bigemoji');">
` `
var regExp = new RegExp(':' + shortcode + ':', 'g') var regExp = new RegExp(':' + shortcode + ':', 'g')
choiceText = choiceText.replace(regExp, emoji_url) choiceText = choiceText.replace(regExp, emoji_url)
@@ -1544,312 +1532,3 @@ function pollParse(poll, acct_id, emojis) {
</div>` </div>`
return pollHtml return pollHtml
} }
//MastodonBaseStreaming
var mastodonBaseWs = {}
var mastodonBaseWsStatus = {}
function mastodonBaseStreaming(acct_id) {
console.log('start to connect mastodonBaseStreaming of ' + acct_id)
notfCommon(acct_id, 0, null, 'no')
const domain = localStorage.getItem(`domain_${acct_id}`)
if (mastodonBaseWsStatus[domain]) return
mastodonBaseWsStatus[domain] = 'undetected'
const at = localStorage.getItem(`acct_${acct_id}_at`)
let wss = 'wss://' + domain
if (localStorage.getItem('streaming_' + acct_id)) {
wss = localStorage.getItem('streaming_' + acct_id)
}
const start = `${wss}/api/v1/streaming/?access_token=${at}`
mastodonBaseWs[domain] = new WebSocket(start)
mastodonBaseWs[domain].onopen = function () {
mastodonBaseWsStatus[domain] = 'connecting'
setTimeout(function () {
mastodonBaseWsStatus[domain] = 'available'
}, 3000)
mastodonBaseWs[domain].send(JSON.stringify({type: 'subscribe', stream: 'user'}))
$('.notice_icon_acct_' + acct_id).removeClass('red-text')
}
mastodonBaseWs[domain].onmessage = function (mess) {
const typeA = JSON.parse(mess.data).event
if (typeA == 'delete') {
$(`[unique-id=${JSON.parse(mess.data).payload}]`).hide()
$(`[unique-id=${JSON.parse(mess.data).payload}]`).remove()
} else if (typeA == 'update' || typeA == 'conversation') {
//markers show中はダメ
const tl = JSON.parse(mess.data).stream
const obj = JSON.parse(JSON.parse(mess.data).payload)
const tls = getTlMeta(tl[0], tl, acct_id, obj)
insertTl(obj, tls)
} else if (typeA == 'filters_changed') {
filterUpdate(acct_id)
} else if (~typeA.indexOf('announcement')) {
announ(acct_id, tlid)
} else if (typeA == 'notification') {
const obj = JSON.parse(JSON.parse(mess.data).payload)
let template = ''
localStorage.setItem('lastnotf_' + acct_id, obj.id)
let popup = localStorage.getItem('popup')
if (!popup) {
popup = 0
}
if (obj.type != 'follow' && obj.type != 'follow_request') {
template = parse([obj], 'notf', acct_id, 'notf', popup)
} else if (obj.type == 'follow_request') {
template = userparse([obj.account], 'request', acct_id, 'notf', -1)
} else {
template = userparse([obj], obj.type, acct_id, 'notf', popup)
}
if (!$('div[data-notfIndv=' + acct_id + '_' + obj.id + ']').length) {
$('div[data-notf=' + acct_id + ']').prepend(template)
$('div[data-const=notf_' + acct_id + ']').prepend(template)
}
jQuery('time.timeago').timeago()
} else {
console.error('unknown type ' + typeA)
}
}
mastodonBaseWs[domain].onerror = function (error) {
notfCommon(acct_id, 0, null, 'only') //fallback
console.error("Error closing " + domain)
console.error(error)
if (mastodonBaseWsStatus[domain] == 'available') {
/*M.toast({
html:
`${lang.lang_parse_disconnected}<button class="btn-flat toast-action" onclick="location.reload()">${lang.lang_layout_reconnect}</button>`,
completeCallback: function () {
parseColumn()
},
displayLength: 3000
})*/
parseColumn()
}
mastodonBaseWsStatus[domain] = 'cannotuse'
setTimeout(function () {
mastodonBaseWsStatus[domain] = 'cannotuse'
}, 3000)
mastodonBaseWs[domain] = false
return false
}
mastodonBaseWs[domain].onclose = function () {
notfCommon(acct_id, 0, null, 'only') //fallback
console.warn("Closing " + domain)
if (mastodonBaseWsStatus[domain] == 'available') {
/*M.toast({
html:
`${lang.lang_parse_disconnected}<button class="btn-flat toast-action" onclick="location.reload()">${lang.lang_layout_reconnect}</button>`,
completeCallback: function () {
parseColumn()
},
displayLength: 3000
})*/
parseColumn()
}
mastodonBaseWs[domain] = false
mastodonBaseWsStatus[domain] = 'cannotuse'
setTimeout(function () {
mastodonBaseWsStatus[domain] = 'cannotuse'
}, 3000)
return false
}
}
function insertTl(obj, tls) {
for (const timeline of tls) {
const { id, voice, type, acct_id } = timeline
const mute = getFilterTypeByAcct(acct_id, type)
if ($(`#unread_${id} .material-icons`).hasClass('teal-text')) continue
if (!$(`#timeline_${id} [toot-id=${obj.id}]`).length) {
if (voice) {
say(obj.content)
}
const template = parse([obj], type, acct_id, id, '', mute, type)
console.log($(`#timeline_box_${id}_box .tl-box`).scrollTop(), `timeline_box_${id}_box .tl-box`)
if (
$(`#timeline_box_${id}_box .tl-box`).scrollTop() === 0
) {
$(`#timeline_${id}`).prepend(template)
} else {
let pool = localStorage.getItem('pool_' + id)
if (pool) {
pool = template + pool
} else {
pool = template
}
localStorage.setItem('pool_' + id, pool)
}
scrollck()
additional(acct_id, id)
jQuery('time.timeago').timeago()
}
}
}
function getTlMeta(type, data, num, status) {
const acct_id = num.toString()
const columns = localStorage.getItem('column')
const obj = JSON.parse(columns)
let ret = []
let i = -1
switch (type) {
case 'user':
for (const tl of obj) {
i++
if (tl.domain != acct_id) continue
if (tl.type == 'mix' || tl.type == 'home') {
let voice = false
if (localStorage.getItem('voice_' + i)) voice = true
ret.push({
id: i,
voice: voice,
type: tl.type,
acct_id: tl.domain
})
}
}
break
case 'public:local':
for (const tl of obj) {
i++
if (tl.domain != acct_id) continue
if (tl.type == 'mix' || tl.type == 'local') {
let voice = false
if (localStorage.getItem('voice_' + i)) voice = true
ret.push({
id: i,
voice: voice,
type: tl.type,
acct_id: tl.domain
})
}
}
break
case 'public:local:media':
for (const tl of obj) {
i++
if (tl.domain != acct_id) continue
if (tl.type == 'local-media') {
let voice = false
if (localStorage.getItem('voice_' + i)) voice = true
ret.push({
id: i,
voice: voice,
type: tl.type,
acct_id: tl.domain
})
}
}
break;
case 'public':
for (const tl of obj) {
i++
if (tl.domain != acct_id) continue
if (tl.type == 'pub') {
console.log(i, tl)
let voice = false
if (localStorage.getItem('voice_' + i)) voice = true
ret.push({
id: i,
voice: voice,
type: tl.type,
acct_id: tl.domain
})
}
}
break;
case 'public:media':
for (const tl of obj) {
i++
if (tl.domain != acct_id) continue
if (tl.type == 'pub-media') {
let voice = false
if (localStorage.getItem('voice_' + i)) voice = true
ret.push({
id: i,
voice: voice,
type: tl.type,
acct_id: tl.domain
})
}
}
break;
case 'list':
for (const tl of obj) {
i++
if (tl.domain != acct_id) continue
if (tl.type == 'list' && tl.data == data[1]) {
let voice = false
if (localStorage.getItem('voice_' + i)) voice = true
ret.push({
id: i,
voice: voice,
type: tl.type,
acct_id: tl.domain
})
}
}
break;
case 'direct':
for (const tl of obj) {
i++
if (tl.domain != acct_id) continue
if (tl.type == 'dm') {
let voice = false
if (localStorage.getItem('voice_' + i)) voice = true
ret.push({
id: i,
voice: voice,
type: tl.type,
acct_id: tl.domain
})
}
}
break;
case 'hashtag':
for (const tl of obj) {
i++
if (tl.domain != acct_id) continue
const columnDataRaw = tl.data
let columnData
if (!columnDataRaw.name) {
columnData = { name: columnDataRaw }
} else {
columnData = columnDataRaw
}
if (tl.type == 'tag') {
let voice = false
let can = false
if (columnData.name == data[1]) can = true
//any
if (columnData.any.split(',').includes(data[1])) can = true
//all
const { tags } = status
if (columnData.all) can = true
for (const { name } of tags) {
if (!columnData.all.split(',').includes(name)) {
can = false
break
}
}
//none
if (columnData.none) can = true
for (const { name } of tags) {
if (columnData.none.split(',').includes(name)) {
can = false
break
}
}
if (localStorage.getItem('voice_' + i)) voice = true
ret.push({
id: i,
voice: voice,
type: tl.type,
acct_id: tl.domain
})
}
}
break;
default:
console.error(`Cannot catch`);
}
return ret
}

View File

@@ -25,7 +25,6 @@ function pollToggle() {
} }
$('#post-box').css('width', width + 'px') $('#post-box').css('width', width + 'px')
$('#emoji').addClass('hide') $('#emoji').addClass('hide')
$('#draft').addClass('hide')
$('#poll').addClass('hide') $('#poll').addClass('hide')
$('#pollsta').text(lang.lang_no) $('#pollsta').text(lang.lang_no)
} }

View File

@@ -219,9 +219,9 @@ function moreTs(tlid, q) {
function graphDraw(tag, acct_id) { function graphDraw(tag, acct_id) {
var tags = '' var tags = ''
var his = tag.history var his = tag.history
return graphDrawCore(his, tag, acct_id) return graphDrawCore(his, tag)
} }
function graphDrawCore(his, tag, acct_id) { function graphDrawCore(his, tag) {
var max = Math.max.apply(null, [ var max = Math.max.apply(null, [
his[0].uses, his[0].uses,
his[1].uses, his[1].uses,
@@ -307,7 +307,7 @@ function trend() {
Object.keys(json).forEach(function(keye) { Object.keys(json).forEach(function(keye) {
var tag = json[keye] var tag = json[keye]
var his = tag.history var his = tag.history
tags = graphDrawCore(his, tag, acct_id) tags = graphDrawCore(his, tag)
$('#src-contents').append(tags) $('#src-contents').append(tags)
}) })

View File

@@ -44,10 +44,10 @@ function tl(type, data, acct_id, tlid, delc, voice, mode) {
//Integratedなら飛ばす //Integratedなら飛ばす
$('#notice_' + tlid).text( $('#notice_' + tlid).text(
'Integrated TL(' + 'Integrated TL(' +
localStorage.getItem('user_' + acct_id) + localStorage.getItem('user_' + acct_id) +
'@' + '@' +
domain + domain +
')' ')'
) )
$('#notice_icon_' + tlid).text('merge_type') $('#notice_icon_' + tlid).text('merge_type')
mixtl(acct_id, tlid, 'integrated', delc, voice) mixtl(acct_id, tlid, 'integrated', delc, voice)
@@ -56,10 +56,10 @@ function tl(type, data, acct_id, tlid, delc, voice, mode) {
//Local+なら飛ばす //Local+なら飛ばす
$('#notice_' + tlid).text( $('#notice_' + tlid).text(
'Local+ TL(' + 'Local+ TL(' +
localStorage.getItem('user_' + acct_id) + localStorage.getItem('user_' + acct_id) +
'@' + '@' +
domain + domain +
')' ')'
) )
$('#notice_icon_' + tlid).text('people_outline') $('#notice_icon_' + tlid).text('people_outline')
mixtl(acct_id, tlid, 'plus', delc, voice) mixtl(acct_id, tlid, 'plus', delc, voice)
@@ -69,11 +69,11 @@ function tl(type, data, acct_id, tlid, delc, voice, mode) {
notf(acct_id, tlid, 'direct') notf(acct_id, tlid, 'direct')
$('#notice_' + tlid).text( $('#notice_' + tlid).text(
cap(type, data, acct_id) + cap(type, data, acct_id) +
'(' + '(' +
localStorage.getItem('user_' + acct_id) + localStorage.getItem('user_' + acct_id) +
'@' + '@' +
domain + domain +
')' ')'
) )
$('#notice_icon_' + tlid).text('notifications') $('#notice_icon_' + tlid).text('notifications')
return return
@@ -82,11 +82,11 @@ function tl(type, data, acct_id, tlid, delc, voice, mode) {
getBookmark(acct_id, tlid) getBookmark(acct_id, tlid)
$('#notice_' + tlid).text( $('#notice_' + tlid).text(
cap(type, data, acct_id) + cap(type, data, acct_id) +
'(' + '(' +
localStorage.getItem('user_' + acct_id) + localStorage.getItem('user_' + acct_id) +
'@' + '@' +
domain + domain +
')' ')'
) )
$('#notice_icon_' + tlid).text('bookmark') $('#notice_icon_' + tlid).text('bookmark')
return return
@@ -95,11 +95,11 @@ function tl(type, data, acct_id, tlid, delc, voice, mode) {
getUtl(acct_id, tlid, data, false) getUtl(acct_id, tlid, data, false)
$('#notice_' + tlid).text( $('#notice_' + tlid).text(
cap(type, data, acct_id) + cap(type, data, acct_id) +
'(' + '(' +
localStorage.getItem('user_' + acct_id) + localStorage.getItem('user_' + acct_id) +
'@' + '@' +
domain + domain +
')' ')'
) )
$('#notice_icon_' + tlid).text('person') $('#notice_icon_' + tlid).text('person')
return return
@@ -117,11 +117,11 @@ function tl(type, data, acct_id, tlid, delc, voice, mode) {
} }
$('#notice_' + tlid).text( $('#notice_' + tlid).text(
cap(type, data, acct_id) + cap(type, data, acct_id) +
'(' + '(' +
localStorage.getItem('user_' + acct_id) + localStorage.getItem('user_' + acct_id) +
'@' + '@' +
domain + domain +
')' ')'
) )
} else { } else {
var hdr = { var hdr = {
@@ -206,7 +206,7 @@ function tl(type, data, acct_id, tlid, delc, voice, mode) {
additional(acct_id, tlid) additional(acct_id, tlid)
jQuery('time.timeago').timeago() jQuery('time.timeago').timeago()
todc() todc()
reload(type, 'from timeline to reload', acct_id, tlid, data, mute, delc, voice) reload(type, '', acct_id, tlid, data, mute, delc, voice)
if (type == 'home' || type == 'notf') { if (type == 'home' || type == 'notf') {
//Markers //Markers
var markers = localStorage.getItem('markers') var markers = localStorage.getItem('markers')
@@ -247,243 +247,194 @@ function reload(type, cc, acct_id, tlid, data, mute, delc, voice, mode) {
} }
}, 100) }, 100)
} else { } else {
var domain = localStorage.getItem('domain_' + acct_id) var misskey = false
if (mastodonBaseWsStatus[domain] == 'cannotuse') { if (localStorage.getItem('streaming_' + acct_id)) {
oldStreaming(type, cc, acct_id, tlid, data, mute, delc, voice, mode) var wss = localStorage.getItem('streaming_' + acct_id)
} else if (mastodonBaseWsStatus[domain] == 'undetected' || mastodonBaseWsStatus[domain] == 'connecting') { } else {
const mbws = setInterval(function () { var wss = 'wss://' + domain
if (mastodonBaseWsStatus[domain] == 'cannotuse') { }
oldStreaming(type, cc, acct_id, tlid, data, mute, delc, voice, mode) if (type == 'home') {
clearInterval(mbws) var start = wss + '/api/v1/streaming/?stream=user&access_token=' + at
} else if (mastodonBaseWsStatus[domain] == 'available') { } else if (type == 'pub') {
$('#notice_icon_' + tlid).removeClass('red-text') var add = ''
stremaingSubscribe(type, acct_id, data) if(remoteOnlyCk(tlid)){
clearInterval(mbws) add = '&remote=true'
}
var start = wss + '/api/v1/streaming/?stream=public&access_token=' + at + add
} else if (type == 'pub-media') {
var add = ''
if(remoteOnlyCk(tlid)){
add = '&remote=true'
}var start =
wss + '/api/v1/streaming/?stream=public:media&access_token=' + at + add
} else if (type == 'local') {
var start =
wss + '/api/v1/streaming/?stream=public:local&access_token=' + at
} else if (type == 'local-media') {
var start =
wss +
'/api/v1/streaming/?stream=public:local:media&only_media=true&access_token=' +
at
} else if (type == 'tag') {
if (type == 'tag') {
var tag = localStorage.getItem('tag-range')
if (tag == 'local') {
data = data + '&local=true'
} }
}, 1000) }
} else if (mastodonBaseWsStatus[domain] == 'available') { var start =
wss +
'/api/v1/streaming/?stream=hashtag&tag=' +
data +
'&access_token=' +
at
} else if (type == 'noauth') {
var start = 'wss://' + acct_id + '/api/v1/streaming/?stream=public:local'
} else if (type == 'list') {
var start =
wss +
'/api/v1/streaming/?stream=list&list=' +
data +
'&access_token=' +
at
} else if (type == 'dm') {
var start = wss + '/api/v1/streaming/?stream=direct&access_token=' + at
}
var wsid = websocket.length
localStorage.setItem('wss_' + tlid, wsid)
websocket[wsid] = new WebSocket(start)
websocket[wsid].onopen = function (mess) {
console.table({
tlid: tlid,
type: 'Connect Streaming API' + type,
domain: domain,
message: [mess],
})
errorct = 0
$('#notice_icon_' + tlid).removeClass('red-text') $('#notice_icon_' + tlid).removeClass('red-text')
stremaingSubscribe(type, acct_id, data)
} }
} websocket[wsid].onmessage = function (mess) {
} console.log([tlid + ':Receive Streaming API:', JSON.parse(mess.data)])
function stremaingSubscribe(type, acct_id, data, unsubscribe) { if (misskey) {
let command = 'subscribe' if (JSON.parse(mess.data).type == 'note') {
if (unsubscribe) command = 'unsubscribe' var obj = JSON.parse(mess.data).body
let stream if (voice) {
const domain = localStorage.getItem('domain_' + acct_id) say(obj.text)
if(type == 'home') return false
if (type === 'local' || type === 'mix') { stream = 'public:local' }
else if (type === 'local-media') { stream = 'public:local:media' }
else if (type === 'pub') { stream = 'public' }
else if (type === 'pub-media') { stream = 'public:media' }
else if (type === 'list') {
mastodonBaseWs[domain].send(JSON.stringify({type: command, stream: 'list', list: data}))
return true
} else if (type === 'tag') {
let arr = []
let name = data
if (data.name) name = data.name
arr.push(name)
if (data.any) arr = arr.concat(data.any.split(','))
if (data.all) arr = arr.concat(data.all.split(','))
for (const tag of arr) {
mastodonBaseWs[domain].send(JSON.stringify({type: command, stream: 'hashtag', tag: tag}))
}
return true
}
mastodonBaseWs[domain].send(JSON.stringify({type: command, stream: stream}))
}
function oldStreaming(type, cc, acct_id, tlid, data, mute, delc, voice, mode) {
var misskey = false
const domain = localStorage.getItem(`domain_${acct_id}`)
var at = localStorage.getItem('acct_' + acct_id + '_at')
if (localStorage.getItem('streaming_' + acct_id)) {
var wss = localStorage.getItem('streaming_' + acct_id)
} else {
var wss = 'wss://' + domain
}
if (type == 'home') {
var start = wss + '/api/v1/streaming/?stream=user&access_token=' + at
} else if (type == 'pub') {
var add = ''
if (remoteOnlyCk(tlid)) {
add = '&remote=true'
}
var start = wss + '/api/v1/streaming/?stream=public&access_token=' + at + add
} else if (type == 'pub-media') {
var add = ''
if (remoteOnlyCk(tlid)) {
add = '&remote=true'
} var start =
wss + '/api/v1/streaming/?stream=public:media&access_token=' + at + add
} else if (type == 'local') {
var start =
wss + '/api/v1/streaming/?stream=public:local&access_token=' + at
} else if (type == 'local-media') {
var start =
wss +
'/api/v1/streaming/?stream=public:local:media&only_media=true&access_token=' +
at
} else if (type == 'tag') {
var tag = localStorage.getItem('tag-range')
if (tag == 'local') {
data = data + '&local=true'
}
if (data.name) {
data = data.name
}
var start =
wss +
'/api/v1/streaming/?stream=hashtag&tag=' +
data +
'&access_token=' +
at + add
} else if (type == 'noauth') {
var start = 'wss://' + acct_id + '/api/v1/streaming/?stream=public:local'
} else if (type == 'list') {
var start =
wss +
'/api/v1/streaming/?stream=list&list=' +
data +
'&access_token=' +
at
} else if (type == 'dm') {
var start = wss + '/api/v1/streaming/?stream=direct&access_token=' + at
}
var wsid = websocket.length
localStorage.setItem('wss_' + tlid, wsid)
websocket[wsid] = new WebSocket(start)
websocket[wsid].onopen = function (mess) {
console.table({
tlid: tlid,
type: 'Connect Streaming API' + type,
domain: domain,
message: [mess],
})
errorct = 0
$('#notice_icon_' + tlid).removeClass('red-text')
}
websocket[wsid].onmessage = function (mess) {
console.log([tlid + ':Receive Streaming API:', JSON.parse(mess.data)])
if (misskey) {
if (JSON.parse(mess.data).type == 'note') {
var obj = JSON.parse(mess.data).body
if (voice) {
say(obj.text)
}
websocketNotf[acct_id].send(
JSON.stringify({
type: 'capture',
id: obj.id,
})
)
var templete = misskeyParse([obj], type, acct_id, tlid, '', mute)
var pool = localStorage.getItem('pool_' + tlid)
if (pool) {
pool = templete + pool
} else {
pool = templete
}
localStorage.setItem('pool_' + tlid, pool)
scrollck()
jQuery('time.timeago').timeago()
}
} else {
var typeA = JSON.parse(mess.data).event
if (typeA == 'delete') {
var obj = JSON.parse(mess.data).payload
if (delc == 'true') {
$(
'#timeline_' +
tlid +
' [unique-id=' +
JSON.parse(mess.data).payload +
']'
).addClass('emphasized')
$(
'#timeline_' +
tlid +
' [unique-id=' +
JSON.parse(mess.data).payload +
']'
).addClass('by_delcatch')
} else {
$('[unique-id=' + JSON.parse(mess.data).payload + ']').hide()
$('[unique-id=' + JSON.parse(mess.data).payload + ']').remove()
}
} else if (typeA == 'update' || typeA == 'conversation') {
if (
!$('#unread_' + tlid + ' .material-icons').hasClass('teal-text')
) {
//markers show中はダメ
var obj = JSON.parse(JSON.parse(mess.data).payload)
if (
$('#timeline_' + tlid + ' [toot-id=' + obj.id + ']').length < 1
) {
if (voice) {
say(obj.content)
}
var templete = parse([obj], type, acct_id, tlid, '', mute, type)
if (
$('timeline_box_' + tlid + '_box .tl-box').scrollTop() === 0
) {
$('#timeline_' + tlid).prepend(templete)
} else {
var pool = localStorage.getItem('pool_' + tlid)
if (pool) {
pool = templete + pool
} else {
pool = templete
}
localStorage.setItem('pool_' + tlid, pool)
}
scrollck()
additional(acct_id, tlid)
jQuery('time.timeago').timeago()
} else {
todo('二重取得発生中')
} }
websocketNotf[acct_id].send(
todc() JSON.stringify({
type: 'capture',
id: obj.id,
})
)
var templete = misskeyParse([obj], type, acct_id, tlid, '', mute)
var pool = localStorage.getItem('pool_' + tlid)
if (pool) {
pool = templete + pool
} else {
pool = templete
}
localStorage.setItem('pool_' + tlid, pool)
scrollck()
jQuery('time.timeago').timeago()
}
} else {
var typeA = JSON.parse(mess.data).event
if (typeA == 'delete') {
var obj = JSON.parse(mess.data).payload
if (delc == 'true') {
$(
'#timeline_' +
tlid +
' [unique-id=' +
JSON.parse(mess.data).payload +
']'
).addClass('emphasized')
$(
'#timeline_' +
tlid +
' [unique-id=' +
JSON.parse(mess.data).payload +
']'
).addClass('by_delcatch')
} else {
$('[unique-id=' + JSON.parse(mess.data).payload + ']').hide()
$('[unique-id=' + JSON.parse(mess.data).payload + ']').remove()
}
} else if (typeA == 'update' || typeA == 'conversation') {
if (
!$('#unread_' + tlid + ' .material-icons').hasClass('teal-text')
) {
//markers show中はダメ
var obj = JSON.parse(JSON.parse(mess.data).payload)
if (
$('#timeline_' + tlid + ' [toot-id=' + obj.id + ']').length < 1
) {
if (voice) {
say(obj.content)
}
var templete = parse([obj], type, acct_id, tlid, '', mute, type)
if (
$('timeline_box_' + tlid + '_box .tl-box').scrollTop() === 0
) {
$('#timeline_' + tlid).prepend(templete)
} else {
var pool = localStorage.getItem('pool_' + tlid)
if (pool) {
pool = templete + pool
} else {
pool = templete
}
localStorage.setItem('pool_' + tlid, pool)
}
scrollck()
additional(acct_id, tlid)
jQuery('time.timeago').timeago()
} else {
todo('二重取得発生中')
}
todc()
}
} else if (typeA == 'filters_changed') {
filterUpdate(acct_id)
} else if (~typeA.indexOf('announcement')) {
announ(acct_id, tlid)
} }
} else if (typeA == 'filters_changed') {
filterUpdate(acct_id)
} else if (~typeA.indexOf('announcement')) {
announ(acct_id, tlid)
} }
} }
} websocket[wsid].onerror = function (error) {
websocket[wsid].onerror = function (error) { console.error('Error closing')
console.error('Error closing') console.error(error)
console.error(error) if (mode == 'error') {
if (mode == 'error') { $('#notice_icon_' + tlid).addClass('red-text')
$('#notice_icon_' + tlid).addClass('red-text') todo('WebSocket Error ' + error)
todo('WebSocket Error ' + error) } else {
} else { errorct++
errorct++ console.log(errorct)
console.log(errorct) if (errorct < 3) {
if (errorct < 3) { reconnector(tlid, type, acct_id, data, 'error')
reconnector(tlid, type, acct_id, data, 'error') }
} }
return false
} }
return false websocket[wsid].onclose = function () {
} console.warn('Closing ' + tlid)
websocket[wsid].onclose = function () { if (mode == 'error') {
console.warn('Closing ' + tlid) $('#notice_icon_' + tlid).addClass('red-text')
if (mode == 'error') { todo('WebSocket Closed')
$('#notice_icon_' + tlid).addClass('red-text') } else {
todo('WebSocket Closed') errorct++
} else { console.log(errorct)
errorct++ if (errorct < 3) {
console.log(errorct) reconnector(tlid, type, acct_id, data, 'error')
if (errorct < 3) { }
reconnector(tlid, type, acct_id, data, 'error')
} }
return false
} }
return false
} }
} }
//一定のスクロールで発火 //一定のスクロールで発火
function moreload(type, tlid) { function moreload(type, tlid) {
var multi = localStorage.getItem('column') var multi = localStorage.getItem('column')
@@ -915,13 +866,13 @@ function com(type, data, tlid) {
return 'public?local=true&only_media=true&' return 'public?local=true&only_media=true&'
} else if (type == 'pub') { } else if (type == 'pub') {
var add = '' var add = ''
if (remoteOnlyCk(tlid)) { if(remoteOnlyCk(tlid)){
add = 'remote=true&' add = 'remote=true&'
} }
return 'public?' + add return 'public?' + add
} else if (type == 'pub-media') { } else if (type == 'pub-media') {
var add = '' var add = ''
if (remoteOnlyCk(tlid)) { if(remoteOnlyCk(tlid)){
add = 'remote=true&' add = 'remote=true&'
} }
return 'public?only_media=true&' + add return 'public?only_media=true&' + add
@@ -1047,7 +998,7 @@ function reconnector(tlid, type, acct_id, data, mode) {
var voice = false var voice = false
} }
var mute = getFilterTypeByAcct(acct_id, type) var mute = getFilterTypeByAcct(acct_id, type)
var domain = localStorage.getItem('domain_' + acct_id) reload(type, '', acct_id, tlid, data, mute, '', voice, mode)
} }
M.toast({ html: lang.lang_tl_reconnect, displayLength: 2000 }) M.toast({ html: lang.lang_tl_reconnect, displayLength: 2000 })
} }
@@ -1057,12 +1008,6 @@ function columnReload(tlid, type) {
var multi = localStorage.getItem('column') var multi = localStorage.getItem('column')
var obj = JSON.parse(multi) var obj = JSON.parse(multi)
var acct_id = obj[tlid].domain var acct_id = obj[tlid].domain
var domain = localStorage.getItem('domain_' + acct_id)
if (mastodonBaseWsStatus[domain] == 'available') {
stremaingSubscribe(type, acct_id, obj[tlid].data, true)
parseColumn(tlid, true)
return true
}
if (type == 'mix' || type == 'integrated' || type == 'plus') { if (type == 'mix' || type == 'integrated' || type == 'plus') {
if (localStorage.getItem('voice_' + tlid)) { if (localStorage.getItem('voice_' + tlid)) {
var voice = true var voice = true
@@ -1082,10 +1027,15 @@ function columnReload(tlid, type) {
$('#notice_icon_' + tlid).removeClass('red-text') $('#notice_icon_' + tlid).removeClass('red-text')
getBookmark(acct_id, tlid, false) getBookmark(acct_id, tlid, false)
} else { } else {
var wss = localStorage.getItem('wss_' + tlid) var wss = localStorage.getItem('wss_' + tlid)
websocket[wss].close() websocket[wss].close()
parseColumn(tlid, false) if (localStorage.getItem('voice_' + tlid)) {
var voice = true
} else {
var voice = false
}
var mute = getFilterTypeByAcct(acct_id, type)
parseColumn(tlid)
} }
} }
//Markers //Markers
@@ -1128,10 +1078,10 @@ function getMarker(tlid, type, acct_id) {
$('#unread_' + tlid).attr( $('#unread_' + tlid).attr(
'title', 'title',
lang.lang_layout_unread + lang.lang_layout_unread +
':' + ':' +
json.updated_at + json.updated_at +
' v' + ' v' +
json.version json.version
) )
$('#unread_' + tlid).attr('data-id', json.last_read_id) $('#unread_' + tlid).attr('data-id', json.last_read_id)
} else { } else {
@@ -1335,8 +1285,8 @@ function asReadEnd() {
onBeforeOpen: () => { onBeforeOpen: () => {
Swal.showLoading() Swal.showLoading()
}, },
onClose: () => { }, onClose: () => {},
}).then((result) => { }) }).then((result) => {})
} else { } else {
postMessage(['asReadComp', ''], '*') postMessage(['asReadComp', ''], '*')
} }
@@ -1399,8 +1349,8 @@ function getUtl(acct_id, tlid, data, more) {
moreloading = true moreloading = true
if (more) { if (more) {
var sid = $('#timeline_' + tlid + ' .cvo') var sid = $('#timeline_' + tlid + ' .cvo')
.last() .last()
.attr('unique-id') .attr('unique-id')
var ad = '?max_id=' + sid var ad = '?max_id=' + sid
} else { } else {
var ad = '' var ad = ''
@@ -1468,7 +1418,7 @@ function announ(acct_id, tlid) {
$('.notf-announ_' + acct_id).addClass('hide') $('.notf-announ_' + acct_id).addClass('hide')
} }
var templete = announParse(json, acct_id, tlid) var templete = announParse(json, acct_id, tlid)
$('.announce_' + acct_id).html(templete) $('#announce_' + tlid).html(templete)
jQuery('time.timeago').timeago() jQuery('time.timeago').timeago()
todc() todc()
} }
@@ -1476,7 +1426,7 @@ function announ(acct_id, tlid) {
} }
//buildQuery //buildQuery
function buildQuery(name, data) { function buildQuery(name, data) {
if (!data || data == '') return '' if(!data || data == '') return ''
var arr = data.split(',') var arr = data.split(',')
var str = '' var str = ''
for (var i = 0; i < arr.length; i++) { for (var i = 0; i < arr.length; i++) {

View File

@@ -120,7 +120,7 @@ function imageXhr(id, key, murl) {
element.onload = function() { element.onload = function() {
var width = element.naturalWidth var width = element.naturalWidth
if(width < 650) { if(width < 650) {
width = 650 width = 650;
} }
var height = element.naturalHeight var height = element.naturalHeight
var windowH = $(window).height() var windowH = $(window).height()
@@ -182,7 +182,7 @@ function zoom(z) {
$('#imagewrap img').css('height', hgt + 'px') $('#imagewrap img').css('height', hgt + 'px')
} }
//スマホ対応ドラッグ移動システム //スマホ対応ドラッグ移動システム
(function() { ;(function() {
$.fn.dragScroll = function() { $.fn.dragScroll = function() {
var target = this var target = this
$(this) $(this)

View File

@@ -45,13 +45,14 @@ function parseColumn(target, dontclose) {
var templete var templete
Object.keys(obj).forEach(function (key) { Object.keys(obj).forEach(function (key) {
var acct = obj[key] var acct = obj[key]
localStorage.setItem('name_' + key, acct.name) localStorage.setItem('name_' + key, acct.name)
localStorage.setItem('user_' + key, acct.user) localStorage.setItem('user_' + key, acct.user)
localStorage.setItem('user-id_' + key, acct.id) localStorage.setItem('user-id_' + key, acct.id)
localStorage.setItem('prof_' + key, acct.prof) localStorage.setItem('prof_' + key, acct.prof)
localStorage.setItem('domain_' + key, acct.domain) localStorage.setItem('domain_' + key, acct.domain)
localStorage.setItem('acct_' + key + '_at', acct.at) localStorage.setItem('acct_' + key + '_at', acct.at)
if(!target) mastodonBaseStreaming(key) notf(key, 0)
ckdb(key) ckdb(key)
//フィルターデータ読もう //フィルターデータ読もう
getFilter(key) getFilter(key)
@@ -72,14 +73,10 @@ function parseColumn(target, dontclose) {
var col = localStorage.getItem('column') var col = localStorage.getItem('column')
if (!col) { if (!col) {
var obj = [ var obj = [
{
domain: 0,
type: 'home',
},
{ {
domain: 0, domain: 0,
type: 'local', type: 'local',
} },
] ]
var json = JSON.stringify(obj) var json = JSON.stringify(obj)
localStorage.setItem('column', json) localStorage.setItem('column', json)
@@ -104,6 +101,7 @@ function parseColumn(target, dontclose) {
$('.box, .boxIn').resizable('destroy') $('.box, .boxIn').resizable('destroy')
} }
} }
console.log(obj)
var basekey = 0 var basekey = 0
for (var key = 0; key < obj.length; key++) { for (var key = 0; key < obj.length; key++) {
var next = key + 1 var next = key + 1
@@ -149,6 +147,7 @@ function parseColumn(target, dontclose) {
icnsert = ' style="color: #' + ichex + '" ' icnsert = ' style="color: #' + ichex + '" '
} }
} }
console.log(acct)
if (acctlist[acct.domain]) { if (acctlist[acct.domain]) {
if (acctlist[acct.domain].background != 'def') { if (acctlist[acct.domain].background != 'def') {
insert = insert + ' border-bottom:medium solid #' + acctlist[acct.domain].background + ';' insert = insert + ' border-bottom:medium solid #' + acctlist[acct.domain].background + ';'
@@ -159,21 +158,15 @@ function parseColumn(target, dontclose) {
} else { } else {
localStorage.removeItem('hasNotfC_' + acct.domain) localStorage.removeItem('hasNotfC_' + acct.domain)
} }
var css = ''
var width = localStorage.getItem('width') var width = localStorage.getItem('width')
if (width) { if (width) {
css = ' min-width:' + width + 'px;' var 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;'
} }
if (acct.width) { 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 (acct.type == 'webview') {
if (localStorage.getItem('fixwidth')) { if (localStorage.getItem('fixwidth')) {
@@ -228,63 +221,65 @@ function parseColumn(target, dontclose) {
var animecss = '' var animecss = ''
} }
var unread = `<a id="unread_${key}" onclick="showUnread('${key}','${acct.type}','${acct.domain}')" var unread = `<a id="unread_${key}" onclick="showUnread('${key}','${acct.type}','${acct.domain}')"
class="setting nex waves-effect" title="${lang.lang_layout_unread}"> class="setting nex" title="${lang.lang_layout_unread}">
<i class="material-icons waves-effect nex">more</i><br />${lang.lang_layout_unread} <i class="material-icons waves-effect nex">more</i>
</a>` </a>${lang.lang_layout_unread}<br>`
var notfDomain = acct.domain var notfDomain = acct.domain
var notfKey = key var notfKey = key
var if_tag = '' var if_tag = ''
var if_tag_btn = '' var if_tag_btn = ''
if (acct.type == 'notf') { if (acct.type == 'notf') {
var exclude = var exclude =
`<div style="border: 1px solid; padding: 5px; margin-top: 5px; margin-bottom: 5px;">${lang.lang_layout_excluded}:<br> lang.lang_excluded +
`:<br>
<label> <label>
<input type="checkbox" class="filled-in" id="exc-reply-${key}" ${excludeCk(key, 'mention')} /> <input type="checkbox" class="filled-in" id="exc-reply-${key}" ${excludeCk(key, 'mention')} />
<span> <span>
${lang.lang_layout_mention} <i class="fas fa-share exc-icons"></i>
</span> </span>
</label> </label>
<label> <label>
<input type="checkbox" class="filled-in" id="exc-fav-${key}" ${excludeCk(key, 'favourite')} /> <input type="checkbox" class="filled-in" id="exc-fav-${key}" ${excludeCk(key, 'favourite')} />
<span> <span>
${lang.lang_layout_fav} <i class="fas fa-star exc-icons"></i>
</span> </span>
</label> </label>
<label> <label>
<input type="checkbox" class="filled-in" id="exc-bt-${key}" ${excludeCk(key, 'reblog')} /> <input type="checkbox" class="filled-in" id="exc-bt-${key}" ${excludeCk(key, 'reblog')} />
<span> <span>
${lang.lang_layout_bt} <i class="fas fa-retweet exc-icons"></i>
</span> </span>
</label> </label>
<label> <label>
<input type="checkbox" class="filled-in" id="exc-follow-${key}" ${excludeCk(key, 'follow')} /> <input type="checkbox" class="filled-in" id="exc-follow-${key}" ${excludeCk(key, 'follow')} />
<span> <span>
${lang.lang_status_follow} <i class="fas fa-users exc-icons"></i>
</span> </span>
</label> </label>
<label> <label>
<input type="checkbox" class="filled-in" id="exc-poll-${key}" ${excludeCk(key, 'poll')} /> <input type="checkbox" class="filled-in" id="exc-poll-${key}" ${excludeCk(key, 'poll')} />
<span> <span>
${lang.lang_layout_poll} <i class="fas fa-tasks exc-icons"></i>
</span> </span>
</label> <br /> </label>
<button class="btn btn-flat waves-effect notf-exclude-btn waves-light" style="width:calc(50% - 11px); padding:0;" onclick="exclude('${key}')">Filter</button>` <button class="btn waves-effect" style="width:60px; padding:0;" onclick="exclude('${key}')">Filter</button>`
if (checkNotfFilter(key)) { if (checkNotfFilter(key)) {
exclude = exclude =
exclude + exclude +
`<button class="btn btn-flat red-text waves-effect notf-exclude-btn waves-light" style="width:calc(50% - 11px); padding:0;" onclick="resetNotfFilter('${key}')"> `<button class="btn red waves-effect" style="width:60px; padding:0;" onclick="resetNotfFilter('${key}')">
Clear all Clear all
</button>` </button>`
} }
exclude = exclude + '</div>' exclude = exclude + '<br>'
notfDomain = 'dummy' notfDomain = 'dummy'
notfKey = 'dummy' notfKey = 'dummy'
} else if (acct.type == 'home') { } else if (acct.type == 'home') {
var exclude = `<a onclick="ebtToggle('${key}')" class="setting nex waves-effect"> var exclude = `<a onclick="ebtToggle('${key}')" class="setting nex">
<i class="fas fa-retweet nex" title="${lang.lang_layout_excludingbt}" style="font-size: 24px"></i> <i class="fas fa-retweet waves-effect nex" title="${lang.lang_layout_excludingbt}" style="font-size:24px"></i>
<span id="sta-bt-${key}">Off</span><br /> <span id="sta-bt-${key}">Off</span>
</a>
${lang.lang_layout_excludingbt} ${lang.lang_layout_excludingbt}
</a>` <br>`
} else if (acct.type == 'tag') { } else if (acct.type == 'tag') {
if (acct.data.name) { if (acct.data.name) {
var name = acct.data.name var name = acct.data.name
@@ -333,13 +328,15 @@ function parseColumn(target, dontclose) {
var basehtml = `<div style="${css}" class="box ${animecss}" id="timeline_box_${basekey}_parentBox"></div>` var basehtml = `<div style="${css}" class="box ${animecss}" id="timeline_box_${basekey}_parentBox"></div>`
$('#timeline-container').append(basehtml) $('#timeline-container').append(basehtml)
} }
var left_hold = `<a onclick="leftFoldSet('${key}')" class="setting nex waves-effect"> var left_hold = `<a onclick="leftFoldSet('${key}')" class="setting nex">
<i class="material-icons waves-effect nex" title="${lang.lang_layout_leftFold}">view_agenda</i><br /> <i class="material-icons waves-effect nex" title="${lang.lang_layout_leftFold}">view_agenda</i>
${lang.lang_layout_leftFold}</a>` </a>
${lang.lang_layout_leftFold}<br>`
} else { } else {
var left_hold = `<a onclick="leftFoldRemove('${key}')" class="setting nex waves-effect"> var left_hold = `<a onclick="leftFoldRemove('${key}')" class="setting nex">
<i class="material-icons waves-effect nex" title="${lang.lang_layout_leftUnfold}">view_column</i><br /> <i class="material-icons waves-effect nex" title="${lang.lang_layout_leftUnfold}">view_column</i>
${lang.lang_layout_leftUnfold}</a>` </a>
${lang.lang_layout_leftUnfold}<br>`
} }
if (key === 0) { if (key === 0) {
left_hold = '' left_hold = ''
@@ -358,21 +355,22 @@ function parseColumn(target, dontclose) {
var addHeight = '' var addHeight = ''
} }
if (acct.type != 'pub' && acct.type != 'pub-media') { if (acct.type != 'pub' && acct.type != 'pub-media') {
var mediaFil = `<a onclick="mediaToggle('${key}')" class="setting nex waves-effect"> console.log(acct.type, key)
<i class="material-icons nex" title="${lang.lang_layout_mediafil}">perm_media</i> var mediaFil = `<a onclick="mediaToggle('${key}')" class="setting nex">
<span id="sta-media-${key}">On</span><br /> <i class="material-icons waves-effect nex" title="${lang.lang_layout_mediafil}">perm_media</i>
${lang.lang_layout_mediafil}</a>` <span id="sta-media-${key}">On</span>
</a>${lang.lang_layout_mediafil}`
} else { } else {
var mediaFil = `<a onclick="remoteOnly('${key}','${acct.type}')" class="setting nex waves-effect"> var mediaFil = `<a onclick="remoteOnly('${key}','${acct.type}')" class="setting nex">
<i class="material-icons nex" title="${lang.lang_layout_remoteOnly}">perm_media</i><br /> <i class="material-icons waves-effect nex" title="${lang.lang_layout_remoteOnly}">perm_media</i>
<span id="sta-remote-${key}">Off</span> <span id="sta-remote-${key}">Off</span>
${lang.lang_layout_remoteOnly}</a>` </a>${lang.lang_layout_remoteOnly}`
} }
var html = ` var html = `
<div class="boxIn" id="timeline_box_${key}_box" tlid="${key}" data-acct="${acct.domain}" style="${addHeight}"> <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="notice-box z-depth-2" id="menu_${key}" style="${insert}">
<div class="area-notice"> <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%;" style="font-size:40px; padding-top:25%;"
onclick="checkStr('${acct.type}','${data}','${acct.domain}', '${key}', '${delc}','${voice}',null)" onclick="checkStr('${acct.type}','${data}','${acct.domain}', '${key}', '${delc}','${voice}',null)"
title="${lang.lang_layout_gotop}" aria-hidden="true"> title="${lang.lang_layout_gotop}" aria-hidden="true">
@@ -415,35 +413,38 @@ function parseColumn(target, dontclose) {
</div> </div>
</div> </div>
<div class="column-hide notf-indv-box z-depth-4" id="notf-box_${notfKey}"> <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="announce_${notfKey}" style="border: 1px solid"></div>
<div id="notifications_${notfKey}" data-notf="${notfDomain}" data-type="notf" class="notf-timeline"> <div id="notifications_${notfKey}" data-notf="${notfDomain}" data-type="notf" class="notf-timeline">
</div> </div>
</div> </div>
<div class="column-hide notf-indv-box" id="util-box_${key}" style="padding:5px;"> <div class="column-hide notf-indv-box" id="util-box_${key}" style="padding:5px;">
${exclude}
${unread} ${unread}
${left_hold} ${exclude}${left_hold}
${mediaFil} ${mediaFil}<br>
<a onclick="cardToggle('${key}')" class="setting nex waves-effect"> <a onclick="cardToggle('${key}')" class="setting nex">
<i class="material-icons nex" title="${lang.lang_layout_linkanades}">link</i> <i class="material-icons waves-effect nex" title="${lang.lang_layout_linkanades}">link</i>
<span id="sta-card-${key}">On</span><br /> <span id="sta-card-${key}">On</span>
${lang.lang_layout_linkana} </a>
${lang.lang_layout_linkana}
<br>
<a onclick="voiceToggle('${key}')" class="setting nex">
<i class="material-icons waves-effect nex" title="${lang.lang_layout_tts}">hearing</i>
<span id="sta-voice-${key}">On</span>
</a> </a>
<a onclick="voiceToggle('${key}')" class="setting nex waves-effect">
<i class="material-icons nex" title="${lang.lang_layout_tts}">hearing</i>
<span id="sta-voice-${key}">On</span><br />
${lang.lang_layout_tts} ${lang.lang_layout_tts}
TL</a> TL<br>
<a onclick="columnReload('${key}','${acct.type}')" class="setting nex ${if_misskey_hide} waves-effect"> <a onclick="columnReload('${key}','${acct.type}')" class="setting nex ${if_misskey_hide}">
<i class="material-icons nex" title="${lang.lang_layout_reconnect}">refresh</i> <i class="material-icons waves-effect nex" title="${lang.lang_layout_reconnect}">refresh</i>
<br /> </a>
<span>
${lang.lang_layout_reconnect} ${lang.lang_layout_reconnect}
</a><br /> </span>
<br>
${lang.lang_layout_headercolor} ${lang.lang_layout_headercolor}
<br> <br>
<div id="picker_${key}" class="color-picker"></div> <div id="picker_${key}" class="color-picker"></div>
</div>${if_tag} </div>${if_tag}
<div class="tl-box" tlid="${key}"> <div class="tl-box" tlid="${key}" id="tlBox${key}">
<div id="timeline_${key}" class="tl ${acct.type}-timeline " tlid="${key}" <div id="timeline_${key}" class="tl ${acct.type}-timeline " tlid="${key}"
data-type="${acct.type}" data-acct="${acct.domain}" data-const="${acct.type}_${acct.domain}"> data-type="${acct.type}" data-acct="${acct.domain}" data-const="${acct.type}_${acct.domain}">
<div id="landing_${key}" style="text-align:center"> <div id="landing_${key}" style="text-align:center">
@@ -507,6 +508,8 @@ function parseColumn(target, dontclose) {
} }
} }
} }
console.log('multiSelector')
multiSelector()
$('.box, .boxIn').resizable({ $('.box, .boxIn').resizable({
minHeight: 50, minHeight: 50,
minWidth: 50, minWidth: 50,
@@ -651,7 +654,7 @@ function removeColumn(tlid) {
localStorage.setItem('column', json) localStorage.setItem('column', json)
sortLoad() sortLoad()
$('#timeline_box_' + tlid + '_box').remove() $('#timeline_box_' + tlid + '_box').remove()
if (!data.left_fold) { if(!data.left_fold) {
$('#timeline_box_' + tlid + '_parentBox').remove() $('#timeline_box_' + tlid + '_parentBox').remove()
} }
} }
@@ -785,8 +788,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> <i class="fab fa-twitter waves-effect" id="notice_icon_${key}" style="font-size:40px; padding-top:25%;"></i>
</div> </div>
<div class="area-notice_name tl-title">WebView('${url}')</div> <div class="area-notice_name tl-title">WebView('${url}')</div>
<div class="area-sta"> <div class="area-sta"></div>
</div>
<div class="area-a2"> <div class="area-a2">
<a onclick="removeColumn('${key}')" class="setting nex"> <a onclick="removeColumn('${key}')" class="setting nex">
<i class="material-icons waves-effect nex" title="${lang.lang_layout_delthis}" ${icnsert}>cancel</i> <i class="material-icons waves-effect nex" title="${lang.lang_layout_delthis}" ${icnsert}>cancel</i>
@@ -804,7 +806,7 @@ function webviewParse(url, key, insert, icnsert, css) {
<br> <br>
<div id="picker_${key}" class="color-picker"></div> <div id="picker_${key}" class="color-picker"></div>
</div> </div>
<div class="tl-box" tlid="${key}" style="width:100%;height:100%;"> <div class="tl-box" tlid="${key}" style="width:100%;height:100%;" id="tlBox${key}">
<div id="timeline_${key}" class="tl" tlid="${key}" data-type="webview" style="width:100%;height:100%;"> <div id="timeline_${key}" class="tl" tlid="${key}" data-type="webview" style="width:100%;height:100%;">
<webview src="${url}" style="width:100%;height:100%;" id="webview" preload="./js/platform/twitter.js"></webview> <webview src="${url}" style="width:100%;height:100%;" id="webview" preload="./js/platform/twitter.js"></webview>
</div> </div>
@@ -829,7 +831,7 @@ function unstreamingTL(type, key, basekey, insert, icnsert, left_fold, css, anim
${lang.lang_layout_leftUnfold} ${lang.lang_layout_leftUnfold}
</span><br>` </span><br>`
} }
if (type == 'utl') { if(type == 'utl') {
var dataHtml = false var dataHtml = false
} else { } else {
var dataHtml = data var dataHtml = data
@@ -866,7 +868,7 @@ function unstreamingTL(type, key, basekey, insert, icnsert, left_fold, css, anim
${lang.lang_layout_headercolor}<br> ${lang.lang_layout_headercolor}<br>
<div id="picker_${key}" class="color-picker"></div> <div id="picker_${key}" class="color-picker"></div>
</div> </div>
<div class="tl-box" tlid="${key}"> <div class="tl-box" tlid="${key}" id="tlBox${key}">
<div id="timeline_${key}" class="tl ${type}-timeline" tlid="${key}" data-type="${type}" data-acct="${data}"> <div id="timeline_${key}" class="tl ${type}-timeline" tlid="${key}" data-type="${type}" data-acct="${data}">
<div id="landing_${key}" style="text-align:center"> <div id="landing_${key}" style="text-align:center">
${lang.lang_layout_nodata} ${lang.lang_layout_nodata}
@@ -899,13 +901,13 @@ function bookmark(key, data) {
tl('bookmark', '', data, key, 'false', voice, '') tl('bookmark', '', data, key, 'false', voice, '')
} }
function utl(key, acct_id, data) { function utl(key, acct_id, data) {
if (!data) { if(!data) {
var multi = localStorage.getItem('column') var multi = localStorage.getItem('column')
var obj = JSON.parse(multi) var obj = JSON.parse(multi)
data = obj[key].data data = obj[key].data
acct_id = obj[key].domain acct_id = obj[key].domain
} }
console.log(key, data) console.log(key, data)
if (localStorage.getItem('voice_' + key)) { if (localStorage.getItem('voice_' + key)) {
var voice = true var voice = true

View File

@@ -1,24 +1,24 @@
function menu() { function menu() {
localStorage.setItem("menu-done", true) localStorage.setItem("menu-done", true);
$("#fukidashi").addClass("hide") $("#fukidashi").addClass("hide")
if (!$("#menu").hasClass("appear")) { if (!$("#menu").hasClass("appear")) {
$("#menu").addClass("appear") $("#menu").addClass("appear")
var left = localStorage.getItem("menu-left") var left = localStorage.getItem("menu-left");
if (left > $('body').width() - $('#menu').width()) { if (left > $('body').width() - $('#menu').width()) {
left = $('body').width() - $('#menu').width() left = $('body').width() - $('#menu').width();
} else if (left < 0) { } else if (left < 0) {
left = 0 left = 0;
} }
var top = localStorage.getItem("menu-top") var top = localStorage.getItem("menu-top");
if (top > $('body').height() - $('#menu').height()) { if (top > $('body').height() - $('#menu').height()) {
top = $('body').height() - $('#menu').height() top = $('body').height() - $('#menu').height();
} else if (top < 0) { } else if (top < 0) {
top = 0 top = 0;
} }
$('#menu').css("left", left + "px") $('#menu').css("left", left + "px")
$('#menu').css("top", top + "px") $('#menu').css("top", top + "px")
var height = localStorage.getItem("menu-height") var height = localStorage.getItem("menu-height");
var width = localStorage.getItem("menu-width") var width = localStorage.getItem("menu-width");
if(height){ if(height){
$('#menu').css("height", height + "px") $('#menu').css("height", height + "px")
}else{ }else{
@@ -27,13 +27,13 @@ function menu() {
if(width){ if(width){
$('#menu').css("width", width + "px") $('#menu').css("width", width + "px")
} }
$('#menu').fadeIn() $('#menu').fadeIn();
$("#menu-bar").html("TheDesk " + localStorage.getItem("ver")) $("#menu-bar").html("TheDesk " + localStorage.getItem("ver"));
$(".menu-content").addClass("hide") $(".menu-content").addClass("hide");
$("#add-box").removeClass("hide") $("#add-box").removeClass("hide");
$("#left-menu div").removeClass("active") $("#left-menu div").removeClass("active");
$("#addColumnMenu").addClass("active") $("#addColumnMenu").addClass("active");
$("#addColumnMenu").click() $("#addColumnMenu").click();
} else { } else {
$('#menu').fadeOut() $('#menu').fadeOut()
$("#menu").removeClass("appear") $("#menu").removeClass("appear")
@@ -44,35 +44,35 @@ $(function () {
$("#menu").draggable({ $("#menu").draggable({
handle: "#menu-bar", handle: "#menu-bar",
stop: function () { stop: function () {
var left = $('#menu').offset().left var left = $('#menu').offset().left;
if (left > $('body').width() - $('#menu').width()) { if (left > $('body').width() - $('#menu').width()) {
left = $('body').width() - $('#menu').width() left = $('body').width() - $('#menu').width();
} else if (left < 0) { } else if (left < 0) {
left = 0 left = 0;
} }
var top = $('#menu').offset().top var top = $('#menu').offset().top;
if (top > $('body').height() - $('#menu').height()) { if (top > $('body').height() - $('#menu').height()) {
top = $('body').height() - $('#menu').height() top = $('body').height() - $('#menu').height();
} else if (top < 0) { } else if (top < 0) {
top = 0 top = 0;
} }
localStorage.setItem("menu-left", left) localStorage.setItem("menu-left", left);
localStorage.setItem("menu-top", top) localStorage.setItem("menu-top", top);
} }
}) });
$("#menu").resizable({ $("#menu").resizable({
minHeight: 150, minHeight: 150,
minWidth: 200, minWidth: 200,
stop: function (event, ui) { stop: function (event, ui) {
localStorage.setItem("menu-height", ui.size.height) localStorage.setItem("menu-height", ui.size.height);
localStorage.setItem("menu-width", ui.size.width) localStorage.setItem("menu-width", ui.size.width);
} }
}) });
}) });
function help() { function help() {
$("#left-menu a").removeClass("active") $("#left-menu a").removeClass("active");
$("#helpMenu").addClass("active") $("#helpMenu").addClass("active");
$(".menu-content").addClass("hide") $(".menu-content").addClass("hide");
$("#help-box").removeClass("hide") $("#help-box").removeClass("hide");
postMessage(["sendSinmpleIpc", "getLogs"], "*") postMessage(["sendSinmpleIpc", "getLogs"], "*")
} }

View File

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

View File

@@ -32,7 +32,6 @@ function mini() {
function show() { function show() {
$('#post-box').addClass('appear') $('#post-box').addClass('appear')
$('#textarea').focus() $('#textarea').focus()
console.log('show' + localStorage.getItem('postbox-left'))
var left = localStorage.getItem('postbox-left') var left = localStorage.getItem('postbox-left')
if (left > $('body').width() - $('#post-box').width()) { if (left > $('body').width() - $('#post-box').width()) {
left = $('body').width() - $('#post-box').width() left = $('body').width() - $('#post-box').width()
@@ -55,10 +54,12 @@ function show() {
} }
$('#post-box').fadeIn() $('#post-box').fadeIn()
$('#textarea').characterCounter() $('#textarea').characterCounter()
mdCheck() mdCheck()
} }
$(function () { $(function () {
$('#post-box').draggable({ $('#post-box').draggable({
handle: '#post-bar', handle: '#post-bar',
stop: function () { stop: function () {
@@ -101,7 +102,7 @@ if (location.search) {
$('.mini-btn').text('expand_less') $('.mini-btn').text('expand_less')
} }
} }
window.onload = function () { initPostbox(); connection() } window.onload = initPostbox
function initPostbox() { function initPostbox() {
$('#posttgl').click(function (e) { $('#posttgl').click(function (e) {
if (!$('#post-box').hasClass('appear')) { if (!$('#post-box').hasClass('appear')) {
@@ -126,6 +127,11 @@ function initPostbox() {
localStorage.removeItem('nohide') localStorage.removeItem('nohide')
srcBox('close') srcBox('close')
}) })
$('#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) localStorage.setItem('nohide', true)
var countup = function () { var countup = function () {

View File

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

View File

@@ -80,6 +80,22 @@ var postView = new Vue({
}) })
//設定ボタン押した。 //設定ボタン押した。
function settings() { function settings() {
var cd = $('[name=theme]:checked').val()
var ct = $('[data-ct=' + cd + ']').html()
if (cd == 'custom' && !$('#custom-sel-sel').val()) {
var theme = localStorage.getItem('theme')
if (!theme) {
var theme = 'white'
}
$('#' + theme).prop('checked', true)
} else {
if (cd != localStorage.getItem('theme')) {
M.toast({ html: lang.lang_setting_theme.replace('{{set}}', ct), displayLength: 3000 })
}
//テーマはこの場で設定
themes(cd)
localStorage.setItem('theme', cd)
}
var fontd = $('#font').val() var fontd = $('#font').val()
if (fontd) { if (fontd) {
if (fontd != localStorage.getItem('font')) { if (fontd != localStorage.getItem('font')) {
@@ -151,10 +167,10 @@ function load() {
var font = '' var font = ''
} }
$('#font').val(font) $('#font').val(font)
$('#c1-file').text(localStorage.getItem('custom1') != 'null' ? localStorage.getItem('custom1') : '') $('#c1-file').text(localStorage.getItem('custom1'))
$('#c2-file').text(localStorage.getItem('custom2') != 'null' ? localStorage.getItem('custom2') : '') $('#c2-file').text(localStorage.getItem('custom2'))
$('#c3-file').text(localStorage.getItem('custom3') != 'null' ? localStorage.getItem('custom3') : '') $('#c3-file').text(localStorage.getItem('custom3'))
$('#c4-file').text(localStorage.getItem('custom4') != 'null' ? localStorage.getItem('custom4') : '') $('#c4-file').text(localStorage.getItem('custom4'))
var cvol = localStorage.getItem('customVol') var cvol = localStorage.getItem('customVol')
if (cvol) { if (cvol) {
$('#soundvol').val(cvol * 100) $('#soundvol').val(cvol * 100)
@@ -492,39 +508,35 @@ function fontList(arg) {
function insertFont(name) { function insertFont(name) {
$('#font').val(name) $('#font').val(name)
} }
function copyColor(from, to) { $('.color-picker').each(function (i, elem) {
let props = [ pickerDefine(i, 'fff')
'background', 'subcolor', 'text', 'accent', })
'modal', 'modalFooter', 'third', 'forth', function pickerDefine(i, color) {
'bottom', 'emphasized', 'postbox', 'active', var pickr = new Pickr({
'selected', 'selectedWithShared' el: '#color-picker' + i,
] default: color,
let i = 0 showAlways: true,
let color appendToBody: true,
for (tag of props) { closeWithKey: 'Escape',
if(tag == from) { comparison: false,
let used = $(`#use-color_${i}`).prop('checked') components: {
if(!used) { preview: true, // Left side color comparison
Swal.fire({ opacity: false, // Opacity slider
type: 'error', hue: true, // Hue slider
title: 'Not checked', interaction: {
}) rgba: false, // rgba option (red green blue and alpha)
break input: true, // input / output element
} },
color = $(`#color-picker${i}_value`).val() },
break strings: {
} save: 'Save', // Default for save button
i++ clear: 'Clear', // Default for clear button
} },
if(!color) return false })
for (tag of props) { pickr.on('change', (...args) => {
if(tag == to) { var rgb = 'rgb(' + args[0].toRGBA()[0] + ',' + args[0].toRGBA()[1] + ',' + args[0].toRGBA()[2] + ')'
$(`#color-picker${i}_value`).val(color) $('#color-picker' + i + '_value').val(rgb)
$(`#use-color_${i}`).prop('checked', true) })
break
}
i++
}
} }
function customComp() { function customComp() {
var nameC = $('#custom_name').val() var nameC = $('#custom_name').val()
@@ -532,32 +544,59 @@ function customComp() {
return false return false
} }
var descC = $('#custom_desc').val() var descC = $('#custom_desc').val()
var bgC = $('#color-picker0_value').val() var primaryC = $('#color-picker0_value').val()
var subcolorC = $('#color-picker2_value').val() if (!primaryC) {
var textC = $('#color-picker1_value').val() primaryC = 'rgb(255,255,255)'
var accentC = $('#color-picker3_value').val() }
var secondaryC = $('#color-picker1_value').val()
if (!secondaryC) {
secondaryC = 'rgb(255,255,255)'
}
var textC = $('#color-picker2_value').val()
if (!textC) {
textC = 'rgb(255,255,255)'
}
var multi = localStorage.getItem('multi') var multi = localStorage.getItem('multi')
let advanced = [ if ($('#pickers').hasClass('advanceTheme')) {
'modal', 'modalFooter', 'third', 'forth', var accentC = $('#color-picker3_value').val()
'bottom', 'emphasized', 'postbox', 'active', if (!accentC) {
'selected', 'selectedWithShared' accentC = null
]
var advanceTheme = {}
let i = 4
for (tag of advanced) {
let used = $(`#use-color_${i}`).prop('checked')
if (used) {
advanceTheme[tag] = $(`#color-picker${i}_value`).val()
} }
i++ var activeC = $('#color-picker4_value').val()
if (!activeC) {
activeC = null
}
var modalC = $('#color-picker5_value').val()
if (!modalC) {
modalC = null
}
var bottomC = $('#color-picker6_value').val()
if (!bottomC) {
bottomC = null
}
var postboxC = $('#color-picker7_value').val()
if (!postboxC) {
postboxC = null
}
var subcolorC = $('#color-picker8_value').val()
if (!subcolorC) {
subcolorC = null
}
var advanceTheme = {
TheDeskAccent: accentC,
TheDeskActive: activeC,
TheDeskModal: modalC,
TheDeskBottom: bottomC,
TheDeskPostbox: postboxC,
TheDeskSubcolor: subcolorC,
}
} else {
var advanceTheme = {}
} }
var my = JSON.parse(multi)[0].name var my = JSON.parse(multi)[0].name
var id = $('#custom-edit-sel').val() var id = $('#custom-edit-sel').val()
const defaults = [ if (id == 'add_new') {
'black','blue','brown','green','indigo','polar','snow','white'
]
if (id == 'add_new' || defaults.includes(id)) {
id = makeCID() id = makeCID()
} }
localStorage.setItem('customtheme-id', id) localStorage.setItem('customtheme-id', id)
@@ -566,48 +605,26 @@ function customComp() {
author: my, author: my,
desc: descC, desc: descC,
base: $('[name=direction]:checked').val(), base: $('[name=direction]:checked').val(),
primary: { vars: {
background: bgC, primary: primaryC,
subcolor: subcolorC, secondary: secondaryC,
text: textC, text: textC,
accent: accentC
}, },
advanced: advanceTheme, props: advanceTheme,
id: id, id: id,
version: '2'
} }
$('#custom_json').val(JSON.stringify(json)) $('#custom_json').val(JSON.stringify(json))
let timerInterval themes('custom')
Swal.fire({ $('#custom').prop('checked', true)
title: 'Saving...', $('#custom_name').val('')
html: '', $('#custom_desc').val('')
timer: 1000, $('#dark').prop('checked', true)
timerProgressBar: true, $('#custom_json').val('')
onBeforeOpen: () => { for (var i = 0; i <= 8; i++) {
Swal.showLoading() $('#color-picker' + i + '-wrap').html('<div class="color-picker" id="color-picker' + i + '"></div>')
}, $('#color-picker' + i + '_value').val('')
onClose: () => { pickerDefine(i, 'fff')
clearInterval(timerInterval) }
}
}).then((result) => {
themes()
ctLoad()
Swal.fire({
title: 'Refreshing...',
html: '',
timer: 1000,
timerProgressBar: true,
onBeforeOpen: () => {
Swal.showLoading()
},
onClose: () => {
clearInterval(timerInterval)
}
}).then((result) => {
$('#custom-edit-sel').val(id)
$('select').formSelect()
})
})
postMessage(['themeJsonCreate', JSON.stringify(json)], '*') postMessage(['themeJsonCreate', JSON.stringify(json)], '*')
} }
function deleteIt() { function deleteIt() {
@@ -616,34 +633,34 @@ function deleteIt() {
$('#custom_desc').val('') $('#custom_desc').val('')
$('#dark').prop('checked', true) $('#dark').prop('checked', true)
$('#custom_json').val('') $('#custom_json').val('')
for (var i = 0; i <= 13; i++) { for (var i = 0; i <= 8; i++) {
if (i >= 4) $(`#use-color_${i}`).prop('checked', false) $('#color-picker' + i + '-wrap').html('<div class="color-picker" id="color-picker' + i + '"></div>')
$('#color-picker' + i + '_value').val('') $('#color-picker' + i + '_value').val('')
pickerDefine(i, 'fff')
} }
postMessage(['themeJsonDelete', id + '.thedesktheme'], '*') postMessage(['themeJsonDelete', id], '*')
} }
function ctLoad() { function ctLoad() {
postMessage(['sendSinmpleIpc', 'theme-json-list'], '*') postMessage(['sendSinmpleIpc', 'theme-json-list'], '*')
} }
function ctLoadCore(args) { function ctLoadCore(args) {
var template = '' var templete = ''
var editTemplate = ''
Object.keys(args).forEach(function (key) { Object.keys(args).forEach(function (key) {
var theme = args[key] var theme = args[key]
var themeid = theme.id var themeid = theme.id
template = template + `<option value="${themeid}">${theme.name}${theme.compatible ? `(${lang.lang_setting_compat})` : ''}</option>` templete = templete + '<option value="' + themeid + '">' + theme.name + '</option>'
if (!theme.compatible) editTemplate = editTemplate + `<option value="${themeid}">${theme.name}</option>`
}) })
$('#custom-sel-sel').html(template) if (args[0]) {
editTemplate = '<option value="add_new">' + $('#edit-selector').attr('data-add') + '</option>' + editTemplate localStorage.setItem('customtheme-id', args[0].id)
$('#custom-edit-sel').html(editTemplate) }
$('#custom-sel-sel').val(localStorage.getItem('customtheme-id')) $('#custom-sel-sel').html(templete)
templete = '<option value="add_new">' + $('#edit-selector').attr('data-add') + '</option>' + templete
$('#custom-edit-sel').html(templete)
$('select').formSelect() $('select').formSelect()
} }
function customSel() { function customSel() {
var id = $('#custom-sel-sel').val() var id = $('#custom-sel-sel').val()
localStorage.setItem('customtheme-id', id) localStorage.setItem('customtheme-id', id)
themes(id)
} }
function custom() { function custom() {
var id = $('#custom-edit-sel').val() var id = $('#custom-edit-sel').val()
@@ -652,47 +669,58 @@ function custom() {
$('#custom_desc').val('') $('#custom_desc').val('')
$('#dark').prop('checked', true) $('#dark').prop('checked', true)
$('#custom_json').val('') $('#custom_json').val('')
for (var i = 0; i <= 13; i++) { for (var i = 0; i <= 8; i++) {
if (i >= 4) $(`#use-color_${i}`).prop('checked', false) $('#color-picker' + i + '-wrap').html('<div class="color-picker" id="color-picker' + i + '"></div>')
$('#color-picker' + i + '_value').val('') $('#color-picker' + i + '_value').val('')
pickerDefine(i, 'fff')
} }
$('#delTheme').addClass('disabled') $('#delTheme').addClass('disabled')
} else { } else {
$('#delTheme').removeClass('disabled') $('#delTheme').removeClass('disabled')
postMessage(['themeJsonRequest', id + '.thedesktheme'], '*') postMessage(['themeJsonRequest', id], '*')
} }
} }
function customConnect(raw) { function customConnect(raw) {
var args = raw[0] var args = raw[0]
$('#custom_name').val(`${args.name} ${args.default ? 'Customed' : ''}`) $('#custom_name').val(args.name)
$('#custom_desc').val(args.default ? 'TheDesk default theme with some changes by user' : args.desc) $('#custom_desc').val(args.desc)
$('#' + args.base).prop('checked', true) $('#' + args.base).prop('checked', true)
//Background //Primary
$('#color-picker0_value').val(args.primary.background) $('#color-picker0-wrap').html('<div class="color-picker" id="color-picker0"></div>')
pickerDefine(0, rgbToHex(args.vars.primary))
$('#color-picker0_value').val(args.vars.primary)
//Secondary
$('#color-picker1-wrap').html('<div class="color-picker" id="color-picker1"></div>')
pickerDefine(1, rgbToHex(args.vars.secondary))
$('#color-picker1_value').val(args.vars.secondary)
//Text //Text
$('#color-picker1_value').val(args.primary.text) $('#color-picker2-wrap').html('<div class="color-picker" id="color-picker2"></div>')
//Subcolor $('#color-picker2_value').val(args.vars.text)
$('#color-picker2_value').val(args.primary.subcolor) pickerDefine(2, rgbToHex(args.vars.text))
//Accent //TheDesk Only
$('#color-picker3_value').val(args.primary.accent) advancedConncet(args, 'TheDeskAccent', 'secondary', 3)
let advanced = [ advancedConncet(args, 'TheDeskActive', 'primary', 4)
'modal', 'modalFooter', 'third', 'forth', advancedConncet(args, 'TheDeskModal', 'secondary', 5)
'bottom', 'emphasized', 'postbox', 'active', advancedConncet(args, 'TheDeskBottom', 'primary', 6)
'selected', 'selectedWithShared' advancedConncet(args, 'TheDeskPostbox', 'primary', 7)
] advancedConncet(args, 'TheDeskSubcolor', 'primary', 8)
let i = 4
for (tag of advanced) {
if (args.advanced[tag]) {
$(`#color-picker${i}_value`).val(args.advanced[tag])
}
$(`#use-color_${i}`).prop('checked', true)
i++
}
$('#custom_json').val(raw[1]) $('#custom_json').val(raw[1])
if(args.default) { }
$('#delTheme').addClass('disabled') function advancedConncet(args, tar, sub, i) {
if (args.props) {
if (args.props[tar]) {
var color = args.props[tar]
$('#pickers').addClass('advanceTheme')
$('.advanced').removeClass('hide')
} else {
var color = args.vars[sub]
}
} else {
var color = args.vars[sub]
} }
$('#color-picker' + i + '-wrap').html('<div class="color-picker" id="color-picker' + i + '"></div>')
$('#color-picker' + i + '_value').val(color)
pickerDefine(i, rgbToHex(color))
} }
function customImp() { function customImp() {
var json = $('#custom_import').val() var json = $('#custom_import').val()
@@ -726,7 +754,7 @@ function customSound(key) {
} }
function customSoundSave(key, file) { function customSoundSave(key, file) {
localStorage.setItem('custom' + key, file) localStorage.setItem('custom' + key, file)
$(`#c${key}-file`).text(file) $('#c1-file').text(file)
} }
window.onload = function () { window.onload = function () {
//最初に読む //最初に読む
@@ -804,5 +832,3 @@ function lastFmSet() {
} }
M.toast({ html: 'Complete: last.fm', displayLength: 3000 }) M.toast({ html: 'Complete: last.fm', displayLength: 3000 })
} }
function stopVideo() { return false }

View File

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

View File

@@ -1,44 +1,30 @@
function spotifyConnect() { function spotifyConnect() {
var auth = 'https://spotify.thedesk.top/connect' 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'
$('#spotify-code-show').removeClass('hide') var platform = localStorage.getItem('platform')
postMessage(['openUrl', auth], '*') if (platform == 'win32') {
postMessage(['openUrl', auth], '*')
postMessage(['sendSinmpleIpc', 'quit'], '*')
} else {
auth = auth + '&state=code'
$('#spotify-code-show').removeClass('hide')
postMessage(['openUrl', auth], '*')
}
} }
function spotifyAuth() { function spotifyAuth() {
var code = $('#spotify-code').val() var code = $('#spotify-code').val()
localStorage.setItem('spotify-token', code) localStorage.setItem('spotify', 'code')
localStorage.setItem('spotify-refresh', code)
$('#spotify-code-show').addClass('hide') $('#spotify-code-show').addClass('hide')
$('#spotify-enable').addClass('disabled') $('#spotify-enable').addClass('disabled')
$('#spotify-disable').removeClass('disabled') $('#spotify-disable').removeClass('disabled')
} }
function spotifyDisconnect() { function spotifyDisconnect() {
var start = 'https://spotify.thedesk.top/disconnect?code=' + localStorage.getItem('spotify-token') localStorage.removeItem('spotify')
fetch(start, { localStorage.removeItem('spotify-refresh')
method: 'GET', checkSpotify()
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()
})
} }
function checkSpotify() { function checkSpotify() {
if (localStorage.getItem('spotify-token')) { if (localStorage.getItem('spotify')) {
$('#spotify-enable').addClass('disabled') $('#spotify-enable').addClass('disabled')
$('#spotify-disable').removeClass('disabled') $('#spotify-disable').removeClass('disabled')
} else { } else {
@@ -85,8 +71,8 @@ function aMusicFlagSave() {
} }
function nowplaying(mode) { function nowplaying(mode) {
if (mode == 'spotify') { if (mode == 'spotify') {
var start = 'https://spotify.thedesk.top/current-playing?code=' + 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-token') var at = localStorage.getItem('spotify')
if (at) { if (at) {
fetch(start, { fetch(start, {
method: 'GET', method: 'GET',
@@ -107,10 +93,7 @@ function nowplaying(mode) {
setLog(start, 'JSON', error) setLog(start, 'JSON', error)
console.error(error) console.error(error)
}) })
.then(function (jsonRaw) { .then(function (json) {
var code = jsonRaw.token
localStorage.setItem('spotify-token', code)
var json = jsonRaw.data
console.table(json) console.table(json)
if (json.length < 1) { if (json.length < 1) {
return false return false
@@ -186,10 +169,11 @@ function nowplaying(mode) {
return false return false
} }
var item = json.recenttracks.track[0] var item = json.recenttracks.track[0]
if (!item['@attr']) return false if(!item['@attr']) return false
var img = item.image[3]['#text'] var img = item.image[3]['#text']
var isImg = item.streamable*1
var flag = localStorage.getItem('artwork') var flag = localStorage.getItem('artwork')
if (flag && img != 'https://lastfm.freetls.fastly.net/i/u/300x300/2a96cbd8b46e442fc41c2b86b821562f.png' && img) { if (flag && isImg && img) {
postMessage(['bmpImage', [img, 0]], '*') postMessage(['bmpImage', [img, 0]], '*')
} }
var content = localStorage.getItem('np-temp') var content = localStorage.getItem('np-temp')
@@ -203,7 +187,7 @@ function nowplaying(mode) {
var regExp = new RegExp('{artist}', 'g') var regExp = new RegExp('{artist}', 'g')
content = content.replace(regExp, item.artist['#text']) content = content.replace(regExp, item.artist['#text'])
var regExp = new RegExp('{url}', 'g') var regExp = new RegExp('{url}', 'g')
content = content.replace(regExp, '') content = content.replace(regExp,'')
var regExp = new RegExp('{composer}', 'g') var regExp = new RegExp('{composer}', 'g')
content = content.replace(regExp, '') content = content.replace(regExp, '')
var regExp = new RegExp('{hz}', 'g') var regExp = new RegExp('{hz}', 'g')

View File

@@ -1,20 +1,35 @@
//テーマ適用 //テーマ適用
function themes(theme) { function themes(theme) {
if (!theme) { if (!theme) {
var theme = localStorage.getItem('customtheme-id') var theme = localStorage.getItem('theme')
if (!theme) { if (!theme) {
localStorage.setItem('customtheme-id', 'black') var theme = 'black'
theme = 'black' localStorage.setItem('theme', 'black')
} }
} }
postMessage(['themeCSSRequest', theme + '.thedesktheme'], '*')
var el = document.getElementsByTagName('html')[0] var el = document.getElementsByTagName('html')[0]
el.style.backgroundColor = 'var(--bg)'
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') var font = localStorage.getItem('font')
if(font) { if (font) {
el.style.fontFamily = font font = font.replace(/"(.+)"/, '$1')
el.style.fontFamily = '"' + font + '"'
} else { } else {
el.style.fontFamily = '' el.style.fontFamily = ''
} }
if (theme == 'custom') {
if (localStorage.getItem('customtheme-id')) {
postMessage(['themeCSSRequest', localStorage.getItem('customtheme-id')], '*')
}
}
el.style.backgroundColor = 'var(--bg)'
} }
themes() themes()

View File

@@ -63,21 +63,16 @@ function tips(mode) {
function startmem() { function startmem() {
postMessage(['sendSinmpleIpc', 'startmem'], '*') postMessage(['sendSinmpleIpc', 'startmem'], '*')
} }
function renderMem(use, cpu, total, core, uptime) { function renderMem(use, cpu, total) {
let day = Math.floor(uptime / 60 / 60 / 24)
let hour = Math.floor(uptime / 60 /60 % 24)
if(hour < 10) hour = '0' + hour
let min = Math.floor(uptime / 60 % 60)
if(min < 10) min = '0' + min
let sec = Math.floor(uptime % 60)
if(sec < 10) sec = '0' + sec
let time = `${day ? day + ' days ' : ''}${hour ? hour + ':' : ''}${min}:${sec}`
//Intel
cpu = cpu.replace('Intel(R)', '').replace('(TM)', '').replace(' CPU', '')
//AMD
cpu = cpu.replace('AMD ', '').replace(/\s[0-9]{1,3}-Core\sProcessor/, '')
$('#tips-text').html( $('#tips-text').html(
`${escapeHTML(cpu)} x ${core}<br />RAM: ${Math.floor(use / 1024 / 1024 / 102.4) / 10}/${Math.floor(total / 1024 / 1024 / 102.4) / 10}GB(${Math.floor((use / total) * 100)}%) UP:${time}` escapeHTML(cpu) +
'<br>Memory:' +
Math.floor(use / 1024 / 1024 / 102.4) / 10 +
'/' +
Math.floor(total / 1024 / 1024 / 102.4) / 10 +
'GB(' +
Math.floor((use / total) * 100) +
'%)'
) )
} }
//トレンドタグ //トレンドタグ
@@ -136,8 +131,12 @@ function trendTagonTip() {
spotint = null spotint = null
function spotifytips() { function spotifytips() {
if (spotint) clearInterval(spotint) if (spotint) clearInterval(spotint)
var start = 'https://spotify.thedesk.top/current-playing?code=' + localStorage.getItem('spotify-token') var start =
var at = localStorage.getItem('spotify-token') 'https://thedesk.top/now-playing?at=' +
localStorage.getItem('spotify') +
'&rt=' +
localStorage.getItem('spotify-refresh')
var at = localStorage.getItem('spotify')
if (at) { if (at) {
fetch(start, { fetch(start, {
method: 'GET', method: 'GET',
@@ -158,10 +157,7 @@ function spotifytips() {
setLog(start, 'JSON', error) setLog(start, 'JSON', error)
console.error(error) console.error(error)
}) })
.then(function(jsonRaw) { .then(async function(json) {
var code = jsonRaw.token
localStorage.setItem('spotify-token', code)
var json = jsonRaw.data
var ms = json.progress_ms var ms = json.progress_ms
if(!ms) { if(!ms) {
tips('ver') tips('ver')
@@ -179,7 +175,7 @@ function spotifytips() {
} }
} }
artisttxt = escapeHTML(artisttxt) artisttxt = escapeHTML(artisttxt)
sleep(last) await sleep(last)
var tms = item.duration_ms var tms = item.duration_ms
var per = (ms / item.duration_ms) * 100 var per = (ms / item.duration_ms) * 100
ms = ms / 1000 ms = ms / 1000
@@ -201,10 +197,12 @@ function spotifytips() {
<i class="material-icons pointer" onclick="nowplaying('spotify');show()" style="font-size:20px">send</i> <i class="material-icons pointer" onclick="nowplaying('spotify');show()" style="font-size:20px">send</i>
</div> </div>
<div id="spot-cover"> <div id="spot-cover">
<img src="${img}" id="spot-img" draggable="false"> <img src="${img}" id="spot-img">
</div> </div>
<div id="spot-name"> <div id="spot-name">
${escapeHTML(item.name)} ${escapeHTML(item.name)}
</div>
<div id="spot-artist">
<span class="gray sml" id="spot-art">${artisttxt}</span> <span class="gray sml" id="spot-art">${artisttxt}</span>
</div> </div>
<div id="spot-time"> <div id="spot-time">
@@ -253,10 +251,10 @@ function trendTagonTipInterval() {
} }
//時計 //時計
var clockint var clockint
function clock() { async function clock() {
var now = new Date() var now = new Date()
var last = 1000 - (now.getTime() % 1000) var last = 1000 - (now.getTime() % 1000)
sleep(last) await sleep(last)
clockint = setInterval(clockStart, 1000) clockint = setInterval(clockStart, 1000)
} }
function clockStart() { function clockStart() {
@@ -288,10 +286,6 @@ function clockStart() {
'</span>' '</span>'
$('#tips-text').html(msg) $('#tips-text').html(msg)
} }
function sleep(waitMsec) {
var startMsec = new Date()
while (new Date() - startMsec < waitMsec);
}
function tipsToggle() { function tipsToggle() {
$('#tips').toggleClass('hide') $('#tips').toggleClass('hide')
$('#tips-menu').toggleClass('hide') $('#tips-menu').toggleClass('hide')

File diff suppressed because it is too large Load Diff

View File

@@ -1,22 +1,24 @@
//プロフ編集 //プロフ編集
//文字系 //文字系
function profedit() { function profedit() {
var acct_id = $('#his-data').attr("use-acct") var acct_id = $('#his-data').attr('use-acct')
todo("Updating...") todo('Updating...')
var domain = localStorage.getItem("domain_" + acct_id) var domain = localStorage.getItem('domain_' + acct_id)
var at = localStorage.getItem("acct_" + acct_id + "_at") var at = localStorage.getItem('acct_' + acct_id + '_at')
var start = "https://" + domain + "/api/v1/accounts/update_credentials" var start = 'https://' + domain + '/api/v1/accounts/update_credentials'
var name = $("#his-name-val").val() var name = $('#his-name-val').val()
var des = $("#his-des-val").val() var des = $('#his-des-val').val()
var httpreq = new XMLHttpRequest() var httpreq = new XMLHttpRequest()
httpreq.open('PATCH', start, true) httpreq.open('PATCH', start, true)
httpreq.setRequestHeader('Content-Type', 'application/json') httpreq.setRequestHeader('Content-Type', 'application/json')
httpreq.setRequestHeader('Authorization', 'Bearer ' + at) httpreq.setRequestHeader('Authorization', 'Bearer ' + at)
httpreq.responseType = "json" httpreq.responseType = 'json'
httpreq.send(JSON.stringify({ httpreq.send(
display_name: name, JSON.stringify({
note: des, display_name: name,
})) note: des,
})
)
httpreq.onreadystatechange = function () { httpreq.onreadystatechange = function () {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
$('#his-data').modal('close') $('#his-data').modal('close')
@@ -27,10 +29,10 @@ function profedit() {
//画像系 //画像系
function imgChange(imgfile, target) { function imgChange(imgfile, target) {
var acct_id = $('#his-data').attr("use-acct") var acct_id = $('#his-data').attr('use-acct')
todo("アップロードしています") todo('アップロードしています')
if (!imgfile.files.length) { if (!imgfile.files.length) {
console.warn("No Image to upload") console.warn('No Image to upload')
return return
} }
var file = imgfile.files[0] var file = imgfile.files[0]
@@ -40,26 +42,27 @@ function imgChange(imgfile, target) {
var blob = toBlob(b64, 'image/png') var blob = toBlob(b64, 'image/png')
var fd = new FormData() var fd = new FormData()
fd.append(target, blob) fd.append(target, blob)
var domain = localStorage.getItem("domain_" + acct_id) var domain = localStorage.getItem('domain_' + acct_id)
var at = localStorage.getItem("acct_" + acct_id + "_at") var at = localStorage.getItem('acct_' + acct_id + '_at')
var start = "https://" + domain + "/api/v1/accounts/update_credentials" var start = 'https://' + domain + '/api/v1/accounts/update_credentials'
var httpreq = new XMLHttpRequest() var httpreq = new XMLHttpRequest()
httpreq.open('PATCH', start, true) httpreq.open('PATCH', start, true)
httpreq.upload.addEventListener("progress", progshow, false) httpreq.upload.addEventListener('progress', progshow, false)
httpreq.setRequestHeader('Authorization', 'Bearer ' + at) httpreq.setRequestHeader('Authorization', 'Bearer ' + at)
httpreq.responseType = "json" httpreq.responseType = 'json'
httpreq.send(fd) httpreq.send(fd)
httpreq.onreadystatechange = function () { httpreq.onreadystatechange = function () {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
var json = httpreq.response var json = httpreq.response
if(this.status!==200){ setLog(start, this.status, this.response) } if (this.status !== 200) {
setLog(start, this.status, this.response)
}
$('#his-data').modal('close') $('#his-data').modal('close')
todc() todc()
localStorage.removeItem("image")
} }
} }
} }
$("#prof-change").html($("#prof-change").html()) $('#prof-change').html($('#prof-change').html())
$("#header-change").html($("#header-change").html()) $('#header-change').html($('#header-change').html())
fr.readAsDataURL(file) fr.readAsDataURL(file)
} }

View File

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

View File

@@ -124,6 +124,7 @@ function createWindow() {
var max_info_path = join(app.getPath('userData'), 'max-window-size.json') var max_info_path = join(app.getPath('userData'), 'max-window-size.json')
var ha_path = join(app.getPath('userData'), 'hardwareAcceleration') var ha_path = join(app.getPath('userData'), 'hardwareAcceleration')
var ua_path = join(app.getPath('userData'), 'useragent') var ua_path = join(app.getPath('userData'), 'useragent')
var frame_path = join(app.getPath('userData'), 'frame')
try { try {
fs.readFileSync(ha_path, 'utf8') fs.readFileSync(ha_path, 'utf8')
app.disableHardwareAcceleration() app.disableHardwareAcceleration()
@@ -151,6 +152,19 @@ function createWindow() {
y: 'string', y: 'string',
} // デフォルトバリュー } // デフォルトバリュー
} }
try {
var frameRaw = fs.readFileSync(frame_path, 'utf8')
if (frameRaw == 'false') {
var frame = false
var frameTitle = 'hidden'
} else {
var frame = true
var frameTitle = 'default'
}
} catch {
var frame = true
}
// メイン画面の表示。ウィンドウの幅、高さを指定できる // メイン画面の表示。ウィンドウの幅、高さを指定できる
var platform = process.platform var platform = process.platform
var bit = process.arch var bit = process.arch
@@ -159,7 +173,6 @@ function createWindow() {
webviewTag: true, webviewTag: true,
nodeIntegration: false, nodeIntegration: false,
contextIsolation: true, contextIsolation: true,
spellcheck: false,
preload: join(__dirname, 'js', 'platform', 'preload.js'), preload: join(__dirname, 'js', 'platform', 'preload.js'),
}, },
width: window_size.width, width: window_size.width,
@@ -167,6 +180,7 @@ function createWindow() {
x: window_size.x, x: window_size.x,
y: window_size.y, y: window_size.y,
show: false, show: false,
frame: frame,
} }
if (platform == 'linux') { if (platform == 'linux') {
arg.resizable = true arg.resizable = true
@@ -175,6 +189,7 @@ function createWindow() {
arg.simpleFullscreen = true arg.simpleFullscreen = true
} else if (platform == 'darwin') { } else if (platform == 'darwin') {
arg.simpleFullscreen = true arg.simpleFullscreen = true
arg.titleBarStyle = frameTitle
} }
mainWindow = new BrowserWindow(arg) mainWindow = new BrowserWindow(arg)
mainWindow.once('page-title-updated', () => { mainWindow.once('page-title-updated', () => {
@@ -278,7 +293,10 @@ function createWindow() {
var platform = process.platform var platform = process.platform
var bit = process.arch var bit = process.arch
Menu.setApplicationMenu(Menu.buildFromTemplate(language.template(lang, mainWindow, packaged, dir, dirname))) Menu.setApplicationMenu(Menu.buildFromTemplate(language.template(lang, mainWindow, packaged, dir, dirname, frame)))
if (!frame) {
mainWindow.setMenu(null)
}
//CSS //CSS
css.css(mainWindow) css.css(mainWindow)
//アップデータとダウンロード //アップデータとダウンロード

View File

@@ -31,246 +31,119 @@ function css(mainWindow) {
} }
}) })
ipc.on('theme-json-delete', function (e, arg) { ipc.on('theme-json-delete', function (e, arg) {
try{ var themecss = join(app.getPath("userData"), arg + ".thedesktheme");
var themecss = join(app.getPath("userData"), arg); console.log(themecss);
console.log(themecss); fs.unlink(themecss, function (err) {
fs.unlink(themecss, function (err) { e.sender.webContents.send('theme-json-delete-complete', "");
e.sender.webContents.send('theme-json-delete-complete', ""); });
});
} catch {
e.sender.webContents.send('theme-json-delete-complete', 'cannot delete');
}
}) })
ipc.on('theme-json-request', function (e, arg) { ipc.on('theme-json-request', function (e, arg) {
try { var themecss = join(app.getPath("userData"), arg + ".thedesktheme");
var themecss = join(app.getAppPath(), '/source/themes', arg) var raw = fs.readFileSync(themecss, 'utf8')
var raw = fs.readFileSync(themecss, 'utf8') var json = JSON5.parse(raw);
var json = JSON5.parse(raw)
} catch {
var themecss = join(app.getPath("userData"), arg)
var raw = fs.readFileSync(themecss, 'utf8')
var json = JSON5.parse(raw)
}
e.sender.webContents.send('theme-json-response', [json, raw]); e.sender.webContents.send('theme-json-response', [json, raw]);
}) })
ipc.on('theme-css-request', function (e, arg) { ipc.on('theme-css-request', function (e, arg) {
var themecss = join(app.getPath("userData"), arg + ".thedesktheme");
try { try {
var themecss = join(app.getAppPath(), '/source/themes', arg) var json = JSON5.parse(fs.readFileSync(themecss, 'utf8'));
var json = JSON5.parse(fs.readFileSync(themecss, 'utf8'))
} catch {
var themecss = join(app.getPath("userData"), arg)
var json = JSON5.parse(fs.readFileSync(themecss, 'utf8'))
}
try { var primary = json.vars.primary;
var css var secondary = json.vars.secondary;
if (json.version) { var text = json.vars.text;
var bg = json.primary.background if (json.base == "light") {
var subcolor = json.primary.subcolor var drag = "rgba(255, 255, 255, 0.8)";
var text = json.primary.text var beforehover = "#757575";
var accent = json.primary.accent var selected = "#3f3f3f"
if (json.base == "light") { var selectedWithShare = "#b2babd"
var drag = "rgba(255, 255, 255, 0.8)"; var gray = "#757575"
var beforehover = "#757575";
var selected = "#3f3f3f"
var selectedWithShare = "#b2babd"
var gray = "#757575"
var hisData = 'rgba(255, 255, 255, 0.9)'
} else {
var drag = "rgba(0, 0, 0, 0.8)";
var beforehover = "#9e9e9e";
var selected = "#c0c0c0"
var selectedWithShare = "#003a30"
var gray = "#cccccc"
var hisData = 'rgba(0, 0, 0, 0.8)'
}
if (!json.advanced) {
json.advanced = {}
}
if (json.advanced.modal) {
var modal = json.advanced.modal
} else {
var modal = bg
}
if (json.advanced.modalFooter) {
var modalFooter = json.advanced.modalFooter
} else {
var modalFooter = bg
if (modal != bg) modalFooter = modal
}
if (json.advanced.thirdColor) {
var thirdColor = json.advanced.thirdColor
} else {
var thirdColor = subcolor
}
if (json.advanced.forthColor) {
var forthColor = json.advanced.forthColor
} else {
var forthColor = subcolor
if (thirdColor != subcolor) forthColor = thirdColor
}
if (json.advanced.bottom) {
var bottom = json.advanced.bottom
} else {
var bottom = subcolor
}
if (json.advanced.emphasized) {
var emphasized = json.advanced.emphasized
} else {
var emphasized = accent
}
if (json.advanced.postbox) {
var postbox = json.advanced.postbox
} else {
var postbox = subcolor
}
if (json.advanced.active) {
var active = json.advanced.active
} else {
var active = accent
}
if (json.advanced.selected) {
var selected = json.advanced.selected
}
if (json.advanced.selectedWithShare) {
var selectedWithShare = json.advanced.selectedWithShare
}
var css = ":root {--bg:" + bg + ";--drag:" + drag + ";" +
"--text:" + text + ";--beforehover:" + beforehover + ";--modal:" +
modal + ";--thirdColor:" + thirdColor + ";--subcolor:" + forthColor +
";--bottom:" + bottom + ";--accent:" + accent + ";" + ";--emphasized:" + emphasized + ";--his-data:" +
hisData +
";--active:" + active + ";--postbox:" + postbox + ";--modalfooter:" +
modalFooter + ";--selected:" + selected + ";--selectedWithShare:" + selectedWithShare +
";--gray:" + gray + ";}" +
".customtheme #imagemodal{background: url(\"../img/pixel.svg\");}";
} else { } else {
var css = compatibleTheme(json) var drag = "rgba(0, 0, 0, 0.8)";
var beforehover = "#9e9e9e";
var selected = "#c0c0c0"
var selectedWithShare = "#003a30"
var gray = "#cccccc"
} }
if (json.props) {
if (json.props.TheDeskAccent) {
var emphasized = json.props.TheDeskAccent
} else {
var emphasized = secondary
}
if (json.props.TheDeskActive) {
var active = json.props.TheDeskActive
} else {
var active = primary
}
if (json.props.TheDeskModal) {
var modal = json.props.TheDeskModal
} else {
var modal = secondary
}
if (json.props.TheDeskBottom) {
var bottom = json.props.TheDeskBottom
} else {
var bottom = primary
}
if (json.props.TheDeskPostbox) {
var postbox = json.props.TheDeskPostbox
} else {
var postbox = primary
}
if (json.props.TheDeskSubcolor) {
var subcolor = json.props.TheDeskSubcolor
} else {
var subcolor = primary
}
} else {
var emphasized = primary
var acs = secondary
var active = primary
var modal = secondary
var bottom = primary
var postbox = primary
var subcolor = primary
}
var css = ".customtheme {--bg:" + secondary + ";--drag:" + drag + ";" +
"--color:" + text + ";--beforehover:" + beforehover + ";--modal:" +
modal + ";--subcolor:" + subcolor + ";--box:" + subcolor +
";--sidebar:" + bottom + ";--shared:" + emphasized + ";" +
"--notfbox:" + secondary + ";--emphasized:" + active + ";--his-data:" +
secondary +
";--active:" + active + ";--postbox:" + postbox + ";--modalfooter:" +
primary +
";--accentbtn:" + subcolor + ";--selected:" + selected + ";--selectedWithShare:" + selectedWithShare + "}"+
"--gray:" + gray + ";"+
".customtheme #imagemodal{background: url(\"../img/pixel.svg\");}";
e.sender.webContents.send('theme-css-response', css); e.sender.webContents.send('theme-css-response', css);
} catch (e) { } catch (e) {
var css = ""; var css = "";
} }
}) })
function compatibleTheme(json) {
var primary = json.vars.primary;
var secondary = json.vars.secondary;
var text = json.vars.text;
if (json.base == "light") {
var drag = "rgba(255, 255, 255, 0.8)";
var beforehover = "#757575";
var selected = "#3f3f3f"
var selectedWithShare = "#b2babd"
var gray = "#757575"
} else {
var drag = "rgba(0, 0, 0, 0.8)";
var beforehover = "#9e9e9e";
var selected = "#c0c0c0"
var selectedWithShare = "#003a30"
var gray = "#cccccc"
}
if (json.advanced) {
if (json.advanced.TheDeskAccent) {
var emphasized = json.advanced.TheDeskAccent
} else {
var emphasized = secondary
}
if (json.advanced.TheDeskActive) {
var active = json.advanced.TheDeskActive
} else {
var active = primary
}
if (json.advanced.TheDeskModal) {
var modal = json.advanced.TheDeskModal
} else {
var modal = secondary
}
if (json.advanced.TheDeskBottom) {
var bottom = json.advanced.TheDeskBottom
} else {
var bottom = primary
}
if (json.advanced.TheDeskPostbox) {
var postbox = json.advanced.TheDeskPostbox
} else {
var postbox = primary
}
if (json.advanced.TheDeskSubcolor) {
var subcolor = json.advanced.TheDeskSubcolor
} else {
var subcolor = primary
}
} else {
var emphasized = primary
var acs = secondary
var active = primary
var modal = secondary
var bottom = primary
var postbox = primary
var subcolor = primary
}
var css = ".customtheme {--bg:" + secondary + ";--drag:" + drag + ";" +
"--text:" + text + ";--beforehover:" + beforehover + ";--modal:" +
modal + ";--thirdColor:" + subcolor + ";--subcolor:" + subcolor +
";--bottom:" + bottom + ";--accent:" + emphasized + ";" +
"--subcolor:" + secondary + ";--emphasized:" + active + ";--his-data:" +
secondary +
";--active:" + active + ";--postbox:" + postbox + ";--modalfooter:" +
primary +
";--active:" + subcolor + ";--selected:" + selected + ";--selectedWithShare:" + selectedWithShare + "}" +
"--gray:" + gray + ";" +
".customtheme #imagemodal{background: url(\"../img/pixel.svg\");}";
return css
}
ipc.on('theme-json-list', function (e, arg) { ipc.on('theme-json-list', function (e, arg) {
var files1 = fs.readdirSync(join(app.getAppPath(), '/source/themes')) fs.readdir(app.getPath("userData"), function (err, files) {
var file1List = files1.filter(function (file) { if (err || !files) throw err;
if (file.match(/\.thedesktheme$/)) { var fileList = files.filter(function (file) {
var tfile = join(app.getAppPath(), '/source/themes', file) if(file.match(/\.thedesktheme$/)){
return fs.statSync(tfile).isFile() && /.*\.thedesktheme$/.test(tfile) var tfile = join(app.getPath("userData"), file)
} else { return fs.statSync(tfile).isFile() && /.*\.thedesktheme$/.test(tfile)
return null }else{
} return null
}) }
var themes = [];
for (var i = 0; i < file1List.length; i++) {
var themecss = join(app.getAppPath(), '/source/themes', file1List[i]);
var json = JSON5.parse(fs.readFileSync(themecss, 'utf8'));
let compat = true
if (json.version) compat = false
themes.push({
name: json.name,
id: json.id,
compatible: compat,
default: true
}) })
} var themes = [];
var files2 = fs.readdirSync(app.getPath("userData")) for (var i = 0; i < fileList.length; i++) {
var file2List = files2.filter(function (file) { var themecss = join(app.getPath("userData"), fileList[i]);
if (file.match(/\.thedesktheme$/)) { var json = JSON5.parse(fs.readFileSync(themecss, 'utf8'));
var tfile = join(app.getPath("userData"), file) themes.push({
return fs.statSync(tfile).isFile() && /.*\.thedesktheme$/.test(tfile) name: json.name,
} else { id: json.id
return null })
} }
}) e.sender.webContents.send('theme-json-list-response', themes);
for (var i = 0; i < file2List.length; i++) { });
var themecss = join(app.getPath("userData"), file2List[i]);
var json = JSON5.parse(fs.readFileSync(themecss, 'utf8'));
let compat = true
if (json.version) compat = false
themes.push({
name: json.name,
id: json.id,
compatible: compat,
default: false
})
}
e.sender.webContents.send('theme-json-list-response', themes);
}) })
} }
exports.css = css; exports.css = css;

View File

@@ -28,7 +28,6 @@ function dl(mainWindow, lang_path, base, dirname) {
show: false show: false
}) })
var lang = fs.readFileSync(lang_path, 'utf8') var lang = fs.readFileSync(lang_path, 'utf8')
//updatewin.toggleDevTools()
updatewin.loadURL(base + lang + '/update.html') updatewin.loadURL(base + lang + '/update.html')
updatewin.webContents.once('dom-ready', () => { updatewin.webContents.once('dom-ready', () => {
updatewin.show() updatewin.show()

View File

@@ -1,5 +1,5 @@
// Create the Application's main menu // Create the Application's main menu
function templete(lang, mainWindow, packaged, dir, dirname) { function templete(lang, mainWindow, packaged, dir, dirname, frame) {
//フレーム //フレーム
if(lang !="ja" && lang != "en"){ if(lang !="ja" && lang != "en"){
lang = "en" lang = "en"
@@ -9,6 +9,11 @@ function templete(lang, mainWindow, packaged, dir, dirname) {
const app = electron.app; const app = electron.app;
const BrowserWindow = electron.BrowserWindow; const BrowserWindow = electron.BrowserWindow;
const join = require('path').join; const join = require('path').join;
ipc.on("frameCheck", function(e, arg) {
if(!frame) {
e.sender.webContents.send("frame", "");
}
});
const dict = { const dict = {
"application": { "application": {
"ja": "アプリケーション", "ja": "アプリケーション",

View File

@@ -188,8 +188,8 @@ function system(mainWindow, dir, lang, dirname) {
}) })
function mems() { function mems() {
var mem = os.totalmem() - os.freemem() var mem = os.totalmem() - os.freemem()
if (mainWindow && event.webContents) { if (mainWindow) {
event.webContents.send('memory', [mem, os.cpus()[0].model, os.totalmem(), os.cpus().length, os.uptime()]) event.webContents.send('memory', [mem, os.cpus()[0].model, os.totalmem()])
} }
} }
ipc.on('endmem', (e, arg) => { ipc.on('endmem', (e, arg) => {

View File

@@ -1,4 +1,5 @@
[ [
"TheDeskは自称ステイホームの必須アイテム",
"あと数秒でPCのファンが全力で回り始める", "あと数秒でPCのファンが全力で回り始める",
"カラムの数だけ夢があるがネットワークは逼迫する", "カラムの数だけ夢があるがネットワークは逼迫する",
"朝起きたらストリーミングが止まっていた…", "朝起きたらストリーミングが止まっていた…",
@@ -49,11 +50,5 @@
"N押すとトゥートのボックスが出て、すぐ打ち込める。", "N押すとトゥートのボックスが出て、すぐ打ち込める。",
"Xを押すとトゥートのボックスは出るけど、打ち込めない。その代わりもう一度押すと消せる。", "Xを押すとトゥートのボックスは出るけど、打ち込めない。その代わりもう一度押すと消せる。",
"トゥートした後ボックスを閉じるとかそのままにしておくとかは、設定で変えられます。", "トゥートした後ボックスを閉じるとかそのままにしておくとかは、設定で変えられます。",
"OpenStickerへの登録データ募集中", "ヌァ=スコ゜、ケエンョ゛ハー゛オセム゛ヌトョ!。シレモゥチャスモハァーワ」。チスョ「ラネ゛ワフン(ァクミス"
"Microsoft Store版のアップデートは向こうに止められてます",
"いのちの輝き版ロゴ",
"いのちの輝き版ロゴ",
"いのちの輝き版ロゴ",
"いのちの輝き版ロゴ",
"いのちの輝き版ロゴ"
] ]

View File

@@ -6,7 +6,6 @@
<link href="./css/tl.css" type="text/css" rel="stylesheet" /> <link href="./css/tl.css" type="text/css" rel="stylesheet" />
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" /> <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" />
<link href="./node_modules/@fortawesome/fontawesome-free/css/all.min.css" type="text/css" rel="stylesheet"> <link href="./node_modules/@fortawesome/fontawesome-free/css/all.min.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="./node_modules/grapheme-splitter/index.js"></script>
<title>TheDesk Nano</title> <title>TheDesk Nano</title>
<style> <style>
html { html {
@@ -16,7 +15,7 @@
height: 100vh; height: 100vh;
overflow: hidden; overflow: hidden;
font-family: sans-serif; font-family: sans-serif;
color: var(--text) !important; color: var(--color) !important;
} }
body { body {
@@ -45,7 +44,7 @@
textarea { textarea {
-webkit-app-region: no-drag; -webkit-app-region: no-drag;
color: var(--text) !important; color: var(--color) !important;
} }
::-webkit-scrollbar { ::-webkit-scrollbar {
@@ -83,16 +82,12 @@
.cvo { .cvo {
grid-template-rows: auto 1rem 1fr auto 2rem; grid-template-rows: auto 1rem 1fr auto 2rem;
} }
.voice {
display: none;
}
</style> </style>
</head> </head>
<body> <body>
<script type="text/javascript" src="./node_modules/jquery/dist/jquery.js"></script> <script type="text/javascript" src="./node_modules/jquery/dist/jquery.js"></script>
<script> <script>
var pwa = false
$.strip_tags = function(str, allowed) { $.strip_tags = function(str, allowed) {
if (!str) { if (!str) {
return ""; return "";
@@ -146,7 +141,7 @@
} }
</script> </script>
<script src="https://twemoji.maxcdn.com/2/twemoji.min.js?2.7"></script> <script src="https://twemoji.maxcdn.com/2/twemoji.min.js?2.7"></script>
<script type="text/javascript" src="./js/platform/first.js"></script> <script type="text/javascript" src="view/en/main.js"></script>
<script type="text/javascript" src="./js/post/status.js"></script> <script type="text/javascript" src="./js/post/status.js"></script>
<script type="text/javascript" src="./js/post/post.js"></script> <script type="text/javascript" src="./js/post/post.js"></script>
<script type="text/javascript" src="./js/post/use-txtbox.js"></script> <script type="text/javascript" src="./js/post/use-txtbox.js"></script>

View File

@@ -75,7 +75,7 @@
</head> </head>
<body class="center" style="overflow: hidden;"> <body class="center" style="overflow: hidden;">
<img src="./img/desk-animation.svg" id="leader" style="max-width: 62%;" /> <img src="./img/desk-animation.svg" style="max-width: 62%;" />
<h1>TheDesk</h1> <h1>TheDesk</h1>
<span id="ver"></span><br /> <span id="ver"></span><br />
<span class="loading"></span><br /> <span class="loading"></span><br />
@@ -84,12 +84,11 @@
<script> <script>
if (location.search) { if (location.search) {
var m = location.search.match(/\?ver=([0-9.]+)&codename=([a-zA-Z]+)&maxim=(.+)/) var m = location.search.match(/\?ver=([0-9.]+)&codename=([a-zA-Z]+)&maxim=(.+)/)
var maxim = decodeURI(m[3])
if(maxim == 'いのちの輝き版ロゴ') document.getElementById('leader').setAttribute('src', './img/2025.svg')
var ver = m[1] var ver = m[1]
var code = m[2] var code = m[2]
var maxim = m[3]
document.getElementById('ver').innerText = `${ver}(${code})` document.getElementById('ver').innerText = `${ver}(${code})`
document.getElementById('maxim').innerText = maxim document.getElementById('maxim').innerText = `${decodeURI(maxim)}`
} }
</script> </script>
</div> </div>

View File

@@ -1,6 +1,6 @@
{ {
"name": "thedesk", "name": "thedesk",
"version": "21.3.0", "version": "21.0.4",
"codename": "Mayu", "codename": "Mayu",
"description": "TheDesk is a Mastodon client for PC.", "description": "TheDesk is a Mastodon client for PC.",
"repository": "https://github.com/cutls/TheDesk", "repository": "https://github.com/cutls/TheDesk",
@@ -8,21 +8,14 @@
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
"construct": "cd view/make && node make --automatic && cd ../../", "construct": "cd view/make && node make --automatic && cd ../../",
"construct:store": "cd view/make && node make --automatic --store && cd ../../",
"dev": "npx electron ./ --dev", "dev": "npx electron ./ --dev",
"dist": "build --linux snap", "dist": "build --linux snap",
"watchview": "node view/make/make.js --automatic --watch", "watchview": "node view/make/make.js --automatic --watch",
"build:js": "node build.js", "build:js": "node build.js",
"build": "node view/make/make.js --automatic && npx electron-builder", "build": "node view/make/make.js --automatic && npx electron-builder",
"build:pwa": "node view/make/make.js --automatic --pwa", "build:all": "npx electron-builder --win --linux",
"build:win:web": "node view/make/make.js --automatic && npx electron-builder --win", "build:win": "npx electron-builder --win",
"build:win:msstore": "node view/make/make.js --automatic --store && npx electron-builder --win appx", "build:pwa": "node view/make/make.js --automatic --pwa"
"build:linux:web": "node view/make/make.js --automatic && npx electron-builder --linux",
"build:linux:snapstore": "node view/make/make.js --automatic --store && npx electron-builder --linux",
"build:mac:web": "node view/make/make.js --automatic && npx electron-builder --mac",
"build:mac:homebrew": "node view/make/make.js --automatic --store && npx electron-builder --mac",
"lint:fix": "eslint js --fix",
"lint": "eslint js"
}, },
"keywords": [ "keywords": [
"mastodon", "mastodon",
@@ -40,8 +33,7 @@
"url": "https://cutls.dev", "url": "https://cutls.dev",
"email": "p@cutls.com" "email": "p@cutls.com"
}, },
"contributor": [ "contributor": [{
{
"name": "とねぢ", "name": "とねぢ",
"url": "https://minohdon.jp/@toneji", "url": "https://minohdon.jp/@toneji",
"email": "solfa.tono@gmail.com" "email": "solfa.tono@gmail.com"
@@ -59,28 +51,28 @@
], ],
"license": "GPL-3.0", "license": "GPL-3.0",
"dependencies": { "dependencies": {
"@fortawesome/fontawesome-free": "^5.15.1", "@fortawesome/fontawesome-free": "^5.13.1",
"electron-dl": "^3.0.2", "custom-electron-titlebar": "^3.2.2-hotfix62",
"jimp": "^0.16.1", "electron-dl": "^3.0.1",
"jimp": "^0.14.0",
"jquery": "^3.5.1", "jquery": "^3.5.1",
"jquery-ui-dist": "^1.12.1", "jquery-ui-dist": "^1.12.1",
"json5": "^2.1.3", "json5": "^2.1.3",
"lodash": "^4.17.20", "lodash": "^4.17.15",
"materialize-css": "git://github.com/cutls/materialize#v1-dev", "materialize-css": "git://github.com/cutls/materialize#v1-dev",
"sumchecker": "^3.0.1", "sumchecker": "^3.0.1",
"sweetalert2": "^10.10.0", "sweetalert2": "^9.15.2",
"system-font-families": "^0.4.1", "system-font-families": "^0.4.1",
"vue": "^2.6.12" "vue": "^2.6.11"
}, },
"optionalDependencies": { "optionalDependencies": {
"itunes-nowplaying-mac": "0.3.1" "itunes-nowplaying-mac": "0.3.1"
}, },
"devDependencies": { "devDependencies": {
"chokidar": "^3.4.3", "chokidar": "^3.4.0",
"electron": "^10.1.5", "electron": "^9.0.5",
"electron-builder": "^22.9.1", "electron-builder": "^22.7.0",
"electron-rebuild": "^2.3.2", "electron-rebuild": "^1.11.0",
"eslint": "^7.13.0",
"readline-sync": "1.4.10" "readline-sync": "1.4.10"
}, },
"build": { "build": {
@@ -96,8 +88,8 @@
"icon": "build/thedesk.ico", "icon": "build/thedesk.ico",
"target": [ "target": [
"nsis", "nsis",
"appx", "portable",
"portable" "appx"
] ]
}, },
"appx": { "appx": {
@@ -119,7 +111,6 @@
"icon": "build/icons", "icon": "build/icons",
"target": [ "target": [
"zip", "zip",
"appImage",
"snap", "snap",
"deb" "deb"
], ],
@@ -136,4 +127,4 @@
}, },
"electronVersion": "9.0.5" "electronVersion": "9.0.5"
} }
} }

Binary file not shown.

View File

@@ -1,27 +0,0 @@
{
name: 'Black',
author: 'TheDesk',
desc: 'TheDesk Default Theme',
base: 'dark',
primary: {
background: '#212121',
subcolor: '#424242',
text: '#fff',
accent: '#004d40',
},
advanced: {
modal: '#000',
modalFooter: '#212121',
third: '#212121',
forth: '#333333',
bottom: '#424242',
emphasized: '#4e342e',
postbox: '#424242',
active: '#3f51b5',
selected: '#3f3f3f',
selectedWithShared: '#003a30',
},
id: 'black',
version: '2',
default: true
}

View File

@@ -1,27 +0,0 @@
{
name: 'Blue',
author: 'TheDesk',
desc: 'TheDesk Default Theme',
base: 'light',
primary: {
background: '#c9e1ec',
subcolor: '#dff1ff',
text: '#000',
accent: '#e0ffe4',
},
advanced: {
modal: '#b2ebf2',
modalFooter: '#2196f3',
third: '#90caf9',
forth: '#90caf9',
bottom: '#b6e6f5',
emphasized: '#c5e1a5',
postbox: '#dff1ff',
active: '#2f7bb7',
selected: '#9dcade',
selectedWithShared: '#c1dac4',
},
id: 'blue',
version: '2',
default: true
}

View File

@@ -1,27 +0,0 @@
{
name: 'Brown',
author: 'TheDesk',
desc: 'TheDesk Default Theme',
base: 'dark',
primary: {
background: '#261411',
subcolor: '#4e342e',
text: '#fff',
accent: '#004d40',
},
advanced: {
modal: '#261411',
modalFooter: '#261411',
third: '#4e342e',
forth: '#4e342e',
bottom: '#4e342e',
emphasized: '#0d47a1',
postbox: '#4e342e',
active: '#827717',
selected: '#6d352b',
selectedWithShared: '#003a30',
},
id: 'brown',
version: '2',
default: true
}

View File

@@ -1,27 +0,0 @@
{
name: 'Green',
author: 'TheDesk',
desc: 'TheDesk Default Theme',
base: 'light',
primary: {
background: '#c8e6c9',
subcolor: '#a5d6a7',
text: '#000',
accent: '#ffcc80',
},
advanced: {
modal: '#81c784',
modalFooter: '#81c784',
third: '#a5d6a7',
forth: '#81c784',
bottom: '#c5e1a5',
emphasized: '#9e9d24',
postbox: '#a5d6a7',
active: '#33691e',
selected: '#78c17a',
selectedWithShared: '#caa266',
},
id: 'green',
version: '2',
default: true
}

View File

@@ -1,27 +0,0 @@
{
name: 'Indigo',
author: 'TheDesk',
desc: 'TheDesk Default Theme',
base: 'dark',
primary: {
background: '#031833',
subcolor: '#1a237e',
text: '#fff',
accent: '#004d40',
},
advanced: {
modal: '#0d1351',
modalFooter: '#031833',
third: '#0d1351',
forth: '#0d47a1',
bottom: '#0d1351',
emphasized: '#4e342e',
postbox: '#1a237e',
active: '#00acc1',
selected: '#214f8a',
selectedWithShared: '#003a30',
},
id: 'indigo',
version: '2',
default: true
}

View File

@@ -1,27 +0,0 @@
{
name: 'Polar Night',
author: 'TheDesk',
desc: 'TheDesk Default Theme',
base: 'dark',
primary: {
background: '#2e3440',
subcolor: '#434c5e',
text: '#ffffff',
accent: '#2d3b58',
},
advanced: {
modal: '#3b4252',
modalFooter: '#485166',
third: '#434c5e',
forth: '#4c566a',
bottom: '#3b4252',
emphasized: '#2f4b86',
postbox: '#434c5e',
active: '#2f4b86',
selected: '#464f61',
selectedWithShared: '#3e527e',
},
id: 'polar',
version: '2',
default: true
}

View File

@@ -1,27 +0,0 @@
{
name: 'Snow Storm',
author: 'TheDesk',
desc: 'TheDesk Default Theme',
base: 'light',
primary: {
background: '#eceff4',
subcolor: '#d8dee9',
text: '#36425a',
accent: '#c3d4e6',
},
advanced: {
modal: '#e5e9f0',
modalFooter: '#b2bed4',
third: '#d8dee9',
forth: '#4c566a',
bottom: '#eeeeee',
emphasized: '#88c0d0',
postbox: '#d8dee9',
active: '#81a1c1',
selected: '#b4bdd0',
selectedWithShared: '#a3afbb',
},
id: 'snow',
version: '2',
default: true
}

View File

@@ -1,27 +0,0 @@
{
name: 'White',
author: 'TheDesk',
desc: 'TheDesk Default Theme',
base: 'light',
primary: {
background: '#fff',
subcolor: '#fff',
text: '#000',
accent: '#cfd8dc',
},
advanced: {
modal: '#fff',
modalFooter: '#fafafa',
third: '#e0e0e0',
forth: '#fff',
bottom: '#eeeeee',
emphasized: '#81c784',
postbox: '#fff',
active: '#009688',
selected: '#c0c0c0',
selectedWithShared: '#b2babd',
},
id: 'white',
version: '2',
default: true
}

View File

@@ -1,7 +1,5 @@
{ {
"latest":[], "latest":[],
"3.2.0": [],
"3.1.5": [],
"3.1.4": [ "3.1.4": [
"リモート限定の連合タイムライン" "リモート限定の連合タイムライン"
], ],

View File

@@ -3,12 +3,12 @@
<head> <head>
<title>Account Manager - TheDesk</title> <title>Account Manager - TheDesk</title>
<meta content="width=device-width,initial-scale=1.0" name="viewport" /> <meta content="width=device-width,initial-scale=1.0" name="viewport" />
<link href="../../css/themes.css" type="text/css" rel="stylesheet">
<link <link
href="../../@@node_base@@/materialize-css/dist/css/materialize.css" href="../../@@node_base@@/materialize-css/dist/css/materialize.css"
type="text/css" type="text/css"
rel="stylesheet" rel="stylesheet"
/> />
<link href="../../css/themes.css" type="text/css" rel="stylesheet" />
<link href="../../css/master.css" type="text/css" rel="stylesheet" /> <link href="../../css/master.css" type="text/css" rel="stylesheet" />
<link href="../../css/tl.css" rel="stylesheet" type="text/css" /> <link href="../../css/tl.css" rel="stylesheet" type="text/css" />
<link href="../../css/userdata.css" rel="stylesheet" type="text/css" /> <link href="../../css/userdata.css" rel="stylesheet" type="text/css" />
@@ -26,7 +26,7 @@
</script> </script>
<script type="text/javascript" src="https://cdn.crowdin.com/jipt/jipt.js"></script> <script type="text/javascript" src="https://cdn.crowdin.com/jipt/jipt.js"></script>
@@comment-end@@ @@comment-end@@
@@pwa@@ @@store@@ @@pwa@@
</head> </head>
<body id="mainView" class="@@pwaClass@@"> <body id="mainView" class="@@pwaClass@@">
@@ -69,7 +69,7 @@
<div class="pwa"> <div class="pwa">
@@codesetupwarn@@<br /> @@codesetupwarn@@<br />
<label> <label>
<input type="checkbox" class="filled-in" id="linux" /> <input type="checkbox" class="filled-in checked" id="linux" checked />
<span>@@codesetup@@</span> <span>@@codesetup@@</span>
</label> </label>
<br /> <br />
@@ -128,17 +128,17 @@
<div id="instance-data"> <div id="instance-data">
Some instance data by Some instance data by
<a href="https://instances.social" target="_blank">instances.social API</a><br /> <a href="https://instances.social" target="_blank">instances.social API</a><br />
<h5 id="ins-title"></h5> <h5 id="ins-title" class="ins-loading"></h5>
Administered by:<a id="ins-admin"></a><br /> Administered by:<a id="ins-admin" class="ins-loading"></a><br />
<span id="ins-desc"></span><br /> <span id="ins-desc" class="ins-loading"></span><br />
<img src="../../img/loading.svg" id="ins-prof" width="200" /><br /> <img src="../../img/loading.svg" id="ins-prof" width="200" /><br />
<br /> <br />
@@domain@@:<span id="ins-name"></span><br /> @@domain@@:<span id="ins-name" class="ins-loading"></span><br />
@@connect@@:<span id="ins-connect"></span>@@ko@@<br /> @@connect@@:<span id="ins-connect" class="ins-loading"></span>@@ko@@<br />
@@toots@@:<span id="ins-toot"></span>@@ko@@<br /> @@toots@@:<span id="ins-toot" class="ins-loading"></span>@@ko@@<br />
@@users@@:<span id="ins-user"></span>@@users@@<br /> @@users@@:<span id="ins-user" class="ins-loading"></span>@@users@@<br />
@@safety@@:<span id="ins-per"></span>%<br /> @@safety@@:<span id="ins-per" class="ins-loading"></span>%<br />
@@ver@@:<span id="ins-ver"></span>@<span id="ins-upd"></span><br /> @@ver@@:<span id="ins-ver" class="ins-loading"></span>@<span id="ins-upd" class="ins-loading"></span><br />
</div> </div>
</div> </div>
<script type="text/javascript" src="../../js/ui/theme.js"></script> <script type="text/javascript" src="../../js/ui/theme.js"></script>

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,5 @@
{ {
"draghere": "Drag here to upload", "draghere": "Drag here to upload",
"nowOffline": "OFFLINE: all of your post is in the draft box and you should reload after re-connect to the Internet",
"reOnline": "Now we are in the Internet, you should reload...",
"close": "Close", "close": "Close",
"webSrc": "Search on Web", "webSrc": "Search on Web",
"tsSrc": "Search on tootsearch", "tsSrc": "Search on tootsearch",
@@ -47,7 +45,6 @@
"thingsEmoji": "Emojis of tools", "thingsEmoji": "Emojis of tools",
"symbolEmoji": "Emojis of symbols", "symbolEmoji": "Emojis of symbols",
"flagsEmoji": "Emojis of flags", "flagsEmoji": "Emojis of flags",
"draft": "Draft",
"poll": "Poll", "poll": "Poll",
"pollDdisabled": "Polls: Disabled", "pollDdisabled": "Polls: Disabled",
"pollProvider": "Provider of Poll", "pollProvider": "Provider of Poll",
@@ -133,7 +130,7 @@
"notf": "Notifications", "notf": "Notifications",
"bookmark": "Bookmarks", "bookmark": "Bookmarks",
"showThisTL": "Show this TL:", "showThisTL": "Show this TL:",
"webviewWarn": "TweetDeck with customed TJDeck(<a href='https://gist.github.com/cutls/8787a55d2c1c53274e68a427966046a6' target='_blank'>Code</a>/<a href='https://gist.github.com/totoraj930/d1394dadb51d75666a76829f61e7280c' target='_blank'>TJDeck</a>).", "webviewWarn": "TweetDeck with customed TJDeck(<a href='https://gist.github.com/cutls/8787a55d2c1c53274e68a427966046a6' target='_blank'>Code</a>/<a href='https://gist.github.com/totoraj930/d1394dadb51d75666a76829f61e7280c' target='_blank'>TJDeck</a>). Keyboard shortcuts will irritate you. When you feel so, you check 'Prefer WebView' on top of the column.",
"add": "Add", "add": "Add",
"search": "Search", "search": "Search",
"sortSet": "Sort", "sortSet": "Sort",

View File

@@ -71,7 +71,6 @@
"lang_post_btn3": "Continue to post", "lang_post_btn3": "Continue to post",
"lang_post_unfinishedMedia": "The server has not finished processing your media. Retry.", "lang_post_unfinishedMedia": "The server has not finished processing your media. Retry.",
"lang_post_retry": "Retry", "lang_post_retry": "Retry",
"lang_post_offline": "Add to the drafts because of offline",
"lang_status_favWarn": "It will take a miunte to favourite a remote toot.", "lang_status_favWarn": "It will take a miunte to favourite a remote toot.",
"lang_status_btWarn": "It will take a miunte to boost a remote toot.", "lang_status_btWarn": "It will take a miunte to boost a remote toot.",
"lang_status_follow": "Follow", "lang_status_follow": "Follow",
@@ -88,9 +87,6 @@
"lang_status_endorse": "Feature on profile", "lang_status_endorse": "Feature on profile",
"lang_status_followers": "Followers", "lang_status_followers": "Followers",
"lang_status_active": "Last status", "lang_status_active": "Last status",
"lang_secure_draft": "Add to draft",
"lang_secure_useThis": "Use this",
"lang_secure_deleteThis": "Delete this",
"lang_suggest_nodata": "Please get emojis list in order to show suggestion.", "lang_suggest_nodata": "Please get emojis list in order to show suggestion.",
"lang_usetxtbox_reply": "Reply Mode. Ctrl+Shift+C to clear.", "lang_usetxtbox_reply": "Reply Mode. Ctrl+Shift+C to clear.",
"lang_cards_check": " check", "lang_cards_check": " check",
@@ -135,17 +131,13 @@
"lang_layout_linkana": "Auto Link Analyzer", "lang_layout_linkana": "Auto Link Analyzer",
"lang_layout_linkanades": "Auto link analyzer", "lang_layout_linkanades": "Auto link analyzer",
"lang_layout_tts": "Text to speech ", "lang_layout_tts": "Text to speech ",
"lang_layout_reconnect": "Reload", "lang_layout_reconnect": "Reload this column",
"lang_layout_headercolor": "Header color of this column", "lang_layout_headercolor": "Header color of this column",
"lang_layout_nodata": "[No data]<br>F5/⌘+R to reload", "lang_layout_nodata": "[No data]<br>F5/⌘+R to reload",
"lang_layout_dm": "Direct Message", "lang_layout_dm": "Direct Message",
"lang_layout_webviewmode": "Prefer WebView", "lang_layout_webviewmode": "Prefer WebView",
"lang_layout_excluded": "Excluded type of notification", "lang_excluded": "Excluded type of notification",
"lang_layout_mention": "Mentions", "lang_layout_excludingbt": "Show BT mode(OFF/Exclude BT/Only BT)",
"lang_layout_fav": "Favourites",
"lang_layout_bt": "Boosts",
"lang_layout_poll": "Polls",
"lang_layout_excludingbt": "Show BT mode",
"lang_layout_leftFold": "Stack to the left", "lang_layout_leftFold": "Stack to the left",
"lang_layout_leftUnfold": "Dock on the right", "lang_layout_leftUnfold": "Dock on the right",
"lang_layout_deleteColumn": "Delete this column", "lang_layout_deleteColumn": "Delete this column",
@@ -230,7 +222,6 @@
"lang_parse_html": "Show embed HTML", "lang_parse_html": "Show embed HTML",
"lang_parse_notffilter": "Show this user's notifications", "lang_parse_notffilter": "Show this user's notifications",
"lang_parse_hidden": "Unvisible quoted toot", "lang_parse_hidden": "Unvisible quoted toot",
"lang_parse_disconnected": "Streaming has been disconnected(retry after 3s)",
"lang_misskeyparse_renote": "Repost", "lang_misskeyparse_renote": "Repost",
"lang_misskeyparse_renoteqt": "Renote", "lang_misskeyparse_renoteqt": "Renote",
"lang_misskeyparse_reaction": "Reaction", "lang_misskeyparse_reaction": "Reaction",
@@ -245,7 +236,6 @@
"lang_misskeyparse_reacted": " reacted your following post.", "lang_misskeyparse_reacted": " reacted your following post.",
"lang_setting_time": "Time format:{{set}}", "lang_setting_time": "Time format:{{set}}",
"lang_setting_theme": "Theme:{{set}}", "lang_setting_theme": "Theme:{{set}}",
"lang_setting_compat": "Compatible",
"lang_setting_nsfw": "Sensitive media:{{set}}", "lang_setting_nsfw": "Sensitive media:{{set}}",
"lang_setting_cw": "CW:{{set}}", "lang_setting_cw": "CW:{{set}}",
"lang_setting_cwtext": "Default CW text:{{set}}", "lang_setting_cwtext": "Default CW text:{{set}}",

View File

@@ -24,11 +24,10 @@
"nativenotf": "Native notification", "nativenotf": "Native notification",
"nnwarn": "This does not work on Windows Portable ver.", "nnwarn": "This does not work on Windows Portable ver.",
"nntest": "Notification test", "nntest": "Notification test",
"width": "Width of columns", "minwidth": "Minimum width of columns",
"widthwarn": "Scroll bar will be shown when your window size is more than ammounts of columns.", "minwidthwarn": "Scroll bar will be shown when your window size is more than ammounts of columns.",
"fixwidth": "Minimum width of TweetDeck browser", "fixwidth": "Minimum width of TweetDeck browser",
"fixwidthwarn": "", "fixwidthwarn": "",
"margin": "Margin between timelines",
"above": "above", "above": "above",
"font": "Font", "font": "Font",
"fontwarn": "Select your favorite font to 'Select'(Windows/ macOS only)", "fontwarn": "Select your favorite font to 'Select'(Windows/ macOS only)",
@@ -44,26 +43,19 @@
"srcUrl": "Search engine", "srcUrl": "Search engine",
"srcUrlWarn": "{q} will be replaced to query.", "srcUrlWarn": "{q} will be replaced to query.",
"themeSel": "Select theme", "themeSel": "Select theme",
"customtheme": "Edit and add themes", "customtheme": "Edit and add custom themes",
"customthemeDirection": "Color scheme", "customthemeDirection": "Color scheme",
"advanced": "Advanced options", "advanced": "Advanced options(6 additional colors)",
"advancedWarn": "", "advancedWarn": "Advanced options will be <i>null</i> if you set nothing, while basic 3 options will be white(<i>fff</i>). They(adv. options) will be reset if you saved with advanced panel closed.",
"use": "Use this", "active": "Background of Show or CW buttons, selected options...",
"copyFrom": "Copy from", "modal": "Background of modals",
"bg": "Background color", "bottom": "Background of bottom bar",
"subcolor": "Distinguishable from background", "postbox": "Background of post box and menu",
"subcolor": "Subcolor, has harmony with secondary color",
"primary": "Background color",
"secondarycolor": "Background of components",
"text": "Text color", "text": "Text color",
"accent": "Background of boosts", "accent": "Background of boosts",
"modal": "Background of modal window",
"modalFooter": "Background of modal window's footer",
"thirdColor": "Backgroud of tag buttons, etc(near to Background)",
"forthColor": "Title bar(same scheme to Background)",
"bottom": "Background of menu-bar at bottom of window",
"emphasized": "Emphasized toot's background",
"postbox": "Background of post-box and menu",
"active": "Background of 'active' elements",
"selected": "Background of selected with arrow keys",
"selectedWithShare": "Background of selected with arrow keys(boosted toots)",
"add_new": "Add new", "add_new": "Add new",
"name": "Name", "name": "Name",
"desc": "About this theme", "desc": "About this theme",
@@ -109,8 +101,8 @@
"or": "or", "or": "or",
"imgheight": "Height of images", "imgheight": "Height of images",
"imgheightwarn": "Option:Set \"full\" to uncrop.", "imgheightwarn": "Option:Set \"full\" to uncrop.",
"ticker": "Enable OpenSticker", "ticker": "Enable #InstanceTicker",
"tickerwarn": "Show the instance name and favicon of tooters <a href=\"https://opensticker.0px.io\">About OpenSticker</a>", "tickerwarn": "Show colorful stickers about the server. <a href=\"https://github.com/MiyonMiyon/InstanceTicker_List\">About #InstanceTicker</a> (c)2018-2020 MiyonMiyon. Released under the MIT License.",
"animation": "Animation of timelines", "animation": "Animation of timelines",
"markers": "Markers(mark as read) on HTL and notifications", "markers": "Markers(mark as read) on HTL and notifications",
"markerswarn": "Mastodon 3.0~. Shared on WebUI and third-party supported clients.", "markerswarn": "Mastodon 3.0~. Shared on WebUI and third-party supported clients.",

View File

@@ -1,7 +1,5 @@
{ {
"draghere": "Drag here to upload", "draghere": "Drag here to upload",
"nowOffline": "OFFLINE: all of your post is in the draft box and you should reload after re-connect to the Internet",
"reOnline": "Now we are in the Internet, you should reload...",
"close": "Close", "close": "Close",
"webSrc": "Search on Web", "webSrc": "Search on Web",
"tsSrc": "Search on tootsearch", "tsSrc": "Search on tootsearch",
@@ -47,7 +45,6 @@
"thingsEmoji": "Emojis of tools", "thingsEmoji": "Emojis of tools",
"symbolEmoji": "Emojis of symbols", "symbolEmoji": "Emojis of symbols",
"flagsEmoji": "Emojis of flags", "flagsEmoji": "Emojis of flags",
"draft": "Draft",
"poll": "Poll", "poll": "Poll",
"pollDdisabled": "Polls: Disabled", "pollDdisabled": "Polls: Disabled",
"pollProvider": "Provider of Poll", "pollProvider": "Provider of Poll",
@@ -133,7 +130,7 @@
"notf": "Notifications", "notf": "Notifications",
"bookmark": "Bookmarks", "bookmark": "Bookmarks",
"showThisTL": "Show this TL:", "showThisTL": "Show this TL:",
"webviewWarn": "TweetDeck with customed TJDeck(<a href='https://gist.github.com/cutls/8787a55d2c1c53274e68a427966046a6' target='_blank'>Code</a>/<a href='https://gist.github.com/totoraj930/d1394dadb51d75666a76829f61e7280c' target='_blank'>TJDeck</a>).", "webviewWarn": "TweetDeck with customed TJDeck(<a href='https://gist.github.com/cutls/8787a55d2c1c53274e68a427966046a6' target='_blank'>Code</a>/<a href='https://gist.github.com/totoraj930/d1394dadb51d75666a76829f61e7280c' target='_blank'>TJDeck</a>). Keyboard shortcuts will irritate you. When you feel so, you check 'Prefer WebView' on top of the column.",
"add": "Add", "add": "Add",
"search": "Search", "search": "Search",
"sortSet": "Sort", "sortSet": "Sort",

View File

@@ -71,7 +71,6 @@
"lang_post_btn3": "Continue to post", "lang_post_btn3": "Continue to post",
"lang_post_unfinishedMedia": "The server has not finished processing your media. Retry.", "lang_post_unfinishedMedia": "The server has not finished processing your media. Retry.",
"lang_post_retry": "Retry", "lang_post_retry": "Retry",
"lang_post_offline": "Add to the drafts because of offline",
"lang_status_favWarn": "It will take a miunte to favourite a remote toot.", "lang_status_favWarn": "It will take a miunte to favourite a remote toot.",
"lang_status_btWarn": "It will take a miunte to boost a remote toot.", "lang_status_btWarn": "It will take a miunte to boost a remote toot.",
"lang_status_follow": "Follow", "lang_status_follow": "Follow",
@@ -88,9 +87,6 @@
"lang_status_endorse": "Feature on profile", "lang_status_endorse": "Feature on profile",
"lang_status_followers": "Followers", "lang_status_followers": "Followers",
"lang_status_active": "Last status", "lang_status_active": "Last status",
"lang_secure_draft": "Add to draft",
"lang_secure_useThis": "Use this",
"lang_secure_deleteThis": "Delete this",
"lang_suggest_nodata": "Please get emojis list in order to show suggestion.", "lang_suggest_nodata": "Please get emojis list in order to show suggestion.",
"lang_usetxtbox_reply": "Reply Mode. Ctrl+Shift+C to clear.", "lang_usetxtbox_reply": "Reply Mode. Ctrl+Shift+C to clear.",
"lang_cards_check": " check", "lang_cards_check": " check",
@@ -135,17 +131,13 @@
"lang_layout_linkana": "Auto Link Analyzer", "lang_layout_linkana": "Auto Link Analyzer",
"lang_layout_linkanades": "Auto link analyzer", "lang_layout_linkanades": "Auto link analyzer",
"lang_layout_tts": "Text to speech ", "lang_layout_tts": "Text to speech ",
"lang_layout_reconnect": "Reload", "lang_layout_reconnect": "Reload this column",
"lang_layout_headercolor": "Header color of this column", "lang_layout_headercolor": "Header color of this column",
"lang_layout_nodata": "[No data]<br>F5/⌘+R to reload", "lang_layout_nodata": "[No data]<br>F5/⌘+R to reload",
"lang_layout_dm": "Direct Message", "lang_layout_dm": "Direct Message",
"lang_layout_webviewmode": "Prefer WebView", "lang_layout_webviewmode": "Prefer WebView",
"lang_layout_excluded": "Excluded type of notification", "lang_excluded": "Excluded type of notification",
"lang_layout_mention": "Mentions", "lang_layout_excludingbt": "Show BT mode(OFF/Exclude BT/Only BT)",
"lang_layout_fav": "Favourites",
"lang_layout_bt": "Boosts",
"lang_layout_poll": "Polls",
"lang_layout_excludingbt": "Show BT mode",
"lang_layout_leftFold": "Stack to the left", "lang_layout_leftFold": "Stack to the left",
"lang_layout_leftUnfold": "Dock on the right", "lang_layout_leftUnfold": "Dock on the right",
"lang_layout_deleteColumn": "Delete this column", "lang_layout_deleteColumn": "Delete this column",
@@ -230,7 +222,6 @@
"lang_parse_html": "Show embed HTML", "lang_parse_html": "Show embed HTML",
"lang_parse_notffilter": "Show this user's notifications", "lang_parse_notffilter": "Show this user's notifications",
"lang_parse_hidden": "Unvisible quoted toot", "lang_parse_hidden": "Unvisible quoted toot",
"lang_parse_disconnected": "Streaming has been disconnected(retry after 3s)",
"lang_misskeyparse_renote": "Repost", "lang_misskeyparse_renote": "Repost",
"lang_misskeyparse_renoteqt": "Renote", "lang_misskeyparse_renoteqt": "Renote",
"lang_misskeyparse_reaction": "Reaction", "lang_misskeyparse_reaction": "Reaction",
@@ -245,7 +236,6 @@
"lang_misskeyparse_reacted": " reacted your following post.", "lang_misskeyparse_reacted": " reacted your following post.",
"lang_setting_time": "Time format:{{set}}", "lang_setting_time": "Time format:{{set}}",
"lang_setting_theme": "Theme:{{set}}", "lang_setting_theme": "Theme:{{set}}",
"lang_setting_compat": "Compatible",
"lang_setting_nsfw": "Sensitive media:{{set}}", "lang_setting_nsfw": "Sensitive media:{{set}}",
"lang_setting_cw": "CW:{{set}}", "lang_setting_cw": "CW:{{set}}",
"lang_setting_cwtext": "Default CW text:{{set}}", "lang_setting_cwtext": "Default CW text:{{set}}",

View File

@@ -24,11 +24,10 @@
"nativenotf": "Native notification", "nativenotf": "Native notification",
"nnwarn": "This does not work on Windows Portable ver.", "nnwarn": "This does not work on Windows Portable ver.",
"nntest": "Notification test", "nntest": "Notification test",
"width": "Width of columns", "minwidth": "Minimum width of columns",
"widthwarn": "Scroll bar will be shown when your window size is more than ammounts of columns.", "minwidthwarn": "Scroll bar will be shown when your window size is more than ammounts of columns.",
"fixwidth": "Minimum width of TweetDeck browser", "fixwidth": "Minimum width of TweetDeck browser",
"fixwidthwarn": "", "fixwidthwarn": "",
"margin": "Margin between timelines",
"above": "above", "above": "above",
"font": "Font", "font": "Font",
"fontwarn": "Select your favorite font to 'Select'(Windows/ macOS only)", "fontwarn": "Select your favorite font to 'Select'(Windows/ macOS only)",
@@ -44,26 +43,19 @@
"srcUrl": "Search engine", "srcUrl": "Search engine",
"srcUrlWarn": "{q} will be replaced to query.", "srcUrlWarn": "{q} will be replaced to query.",
"themeSel": "Select theme", "themeSel": "Select theme",
"customtheme": "Edit and add themes", "customtheme": "Edit and add custom themes",
"customthemeDirection": "Color scheme", "customthemeDirection": "Color scheme",
"advanced": "Advanced options", "advanced": "Advanced options(6 additional colors)",
"advancedWarn": "", "advancedWarn": "Advanced options will be <i>null</i> if you set nothing, while basic 3 options will be white(<i>fff</i>). They(adv. options) will be reset if you saved with advanced panel closed.",
"use": "Use this", "active": "Background of Show or CW buttons, selected options...",
"copyFrom": "Copy from", "modal": "Background of modals",
"bg": "Background color", "bottom": "Background of bottom bar",
"subcolor": "Distinguishable from background", "postbox": "Background of post box and menu",
"subcolor": "Subcolor, has harmony with secondary color",
"primary": "Background color",
"secondarycolor": "Background of components",
"text": "Text color", "text": "Text color",
"accent": "Background of boosts", "accent": "Background of boosts",
"modal": "Background of modal window",
"modalFooter": "Background of modal window's footer",
"thirdColor": "Backgroud of tag buttons, etc(near to Background)",
"forthColor": "Title bar(same scheme to Background)",
"bottom": "Background of menu-bar at bottom of window",
"emphasized": "Emphasized toot's background",
"postbox": "Background of post-box and menu",
"active": "Background of 'active' elements",
"selected": "Background of selected with arrow keys",
"selectedWithShare": "Background of selected with arrow keys(boosted toots)",
"add_new": "Add new", "add_new": "Add new",
"name": "Name", "name": "Name",
"desc": "About this theme", "desc": "About this theme",
@@ -109,8 +101,8 @@
"or": "or", "or": "or",
"imgheight": "Height of images", "imgheight": "Height of images",
"imgheightwarn": "Option:Set \"full\" to uncrop.", "imgheightwarn": "Option:Set \"full\" to uncrop.",
"ticker": "Enable OpenSticker", "ticker": "Enable #InstanceTicker",
"tickerwarn": "Show the instance name and favicon of tooters <a href=\"https://opensticker.0px.io\">About OpenSticker</a>", "tickerwarn": "Show colorful stickers about the server. <a href=\"https://github.com/MiyonMiyon/InstanceTicker_List\">About #InstanceTicker</a> (c)2018-2020 MiyonMiyon. Released under the MIT License.",
"animation": "Animation of timelines", "animation": "Animation of timelines",
"markers": "Markers(mark as read) on HTL and notifications", "markers": "Markers(mark as read) on HTL and notifications",
"markerswarn": "Mastodon 3.0~. Shared on WebUI and third-party supported clients.", "markerswarn": "Mastodon 3.0~. Shared on WebUI and third-party supported clients.",

View File

@@ -1,7 +1,5 @@
{ {
"draghere": "Плъзнете тук за да качите", "draghere": "Плъзнете тук за да качите",
"nowOffline": "OFFLINE: all of your post is in the draft box and you should reload after re-connect to the Internet",
"reOnline": "Now we are in the Internet, you should reload...",
"close": "Затвори", "close": "Затвори",
"webSrc": "Search on Web", "webSrc": "Search on Web",
"tsSrc": "Search on tootsearch", "tsSrc": "Search on tootsearch",
@@ -47,7 +45,6 @@
"thingsEmoji": "Емоти с инструменти", "thingsEmoji": "Емоти с инструменти",
"symbolEmoji": "Емоти със символи", "symbolEmoji": "Емоти със символи",
"flagsEmoji": "Емоти с флагове", "flagsEmoji": "Емоти с флагове",
"draft": "Draft",
"poll": "Анкета", "poll": "Анкета",
"pollDdisabled": "Анкети: Деактивирани", "pollDdisabled": "Анкети: Деактивирани",
"pollProvider": "Доставчик на Анкета", "pollProvider": "Доставчик на Анкета",

View File

@@ -71,7 +71,6 @@
"lang_post_btn3": "Продължете към публикуването", "lang_post_btn3": "Продължете към публикуването",
"lang_post_unfinishedMedia": "The server has not finished processing your media. Retry.", "lang_post_unfinishedMedia": "The server has not finished processing your media. Retry.",
"lang_post_retry": "Retry", "lang_post_retry": "Retry",
"lang_post_offline": "Add to the drafts because of offline",
"lang_status_favWarn": "Ще отнеме минута раздумката отдалечено да стане любима.", "lang_status_favWarn": "Ще отнеме минута раздумката отдалечено да стане любима.",
"lang_status_btWarn": "Ще отнеме минута раздумката отдалечено да бъде подсилена.", "lang_status_btWarn": "Ще отнеме минута раздумката отдалечено да бъде подсилена.",
"lang_status_follow": "Следване", "lang_status_follow": "Следване",
@@ -88,9 +87,6 @@
"lang_status_endorse": "Функция в профила", "lang_status_endorse": "Функция в профила",
"lang_status_followers": "Последователи", "lang_status_followers": "Последователи",
"lang_status_active": "Последно състояние", "lang_status_active": "Последно състояние",
"lang_secure_draft": "Add to draft",
"lang_secure_useThis": "Use this",
"lang_secure_deleteThis": "Изтрийте тази раздумка",
"lang_suggest_nodata": "Моля, вземете списък с емотикони за да покажете състояние.", "lang_suggest_nodata": "Моля, вземете списък с емотикони за да покажете състояние.",
"lang_usetxtbox_reply": "Режим на отговор. Ctrl+Shift+C за изчистване.", "lang_usetxtbox_reply": "Режим на отговор. Ctrl+Shift+C за изчистване.",
"lang_cards_check": " проверка", "lang_cards_check": " проверка",
@@ -140,11 +136,7 @@
"lang_layout_nodata": "[Няма данни]<br>F5/⌘+R за презареждане", "lang_layout_nodata": "[Няма данни]<br>F5/⌘+R за презареждане",
"lang_layout_dm": "Директни съобщения", "lang_layout_dm": "Директни съобщения",
"lang_layout_webviewmode": "Предпочитания за WebView", "lang_layout_webviewmode": "Предпочитания за WebView",
"lang_layout_excluded": "Excluded type of notification", "lang_excluded": "Изключване на вид уведомление",
"lang_layout_mention": "Mentions",
"lang_layout_fav": "Favourites",
"lang_layout_bt": "Boosts",
"lang_layout_poll": "Polls",
"lang_layout_excludingbt": "Показване в BT режим (ИЗКЛ./Изключване BT/ Само в BT)", "lang_layout_excludingbt": "Показване в BT режим (ИЗКЛ./Изключване BT/ Само в BT)",
"lang_layout_leftFold": "Стъпка наляво", "lang_layout_leftFold": "Стъпка наляво",
"lang_layout_leftUnfold": "Док отдясно", "lang_layout_leftUnfold": "Док отдясно",
@@ -230,7 +222,6 @@
"lang_parse_html": "Показване на вграденият HTML код", "lang_parse_html": "Показване на вграденият HTML код",
"lang_parse_notffilter": "Показване на известията от този потребител", "lang_parse_notffilter": "Показване на известията от този потребител",
"lang_parse_hidden": "Unvisible quoted toot", "lang_parse_hidden": "Unvisible quoted toot",
"lang_parse_disconnected": "Streaming has been disconnected(retry after 3s)",
"lang_misskeyparse_renote": "Повторно публикуване", "lang_misskeyparse_renote": "Повторно публикуване",
"lang_misskeyparse_renoteqt": "Повторна бележка", "lang_misskeyparse_renoteqt": "Повторна бележка",
"lang_misskeyparse_reaction": "Реакция", "lang_misskeyparse_reaction": "Реакция",
@@ -245,7 +236,6 @@
"lang_misskeyparse_reacted": " реагирали на следващата ви публикация.", "lang_misskeyparse_reacted": " реагирали на следващата ви публикация.",
"lang_setting_time": "Времеви формат:{{set}}", "lang_setting_time": "Времеви формат:{{set}}",
"lang_setting_theme": "Тема:{{set}}", "lang_setting_theme": "Тема:{{set}}",
"lang_setting_compat": "Compatible",
"lang_setting_nsfw": "NSFW:{{set}}", "lang_setting_nsfw": "NSFW:{{set}}",
"lang_setting_cw": "CW:{{set}}", "lang_setting_cw": "CW:{{set}}",
"lang_setting_cwtext": "Default CW text:{{set}}", "lang_setting_cwtext": "Default CW text:{{set}}",

View File

@@ -24,11 +24,10 @@
"nativenotf": "Вътрешно уведомяване", "nativenotf": "Вътрешно уведомяване",
"nnwarn": "Това не работи в Windows Portable вер.", "nnwarn": "Това не работи в Windows Portable вер.",
"nntest": "Тест за уведомяване", "nntest": "Тест за уведомяване",
"width": "Width of columns", "minwidth": "Минимална ширина на колоните",
"widthwarn": "Scroll bar will be shown when your window size is more than ammounts of columns.", "minwidthwarn": "Лентата за превъртане ще се покаже, когато размерът на прозореца е по-голям от размера на колони.",
"fixwidth": "Минимална ширина на браузъра TweetDeck", "fixwidth": "Минимална ширина на браузъра TweetDeck",
"fixwidthwarn": "", "fixwidthwarn": "",
"margin": "Margin between timelines",
"above": "над", "above": "над",
"font": "Шрифт", "font": "Шрифт",
"fontwarn": "Изберете любимия си шрифт с „Избор“ (само за Windows / macOS)", "fontwarn": "Изберете любимия си шрифт с „Избор“ (само за Windows / macOS)",
@@ -46,24 +45,17 @@
"themeSel": "Изберете тема", "themeSel": "Изберете тема",
"customtheme": "Редактирайте и добавете персонализирани теми", "customtheme": "Редактирайте и добавете персонализирани теми",
"customthemeDirection": "Цветова схема", "customthemeDirection": "Цветова схема",
"advanced": "Advanced options", "advanced": "Advanced options(6 additional colors)",
"advancedWarn": "", "advancedWarn": "Advanced options will be <i>null</i> if you set nothing, while basic 3 options will be white(<i>fff</i>). They(adv. options) will be reset if you saved with advanced panel closed.",
"use": "Use this", "active": "Background of Show or CW buttons, selected options...",
"copyFrom": "Copy from", "modal": "Background of modals",
"bg": "Background color", "bottom": "Background of bottom bar",
"subcolor": "Distinguishable from background", "postbox": "Background of post box and menu",
"subcolor": "Subcolor, has harmony with secondary color",
"primary": "Цвят на фона",
"secondarycolor": "Компоненти на фона",
"text": "Цвят на текста", "text": "Цвят на текста",
"accent": "Фон на подсилването", "accent": "Фон на подсилването",
"modal": "Background of modal window",
"modalFooter": "Background of modal window's footer",
"thirdColor": "Backgroud of tag buttons, etc(near to Background)",
"forthColor": "Title bar(same scheme to Background)",
"bottom": "Background of menu-bar at bottom of window",
"emphasized": "Emphasized toot's background",
"postbox": "Background of post-box and menu",
"active": "Background of 'active' elements",
"selected": "Background of selected with arrow keys",
"selectedWithShare": "Background of selected with arrow keys(boosted toots)",
"add_new": "Добавяне на нов", "add_new": "Добавяне на нов",
"name": "Име", "name": "Име",
"desc": "Относно тази тема", "desc": "Относно тази тема",
@@ -109,7 +101,7 @@
"or": "или", "or": "или",
"imgheight": "Height of images", "imgheight": "Height of images",
"imgheightwarn": "Option:Set \"full\" to uncrop.", "imgheightwarn": "Option:Set \"full\" to uncrop.",
"ticker": "Enable OpenSticker", "ticker": "Enable #InstanceTicker",
"tickerwarn": "Show colorful stickers about the server. <a href=\"https://cdn.weep.me/mastodon/\">About #InstanceTicker</a> Copyright 2018 weepjp, kyori19.", "tickerwarn": "Show colorful stickers about the server. <a href=\"https://cdn.weep.me/mastodon/\">About #InstanceTicker</a> Copyright 2018 weepjp, kyori19.",
"animation": "Анимация на времевата линия", "animation": "Анимация на времевата линия",
"markers": "Markers(mark as read) on HTL and notifications", "markers": "Markers(mark as read) on HTL and notifications",

View File

@@ -1,7 +1,5 @@
{ {
"draghere": "Drag here to upload", "draghere": "Drag here to upload",
"nowOffline": "OFFLINE: all of your post is in the draft box and you should reload after re-connect to the Internet",
"reOnline": "Now we are in the Internet, you should reload...",
"close": "Close", "close": "Close",
"webSrc": "Search on Web", "webSrc": "Search on Web",
"tsSrc": "Search on tootsearch", "tsSrc": "Search on tootsearch",
@@ -47,7 +45,6 @@
"thingsEmoji": "Emojis of tools", "thingsEmoji": "Emojis of tools",
"symbolEmoji": "Emojis of symbols", "symbolEmoji": "Emojis of symbols",
"flagsEmoji": "Emojis of flags", "flagsEmoji": "Emojis of flags",
"draft": "Draft",
"poll": "Poll", "poll": "Poll",
"pollDdisabled": "Polls: Disabled", "pollDdisabled": "Polls: Disabled",
"pollProvider": "Provider of Poll", "pollProvider": "Provider of Poll",
@@ -133,7 +130,7 @@
"notf": "Notifications", "notf": "Notifications",
"bookmark": "Bookmarks", "bookmark": "Bookmarks",
"showThisTL": "Show this TL:", "showThisTL": "Show this TL:",
"webviewWarn": "TweetDeck with customed TJDeck(<a href='https://gist.github.com/cutls/8787a55d2c1c53274e68a427966046a6' target='_blank'>Code</a>/<a href='https://gist.github.com/totoraj930/d1394dadb51d75666a76829f61e7280c' target='_blank'>TJDeck</a>).", "webviewWarn": "TweetDeck with customed TJDeck(<a href='https://gist.github.com/cutls/8787a55d2c1c53274e68a427966046a6' target='_blank'>Code</a>/<a href='https://gist.github.com/totoraj930/d1394dadb51d75666a76829f61e7280c' target='_blank'>TJDeck</a>). Keyboard shortcuts will irritate you. When you feel so, you check 'Prefer WebView' on top of the column.",
"add": "Add", "add": "Add",
"search": "Search", "search": "Search",
"sortSet": "Sort", "sortSet": "Sort",

View File

@@ -71,7 +71,6 @@
"lang_post_btn3": "Continue to post", "lang_post_btn3": "Continue to post",
"lang_post_unfinishedMedia": "The server has not finished processing your media. Retry.", "lang_post_unfinishedMedia": "The server has not finished processing your media. Retry.",
"lang_post_retry": "Retry", "lang_post_retry": "Retry",
"lang_post_offline": "Add to the drafts because of offline",
"lang_status_favWarn": "It will take a miunte to favourite a remote toot.", "lang_status_favWarn": "It will take a miunte to favourite a remote toot.",
"lang_status_btWarn": "It will take a miunte to boost a remote toot.", "lang_status_btWarn": "It will take a miunte to boost a remote toot.",
"lang_status_follow": "Follow", "lang_status_follow": "Follow",
@@ -88,9 +87,6 @@
"lang_status_endorse": "Feature on profile", "lang_status_endorse": "Feature on profile",
"lang_status_followers": "Followers", "lang_status_followers": "Followers",
"lang_status_active": "Last status", "lang_status_active": "Last status",
"lang_secure_draft": "Add to draft",
"lang_secure_useThis": "Use this",
"lang_secure_deleteThis": "Delete this",
"lang_suggest_nodata": "Please get emojis list in order to show suggestion.", "lang_suggest_nodata": "Please get emojis list in order to show suggestion.",
"lang_usetxtbox_reply": "Reply Mode. Ctrl+Shift+C to clear.", "lang_usetxtbox_reply": "Reply Mode. Ctrl+Shift+C to clear.",
"lang_cards_check": " check", "lang_cards_check": " check",
@@ -135,17 +131,13 @@
"lang_layout_linkana": "Auto Link Analyzer", "lang_layout_linkana": "Auto Link Analyzer",
"lang_layout_linkanades": "Auto link analyzer", "lang_layout_linkanades": "Auto link analyzer",
"lang_layout_tts": "Text to speech ", "lang_layout_tts": "Text to speech ",
"lang_layout_reconnect": "Reload", "lang_layout_reconnect": "Reload this column",
"lang_layout_headercolor": "Header color of this column", "lang_layout_headercolor": "Header color of this column",
"lang_layout_nodata": "[No data]<br>F5/⌘+R to reload", "lang_layout_nodata": "[No data]<br>F5/⌘+R to reload",
"lang_layout_dm": "Direct Message", "lang_layout_dm": "Direct Message",
"lang_layout_webviewmode": "Prefer WebView", "lang_layout_webviewmode": "Prefer WebView",
"lang_layout_excluded": "Excluded type of notification", "lang_excluded": "Excluded type of notification",
"lang_layout_mention": "Mentions", "lang_layout_excludingbt": "Show BT mode(OFF/Exclude BT/Only BT)",
"lang_layout_fav": "Favourites",
"lang_layout_bt": "Boosts",
"lang_layout_poll": "Polls",
"lang_layout_excludingbt": "Show BT mode",
"lang_layout_leftFold": "Stack to the left", "lang_layout_leftFold": "Stack to the left",
"lang_layout_leftUnfold": "Dock on the right", "lang_layout_leftUnfold": "Dock on the right",
"lang_layout_deleteColumn": "Delete this column", "lang_layout_deleteColumn": "Delete this column",
@@ -230,7 +222,6 @@
"lang_parse_html": "Show embed HTML", "lang_parse_html": "Show embed HTML",
"lang_parse_notffilter": "Show this user's notifications", "lang_parse_notffilter": "Show this user's notifications",
"lang_parse_hidden": "Unvisible quoted toot", "lang_parse_hidden": "Unvisible quoted toot",
"lang_parse_disconnected": "Streaming has been disconnected(retry after 3s)",
"lang_misskeyparse_renote": "Repost", "lang_misskeyparse_renote": "Repost",
"lang_misskeyparse_renoteqt": "Renote", "lang_misskeyparse_renoteqt": "Renote",
"lang_misskeyparse_reaction": "Reaction", "lang_misskeyparse_reaction": "Reaction",
@@ -245,7 +236,6 @@
"lang_misskeyparse_reacted": " reacted your following post.", "lang_misskeyparse_reacted": " reacted your following post.",
"lang_setting_time": "Time format:{{set}}", "lang_setting_time": "Time format:{{set}}",
"lang_setting_theme": "Theme:{{set}}", "lang_setting_theme": "Theme:{{set}}",
"lang_setting_compat": "Compatible",
"lang_setting_nsfw": "Sensitive media:{{set}}", "lang_setting_nsfw": "Sensitive media:{{set}}",
"lang_setting_cw": "CW:{{set}}", "lang_setting_cw": "CW:{{set}}",
"lang_setting_cwtext": "Default CW text:{{set}}", "lang_setting_cwtext": "Default CW text:{{set}}",

View File

@@ -24,11 +24,10 @@
"nativenotf": "Native notification", "nativenotf": "Native notification",
"nnwarn": "This does not work on Windows Portable ver.", "nnwarn": "This does not work on Windows Portable ver.",
"nntest": "Notification test", "nntest": "Notification test",
"width": "Width of columns", "minwidth": "Minimum width of columns",
"widthwarn": "Scroll bar will be shown when your window size is more than ammounts of columns.", "minwidthwarn": "Scroll bar will be shown when your window size is more than ammounts of columns.",
"fixwidth": "Minimum width of TweetDeck browser", "fixwidth": "Minimum width of TweetDeck browser",
"fixwidthwarn": "", "fixwidthwarn": "",
"margin": "Margin between timelines",
"above": "above", "above": "above",
"font": "Font", "font": "Font",
"fontwarn": "Select your favorite font to 'Select'(Windows/ macOS only)", "fontwarn": "Select your favorite font to 'Select'(Windows/ macOS only)",
@@ -44,26 +43,19 @@
"srcUrl": "Search engine", "srcUrl": "Search engine",
"srcUrlWarn": "{q} will be replaced to query.", "srcUrlWarn": "{q} will be replaced to query.",
"themeSel": "Select theme", "themeSel": "Select theme",
"customtheme": "Edit and add themes", "customtheme": "Edit and add custom themes",
"customthemeDirection": "Color scheme", "customthemeDirection": "Color scheme",
"advanced": "Advanced options", "advanced": "Advanced options(6 additional colors)",
"advancedWarn": "", "advancedWarn": "Advanced options will be <i>null</i> if you set nothing, while basic 3 options will be white(<i>fff</i>). They(adv. options) will be reset if you saved with advanced panel closed.",
"use": "Use this", "active": "Background of Show or CW buttons, selected options...",
"copyFrom": "Copy from", "modal": "Background of modals",
"bg": "Background color", "bottom": "Background of bottom bar",
"subcolor": "Distinguishable from background", "postbox": "Background of post box and menu",
"subcolor": "Subcolor, has harmony with secondary color",
"primary": "Background color",
"secondarycolor": "Background of components",
"text": "Text color", "text": "Text color",
"accent": "Background of boosts", "accent": "Background of boosts",
"modal": "Background of modal window",
"modalFooter": "Background of modal window's footer",
"thirdColor": "Backgroud of tag buttons, etc(near to Background)",
"forthColor": "Title bar(same scheme to Background)",
"bottom": "Background of menu-bar at bottom of window",
"emphasized": "Emphasized toot's background",
"postbox": "Background of post-box and menu",
"active": "Background of 'active' elements",
"selected": "Background of selected with arrow keys",
"selectedWithShare": "Background of selected with arrow keys(boosted toots)",
"add_new": "Add new", "add_new": "Add new",
"name": "Name", "name": "Name",
"desc": "About this theme", "desc": "About this theme",
@@ -109,8 +101,8 @@
"or": "or", "or": "or",
"imgheight": "Height of images", "imgheight": "Height of images",
"imgheightwarn": "Option:Set \"full\" to uncrop.", "imgheightwarn": "Option:Set \"full\" to uncrop.",
"ticker": "Enable OpenSticker", "ticker": "Enable #InstanceTicker",
"tickerwarn": "Show the instance name and favicon of tooters <a href=\"https://opensticker.0px.io\">About OpenSticker</a>", "tickerwarn": "Show colorful stickers about the server. <a href=\"https://github.com/MiyonMiyon/InstanceTicker_List\">About #InstanceTicker</a> (c)2018-2020 MiyonMiyon. Released under the MIT License.",
"animation": "Animation of timelines", "animation": "Animation of timelines",
"markers": "Markers(mark as read) on HTL and notifications", "markers": "Markers(mark as read) on HTL and notifications",
"markerswarn": "Mastodon 3.0~. Shared on WebUI and third-party supported clients.", "markerswarn": "Mastodon 3.0~. Shared on WebUI and third-party supported clients.",

View File

@@ -1,7 +1,5 @@
{ {
"draghere": "Přetáhněte sem pro nahrání", "draghere": "Přetáhněte sem pro nahrání",
"nowOffline": "OFFLINE: all of your post is in the draft box and you should reload after re-connect to the Internet",
"reOnline": "Now we are in the Internet, you should reload...",
"close": "Zavřít", "close": "Zavřít",
"webSrc": "Search on Web", "webSrc": "Search on Web",
"tsSrc": "Search on tootsearch", "tsSrc": "Search on tootsearch",
@@ -47,7 +45,6 @@
"thingsEmoji": "Emojis of tools", "thingsEmoji": "Emojis of tools",
"symbolEmoji": "Emojis of symbols", "symbolEmoji": "Emojis of symbols",
"flagsEmoji": "Emojis of flags", "flagsEmoji": "Emojis of flags",
"draft": "Draft",
"poll": "Anketa", "poll": "Anketa",
"pollDdisabled": "Polls: Disabled", "pollDdisabled": "Polls: Disabled",
"pollProvider": "Provider of Poll", "pollProvider": "Provider of Poll",

View File

@@ -71,7 +71,6 @@
"lang_post_btn3": "Pokračovat k přispívání", "lang_post_btn3": "Pokračovat k přispívání",
"lang_post_unfinishedMedia": "The server has not finished processing your media. Retry.", "lang_post_unfinishedMedia": "The server has not finished processing your media. Retry.",
"lang_post_retry": "Retry", "lang_post_retry": "Retry",
"lang_post_offline": "Add to the drafts because of offline",
"lang_status_favWarn": "Oblíbení vzdáleného tootu bude chvíli trvat.", "lang_status_favWarn": "Oblíbení vzdáleného tootu bude chvíli trvat.",
"lang_status_btWarn": "Boostnutí vzdáleného tootu bude chvíli trvat.", "lang_status_btWarn": "Boostnutí vzdáleného tootu bude chvíli trvat.",
"lang_status_follow": "Sledovat", "lang_status_follow": "Sledovat",
@@ -88,9 +87,6 @@
"lang_status_endorse": "Představit na profilu", "lang_status_endorse": "Představit na profilu",
"lang_status_followers": "Followers", "lang_status_followers": "Followers",
"lang_status_active": "Last status", "lang_status_active": "Last status",
"lang_secure_draft": "Add to draft",
"lang_secure_useThis": "Use this",
"lang_secure_deleteThis": "Smazat tento toot",
"lang_suggest_nodata": "Pro zobrazení návrhu prosím získejte seznam emoji.", "lang_suggest_nodata": "Pro zobrazení návrhu prosím získejte seznam emoji.",
"lang_usetxtbox_reply": "Režim odpovězení. Pro vymazání stiskněte Ctrl+Shift+C.", "lang_usetxtbox_reply": "Režim odpovězení. Pro vymazání stiskněte Ctrl+Shift+C.",
"lang_cards_check": " kontrolovat", "lang_cards_check": " kontrolovat",
@@ -140,11 +136,7 @@
"lang_layout_nodata": "[Žádná data]<br>Obnovte stránku klávesami F5/⌘+R", "lang_layout_nodata": "[Žádná data]<br>Obnovte stránku klávesami F5/⌘+R",
"lang_layout_dm": "Přímá zpráva", "lang_layout_dm": "Přímá zpráva",
"lang_layout_webviewmode": "Preferovat WebView", "lang_layout_webviewmode": "Preferovat WebView",
"lang_layout_excluded": "Excluded type of notification", "lang_excluded": "Excluded type of notification",
"lang_layout_mention": "Mentions",
"lang_layout_fav": "Favourites",
"lang_layout_bt": "Boosts",
"lang_layout_poll": "Polls",
"lang_layout_excludingbt": "Show BT mode(OFF/Exclude BT/Only BT)", "lang_layout_excludingbt": "Show BT mode(OFF/Exclude BT/Only BT)",
"lang_layout_leftFold": "Stack to the left", "lang_layout_leftFold": "Stack to the left",
"lang_layout_leftUnfold": "Dock on the right", "lang_layout_leftUnfold": "Dock on the right",
@@ -230,7 +222,6 @@
"lang_parse_html": "Show embed HTML", "lang_parse_html": "Show embed HTML",
"lang_parse_notffilter": "Show this user's notifications", "lang_parse_notffilter": "Show this user's notifications",
"lang_parse_hidden": "Unvisible quoted toot", "lang_parse_hidden": "Unvisible quoted toot",
"lang_parse_disconnected": "Streaming has been disconnected(retry after 3s)",
"lang_misskeyparse_renote": "Znovusdílení", "lang_misskeyparse_renote": "Znovusdílení",
"lang_misskeyparse_renoteqt": "Renotování", "lang_misskeyparse_renoteqt": "Renotování",
"lang_misskeyparse_reaction": "Reakce", "lang_misskeyparse_reaction": "Reakce",
@@ -245,7 +236,6 @@
"lang_misskeyparse_reacted": " reagoval/a na váš následující příspěvek.", "lang_misskeyparse_reacted": " reagoval/a na váš následující příspěvek.",
"lang_setting_time": "Časový formát: {{set}}", "lang_setting_time": "Časový formát: {{set}}",
"lang_setting_theme": "Motiv: {{set}}", "lang_setting_theme": "Motiv: {{set}}",
"lang_setting_compat": "Compatible",
"lang_setting_nsfw": "Citlivý obsah: {{set}}", "lang_setting_nsfw": "Citlivý obsah: {{set}}",
"lang_setting_cw": "Varování: {{set}}", "lang_setting_cw": "Varování: {{set}}",
"lang_setting_cwtext": "Výchozí text varování: {{set}}", "lang_setting_cwtext": "Výchozí text varování: {{set}}",

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