TheDesk Miho (ver.10)

This commit is contained in:
cutls 2018-02-13 04:16:46 +09:00
parent eec72767c6
commit 1d92abf550
14 changed files with 145 additions and 20 deletions

View File

@ -132,6 +132,9 @@ blockquote:before, .quote:before {
#drag-content { #drag-content {
font-size: 200%; font-size: 200%;
} }
.radio{
font-family:'Yanone Kaffeesatz'
}
/*black theme*/ /*black theme*/
.blacktheme body { .blacktheme body {

View File

@ -84,12 +84,14 @@ p {
background-color:white; background-color:white;
display: inline-block; display: inline-block;
position: relative; position: relative;
font-family: Open Sans;
margin-right: 10px; margin-right: 10px;
width:100%; width:100%;
z-index:1000; z-index:1000;
height:60px; height:60px;
} }
.tl-title {
font-family: Open Sans;
}
#tools { #tools {
position: fixed; position: fixed;
top: 10px; top: 10px;
@ -97,7 +99,7 @@ p {
float: right; float: right;
} }
.setting { .setting {
font-size: 7px; font-size: 10px;
color: gray; color: gray;
cursor: pointer; cursor: pointer;
} }

View File

@ -10,7 +10,7 @@
<link href='./css/userdata.css' rel='stylesheet' type='text/css'> <link href='./css/userdata.css' rel='stylesheet' type='text/css'>
<link href='./css/post.css' rel='stylesheet' type='text/css'> <link href='./css/post.css' rel='stylesheet' type='text/css'>
<link href="./css/master.css" type="text/css" rel="stylesheet"> <link href="./css/master.css" type="text/css" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons|Open+Sans:300" rel="stylesheet"> <link href="https://fonts.googleapis.com/icon?family=Material+Icons|Open+Sans:300|Yanone+Kaffeesatz" rel="stylesheet">
<meta charset="utf-8"> <meta charset="utf-8">
</head> </head>
<body> <body>
@ -23,7 +23,7 @@
<script type="text/javascript" src="./js/common/keyshortcut.js"></script> <script type="text/javascript" src="./js/common/keyshortcut.js"></script>
<script type="text/javascript" src="./js/common/modal.js"></script> <script type="text/javascript" src="./js/common/modal.js"></script>
<script> <script>
var ver="Miho (ver.9)"; var ver="Miho (ver.10)";
//betaを入れるとバージョンチェックしない //betaを入れるとバージョンチェックしない
//var ver="beta"; //var ver="beta";
var acct_id=0; var acct_id=0;
@ -112,6 +112,19 @@ var tlid=0;
<a href="acct.html"><i class="material-icons nex" title="アカウント管理">account_circle</i></a> <a href="acct.html"><i class="material-icons nex" title="アカウント管理">account_circle</i></a>
<a href="index.html" class="setting nex"><i class="material-icons nex" title="スーパーリロード">refresh</i></a> <a href="index.html" class="setting nex"><i class="material-icons nex" title="スーパーリロード">refresh</i></a>
<a onclick="window.open('https://thedesk.top/labo.php');" class="setting nex" target="_blank" id="ranking-btn" style="display:none;"><i class="material-icons nex" title="アスタルテランキング">timeline</i></a> <a onclick="window.open('https://thedesk.top/labo.php');" class="setting nex" target="_blank" id="ranking-btn" style="display:none;"><i class="material-icons nex" title="アスタルテランキング">timeline</i></a>
<a onclick="Rtoggle()" class="setting nex" id="radio-btn"><i class="material-icons nex" title="Radio">play_circle_outline</i></a><span id="radio-sta" class="radio"></span>
<div id="radio-view" class="hide radio">
<span class="cbadge pointer" onclick="Rplay('https://listen.moe/stream','Listen.moe')" data-name="Listen.moe">Listen.moe</span>
<span class="cbadge pointer" onclick="Rplay('http://itori.animenfo.com:443','AnimeNfo Radio')" data-name="AnimeNfo Radio">AnimeNfo Radio</span>
<span class="cbadge pointer" onclick="Rplay('http://hyades.shoutca.st:8043/stream','LoFi hip hop Radio')" data-name="LoFi hip hop Radio">LoFi hip hop Radio</span>
<span class="cbadge pointer" onclick="Rplay('http://89.16.185.174:8004/stream','Linn Classical')" data-name="Linn Classical">Linn Classical</span>
<span class="cbadge pointer" onclick="Ryourself()">Others</span>
</div>
<div id="radio-input" class="hide radio">
<input type="url" id="radio-url" placeholder="URL" style="width:100px">
<button class="btn waves-effect" onclick="Rinput()">Play</button>
<button class="btn waves-effect" onclick="Rselect()">Presets</button>
</div>
<div class="row" style="margin-bottom:0;"> <div class="row" style="margin-bottom:0;">
<span class="sml"><span class="gray">画面内どこでもドラッグ・アンド・ドロップできます。</span><br></span>アカウント選択</span><br> <span class="sml"><span class="gray">画面内どこでもドラッグ・アンド・ドロップできます。</span><br></span>アカウント選択</span><br>
<div class="input-field"> <div class="input-field">
@ -129,7 +142,11 @@ var tlid=0;
<i class="material-icons pointer setting" onclick="tagsel('s')" title="取り消し(Ctrl+S)テキストボックス内を選択してから押すと囲みます。">strikethrough_s</i> <i class="material-icons pointer setting" onclick="tagsel('s')" title="取り消し(Ctrl+S)テキストボックス内を選択してから押すと囲みます。">strikethrough_s</i>
<i class="material-icons pointer setting" onclick="markdown('>','no','yes')" title="引用">format_quote</i> <i class="material-icons pointer setting" onclick="markdown('>','no','yes')" title="引用">format_quote</i>
<i class="material-icons pointer setting" onclick="markdown('#','no','yes')" title="見出し">short_text</i> <i class="material-icons pointer setting" onclick="markdown('#','no','yes')" title="見出し">short_text</i>
<i class="material-icons pointer setting" onclick="markdown('`','yes','no')" title="コード挿入">code</i> <i class="material-icons pointer setting" onclick="markdown('`','yes','no')" title="コード挿入 テキストボックス内を選択してから押すと囲みます。">code</i>
<i class="material-icons pointer setting" onclick="markdown('- ','yes','yes')" title="箇条書きリスト">format_list_bulleted</i>
<i class="material-icons pointer setting" onclick="markdown('1. ','yes','yes')" title="番号付きリスト">format_list_numbered</i>
<i class="pointer setting fa fa-subscript" onclick="markdown('__','yes','no','before')" title="下付き文字 テキストボックス内を選択してから押すと囲みます。" style="font-size:24px"></i>
<i class="pointer setting fa fa-superscript" onclick="markdown('_','yes','no','before')" title="上付き文字 テキストボックス内を選択してから押すと囲みます。" style="font-size:24px"></i>
<i class="material-icons pointer setting" onclick="tagsel('spin')" title="回転 テキストボックス内を選択してから押すと囲みます。">autorenew</i> <i class="material-icons pointer setting" onclick="tagsel('spin')" title="回転 テキストボックス内を選択してから押すと囲みます。">autorenew</i>
<i class="material-icons pointer setting" onclick="tagsel('pulse')" title="点滅 テキストボックス内を選択してから押すと囲みます。">flare</i> <i class="material-icons pointer setting" onclick="tagsel('pulse')" title="点滅 テキストボックス内を選択してから押すと囲みます。">flare</i>
<i class="material-icons pointer setting" onclick="tagsel('flip=vertical')" title="上下反転 テキストボックス内を選択してから押すと囲みます。">swap_vert</i> <i class="material-icons pointer setting" onclick="tagsel('flip=vertical')" title="上下反転 テキストボックス内を選択してから押すと囲みます。">swap_vert</i>
@ -351,7 +368,8 @@ var tlid=0;
</div> </div>
<!--左下メッセージ--> <!--左下メッセージ-->
<div id="message"></div> <div id="message"></div>
<!--Radio-->
<audio src="" id="radio"></audio>
<script type="text/javascript" src="./js/common/about.js"></script> <script type="text/javascript" src="./js/common/about.js"></script>
<script type="text/javascript" src="./js/tl/parse.js"></script> <script type="text/javascript" src="./js/tl/parse.js"></script>
<script type="text/javascript" src="./js/ui/scroll.js"></script> <script type="text/javascript" src="./js/ui/scroll.js"></script>
@ -368,6 +386,7 @@ var tlid=0;
<script type="text/javascript" src="./js/ui/post-box.js"></script> <script type="text/javascript" src="./js/ui/post-box.js"></script>
<script type="text/javascript" src="./js/ui/img.js"></script> <script type="text/javascript" src="./js/ui/img.js"></script>
<script type="text/javascript" src="./js/ui/theme.js"></script> <script type="text/javascript" src="./js/ui/theme.js"></script>
<script type="text/javascript" src="./js/ui/radio.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/reply.js"></script> <script type="text/javascript" src="./js/post/reply.js"></script>
<script type="text/javascript" src="./js/post/secure.js"></script> <script type="text/javascript" src="./js/post/secure.js"></script>

