Compare commits

...

4 Commits

Author SHA1 Message Date
cutls
957ef30fc0 WIP: use-strict 'login' 2019-11-25 00:03:33 +09:00
cutls
bae73521e9 WIP: use-strict 2019-11-24 23:53:35 +09:00
cutls
2583c3b80a Merge branch 'master' into use-strict 2019-11-24 23:35:56 +09:00
cutls
2b6cf60868 WIP: use strict 2019-11-24 22:26:19 +09:00
59 changed files with 503 additions and 421 deletions

View File

@ -1,3 +1,4 @@
'use strict'
//このソフトについて //このソフトについて
function about() { function about() {
postMessage(["sendSinmpleIpc", "about"], "*") postMessage(["sendSinmpleIpc", "about"], "*")

View File

@ -1,3 +1,4 @@
'use strict'
var digitCharacters = [ var 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",

View File

@ -1,3 +1,4 @@
'use strict'
/*! Hammer.JS - v2.0.8 - 2016-04-23 /*! Hammer.JS - v2.0.8 - 2016-04-23
* http://hammerjs.github.io/ * http://hammerjs.github.io/
* *

View File

@ -1,191 +1,192 @@
selectedColumn = 0 'use strict'
selectedToot = 0 var selectedColumn = 0
var selectedToot = 0
$(function($) { $(function($) {
//キーボードショートカット //キーボードショートカット
$(window).keydown(function(e) { $(window).keydown(function(e) {
var hasFocus = $('input').is(':focus'); var hasFocus = $('input').is(':focus')
var hasFocus2 = $('textarea').is(':focus'); var hasFocus2 = $('textarea').is(':focus')
if (document.getElementById("webview")) { if (document.getElementById('webview')) {
if ($("#webviewsel:checked").val()) { if ($('#webviewsel:checked').val()) {
var wv = false; var wv = false
} else { } else {
var wv = true; var wv = true
} }
} else { } else {
var wv = true; var wv = true
} }
//Enter //Enter
if (e.keyCode === 13) { if (e.keyCode === 13) {
if($("#src").is(':focus')){ if ($('#src').is(':focus')) {
src() src()
return false; return false
} }
if($("#list-add").is(':focus')){ if ($('#list-add').is(':focus')) {
makeNewList() makeNewList()
return false; return false
} }
} }
//Ctrl+Shift+Enter:Lgen //Ctrl+Shift+Enter:Lgen
if (event.metaKey || event.ctrlKey && wv) { if (event.metaKey || (event.ctrlKey && wv)) {
if (event.shiftKey) { if (event.shiftKey) {
if (e.keyCode === 13) { if (e.keyCode === 13) {
post('local'); post('local')
return false; return false
} }
} }
} }
//Ctrl+Enter:投稿 //Ctrl+Enter:投稿
if (event.metaKey || event.ctrlKey && wv) { if (event.metaKey || (event.ctrlKey && wv)) {
if (e.keyCode === 13) { if (e.keyCode === 13) {
post(); post()
return false; return false
} }
} }
//Alt+Enter:セカンダリー //Alt+Enter:セカンダリー
if (event.metaKey || event.altKey && wv) { if (event.metaKey || (event.altKey && wv)) {
if (e.keyCode === 13) { if (e.keyCode === 13) {
sec(); sec()
return false; return false
} }
} }
//Esc:消す //Esc:消す
if (e.keyCode === 27 && wv) { if (e.keyCode === 27 && wv) {
hide(); hide()
return false; return false
} }
//F5リロード //F5リロード
if (e.keyCode === 116 && wv) { if (e.keyCode === 116 && wv) {
location.href = "index.html"; location.href = 'index.html'
return false; return false
} }
//Ctrl+Sift+C:全消し //Ctrl+Sift+C:全消し
if (((event.metaKey || event.ctrlKey) && event.shiftKey) && wv) { if ((event.metaKey || event.ctrlKey) && event.shiftKey && wv) {
if (e.keyCode === 67) { if (e.keyCode === 67) {
clear(); clear()
return false; return false
} }
} }
//Ctrl+Sift+N:NowPlaying //Ctrl+Sift+N:NowPlaying
if (((event.metaKey || event.ctrlKey) && event.shiftKey) && wv) { if ((event.metaKey || event.ctrlKey) && event.shiftKey && wv) {
if (e.keyCode === 78) { if (e.keyCode === 78) {
show(); show()
nowplaying() nowplaying()
return false; return false
} }
} }
//input/textareaにフォーカスなし時 //input/textareaにフォーカスなし時
if ((!hasFocus && !hasFocus2) && wv) { if (!hasFocus && !hasFocus2 && wv) {
if (!wv) { if (!wv) {
return true; return true
} }
//Ctrl+V:いつもの //Ctrl+V:いつもの
if (event.metaKey || event.ctrlKey) { if (event.metaKey || event.ctrlKey) {
if (e.keyCode === 86) { if (e.keyCode === 86) {
show(); show()
} }
} }
//X:開閉 //X:開閉
if (e.keyCode === 88) { if (e.keyCode === 88) {
if (!$("#post-box").hasClass("appear")) { if (!$('#post-box').hasClass('appear')) {
show(); show()
$('textarea').focus(); $('textarea').focus()
} else { } else {
hide(); hide()
} }
return false; return false
} }
//N:新トゥート //N:新トゥート
if (e.keyCode === 78) { if (e.keyCode === 78) {
if (!$("#post-box").hasClass("appear")) { if (!$('#post-box').hasClass('appear')) {
show(); show()
} }
$('textarea').focus(); $('textarea').focus()
return false; return false
} }
//Ctrl+E:全ての通知未読を既読にする //Ctrl+E:全ての通知未読を既読にする
if (event.metaKey || event.ctrlKey) { if (event.metaKey || event.ctrlKey) {
if (e.keyCode === 69) { if (e.keyCode === 69) {
allNotfRead(); allNotfRead()
return false; return false
} }
} }
//Ctrl+Space:読み込み //Ctrl+Space:読み込み
if (event.metaKey || event.ctrlKey) { if (event.metaKey || event.ctrlKey) {
if (e.keyCode === 32) { if (e.keyCode === 32) {
parseColumn(); parseColumn()
return false; return false
} }
} }
//Ctrl+Sift+S:設定 //Ctrl+Sift+S:設定
if ((event.metaKey || event.ctrlKey) && event.shiftKey) { if ((event.metaKey || event.ctrlKey) && event.shiftKey) {
if (e.keyCode === 83) { if (e.keyCode === 83) {
location.href = "setting.html"; location.href = 'setting.html'
return false; return false
} }
} }
//Ctrl+Sift+M:アカマネ //Ctrl+Sift+M:アカマネ
if ((event.metaKey || event.ctrlKey) && event.shiftKey) { if ((event.metaKey || event.ctrlKey) && event.shiftKey) {
if (e.keyCode === 77) { if (e.keyCode === 77) {
location.href = "acct.html"; location.href = 'acct.html'
return false; return false
} }
} }
//Ctrl+Sift+P:プロフ //Ctrl+Sift+P:プロフ
if ((event.metaKey || event.ctrlKey) && event.shiftKey) { if ((event.metaKey || event.ctrlKey) && event.shiftKey) {
if (e.keyCode === 80) { if (e.keyCode === 80) {
profShow() profShow()
return false; return false
} }
} }
//数字:TL //数字:TL
if (event.metaKey || event.ctrlKey) { if (event.metaKey || event.ctrlKey) {
if (e.keyCode >= 49 && e.keyCode <= 57) { if (e.keyCode >= 49 && e.keyCode <= 57) {
var kz = e.keyCode - 49; var kz = e.keyCode - 49
goColumn(kz); goColumn(kz)
return false; return false
} }
} }
//矢印:選択 //矢印:選択
if (e.code == "ArrowLeft") { if (e.code == 'ArrowLeft') {
//left //left
if ($("#imagemodal").hasClass("open")) { if ($('#imagemodal').hasClass('open')) {
imgCont('prev'); imgCont('prev')
return false; return false
} }
if (selectedColumn > 0) { if (selectedColumn > 0) {
selectedColumn-- selectedColumn--
} }
tootSelector(selectedColumn, selectedToot) tootSelector(selectedColumn, selectedToot)
return false; return false
} else if (e.code == "ArrowUp") { } else if (e.code == 'ArrowUp') {
//up //up
if ($("#imagemodal").hasClass("open")) { if ($('#imagemodal').hasClass('open')) {
return false; return false
} }
if (selectedToot > 0) { if (selectedToot > 0) {
selectedToot-- selectedToot--
} }
tootSelector(selectedColumn, selectedToot) tootSelector(selectedColumn, selectedToot)
return false; return false
} else if (e.code == "ArrowRight") { } else if (e.code == 'ArrowRight') {
//right //right
if ($("#imagemodal").hasClass("open")) { if ($('#imagemodal').hasClass('open')) {
imgCont('next'); imgCont('next')
return false; return false
} }
if (selectedColumn < $(".tl-box").length - 1) { if (selectedColumn < $('.tl-box').length - 1) {
selectedColumn++ selectedColumn++
} }
tootSelector(selectedColumn, selectedToot) tootSelector(selectedColumn, selectedToot)
return false; return false
} else if (e.code == "ArrowDown") { } else if (e.code == 'ArrowDown') {
//down //down
if ($("#imagemodal").hasClass("open")) { if ($('#imagemodal').hasClass('open')) {
return false; return false
} }
selectedToot++ selectedToot++
tootSelector(selectedColumn, selectedToot) tootSelector(selectedColumn, selectedToot)
return false; return false
} }
//Ctrl+U:0,0選択 //Ctrl+U:0,0選択
if (event.ctrlKey || event.metaKey) { if (event.ctrlKey || event.metaKey) {
@ -193,29 +194,29 @@ $(function ($) {
selectedToot = 0 selectedToot = 0
selectedColumn = 0 selectedColumn = 0
tootSelector(0, 0) tootSelector(0, 0)
return false; return false
} }
} }
//選択時 //選択時
if (e.keyCode == 70) { if (e.keyCode == 70) {
var id = $(".selectedToot").attr('unique-id') var id = $('.selectedToot').attr('unique-id')
var acct_id = $('#timeline_' + selectedColumn).attr("data-acct") var acct_id = $('#timeline_' + selectedColumn).attr('data-acct')
fav(id, acct_id, false) fav(id, acct_id, false)
return false; return false
} }
if (e.keyCode == 66) { if (e.keyCode == 66) {
var id = $(".selectedToot").attr('unique-id') var id = $('.selectedToot').attr('unique-id')
var acct_id = $('#timeline_' + selectedColumn).attr("data-acct") var acct_id = $('#timeline_' + selectedColumn).attr('data-acct')
rt(id, acct_id, false) rt(id, acct_id, false)
return false; return false
} }
if (e.keyCode == 82) { if (e.keyCode == 82) {
var id = $(".selectedToot").attr('unique-id') var id = $('.selectedToot').attr('unique-id')
var acct_id = $('#timeline_' + selectedColumn).attr("data-acct") var acct_id = $('#timeline_' + selectedColumn).attr('data-acct')
var ats_cm = $('.selectedToot .rep-btn').attr("data-men") var ats_cm = $('.selectedToot .rep-btn').attr('data-men')
var mode = $('.selectedToot .rep-btn').attr("data-visen") var mode = $('.selectedToot .rep-btn').attr('data-visen')
re(id, ats_cm, acct_id, mode) re(id, ats_cm, acct_id, mode)
return false; return false
} }
} }
//textareaフォーカス時 //textareaフォーカス時
@ -224,23 +225,27 @@ $(function ($) {
//C+S+(No):ワンクリ //C+S+(No):ワンクリ
if ((event.metaKey || event.ctrlKey) && event.shiftKey) { if ((event.metaKey || event.ctrlKey) && event.shiftKey) {
if (e.keyCode >= 49 && e.keyCode <= 51) { if (e.keyCode >= 49 && e.keyCode <= 51) {
var no = e.keyCode - 48; var no = e.keyCode - 48
if (localStorage.getItem("oks-" + no)) { $("#textarea").val($("#textarea").val() + localStorage.getItem("oks-" + no)) } if (localStorage.getItem('oks-' + no)) {
return false; $('#textarea').val($('#textarea').val() + localStorage.getItem('oks-' + no))
}
return false
} }
} }
} }
} }
}); })
//クリアボタン //クリアボタン
$("#clear").click(function () { $('#clear').click(function() {
clear(); clear()
}); })
}); })
//選択する //選択する
function tootSelector(column, toot) { function tootSelector(column, toot) {
$('.cvo').removeClass("selectedToot") $('.cvo').removeClass('selectedToot')
$('#timeline_' + column + ' .cvo').eq(toot).addClass("selectedToot") $('#timeline_' + column + ' .cvo')
.eq(toot)
.addClass('selectedToot')
var scr = $('.tl-box[tlid=' + column + ']').scrollTop() var scr = $('.tl-box[tlid=' + column + ']').scrollTop()
var elem = $('.selectedToot').offset().top var elem = $('.selectedToot').offset().top
var top = elem - $('.tl-box').height() + scr var top = elem - $('.tl-box').height() + scr

View File

@ -1,3 +1,4 @@
'use strict'
//モーダル・ドロップダウンの各種設定 //モーダル・ドロップダウンの各種設定
$(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

View File

@ -1,3 +1,4 @@
'use strict'
var sha256 = function sha256(ascii) { var sha256 = function sha256(ascii) {
function rightRotate(value, amount) { function rightRotate(value, amount) {
return (value >>> amount) | (value << (32 - amount)); return (value >>> amount) | (value << (32 - amount));

View File

@ -1,346 +1,373 @@
'use strict'
//バージョンチェッカー //バージョンチェッカー
function verck(ver, jp) { function verck(ver, jp) {
console.log("%c Welcome😊", "color: red;font-size:200%;"); console.log('%c Welcome😊', 'color: red;font-size:200%;')
var date = new Date(); var date = new Date()
var show = false; var show = false
if (localStorage.getItem("ver") != ver && localStorage.getItem("winstore")) { if (localStorage.getItem('ver') != ver && localStorage.getItem('winstore')) {
//ちょっと削除とリンク解析の都合上アレ(s) //ちょっと削除とリンク解析の都合上アレ(s)
//対象外のアプデ:storageが20の最初まで"Usamin (18.6.5)" //対象外のアプデ:storageが20の最初まで"Usamin (18.6.5)"
if (!localStorage.getItem("usamin_18_6_5_flag")) { if (!localStorage.getItem('usamin_18_6_5_flag')) {
localStorage.setItem("usamin_18_6_5_flag", true); localStorage.setItem('usamin_18_6_5_flag', true)
var multi = localStorage.getItem("column"); var multi = localStorage.getItem('column')
var obj = JSON.parse(multi); var obj = JSON.parse(multi)
for (var i = 0; i < obj.length; i++) { for (var i = 0; i < obj.length; i++) {
localStorage.removeItem("card_" + i); localStorage.removeItem('card_' + i)
} }
} }
//ちょっと削除とリンク解析の都合上アレ(e) //ちょっと削除とリンク解析の都合上アレ(e)
show = true; show = 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() { $(document).ready(function() {
if (localStorage.getItem("winstore")) { if (localStorage.getItem('winstore')) {
$("#releasenote").modal("open"); $('#releasenote').modal('open')
} }
verp = ver.replace("(", ""); var verp = ver.replace('(', '')
verp = verp.replace(".", "-"); verp = verp.replace('.', '-')
verp = verp.replace(".", "-"); verp = verp.replace('.', '-')
verp = verp.replace("[", "-"); verp = verp.replace('[', '-')
verp = verp.replace("]", ""); verp = verp.replace(']', '')
verp = verp.replace(")", ""); verp = verp.replace(')', '')
verp = verp.replace(" ", "_"); verp = verp.replace(' ', '_')
console.log("%c " + verp, "color: red;font-size:200%;"); console.log('%c ' + verp, 'color: red;font-size:200%;')
if (lang.language == "ja") { if (lang.language == 'ja') {
$("#release-" + verp).show(); $('#release-' + verp).show()
} else { } else {
$("#release-en").show(); $('#release-en').show()
} }
}); })
} }
localStorage.setItem("ver", ver); localStorage.setItem('ver', ver)
if (!show) { if (!show) {
console.log(show); console.log(show)
if (date.getMonth() + 1 >= localStorage.getItem("showSupportMe") || !localStorage.getItem("showSupportMe")) { if (
date.getMonth() + 1 >= localStorage.getItem('showSupportMe') ||
!localStorage.getItem('showSupportMe')
) {
if (date.getMonth() == 11) { if (date.getMonth() == 11) {
var nextmonth = 1; var nextmonth = 1
} else { } else {
var nextmonth = date.getMonth() + 2; var nextmonth = date.getMonth() + 2
} }
if (lang.language != "ja") { if (lang.language != 'ja') {
$("#support-btm-ja").addClass("hide"); $('#support-btm-ja').addClass('hide')
$("#support-btm-en").removeClass("hide"); $('#support-btm-en').removeClass('hide')
} }
localStorage.setItem("showSupportMe", nextmonth); localStorage.setItem('showSupportMe', nextmonth)
$("#support-btm").removeClass("hide"); $('#support-btm').removeClass('hide')
$("#support-btm").animate( $('#support-btm').animate(
{ {
bottom: "0" bottom: '0'
}, },
{ {
duration: 300 duration: 300
} }
); )
} }
} }
var platform = localStorage.getItem("platform"); var platform = localStorage.getItem('platform')
console.log("Your platform:" + platform); console.log('Your platform:' + platform)
if (!localStorage.getItem("winstore")) { if (!localStorage.getItem('winstore')) {
$("#start").css("display", "flex"); $('#start').css('display', 'flex')
} }
if (localStorage.getItem("winstore") == "brewcask" || localStorage.getItem("winstore") == "snapcraft" || localStorage.getItem("winstore") == "winstore") { if (
var winstore = true; localStorage.getItem('winstore') == 'brewcask' ||
localStorage.getItem('winstore') == 'snapcraft' ||
localStorage.getItem('winstore') == 'winstore'
) {
var winstore = true
} else { } else {
var winstore = false; var winstore = false
} }
var l = 5; var l = 5
// 生成する文字列に含める文字セット // 生成する文字列に含める文字セット
var c = "abcdefghijklmnopqrstuvwxyz0123456789"; var c = 'abcdefghijklmnopqrstuvwxyz0123456789'
var cl = c.length; var cl = c.length
var r = ""; var r = ''
for (var i = 0; i < l; i++) { for (var i = 0; i < l; i++) {
r += c[Math.floor(Math.random() * cl)]; r += c[Math.floor(Math.random() * cl)]
} }
var start = "https://thedesk.top/ver.json"; var start = 'https://thedesk.top/ver.json'
fetch(start, { fetch(start, {
method: "GET" method: 'GET'
}) })
.then(function(response) { .then(function(response) {
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);setLog(start, "JSON", error); todo(error)
setLog(start, "JSON", error); setLog(start, 'JSON', error)
console.error(error); setLog(start, 'JSON', error)
console.error(error)
}) })
.then(function(mess) { .then(function(mess) {
console.table(mess); console.table(mess)
if (mess) { if (mess) {
//askjp_jp_ua: 2019年10月24日、mstdn.jpによるユーザーエージェントアクセス制限 //askjp_jp_ua: 2019年10月24日、mstdn.jpによるユーザーエージェントアクセス制限
if (jp && mess.jp_ua && !localStorage.getItem("askjp_jp_ua")) { if (jp && mess.jp_ua && !localStorage.getItem('askjp_jp_ua')) {
localStorage.setItem("askjp_jp_ua", true); localStorage.setItem('askjp_jp_ua', true)
$("#askjp_jp_ua").removeClass("hide"); $('#askjp_jp_ua').removeClass('hide')
} }
var platform = localStorage.getItem("platform"); var platform = localStorage.getItem('platform')
if (platform == "darwin") { if (platform == 'darwin') {
var newest = mess.desk_mac; var newest = mess.desk_mac
} else { } else {
var newest = mess.desk; var newest = mess.desk
} }
if (newest == ver) { if (newest == ver) {
todo(lang.lang_version_usever.replace("{{ver}}", mess.desk)); todo(lang.lang_version_usever.replace('{{ver}}', mess.desk))
//betaかWinstoreならアプデチェックしない //betaかWinstoreならアプデチェックしない
} else if (ver.indexOf("beta") != -1 || winstore) { } else if (ver.indexOf('beta') != -1 || winstore) {
} else { } else {
localStorage.removeItem("instance"); localStorage.removeItem('instance')
if (localStorage.getItem("new-ver-skip")) { if (localStorage.getItem('new-ver-skip')) {
if (localStorage.getItem("next-ver") != newest) { if (localStorage.getItem('next-ver') != newest) {
postMessage(["sendSinmpleIpc", "update"], "*"); postMessage(['sendSinmpleIpc', 'update'], '*')
} else { } else {
console.warn(lang.lang_version_skipver); console.warn(lang.lang_version_skipver)
todo(lang.lang_version_skipver); todo(lang.lang_version_skipver)
} }
} else { } else {
postMessage(["sendSinmpleIpc", "update"], "*"); postMessage(['sendSinmpleIpc', 'update'], '*')
} }
} }
} }
}); })
if (!localStorage.getItem("last-notice-id")) { if (!localStorage.getItem('last-notice-id')) {
localStorage.setItem("last-notice-id", 0); localStorage.setItem('last-notice-id', 0)
} }
var start = "https://thedesk.top/notice?since_id=" + localStorage.getItem("last-notice-id"); var start = 'https://thedesk.top/notice?since_id=' + localStorage.getItem('last-notice-id')
fetch(start, { fetch(start, {
method: "GET" method: 'GET'
}) })
.then(function(response) { .then(function(response) {
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);setLog(start, "JSON", error); todo(error)
console.error(error); setLog(start, 'JSON', error)
console.error(error)
}) })
.then(function(mess) { .then(function(mess) {
if (mess.length < 1) { if (mess.length < 1) {
return false; return false
} else { } else {
var last = localStorage.getItem("last-notice-id"); var last = localStorage.getItem('last-notice-id')
localStorage.setItem("last-notice-id", mess[0].ID); localStorage.setItem('last-notice-id', mess[0].ID)
for (i = 0; i < mess.length; i++) { for (i = 0; i < mess.length; i++) {
var obj = mess[i]; var obj = mess[i]
if (obj.ID * 1 <= last) { if (obj.ID * 1 <= last) {
break; break
} else { } else {
if (obj.type == "textv2") { if (obj.type == 'textv2') {
if (~obj.languages.indexOf(lang.language)) { if (~obj.languages.indexOf(lang.language)) {
var show = true; var show = true
if (obj.toot != "") { if (obj.toot != '') {
var toot = '<button class="btn-flat toast-action" onclick="detEx(\'' + obj.toot + "','main')\">Show</button>"; var toot =
'<button class="btn-flat toast-action" onclick="detEx(\'' +
obj.toot +
"','main')\">Show</button>"
} else { } else {
var toot = ""; var toot = ''
} }
if (obj.ver != "") { if (obj.ver != '') {
if (obj.ver == ver) { if (obj.ver == ver) {
show = true; show = true
} else { } else {
show = false; show = false
} }
} }
if (obj.domain != "") { if (obj.domain != '') {
var multi = localStorage.getItem("multi"); var multi = localStorage.getItem('multi')
if (multi) { if (multi) {
show = false; show = false
var accts = JSON.parse(multi); var accts = JSON.parse(multi)
Object.keys(accts).forEach(function(key) { Object.keys(accts).forEach(function(key) {
var acct = accts[key]; var acct = accts[key]
if (acct.domain == obj.domain) { if (acct.domain == obj.domain) {
show = true; show = true
} }
}); })
} }
} }
if (show) { if (show) {
M.toast({ html: escapeHTML(obj.text) + toot + '<span class="sml grey-text">(スライドして消去)</span>', displayLength: 86400 }); M.toast({
html:
escapeHTML(obj.text) +
toot +
'<span class="sml grey-text">(スライドして消去)</span>',
displayLength: 86400
})
} }
} }
} }
} }
} }
} }
}); })
} }
var infostreaming = false; var infostreaming = false
function infowebsocket() { function infowebsocket() {
infows = new WebSocket("wss://thedesk.top/ws/"); var infows = new WebSocket('wss://thedesk.top/ws/')
infows.onopen = function(mess) { infows.onopen = function(mess) {
console.log([tlid, ":Connect Streaming Info:", mess]); console.log([tlid, ':Connect Streaming Info:', mess])
infostreaming = true; infostreaming = true
}; }
infows.onmessage = function(mess) { infows.onmessage = function(mess) {
console.log([tlid, ":Receive Streaming:", JSON.parse(mess.data)]); console.log([tlid, ':Receive Streaming:', JSON.parse(mess.data)])
var obj = JSON.parse(mess.data); var obj = JSON.parse(mess.data)
if (obj.type != "counter") { if (obj.type != 'counter') {
if (obj.type == "textv2") { if (obj.type == 'textv2') {
if (~obj.languages.indexOf(lang.language)) { if (~obj.languages.indexOf(lang.language)) {
localStorage.setItem("last-notice-id", obj.id); localStorage.setItem('last-notice-id', obj.id)
var show = true; var show = true
if (obj.toot != "") { if (obj.toot != '') {
var toot = '<button class="btn-flat toast-action" onclick="detEx(\'' + obj.toot + "','main')\">Show</button>"; var toot =
'<button class="btn-flat toast-action" onclick="detEx(\'' +
obj.toot +
"','main')\">Show</button>"
} else { } else {
var toot = ""; var toot = ''
} }
if (obj.ver != "") { if (obj.ver != '') {
if (obj.ver == ver) { if (obj.ver == ver) {
show = true; show = true
} else { } else {
show = false; show = false
} }
} }
if (obj.domain != "") { if (obj.domain != '') {
var multi = localStorage.getItem("multi"); var multi = localStorage.getItem('multi')
if (multi) { if (multi) {
show = false; show = false
var accts = JSON.parse(multi); var accts = JSON.parse(multi)
Object.keys(accts).forEach(function(key) { Object.keys(accts).forEach(function(key) {
var acct = accts[key]; var acct = accts[key]
if (acct.domain == obj.domain) { if (acct.domain == obj.domain) {
show = true; show = true
} }
}); })
} }
} }
if (show) { if (show) {
console.log(obj.text); console.log(obj.text)
console.log(escapeHTML(obj.text)); console.log(escapeHTML(obj.text))
M.toast({ html: escapeHTML(obj.text) + toot + '<span class="sml grey-text">(スライドして消去)</span>', displayLength: 86400 }); M.toast({
html:
escapeHTML(obj.text) +
toot +
'<span class="sml grey-text">(スライドして消去)</span>',
displayLength: 86400
})
} }
} }
} }
} else { } else {
$("#persons").text(obj.text); $('#persons').text(obj.text)
}
} }
};
infows.onerror = function(error) { infows.onerror = function(error) {
infostreaming = false; infostreaming = false
console.error("Error closing:info"); console.error('Error closing:info')
console.error(error); console.error(error)
return false; return false
}; }
infows.onclose = function() { infows.onclose = function() {
infostreaming = false; infostreaming = false
console.error("Closing:info"); console.error('Closing:info')
}; }
} }
setInterval(function() { setInterval(function() {
if (!infostreaming) { if (!infostreaming) {
console.log("try to connect to base-streaming"); console.log('try to connect to base-streaming')
infowebsocket(); infowebsocket()
} }
}, 10000); }, 10000)
function openRN() { function openRN() {
$("#releasenote").modal("open"); $('#releasenote').modal('open')
if (lang.language == "ja") { if (lang.language == 'ja') {
verp = ver.replace("(", ""); verp = ver.replace('(', '')
verp = verp.replace(".", "-"); verp = verp.replace('.', '-')
verp = verp.replace(".", "-"); verp = verp.replace('.', '-')
verp = verp.replace("[", "-"); verp = verp.replace('[', '-')
verp = verp.replace("]", ""); verp = verp.replace(']', '')
verp = verp.replace(")", ""); verp = verp.replace(')', '')
verp = verp.replace(" ", "_"); verp = verp.replace(' ', '_')
$("#release-" + verp).show(); $('#release-' + verp).show()
} else { } else {
$("#release-en").show(); $('#release-en').show()
} }
} }
function closeSupport() { function closeSupport() {
$("#support-btm").animate( $('#support-btm').animate(
{ {
bottom: "-300px" bottom: '-300px'
}, },
{ {
duration: 300, duration: 300,
complete: function() { complete: function() {
$("#support-btm").addClass("hide"); $('#support-btm').addClass('hide')
} }
} }
); )
} }
function storeDialog(platform, ver) { function storeDialog(platform, ver) {
if (platform == "win32") { if (platform == 'win32') {
var mes = lang.lang_version_platform; var mes = lang.lang_version_platform
} else if (platform == "linux") { } else if (platform == 'linux') {
var mes = lang.lang_version_platform_linux; var mes = lang.lang_version_platform_linux
} else if (platform == "darwin") { } else if (platform == 'darwin') {
var mes = lang.lang_version_platform_mac; var mes = lang.lang_version_platform_mac
} }
Swal.fire({ Swal.fire({
title: "Select your platform", title: 'Select your platform',
text: mes, text: mes,
type: "info", type: 'info',
showCancelButton: true, showCancelButton: true,
confirmButtonColor: "#3085d6", confirmButtonColor: '#3085d6',
cancelButtonColor: "#3085d6", cancelButtonColor: '#3085d6',
confirmButtonText: lang.lang_no, confirmButtonText: lang.lang_no,
cancelButtonText: lang.lang_yesno cancelButtonText: lang.lang_yesno
}).then(result => { }).then(result => {
//逆にしてる //逆にしてる
if (!result.value) { if (!result.value) {
localStorage.setItem("winstore", "winstore"); localStorage.setItem('winstore', 'winstore')
} else { } else {
localStorage.setItem("winstore", "localinstall"); localStorage.setItem('winstore', 'localinstall')
} }
localStorage.setItem("ver", ver); localStorage.setItem('ver', ver)
show = 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() { $(document).ready(function() {
$("#releasenote").modal("open"); $('#releasenote').modal('open')
verp = ver.replace("(", ""); var verp = ver.replace('(', '')
verp = verp.replace(".", "-"); verp = verp.replace('.', '-')
verp = verp.replace(".", "-"); verp = verp.replace('.', '-')
verp = verp.replace("[", "-"); verp = verp.replace('[', '-')
verp = verp.replace("]", ""); verp = verp.replace(']', '')
verp = verp.replace(")", ""); verp = verp.replace(')', '')
verp = verp.replace(" ", "_"); verp = verp.replace(' ', '_')
console.log("%c " + verp, "color: red;font-size:200%;"); console.log('%c ' + verp, 'color: red;font-size:200%;')
if (lang.language == "ja") { if (lang.language == 'ja') {
$("#release-" + verp).show(); $('#release-' + verp).show()
} else { } else {
$("#release-en").show(); $('#release-en').show()
} }
}); })
}); })
} }
function closeStart() { function closeStart() {
$("#start").css("display", "none"); $('#start').css('display', 'none')
var platform = localStorage.getItem("platform"); var platform = localStorage.getItem('platform')
var ver = localStorage.getItem("ver"); var ver = localStorage.getItem('ver')
storeDialog(platform, ver); storeDialog(platform, ver)
} }

View File

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

View File

@ -1,3 +1,4 @@
'use strict'
var activity=[ var activity=[
{shortcode:"soccer",css:"4.16667% 10.4167%"}, {shortcode:"soccer",css:"4.16667% 10.4167%"},
{shortcode:"basketball",css:"16.6667% 56.25%"}, {shortcode:"basketball",css:"16.6667% 56.25%"},

View File

@ -1,3 +1,4 @@
'use strict'
//インスタンスリスト //インスタンスリスト
var idata = { var idata = {
"kirishima.cloud": "instance", "kirishima.cloud": "instance",

View File

@ -1,3 +1,4 @@
'use strict'
/*ログイン処理・認証までのJS*/ /*ログイン処理・認証までのJS*/
//最初に読むやつ //最初に読むやつ
//アスタルテ判定初期化 //アスタルテ判定初期化
@ -379,9 +380,7 @@ function ckdb(acct_id) {
localStorage.setItem('imas', 'true') localStorage.setItem('imas', 'true')
$('.imasonly').show() $('.imasonly').show()
} }
var at = localStorage.getItem('acct_' + acct_id + '_at')
var bbcode = domain + '_bbcode' var bbcode = domain + '_bbcode'
var letters = domain + '_letters'
var quoteMarker = domain + '_quote' var quoteMarker = domain + '_quote'
if (localStorage.getItem('instance')) { if (localStorage.getItem('instance')) {
var json = JSON.parse(localStorage.getItem('instance')) var json = JSON.parse(localStorage.getItem('instance'))
@ -579,10 +578,10 @@ function multiSelector(parseC) {
//バージョンエンコ //バージョンエンコ
function enc(ver) { function enc(ver) {
var ver = ver.replace(/\s/g, '') var ver = ver.replace(/\s/g, '')
var ver = ver.replace(/\(/g, '-') ver = ver.replace(/\(/g, '-')
var ver = ver.replace(/\)/g, '') ver = ver.replace(/\)/g, '')
var ver = ver.replace(/\[/g, '_') ver = ver.replace(/\[/g, '_')
var ver = ver.replace(/\]/g, '') ver = ver.replace(/\]/g, '')
return ver return ver
} }
//インスタンスティッカー //インスタンスティッカー

View File

@ -1,3 +1,4 @@
'use strict'
//ログアウトします //ログアウトします
function logout() { function logout() {
localStorage.removeItem("acct_" + acct_id + "_at"); localStorage.removeItem("acct_" + acct_id + "_at");

View File

@ -1,3 +1,4 @@
'use strict'
//アカウントマネージャ //アカウントマネージャ
//最初に読むやつ //最初に読むやつ
function load() { function load() {
@ -61,7 +62,7 @@ function load() {
<i class="material-icons">refresh</i>${lang.lang_manager_refresh} <i class="material-icons">refresh</i>${lang.lang_manager_refresh}
</a> </a>
<a class="waves-effect disTar pointer red-text" onclick="multiDel('${key}')"> <a class="waves-effect disTar pointer red-text" onclick="multiDel('${key}')">
<i class="material-icons">delete</i>${lang.lang_manager_delete}" <i class="material-icons">delete</i>${lang.lang_manager_delete}
</a><br />${lang.lang_manager_color} </a><br />${lang.lang_manager_color}
<div id="colorsel_${key}" class="colorsel"></div> <div id="colorsel_${key}" class="colorsel"></div>
</div> </div>
@ -316,14 +317,8 @@ function support() {
Object.keys(idata).forEach(function(key) { Object.keys(idata).forEach(function(key) {
var instance = idata[key] var instance = idata[key]
if (instance == 'instance') { if (instance == 'instance') {
templete = var templete =
'<a onclick="login(\'' + `<a onclick="login('${key}')" class="collection-item pointer transparent">${idata[key + '_name']}(${key})</a>`
key +
'\')" class="collection-item pointer transparent">' +
idata[key + '_name'] +
'(' +
key +
')</a>'
$('#support').append(templete) $('#support').append(templete)
} }
}) })
@ -331,8 +326,6 @@ function support() {
//URL指定してポップアップ //URL指定してポップアップ
function login(url) { function login(url) {
var multi = localStorage.getItem('multi')
var obj = JSON.parse(multi)
if ($('#misskey:checked').val() == 'on') { if ($('#misskey:checked').val() == 'on') {
$('#misskey').prop('checked', true) $('#misskey').prop('checked', true)
misskeyLogin(url) misskeyLogin(url)
@ -938,7 +931,6 @@ function multisel() {
} else { } else {
var obj = JSON.parse(multi) var obj = JSON.parse(multi)
} }
var templete
var last = localStorage.getItem('main') var last = localStorage.getItem('main')
var sel var sel
if (obj.length < 1) { if (obj.length < 1) {
@ -947,21 +939,18 @@ function multisel() {
} else { } else {
Object.keys(obj).forEach(function(key) { Object.keys(obj).forEach(function(key) {
var acct = obj[key] var acct = obj[key]
var list = key * 1 + 1
if (key == last) { if (key == last) {
sel = 'selected' sel = 'selected'
mainb = '(' + lang.lang_manager_def + ')' var mainb = '(' + lang.lang_manager_def + ')'
var domain = localStorage.getItem('domain_' + key)
var profimg = localStorage.getItem('prof_' + key) var profimg = localStorage.getItem('prof_' + key)
var domain = localStorage.getItem('domain_' + key)
if (!profimg) { if (!profimg) {
profimg = '../../img/missing.svg' profimg = '../../img/missing.svg'
} }
} else { } else {
sel = '' sel = ''
mainb = '' var mainb = ''
} }
template = ` var template = `
<option value="${key}" data-icon="${acct.prof}" class="left circle" ${sel}> <option value="${key}" data-icon="${acct.prof}" class="left circle" ${sel}>
${acct.user}@${acct.domain}${mainb} ${acct.user}@${acct.domain}${mainb}
</option> </option>
@ -977,7 +966,7 @@ function mainacct() {
M.toast({ html: lang.lang_manager_mainAcct, displayLength: 3000 }) M.toast({ html: lang.lang_manager_mainAcct, displayLength: 3000 })
} }
function colorpicker(key) { function colorpicker(key) {
temp = `<div onclick="coloradd('${key}','def','def')" class="pointer exc">${lang.lang_manager_none}</div> var temp = `<div onclick="coloradd('${key}','def','def')" class="pointer exc">${lang.lang_manager_none}</div>
<div onclick="coloradd('${key}','f44336','white')" class="red white-text pointer"></div> <div onclick="coloradd('${key}','f44336','white')" class="red white-text pointer"></div>
<div onclick="coloradd('${key}','e91e63','white')" class="pink white-text pointer"></div> <div onclick="coloradd('${key}','e91e63','white')" class="pink white-text pointer"></div>
<div onclick="coloradd('${key}','9c27b0','white')" class="purple white-text pointer"></div> <div onclick="coloradd('${key}','9c27b0','white')" class="purple white-text pointer"></div>

View File

@ -1,3 +1,4 @@
'use strict'
//プラットフォーム別 最後に読むやつ //プラットフォーム別 最後に読むやつ
//リンクを外部で開くか内部で出すか //リンクを外部で開くか内部で出すか
$(document).on('click', 'a', e => { $(document).on('click', 'a', e => {
@ -10,7 +11,7 @@ $(document).on('click', 'a', e => {
if (url) { if (url) {
urls = url.match(/https?:\/\/(.+)/) urls = url.match(/https?:\/\/(.+)/)
//トゥートのURLぽかったら //トゥートのURLぽかったら
toot = url.match(/https:\/\/([^+_]+)\/@([a-zA-Z0-9_]+)\/([0-9]+)/) var toot = url.match(/https:\/\/([^+_]+)\/@([a-zA-Z0-9_]+)\/([0-9]+)/)
if (!toot) { if (!toot) {
//Pleroma対策 //Pleroma対策
toot = url.match(/https:\/\/([^+_]+)\/users\/([a-zA-Z0-9_]+)\/statuses\/([0-9]+)/) toot = url.match(/https:\/\/([^+_]+)\/users\/([a-zA-Z0-9_]+)\/statuses\/([0-9]+)/)
@ -103,7 +104,7 @@ function playSound() {
if (soundFile) { if (soundFile) {
soundFile.stop() soundFile.stop()
} }
context = new AudioContext() var context = new AudioContext()
context.createBufferSource().start(0) context.createBufferSource().start(0)
context.decodeAudioData(request.response, function(buf) { context.decodeAudioData(request.response, function(buf) {
//console.log("Playing:" , source) //console.log("Playing:" , source)
@ -123,11 +124,6 @@ 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], '*')

View File

@ -1 +1,2 @@
'use strict'
//jQuery読む //jQuery読む

View File

@ -1,3 +1,4 @@
'use strict'
document.title = 'TheDesk' document.title = 'TheDesk'
$.strip_tags = function(str, allowed) { $.strip_tags = function(str, allowed) {
if (!str) { if (!str) {

View File

@ -1,3 +1,4 @@
'use strict'
//TL取得 //TL取得
var websocket var websocket
function tl(data) { function tl(data) {

View File

@ -1,9 +1,10 @@
'use strict'
var electron = require('electron') var electron = require('electron')
const shell = electron.shell const shell = electron.shell
var ipc = electron.ipcRenderer var ipc = electron.ipcRenderer
onmessage = function(e) { onmessage = function(e) {
if (e.data[0] == 'openUrl') { if (e.data[0] == 'openUrl') {
urls = e.data[1].match(/https?:\/\/(.+)/) var urls = e.data[1].match(/https?:\/\/(.+)/)
if (urls) { if (urls) {
shell.openExternal(e.data[1]) shell.openExternal(e.data[1])
} }

View File

@ -1,3 +1,4 @@
'use strict'
/*! https://mths.be/punycode v1.4.1 by @mathias */ /*! https://mths.be/punycode v1.4.1 by @mathias */
;(function(root) { ;(function(root) {
/** Detect free variables */ /** Detect free variables */

View File

@ -1,3 +1,4 @@
'use strict'
//BBCodeとMarkdownの入力・パーサー //BBCodeとMarkdownの入力・パーサー
//アカウント変えた時にBBとかMDとか //アカウント変えた時にBBとかMDとか
function mdCheck() { function mdCheck() {

View File

@ -1,3 +1,4 @@
'use strict'
//絵文字ピッカー //絵文字ピッカー
//最初に読み込む //最初に読み込む
$('#emoji-before').addClass('disabled') $('#emoji-before').addClass('disabled')

View File

@ -1,3 +1,4 @@
'use strict'
//ドラッグ・アンド・ドロップからアップロードまで。uiのimg.jsとは異なります。 //ドラッグ・アンド・ドロップからアップロードまで。uiのimg.jsとは異なります。
var obj = $('body') var obj = $('body')
var system var system

View File

@ -1,3 +1,4 @@
'use strict'
//Renpost //Renpost
function renote(id, acct_id, remote) { function renote(id, acct_id, remote) {
if ($('#pub_' + id).hasClass('rted')) { if ($('#pub_' + id).hasClass('rted')) {

View File

@ -1,3 +1,4 @@
'use strict'
/*投稿系*/ /*投稿系*/
//投稿 //投稿
function sec() { function sec() {

View File

@ -1,3 +1,4 @@
'use strict'
/*保護系*/ /*保護系*/
//画像保護 //画像保護
function nsfw() { function nsfw() {

View File

@ -1,3 +1,4 @@
'use strict'
//お気に入り登録やブースト等、フォローやブロック等 //お気に入り登録やブースト等、フォローやブロック等
//お気に入り登録 //お気に入り登録
function fav(id, acct_id, remote) { function fav(id, acct_id, remote) {

View File

@ -1,3 +1,4 @@
'use strict'
//入力時にハッシュタグと@をサジェスト //入力時にハッシュタグと@をサジェスト
var timer = null var timer = null

View File

@ -1,3 +1,4 @@
'use strict'
/*リプライ*/ /*リプライ*/
function re(id, ats_cm, acct_id, mode) { function re(id, ats_cm, acct_id, mode) {
clear() clear()

View File

@ -1,3 +1,4 @@
'use strict'
//カード処理やメンション、ハッシュタグの別途表示 //カード処理やメンション、ハッシュタグの別途表示
//全てのTL処理で呼び出し //全てのTL処理で呼び出し
function additional(acct_id, tlid) { function additional(acct_id, tlid) {
@ -37,7 +38,7 @@ function additional(acct_id, tlid) {
} }
//トゥートのURLぽかったら //トゥートのURLぽかったら
toot = text.match(/https:\/\/([a-zA-Z0-9.-]+)\/@([a-zA-Z0-9_]+)\/([0-9]+)/) var toot = text.match(/https:\/\/([a-zA-Z0-9.-]+)\/@([a-zA-Z0-9_]+)\/([0-9]+)/)
if (toot) { if (toot) {
if (toot[1]) { if (toot[1]) {
$(this).attr('data-acct', acct_id) $(this).attr('data-acct', acct_id)
@ -172,7 +173,7 @@ function additionalIndv(tlid, acct_id, id) {
console.error(error) console.error(error)
}) })
.then(function(json) { .then(function(json) {
cards = json.card var cards = json.card
var analyze = cardHtml(cards, acct_id, id) var analyze = cardHtml(cards, acct_id, id)
$('[toot-id=' + id + '] .additional').html(analyze) $('[toot-id=' + id + '] .additional').html(analyze)
if (json.title) { if (json.title) {

View File

@ -1,3 +1,4 @@
'use strict'
//トゥートの詳細 //トゥートの詳細
function details(id, acct_id, tlid, mode) { function details(id, acct_id, tlid, mode) {
if (mode == 'dm') { if (mode == 'dm') {

View File

@ -1,3 +1,4 @@
'use strict'
//日付パーサー //日付パーサー
function date(str, datetype) { function date(str, datetype) {
if (datetype == "relative") { if (datetype == "relative") {

View File

@ -1,3 +1,4 @@
'use strict'
//ディレクトリ //ディレクトリ
//ディレクトリトグル //ディレクトリトグル
function dirMenu() { function dirMenu() {

View File

@ -1,3 +1,4 @@
'use strict'
/*メディアフィルター機能*/ /*メディアフィルター機能*/
//各TL上方のMedia[On/Off] //各TL上方のMedia[On/Off]
function mediaToggle(tlid) { function mediaToggle(tlid) {

View File

@ -1,3 +1,4 @@
'use strict'
function listMenu() { function listMenu() {
$('#left-menu div').removeClass('active') $('#left-menu div').removeClass('active')
$('#listMenu').addClass('active') $('#listMenu').addClass('active')

View File

@ -1,3 +1,4 @@
'use strict'
function escapeHTMLtemp(str) { function escapeHTMLtemp(str) {
if (!str) { if (!str) {
return ""; return "";

View File

@ -1,3 +1,4 @@
'use strict'
//Integrated TL //Integrated TL
async function mixtl(acct_id, tlid, type, delc, voice) { async function mixtl(acct_id, tlid, type, delc, voice) {
localStorage.setItem('now', type) localStorage.setItem('now', type)

View File

@ -1,3 +1,4 @@
'use strict'
//通知 //通知
//取得+Streaming接続 //取得+Streaming接続
function notf(acct_id, tlid, sys) { function notf(acct_id, tlid, sys) {

View File

@ -1,3 +1,4 @@
'use strict'
//Integrated TL //Integrated TL
function mixtl(acct_id, tlid, type, delc, voice) { function mixtl(acct_id, tlid, type, delc, voice) {
localStorage.removeItem('morelock') localStorage.removeItem('morelock')

View File

@ -1,3 +1,4 @@
'use strict'
//オブジェクトパーサー(トゥート) //オブジェクトパーサー(トゥート)
function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) { function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
var splitter = new GraphemeSplitter() var splitter = new GraphemeSplitter()
@ -539,11 +540,11 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
.match( .match(
/https?:\/\/([^+_]+)\/?(?!.*((media|tags)|mentions)).*([-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)?/ /https?:\/\/([^+_]+)\/?(?!.*((media|tags)|mentions)).*([-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)?/
) )
urlsck = content.match(/(https?):\/\/([^<>]*?)\/([^"]*)/g) var urlsck = content.match(/(https?):\/\/([^<>]*?)\/([^"]*)/g)
if (urlsck) { if (urlsck) {
for (var urlct = 0; urlct < urlsck.length; urlct++) { for (var urlct = 0; urlct < urlsck.length; urlct++) {
var urlindv = urlsck[urlct] var urlindv = urlsck[urlct]
urlCont = urlindv.match(/(https?):\/\/([^a-zA-Z0-9.-]*?)\.(.+?)\/([^"]*)/) var urlCont = urlindv.match(/(https?):\/\/([^a-zA-Z0-9.-]*?)\.(.+?)\/([^"]*)/)
if (urlCont) { if (urlCont) {
urlindv = urlindv.replace(/[.*+?^=!:${}()|[\]\/\\]/g, '\\$&') urlindv = urlindv.replace(/[.*+?^=!:${}()|[\]\/\\]/g, '\\$&')
var encoded = encodeURI(urlCont[4]) var encoded = encodeURI(urlCont[4])

View File

@ -1,3 +1,4 @@
'use strict'
//アンケートのトグル //アンケートのトグル
function pollToggle() { function pollToggle() {
if ($('#poll').hasClass('hide')) { if ($('#poll').hasClass('hide')) {

View File

@ -1,8 +1,9 @@
$voise = null 'use strict'
isBouyomi = localStorage.getItem('voice_bouyomi') var $voise = null
$voiseName = lang.lang_speech var isBouyomi = localStorage.getItem('voice_bouyomi')
$voices = speechSynthesis.getVoices() var $voiseName = lang.lang_speech
$synthes = new SpeechSynthesisUtterance() var $voices = speechSynthesis.getVoices()
var $synthes = new SpeechSynthesisUtterance()
$voise = $.grep($voices, function(n, i) { $voise = $.grep($voices, function(n, i) {
return n.name == $voiseName return n.name == $voiseName
})[0] })[0]
@ -12,14 +13,14 @@ speechSynthesis.cancel()
if (!localStorage.getItem('voice_vol')) { if (!localStorage.getItem('voice_vol')) {
localStorage.setItem('voice_vol', 1) localStorage.setItem('voice_vol', 1)
} }
voiceRate = localStorage.getItem('voice_speed') var voiceRate = localStorage.getItem('voice_speed')
$synthes.rate = voiceRate $synthes.rate = voiceRate
voicePitch = localStorage.getItem('voice_pitch') var voicePitch = localStorage.getItem('voice_pitch')
$synthes.pitch = voicePitch $synthes.pitch = voicePitch
voiceVol = localStorage.getItem('voice_vol') var voiceVol = localStorage.getItem('voice_vol')
$synthes.volume = voiceVol $synthes.volume = voiceVol
function say(msgr) { function say(msgr) {
msg = voiceParse(msgr) var msg = voiceParse(msgr)
var voice = localStorage.getItem('voicebank') var voice = localStorage.getItem('voicebank')
var obj = JSON.parse(voice) var obj = JSON.parse(voice)
if (!obj) { if (!obj) {
@ -31,7 +32,7 @@ function say(msgr) {
localStorage.setItem('voicebank', json) localStorage.setItem('voicebank', json)
} }
} }
$repeat = setInterval(function() { var $repeat = setInterval(function() {
if (!speechSynthesis.speaking) { if (!speechSynthesis.speaking) {
var voice = localStorage.getItem('voicebank') var voice = localStorage.getItem('voicebank')
if (voice) { if (voice) {
@ -72,7 +73,7 @@ $repeat = setInterval(function() {
} }
}, 300) }, 300)
function voiceParse(msg) { function voiceParse(msg) {
msg = $.strip_tags(msg) var msg = $.strip_tags(msg)
msg = msg.replace(/#/g, '') msg = msg.replace(/#/g, '')
msg = msg.replace(/'/g, '') msg = msg.replace(/'/g, '')
msg = msg.replace(/"/g, '') msg = msg.replace(/"/g, '')

View File

@ -1,3 +1,4 @@
'use strict'
//検索 //検索
//検索ボックストグル //検索ボックストグル
function searchMenu() { function searchMenu() {

View File

@ -1,3 +1,4 @@
'use strict'
//タグ表示 //タグ表示
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=(.+)/)

View File

@ -1,5 +1,6 @@
'use strict'
//TL取得 //TL取得
moreloading = false var moreloading = false
var errorct = 0 var errorct = 0
function tl(type, data, acct_id, tlid, delc, voice, mode) { function tl(type, data, acct_id, tlid, delc, voice, mode) {
scrollevent() scrollevent()

View File

@ -1,3 +1,4 @@
'use strict'
/*イメージビューワー*/ /*イメージビューワー*/
//postのimg.jsとは異なります。 //postのimg.jsとは異なります。
function imgv(id, key, acct_id) { function imgv(id, key, acct_id) {
@ -76,7 +77,7 @@ function imgCont(type) {
} }
function imageXhr(id, key, murl) { function imageXhr(id, key, murl) {
var startTime = new Date() var startTime = new Date()
xhr = new XMLHttpRequest() var xhr = new XMLHttpRequest()
xhr.open('GET', murl, true) xhr.open('GET', murl, true)
xhr.responseType = 'arraybuffer' xhr.responseType = 'arraybuffer'
xhr.addEventListener( xhr.addEventListener(
@ -104,7 +105,7 @@ function imageXhr(id, key, murl) {
) )
xhr.onreadystatechange = function() { xhr.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) { if (this.readyState == 4 && this.status == 200) {
r = new FileReader() var r = new FileReader()
r.readAsDataURL(this.response) r.readAsDataURL(this.response)
r.onload = function() { r.onload = function() {
var b64 = r.result var b64 = r.result

View File

@ -1,3 +1,4 @@
'use strict'
//レイアウトの設定 //レイアウトの設定
var websocketOld = [] var websocketOld = []
@ -706,7 +707,7 @@ function setToggleTag(tlid) {
} }
} }
function colorpicker(key) { function colorpicker(key) {
temp = `<div onclick="coloradd('${key}','def','def')" class="pointer">Default</div> var temp = `<div onclick="coloradd('${key}','def','def')" class="pointer">Default</div>
<div onclick="coloradd('${key}','f44336','white')" class="red white-text pointer">Red</div> <div onclick="coloradd('${key}','f44336','white')" class="red white-text pointer">Red</div>
<div onclick="coloradd('${key}','e91e63','white')" class="pink white-text pointer">Pink</div> <div onclick="coloradd('${key}','e91e63','white')" class="pink white-text pointer">Pink</div>
<div onclick="coloradd('${key}','9c27b0','white')" class="purple white-text pointer">Purple</div> <div onclick="coloradd('${key}','9c27b0','white')" class="purple white-text pointer">Purple</div>

View File

@ -1,3 +1,4 @@
'use strict'
function menu() { function menu() {
localStorage.setItem("menu-done", true); localStorage.setItem("menu-done", true);
$("#fukidashi").addClass("hide") $("#fukidashi").addClass("hide")

View File

@ -1,3 +1,4 @@
'use strict'
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");

View File

@ -1,3 +1,4 @@
'use strict'
/*ささやきボックス(Cr民並感)*/ /*ささやきボックス(Cr民並感)*/
//✕隠す //✕隠す
function hide() { function hide() {

View File

@ -1,3 +1,4 @@
'use strict'
var r = document.getElementById("radio"); var r = document.getElementById("radio");
function Rtoggle() { function Rtoggle() {
if ($("#radio").hasClass("play")) { if ($("#radio").hasClass("play")) {

View File

@ -1,3 +1,4 @@
'use strict'
//スクロールで続きを読む //スクロールで続きを読む
function scrollevent() { function scrollevent() {
$('.tl-box').scroll(function() { $('.tl-box').scroll(function() {

View File

@ -1,3 +1,4 @@
'use strict'
//設定(setting.html)で読む //設定(setting.html)で読む
var envView = new Vue({ var envView = new Vue({
el: "#envView", el: "#envView",

View File

@ -1,3 +1,4 @@
'use strict'
//ソートデータ読み込み //ソートデータ読み込み
function sortLoad () { function sortLoad () {
$("#sort").html(""); $("#sort").html("");

View File

@ -1,3 +1,4 @@
'use strict'
function spotifyConnect() { function spotifyConnect() {
var auth = "https://accounts.spotify.com/authorize?client_id=0f18e54abe0b4aedb4591e353d3aff69&redirect_uri=https://thedesk.top/spotify-connect&response_type=code&scope=user-read-currently-playing"; var auth = "https://accounts.spotify.com/authorize?client_id=0f18e54abe0b4aedb4591e353d3aff69&redirect_uri=https://thedesk.top/spotify-connect&response_type=code&scope=user-read-currently-playing";
var platform = localStorage.getItem("platform"); var platform = localStorage.getItem("platform");

View File

@ -1,3 +1,4 @@
'use strict'
//テーマ適用 //テーマ適用
function themes(theme) { function themes(theme) {
if (!theme) { if (!theme) {

View File

@ -1,3 +1,4 @@
'use strict'
//左下のメッセージ //左下のメッセージ
var todcTrigger = null var todcTrigger = null
function todo(mes) { function todo(mes) {
@ -128,7 +129,7 @@ function trendTagonTip() {
}) })
} }
//Spotify //Spotify
spotint = null var spotint = null
function spotifytips() { function spotifytips() {
if (spotint) clearInterval(spotint) if (spotint) clearInterval(spotint)
var start = var start =

View File

@ -1,3 +1,4 @@
'use strict'
//ユーザーデータ表示 //ユーザーデータ表示
//タイムライン //タイムライン
function utl(user, more, acct_id) { function utl(user, more, acct_id) {

View File

@ -1,3 +1,4 @@
'use strict'
//プロフ編集 //プロフ編集
//文字系 //文字系
function profedit() { function profedit() {

View File

@ -1,3 +1,4 @@
'use strict'
//ユーザーデータ表示 //ユーザーデータ表示
localStorage.removeItem("history"); localStorage.removeItem("history");
//コード受信 //コード受信