ToDo: done: ts column/menu .active/ about

This commit is contained in:
Cutls 2019-04-09 23:12:11 +09:00
parent f1c4276d06
commit 1670c0bc08
11 changed files with 110 additions and 50 deletions

View File

@ -76,7 +76,7 @@ a,button{
<img src="./img/desk.png" style="max-width:70%;"> <img src="./img/desk.png" style="max-width:70%;">
<h5>TheDesk</h5> <h5>TheDesk</h5>
<div class='container'> <div class='container'>
<div class='area-name1'>バージョン</div> <div class='area-name1'>External version</div>
<div class='area-data1' id="now"></div> <div class='area-data1' id="now"></div>
<div class='area-name2'>Internal version</div> <div class='area-name2'>Internal version</div>
<div class='area-data2' id="ver"></div> <div class='area-data2' id="ver"></div>

View File

@ -224,7 +224,10 @@ grid-area: toot;
cursor:text; cursor:text;
user-select: auto; user-select: auto;
grid-area: additional; grid-area: additional;
} overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.area-actions { .area-actions {
padding:0; padding:0;

View File

@ -15,7 +15,7 @@ function src(mode) {
var q = $("#src").val(); var q = $("#src").val();
var acct_id = $("#src-acct-sel").val(); var acct_id = $("#src-acct-sel").val();
if(acct_id=="tootsearch"){ if(acct_id=="tootsearch"){
tootsearch(q); tsAdd(q)
return false; return false;
} }
localStorage.setItem("last-use", acct_id); localStorage.setItem("last-use", acct_id);
@ -73,9 +73,26 @@ function src(mode) {
jQuery("time.timeago").timeago(); jQuery("time.timeago").timeago();
}); });
} }
function tootsearch(q){ function tsAdd(q){
var add = {
domain: acct_id,
type: "tootsearch",
data: q
};
var multi = localStorage.getItem("column");
var obj = JSON.parse(multi);
localStorage.setItem("card_" + obj.length,"true");
obj.push(add);
console.log(obj);
var json = JSON.stringify(obj);
localStorage.setItem("column", json);
parseColumn();
}
function tootsearch(tlid,q){
var start = "https://tootsearch.chotto.moe/api/v1/search?from=0&sort=created_at%3Adesc&q=" + q var start = "https://tootsearch.chotto.moe/api/v1/search?from=0&sort=created_at%3Adesc&q=" + q
console.log(start) console.log(start)
$("#notice_" + tlid).text("tootsearch("+q+")");
$("#notice_icon_" + tlid).text("search");
fetch(start, { fetch(start, {
method: 'GET', method: 'GET',
headers: { headers: {
@ -90,17 +107,25 @@ function tootsearch(q){
var templete=""; var templete="";
var json=raw.hits.hits; var json=raw.hits.hits;
console.log(json); console.log(json);
Object.keys(json).forEach(function(key5) { var max_id = raw["hits"]["total"];
var toot = json[key5]["_source"]; for(var i=0;i<json.length;i++){
console.log(toot); var toot = json[i]["_source"];
if(toot && toot.account){ console.log(lastid)
templete = templete+parse([toot],'noauth'); if(lastid!=toot.uri){
console.log(toot);
if(toot && toot.account){
templete = templete+parse([toot], "noauth", null, tlid, 0, [], "tootsearch")
}
} }
}); var lastid=toot.uri;
}
if(!templete){ if(!templete){
templete=lang.lang_details_nodata; templete=lang.lang_details_nodata;
}else{
templete=templete+'<div class="hide ts-marker" data-maxid="'+max_id+'"></div>';
} }
$("#src-contents").html("Tootsearch("+lang.lang_src_ts+")<br>" + templete); $("#timeline_" + tlid).html(templete);
jQuery("time.timeago").timeago(); jQuery("time.timeago").timeago();
}); });
} }

View File

@ -442,8 +442,6 @@ function moreload(type, tlid) {
headers: hdr headers: hdr
}; };
} }
fetch(start, i).then(function(response) { fetch(start, i).then(function(response) {
return response.json(); return response.json();
}).catch(function(error) { }).catch(function(error) {
@ -677,6 +675,8 @@ function cap(type, data, acct_id) {
var response= "Local+" var response= "Local+"
}else if (type == "webview") { }else if (type == "webview") {
var response="Twitter" var response="Twitter"
}else if (type == "tootsearch") {
var response="tootsearch(" + data + ")";
} }
return response; return response;
} }
@ -734,7 +734,7 @@ function icon(type) {
} else if (type == "pub-media") { } else if (type == "pub-media") {
var response="language"; var response="language";
} else if (type == "tag") { } else if (type == "tag") {
var response="search"; var response="whatshot";
} else if (type == "list") { } else if (type == "list") {
var response="view_headline"; var response="view_headline";
} else if (type == "notf") { } else if (type == "notf") {
@ -749,6 +749,8 @@ function icon(type) {
var response="merge_type"; var response="merge_type";
}else if (type == "webview") { }else if (type == "webview") {
var response="language"; var response="language";
}else if (type == "tootsearch") {
var response="search";
} }
return response; return response;
} }