View File

@ -17,6 +17,13 @@ $(function($) {
return false; return false;
} }
} }
//Shift+Space:Markdownゼロ幅スペース
if (event.shiftKey) {
if (e.keyCode === 32) {
brInsert("");
return false;
}
}
//Esc:消す //Esc:消す
if (e.keyCode === 27) { if (e.keyCode === 27) {
hide(); hide();

View File

@ -59,7 +59,7 @@
$.strip_tags = function(str, allowed) { $.strip_tags = function(str, allowed) {
allowed = (((allowed || '') + '').toLowerCase().match(/<[a-z][a-z0-9]*>/g) || []) allowed = (((allowed || '') + '').toLowerCase().match(/<[a-z][a-z0-9]*>/g) || [])
.join(''); .join('');
var tags = /<\/?([a-z][a-z0-9]*)\b[^>]*>/gi, var tags = /<\/?([a-z][a-z0-9]*)\b[^>]*>?/gi,
commentsAndPhpTags = /<!--[\s\S]*?-->|<\?(?:php)?[\s\S]*?\?>/gi; commentsAndPhpTags = /<!--[\s\S]*?-->|<\?(?:php)?[\s\S]*?\?>/gi;
return str.replace(commentsAndPhpTags, '').replace(tags, function($0, $1) { return str.replace(commentsAndPhpTags, '').replace(tags, function($0, $1) {
return allowed.indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : ''; return allowed.indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : '';

View File

@ -94,8 +94,14 @@ function surroundHTML(tagS,tagE) {
target.value = beforeNode + insertNode + afterNode; target.value = beforeNode + insertNode + afterNode;
} }
} }
function markdown(tag,ck,br){ function markdown(tag,ck,br,space){
surroundMD(tag,tag,ck); if(space=="before"){
tagE=tag;
tag=" "+tag;
}else{
tagE=tag;
}
surroundMD(tag,tagE,ck,br);
$("#textarea").focus(); $("#textarea").focus();
} }
function surroundMD(tagS,tagE,ck,br) { function surroundMD(tagS,tagE,ck,br) {
@ -204,7 +210,7 @@ function preview(){
var bb=bb.replace(/\[colorhex=([A-Fa-f0-9]+)\](.+)\[\/colorhex\]/g,'<span style="color:#$1">$2<\/span>'); var bb=bb.replace(/\[colorhex=([A-Fa-f0-9]+)\](.+)\[\/colorhex\]/g,'<span style="color:#$1">$2<\/span>');
//code //code
var bb=bb.replace(/`(.+)`/g,'<code>$1<\/code>'); var bb=bb.replace(/`(.+)`/g,'<code>$1<\/code>');
//index //head
var m; var m;
m=bb.match(/^#{1,6}(.+)$/gm); m=bb.match(/^#{1,6}(.+)$/gm);
if(m){ if(m){
@ -214,12 +220,45 @@ function preview(){
var bb=bb.replace(new RegExp(m[i], ""),indexct); var bb=bb.replace(new RegExp(m[i], ""),indexct);
} }
} }
//list(ul)
var li;
li=bb.match(/^\- (.+)$/gm);
if(li){
for(let l = 0; l < li.length; l++) {
var u=li[l].match(/^\- (.+)$/);
var listUl='<li>'+u[1]+'</li>';
if(l == 0){
listUl='<ul>'+listUl;
}
if(l==li.length-1){
listUl=listUl+'</ul>';
}
var bb=bb.replace(new RegExp(li[l], ""),listUl);
}
}
//list(ol)
var li;
li=bb.match(/^1\. (.+)$/gm);
if(li){
for(let l = 0; l < li.length; l++) {
var u=li[l].match(/^1\. (.+)$/);
var listUl='<li>'+u[1]+'</li>';
if(l == 0){
listUl='<ol>'+listUl;
}
if(l==li.length-1){
listUl=listUl+'</ol>';
}
var bb=bb.replace(new RegExp(li[l], ""),listUl);
}
}
//img //img
var bb=bb.replace(/!\[(.+)\]\((https:\/\/[-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)\)/g,'<img src="$2" text="$1" style="width:100%">'); var bb=bb.replace(/!\[(.+)\]\((https:\/\/[-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)\)/g,'<img src="$2" text="$1" style="width:100%">');
//link //link
var bb=bb.replace(/\[(.+)\]\((https?:\/\/[-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)\)/g,'<a href="$2" target="_blank">$1<\/a>'); var bb=bb.replace(/\[(.+)\]\((https?:\/\/[-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)\)/g,'<a href="$2" target="_blank">$1<\/a>');
bb=nl2br(bb);
$("#md-preview").html(nl2br(bb)); bb=bb.replace(new RegExp("</li><br />", "g"),"");
$("#md-preview").html(bb);
} }
//Editで戻る //Editで戻る
function previewEdit(){ function previewEdit(){

View File

@ -92,7 +92,7 @@ function emojiList(target) {
var emoji = obj[i]; var emoji = obj[i];
if (emoji) { if (emoji) {
html = html + '<a onclick="emojiInsert(\':' + emoji.shortcode + html = html + '<a onclick="emojiInsert(\':' + emoji.shortcode +
':\')" class="pointer"><img src="' + emoji.url + '" width="20"></a>'; ': \')" class="pointer"><img src="' + emoji.url + '" width="20"></a>';
} }
} }
$("#emoji-list").html(html); $("#emoji-list").html(html);

View File

@ -47,4 +47,5 @@ function cw(){
//TLでコンテンツワーニングを表示トグル //TLでコンテンツワーニングを表示トグル
function cw_show(id){ function cw_show(id){
$(".cw_hide_"+id).toggleClass("cw"); $(".cw_hide_"+id).toggleClass("cw");
$(".cw-long-"+id).toggleClass("hide");
} }

View File

@ -117,9 +117,11 @@ function cardToggle(tlid) {
if (!card) { if (!card) {
localStorage.setItem("card_" + tlid, "true"); localStorage.setItem("card_" + tlid, "true");
$("#sta-card-" + tlid).text("Off"); $("#sta-card-" + tlid).text("Off");
$("#sta-card-" + tlid).css("color",'red');
} else { } else {
localStorage.removeItem("card_" + tlid); localStorage.removeItem("card_" + tlid);
$("#sta-card-" + tlid).text("On"); $("#sta-card-" + tlid).text("On");
$("#sta-card-" + tlid).css("color",'#009688');
} }
} }
//各TL上方のLink[On/Off]をチェック //各TL上方のLink[On/Off]をチェック
@ -127,7 +129,9 @@ function cardCheck(tlid) {
var card = localStorage.getItem("card_" + tlid); var card = localStorage.getItem("card_" + tlid);
if (!card) { if (!card) {
$("#sta-card-" + tlid).text("On"); $("#sta-card-" + tlid).text("On");
$("#sta-card-" + tlid).css("color",'#009688');
} else { } else {
$("#sta-card-" + tlid).text("Off"); $("#sta-card-" + tlid).text("Off");
$("#sta-card-" + tlid).css("color",'red');
} }
} }

View File

@ -65,8 +65,8 @@ function parse(obj, mix, acct_id) {
2; 2;
if (sent < ct && $.mb_strlen(toot.content) > 5) { if (sent < ct && $.mb_strlen(toot.content) > 5) {
var content = '<span class="gray">以下全文</span><br>' + toot.content var content = '<span class="gray">以下全文</span><br>' + toot.content
var spoil = $.strip_tags($.mb_substr(toot.content, 0, 100)) + var spoil = '<span class="cw-long-'+toot.id+'">'+$.strip_tags($.mb_substr(toot.content, 0, 100)) +
'<span class="gray">自動折りたたみ</span>'; '</span><span class="gray">自動折りたたみ</span>';
var spoiler = "cw cw_hide_" + toot.id; var spoiler = "cw cw_hide_" + toot.id;
var spoiler_show = '<a href="#" onclick="cw_show(\'' + toot.id + var spoiler_show = '<a href="#" onclick="cw_show(\'' + toot.id +
'\')" class="nex parsed">続き…</a>'; '\')" class="nex parsed">続き…</a>';
@ -77,6 +77,15 @@ function parse(obj, mix, acct_id) {
var spoiler_show = ""; var spoiler_show = "";
} }
} }
var urls = content.match(
/https?:\/\/([-a-zA-Z0-9@.]+)\/?([-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)?/
);
if(urls){
var analyze='<a onclick="additionalIndv(\'' + tlid + '\',' + acct_id +
',\''+id+'\')" class="add-show pointer">URL解析</a>';
}else{
var analyze='';
}
var viewer = ""; var viewer = "";
var youtube = ""; var youtube = "";
var emojick = toot.emojis[0]; var emojick = toot.emojis[0];
@ -177,8 +186,7 @@ function parse(obj, mix, acct_id) {
api_spoil + ' cw_text_' + toot.id + '">' + spoil + spoiler_show + api_spoil + ' cw_text_' + toot.id + '">' + spoil + spoiler_show +
'</span>' + '</span>' +
'' + viewer + '' + '' + viewer + '' +
'<div class="additional"><a onclick="additionalIndv(\'' + tlid + '\',' + acct_id + '<div class="additional">' + analyze + '</div><span class="cbadge"><i class="fa fa-clock-o"></i>' +
',\''+id+'\')" class="add-show pointer">URL解析</a></div><span class="cbadge"><i class="fa fa-clock-o"></i>' +
date(toot.created_at, datetype) + '</span>' + date(toot.created_at, datetype) + '</span>' +
'<span class="cbadge">via ' + via + '<span class="cbadge">via ' + via +
'</span>' + mentions + tags + '</span>' + mentions + tags +

View File

@ -56,7 +56,7 @@
Object.keys(obj).forEach(function(key) { Object.keys(obj).forEach(function(key) {
var acct = obj[key]; var acct = obj[key];
var html = '<div class="box" id="timeline_box_' + key + '_box" tlid="' + key + var html = '<div class="box" id="timeline_box_' + key + '_box" tlid="' + key +
'"><div class="notice-box"><span id="notice_' + key + '"></span><br>' + '"><div class="notice-box"><span id="notice_' + key + '" class="tl-title"></span><br>' +
'<a onclick="notfToggle(' + acct.domain + ',' + key + '<a onclick="notfToggle(' + acct.domain + ',' + key +
')" class="setting nex" title="このアカウントの通知"><i class="material-icons nex notf-icon_' + ')" class="setting nex" title="このアカウントの通知"><i class="material-icons nex notf-icon_' +
key + '">notifications</i></a>' + key + '">notifications</i></a>' +

36
app/js/ui/radio.js Normal file
View File

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

View File

@ -17,6 +17,12 @@ function scrollck() {
jQuery("time.timeago").timeago(); jQuery("time.timeago").timeago();
localStorage.removeItem("pool_" + tlid); localStorage.removeItem("pool_" + tlid);
} }
//自動リフレッシュ
if( $("#timeline_" + tlid+" .cvo").length > 100 ){
for(var i=100;i<$("#timeline_" + tlid +" .cvo").length;i++){
$("#timeline_" + tlid +" .cvo").eq(i).remove();
}
}
} }
//続きを読むトリガー //続きを読むトリガー
var scrt = $(this).find(".tl").height() - 1000; var scrt = $(this).find(".tl").height() - 1000;
@ -28,5 +34,5 @@ function scrollck() {
} }
function goTop(id){ function goTop(id){
$("#timeline_"+id+"_box .tl-box").scrollTop(0) $("#timeline_box_"+id+"_box .tl-box").scrollTop(0)
} }

View File

@ -1 +1 @@
{"desk":"Miho (ver.8)","date":"2018-02-09","detail":"内部V:11.8.0|インスタンス入力時のサジェスト。キーボードショートカットCtrl+R(アスタルテランキング)"} {"desk":"Miho (ver.10)","date":"2018-02-12","detail":"内部V:11.10.0|ラジオ機能・Markdownリスト、上下飾り文字・自動リフレッシュ(100件)・見やすいURL解析ボタン・バグ修正"}