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%;">
<h5>TheDesk</h5>
<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-name2'>Internal version</div>
<div class='area-data2' id="ver"></div>

View File

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

View File

@ -15,7 +15,7 @@ function src(mode) {
var q = $("#src").val();
var acct_id = $("#src-acct-sel").val();
if(acct_id=="tootsearch"){
tootsearch(q);
tsAdd(q)
return false;
}
localStorage.setItem("last-use", acct_id);
@ -73,9 +73,26 @@ function src(mode) {
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
console.log(start)
$("#notice_" + tlid).text("tootsearch("+q+")");
$("#notice_icon_" + tlid).text("search");
fetch(start, {
method: 'GET',
headers: {
@ -90,17 +107,25 @@ function tootsearch(q){
var templete="";
var json=raw.hits.hits;
console.log(json);
Object.keys(json).forEach(function(key5) {
var toot = json[key5]["_source"];
console.log(toot);
if(toot && toot.account){
templete = templete+parse([toot],'noauth');
var max_id = raw["hits"]["total"];
for(var i=0;i<json.length;i++){
var toot = json[i]["_source"];
console.log(lastid)
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){
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();
});
}

View File

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

View File

@ -130,6 +130,21 @@ function parseColumn() {
}
var html =webviewParse("https://tweetdeck.twitter.com",key,insert,icnsert,css);
$("#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{
var width = localStorage.getItem("width");
if (width) {
@ -448,6 +463,37 @@ function webviewParse(url,key,insert,icnsert,css){
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){
var multi = localStorage.getItem("column");
var obj = JSON.parse(multi);

View File

@ -19,6 +19,8 @@ function menu(){
$("#menu-bar").html("TheDesk "+localStorage.getItem("ver"));
$(".menu-content").addClass("hide");
$("#add-box").removeClass("hide");
$("#left-menu div").removeClass("active");
$("#addColumnMenu").addClass("active");
}else{
$('#menu').fadeOut()
$("#menu").removeClass("appear")

View File

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

View File

@ -259,12 +259,8 @@ var tlid=0;
<div id="poll" class="hide">
<select id="poll-sel" onchange="pollProviderCk()">
<option value="nothing">Polls: Disabled</option>
<option value="votedon">votedon.</option>
<option value="mastodon-poll">Mastodon(2.8~)</option>
</select>
<div id="votedon" class="poll-provider hide">
WIP
</div>
<div id="mastodon-poll" class="poll-provider hide">
<input type="text" class="mastodon-choice" placeholder="Choice1">
<input type="text" class="mastodon-choice" placeholder="Choice2">
@ -687,11 +683,10 @@ var tlid=0;
<div class="input-field">
<select id="src-acct-sel" class="acct-sel" onchange="trend()"></select>
</div><div class="input-field">
<i class="material-icons prefix">search</i>
<input id="src" type="text" class="validate" style="width:calc( 60% - 40px);">
<input id="src" type="text" class="validate" style="width:60%">
<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">
<i class="material-icons left">search</i>Search
<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" style="margin:0">search</i>Search
</button>
<br>
<br>
@ -705,7 +700,7 @@ var tlid=0;
<div id="sort-box" class="hide menu-content">
<ul id="sort"></ul>
<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
</button>
</div>

View File

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

View File

@ -259,12 +259,8 @@ var tlid=0;
<div id="poll" class="hide">
<select id="poll-sel" onchange="pollProviderCk()">
<option value="nothing">{{pollDdisabled}}</option>
<option value="votedon">votedon.</option>
<option value="mastodon-poll">Mastodon(2.8~)</option>
</select>
<div id="votedon" class="poll-provider hide">
WIP
</div>
<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}}2">
@ -687,11 +683,10 @@ var tlid=0;
<div class="input-field">
<select id="src-acct-sel" class="acct-sel" onchange="trend()"></select>
</div><div class="input-field">
<i class="material-icons prefix">search</i>
<input id="src" type="text" class="validate" style="width:calc( 60% - 40px);">
<input id="src" type="text" class="validate" style="width:60%">
<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">
<i class="material-icons left">search</i>{{search}}
<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" style="margin:0">search</i>{{search}}
</button>
<br>
<br>
@ -705,7 +700,7 @@ var tlid=0;
<div id="sort-box" class="hide menu-content">
<ul id="sort"></ul>
<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}}
</button>
</div>

View File

@ -259,12 +259,8 @@ var tlid=0;
<div id="poll" class="hide">
<select id="poll-sel" onchange="pollProviderCk()">
<option value="nothing">crwdns2408:0crwdne2408:0</option>
<option value="votedon">votedon.</option>
<option value="mastodon-poll">Mastodon(2.8~)</option>
</select>
<div id="votedon" class="poll-provider hide">
WIP
</div>
<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:02">
@ -687,11 +683,10 @@ var tlid=0;
<div class="input-field">
<select id="src-acct-sel" class="acct-sel" onchange="trend()"></select>
</div><div class="input-field">
<i class="material-icons prefix">search</i>
<input id="src" type="text" class="validate" style="width:calc( 60% - 40px);">
<input id="src" type="text" class="validate" style="width:60%">
<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">
<i class="material-icons left">search</i>crwdns492:0crwdne492:0
<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" style="margin:0">search</i>crwdns492:0crwdne492:0
</button>
<br>
<br>
@ -705,7 +700,7 @@ var tlid=0;
<div id="sort-box" class="hide menu-content">
<ul id="sort"></ul>
<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
</button>
</div>