View File

@ -130,6 +130,21 @@ function parseColumn() {
} }
var html =webviewParse("https://tweetdeck.twitter.com",key,insert,icnsert,css); var html =webviewParse("https://tweetdeck.twitter.com",key,insert,icnsert,css);
$("#timeline-container").append(html); $("#timeline-container").append(html);
}else if(acct.type=="tootsearch"){
if(!acct.left_fold){
basekey=key;
}
var width = localStorage.getItem("width");
if (width) {
var css=" min-width:"+width+"px;"
}
var anime = localStorage.getItem("animation");
if (anime=="yes" || !anime) {
var animecss="box-anime";
}else{
var animecss="";
}
unstreamingTL(acct.type,key,basekey,insert,icnsert,acct.left_fold,css,animecss,acct.data);
}else{ }else{
var width = localStorage.getItem("width"); var width = localStorage.getItem("width");
if (width) { if (width) {
@ -448,6 +463,37 @@ function webviewParse(url,key,insert,icnsert,css){
return html; return html;
} }
function unstreamingTL(type,key,basekey,insert,icnsert,left_fold,css,animecss,q){
if(!left_fold){
var basehtml = '<div style="'+css+'" class="box '+animecss+'" id="timeline_box_' + basekey + '_parentBox"></div>';
$("#timeline-container").append(basehtml);
var left_hold='<a onclick="leftFoldSet(' + key +')" class="setting nex"><i class="material-icons waves-effect nex" title="'+lang.lang_layout_leftFold+'">view_agenda</i></a>'+lang.lang_layout_leftFold+'</span><br>';
}else{
var left_hold='<a onclick="leftFoldRemove(' + key +')" class="setting nex"><i class="material-icons waves-effect nex" title="'+lang.lang_layout_leftUnfold+'">view_column</i></a>'+lang.lang_layout_leftUnfold+'</span><br>';
}
var html='<div class="boxIn" id="timeline_box_' + key + '_box" tlid="' + key +
'"><div class="notice-box z-depth-2" id="menu_'+key+'" style="'+insert+' ">'+
'<div class="area-notice"><i class="material-icons waves-effect" id="notice_icon_' + key + '" style="font-size:40px; padding-top:25%;" onclick="reloadTL('+key+')" title="'+lang.lang_layout_gotop +'"></i></div>'+
'<div class="area-notice_name"><span id="notice_' + key + '" class="tl-title"></span></div>'+
'<div class="area-a1"></div><div class="area-sta"></div>'+
'<div class="area-a2"><a onclick="removeColumn(' + key +
')" class="setting nex"><i class="material-icons waves-effect nex" title="'+lang.lang_layout_delthis +'"'+icnsert+'>cancel</i></a></div>'+
'<div class="area-a3"><a onclick="setToggle(' + key +
')" class="setting nex" title="'+lang.lang_layout_setthis +'"'+icnsert+'><i class="material-icons waves-effect nex">settings</i></a></div></div>'+
'<div class="column-hide notf-indv-box" id="util-box_' + key +
'" style="padding:5px;">'+left_hold+'<a onclick="mediaToggle(' + key +
')" class="setting nex"><i class="material-icons waves-effect nex" title="'+lang.lang_layout_mediafil +'">perm_media</i><span id="sta-media-' +
key + '">On</span></a>'+lang.lang_layout_mediafil +'<br>'+lang.lang_layout_headercolor +'<br><div id="picker_'+key+'" class="color-picker"></div></div><div class="tl-box" tlid="' + key + '"><div id="timeline_' + key +
'" class="tl '+type+'-timeline " tlid="' + key + '" data-type="' + type + '" data-acct="nostr"><div id="landing_'+key+'" style="text-align:center">'+lang.lang_layout_nodata +'</div></div></div>'
$('#timeline_box_' + basekey + '_parentBox').append(html);
tootsearch(key,q);
cardCheck(key);
ebtCheck(key);
mediaCheck(key);
catchCheck(key);
voiceCheck(key);
return true;
}
function leftFoldSet(key){ function leftFoldSet(key){
var multi = localStorage.getItem("column"); var multi = localStorage.getItem("column");
var obj = JSON.parse(multi); var obj = JSON.parse(multi);

View File

@ -19,6 +19,8 @@ function menu(){
$("#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");
$("#addColumnMenu").addClass("active");
}else{ }else{
$('#menu').fadeOut() $('#menu').fadeOut()
$("#menu").removeClass("appear") $("#menu").removeClass("appear")

View File

@ -58,6 +58,8 @@ function Scap(type, data) {
return "Integrated" return "Integrated"
}else if (type == "webview") { }else if (type == "webview") {
return "Twitter" return "Twitter"
}else if (type == "tootsearch") {
return "tootsearch(" + data + ")"
}else{ }else{
console.log(type); console.log(type);
} }

View File

@ -259,12 +259,8 @@ var tlid=0;
<div id="poll" class="hide"> <div id="poll" class="hide">
<select id="poll-sel" onchange="pollProviderCk()"> <select id="poll-sel" onchange="pollProviderCk()">
<option value="nothing">Polls: Disabled</option> <option value="nothing">Polls: Disabled</option>
<option value="votedon">votedon.</option>
<option value="mastodon-poll">Mastodon(2.8~)</option> <option value="mastodon-poll">Mastodon(2.8~)</option>
</select> </select>
<div id="votedon" class="poll-provider hide">
WIP
</div>
<div id="mastodon-poll" class="poll-provider hide"> <div id="mastodon-poll" class="poll-provider hide">
<input type="text" class="mastodon-choice" placeholder="Choice1"> <input type="text" class="mastodon-choice" placeholder="Choice1">
<input type="text" class="mastodon-choice" placeholder="Choice2"> <input type="text" class="mastodon-choice" placeholder="Choice2">
@ -687,11 +683,10 @@ var tlid=0;
<div class="input-field"> <div class="input-field">
<select id="src-acct-sel" class="acct-sel" onchange="trend()"></select> <select id="src-acct-sel" class="acct-sel" onchange="trend()"></select>
</div><div class="input-field"> </div><div class="input-field">
<i class="material-icons prefix">search</i> <input id="src" type="text" class="validate" style="width:60%">
<input id="src" type="text" class="validate" style="width:calc( 60% - 40px);">
<label for="src" data-trans="src">Search</label> <label for="src" data-trans="src">Search</label>
<button class="btn waves-effect indigo" style="width:calc( 40% - 40px);" onclick="src()" data-trans-i="src"> <button class="btn waves-effect indigo" style="width: 36%;padding: 0;padding-left: 15px;" onclick="src()" data-trans-i="src">
<i class="material-icons left">search</i>Search <i class="material-icons left" style="margin:0">search</i>Search
</button> </button>
<br> <br>
<br> <br>
@ -705,7 +700,7 @@ var tlid=0;
<div id="sort-box" class="hide menu-content"> <div id="sort-box" class="hide menu-content">
<ul id="sort"></ul> <ul id="sort"></ul>
<div> <div>
<button onclick="sort()" class="btn waves-effect nex" style="width:100%; max-width:300px;" data-trans-i="sort"> <button onclick="sort()" class="btn waves-effect nex" style="width:97.5%;" data-trans-i="sort">
<i class="material-icons left">sort</i>Sort <i class="material-icons left">sort</i>Sort
</button> </button>
</div> </div>

View File

@ -259,12 +259,8 @@ var tlid=0;
<div id="poll" class="hide"> <div id="poll" class="hide">
<select id="poll-sel" onchange="pollProviderCk()"> <select id="poll-sel" onchange="pollProviderCk()">
<option value="nothing">アンケートを使用しない</option> <option value="nothing">アンケートを使用しない</option>
<option value="votedon">votedon.</option>
<option value="mastodon-poll">Mastodon(2.8~)</option> <option value="mastodon-poll">Mastodon(2.8~)</option>
</select> </select>
<div id="votedon" class="poll-provider hide">
WIP
</div>
<div id="mastodon-poll" class="poll-provider hide"> <div id="mastodon-poll" class="poll-provider hide">
<input type="text" class="mastodon-choice" placeholder="選択肢1"> <input type="text" class="mastodon-choice" placeholder="選択肢1">
<input type="text" class="mastodon-choice" placeholder="選択肢2"> <input type="text" class="mastodon-choice" placeholder="選択肢2">
@ -687,11 +683,10 @@ var tlid=0;
<div class="input-field"> <div class="input-field">
<select id="src-acct-sel" class="acct-sel" onchange="trend()"></select> <select id="src-acct-sel" class="acct-sel" onchange="trend()"></select>
</div><div class="input-field"> </div><div class="input-field">
<i class="material-icons prefix">search</i> <input id="src" type="text" class="validate" style="width:60%">
<input id="src" type="text" class="validate" style="width:calc( 60% - 40px);">
<label for="src" data-trans="src">検索</label> <label for="src" data-trans="src">検索</label>
<button class="btn waves-effect indigo" style="width:calc( 40% - 40px);" onclick="src()" data-trans-i="src"> <button class="btn waves-effect indigo" style="width: 36%;padding: 0;padding-left: 15px;" onclick="src()" data-trans-i="src">
<i class="material-icons left">search</i>検索 <i class="material-icons left" style="margin:0">search</i>検索
</button> </button>
<br> <br>
<br> <br>
@ -705,7 +700,7 @@ var tlid=0;
<div id="sort-box" class="hide menu-content"> <div id="sort-box" class="hide menu-content">
<ul id="sort"></ul> <ul id="sort"></ul>
<div> <div>
<button onclick="sort()" class="btn waves-effect nex" style="width:100%; max-width:300px;" data-trans-i="sort"> <button onclick="sort()" class="btn waves-effect nex" style="width:97.5%;" data-trans-i="sort">
<i class="material-icons left">sort</i>並べ替え設定 <i class="material-icons left">sort</i>並べ替え設定
</button> </button>
</div> </div>

View File

@ -259,12 +259,8 @@ var tlid=0;
<div id="poll" class="hide"> <div id="poll" class="hide">
<select id="poll-sel" onchange="pollProviderCk()"> <select id="poll-sel" onchange="pollProviderCk()">
<option value="nothing">{{pollDdisabled}}</option> <option value="nothing">{{pollDdisabled}}</option>
<option value="votedon">votedon.</option>
<option value="mastodon-poll">Mastodon(2.8~)</option> <option value="mastodon-poll">Mastodon(2.8~)</option>
</select> </select>
<div id="votedon" class="poll-provider hide">
WIP
</div>
<div id="mastodon-poll" class="poll-provider hide"> <div id="mastodon-poll" class="poll-provider hide">
<input type="text" class="mastodon-choice" placeholder="{{choice}}1"> <input type="text" class="mastodon-choice" placeholder="{{choice}}1">
<input type="text" class="mastodon-choice" placeholder="{{choice}}2"> <input type="text" class="mastodon-choice" placeholder="{{choice}}2">
@ -687,11 +683,10 @@ var tlid=0;
<div class="input-field"> <div class="input-field">
<select id="src-acct-sel" class="acct-sel" onchange="trend()"></select> <select id="src-acct-sel" class="acct-sel" onchange="trend()"></select>
</div><div class="input-field"> </div><div class="input-field">
<i class="material-icons prefix">search</i> <input id="src" type="text" class="validate" style="width:60%">
<input id="src" type="text" class="validate" style="width:calc( 60% - 40px);">
<label for="src" data-trans="src">{{search}}</label> <label for="src" data-trans="src">{{search}}</label>
<button class="btn waves-effect indigo" style="width:calc( 40% - 40px);" onclick="src()" data-trans-i="src"> <button class="btn waves-effect indigo" style="width: 36%;padding: 0;padding-left: 15px;" onclick="src()" data-trans-i="src">
<i class="material-icons left">search</i>{{search}} <i class="material-icons left" style="margin:0">search</i>{{search}}
</button> </button>
<br> <br>
<br> <br>
@ -705,7 +700,7 @@ var tlid=0;
<div id="sort-box" class="hide menu-content"> <div id="sort-box" class="hide menu-content">
<ul id="sort"></ul> <ul id="sort"></ul>
<div> <div>
<button onclick="sort()" class="btn waves-effect nex" style="width:100%; max-width:300px;" data-trans-i="sort"> <button onclick="sort()" class="btn waves-effect nex" style="width:97.5%;" data-trans-i="sort">
<i class="material-icons left">sort</i>{{sortSet}} <i class="material-icons left">sort</i>{{sortSet}}
</button> </button>
</div> </div>

View File

@ -259,12 +259,8 @@ var tlid=0;
<div id="poll" class="hide"> <div id="poll" class="hide">
<select id="poll-sel" onchange="pollProviderCk()"> <select id="poll-sel" onchange="pollProviderCk()">
<option value="nothing">crwdns2408:0crwdne2408:0</option> <option value="nothing">crwdns2408:0crwdne2408:0</option>
<option value="votedon">votedon.</option>
<option value="mastodon-poll">Mastodon(2.8~)</option> <option value="mastodon-poll">Mastodon(2.8~)</option>
</select> </select>
<div id="votedon" class="poll-provider hide">
WIP
</div>
<div id="mastodon-poll" class="poll-provider hide"> <div id="mastodon-poll" class="poll-provider hide">
<input type="text" class="mastodon-choice" placeholder="crwdns2414:0crwdne2414:01"> <input type="text" class="mastodon-choice" placeholder="crwdns2414:0crwdne2414:01">
<input type="text" class="mastodon-choice" placeholder="crwdns2414:0crwdne2414:02"> <input type="text" class="mastodon-choice" placeholder="crwdns2414:0crwdne2414:02">
@ -687,11 +683,10 @@ var tlid=0;
<div class="input-field"> <div class="input-field">
<select id="src-acct-sel" class="acct-sel" onchange="trend()"></select> <select id="src-acct-sel" class="acct-sel" onchange="trend()"></select>
</div><div class="input-field"> </div><div class="input-field">
<i class="material-icons prefix">search</i> <input id="src" type="text" class="validate" style="width:60%">
<input id="src" type="text" class="validate" style="width:calc( 60% - 40px);">
<label for="src" data-trans="src">crwdns492:0crwdne492:0</label> <label for="src" data-trans="src">crwdns492:0crwdne492:0</label>
<button class="btn waves-effect indigo" style="width:calc( 40% - 40px);" onclick="src()" data-trans-i="src"> <button class="btn waves-effect indigo" style="width: 36%;padding: 0;padding-left: 15px;" onclick="src()" data-trans-i="src">
<i class="material-icons left">search</i>crwdns492:0crwdne492:0 <i class="material-icons left" style="margin:0">search</i>crwdns492:0crwdne492:0
</button> </button>
<br> <br>
<br> <br>
@ -705,7 +700,7 @@ var tlid=0;
<div id="sort-box" class="hide menu-content"> <div id="sort-box" class="hide menu-content">
<ul id="sort"></ul> <ul id="sort"></ul>
<div> <div>
<button onclick="sort()" class="btn waves-effect nex" style="width:100%; max-width:300px;" data-trans-i="sort"> <button onclick="sort()" class="btn waves-effect nex" style="width:97.5%;" data-trans-i="sort">
<i class="material-icons left">sort</i>crwdns493:0crwdne493:0 <i class="material-icons left">sort</i>crwdns493:0crwdne493:0
</button> </button>
</div> </div>