This commit is contained in:
Cutls
2019-05-19 15:17:05 +09:00
parent 3cde6d0bff
commit d3ff1aa17a
50 changed files with 187 additions and 281 deletions

View File

@@ -179,7 +179,6 @@ function emojiInsert(code, del) {
} else {
var brank = " ";
}
console.log(selin);
var now = $("#textarea").val();
if (selin > 0) {
var before = now.substr(0, selin);

View File

@@ -36,7 +36,7 @@ $("#drag").on('dragleave', function(e) {
//複数アップ
function pimg(files) {
console.log(files);
console.table(files);
for (i = 0; i < files.length; i++) {
var dot=files[i].path.match(/\.(.+)$/)[1];
if(dot=="bmp" || dot=="BMP"){
@@ -95,7 +95,6 @@ function media(b64, type, no) {
localStorage.setItem("image","busy");
todo("Image Upload...");
var media = toBlob(b64, type);
console.log(media);
var fd = new FormData();
fd.append('file', media);
var acct_id = $("#post-acct-sel").val();
@@ -128,7 +127,6 @@ function media(b64, type, no) {
httpreq.onreadystatechange = function() {
if (httpreq.readyState === 4) {
var json = httpreq.response;
console.log(json);
var img = localStorage.getItem("img");
if (json.type.indexOf("image")!=-1) {
var html = '<img src="' + json[previewer] + '" class="preview-img pointer" data-media="'+json["id"]+'" onclick="deleteImage(\''+json["id"]+'\')" title="'+lang.lang_postimg_delete+'">';
@@ -182,14 +180,13 @@ function toBlob(base64, type) {
//画像を貼り付けたら…
var element = document.querySelector("#textarea");
element.addEventListener("paste", function(e){
console.log(e)
if (!e.clipboardData || !e.clipboardData.items) {
return true;
}
// DataTransferItemList に画像が含まれいない場合は終了する
var imageItems = [...e.clipboardData.items].filter(i => i.type.startsWith('image'));
if (imageItems.length == 0) {
console.log("not image")
console.warn("it is not image")
return true;
}
@@ -223,7 +220,6 @@ ipc.on('adobeagree', function (event, arg) {
localStorage.setItem("adobeagree",arg);
});
function deleteImage(key){
console.log(key);
if(!confirm(lang.lang_postimg_delete)){
return false;
}

View File

@@ -17,7 +17,7 @@ function renote(id, acct_id, remote) {
httpreq.onreadystatechange = function() {
if (httpreq.readyState === 4) {
var json = httpreq.response;
console.log(json);
console.log(["Success: renote",json]);
$("[toot-id=" + id + "]").addClass("rted");
$(".rt_"+id).toggleClass("teal-text");
}
@@ -63,7 +63,7 @@ function reactiontoggle(id,acct_id,tlid){
httpreq.onreadystatechange = function() {
if (httpreq.readyState === 4) {
var json = httpreq.response;
console.log(json);
console.log(["Success: reaction",json]);
if(json.reactions){
var reactions=["like","love","laugh","hmm","surprise","congrats","angry","confused","pudding","rip"];
for(var i=0;i<reactions.length;i++){
@@ -121,7 +121,6 @@ function reactRefresh(acct_id,id){
method: "POST",
body: JSON.stringify(req),
}
console.log(req)
fetch(start, i,
).then(function(response) {
return response.json();
@@ -149,7 +148,6 @@ function reactRefreshCore(json){
Object.keys(json.reactions).forEach(function(keye) {
keyeClass=keye.replace(regExp,'');
if(json.reactions[keye]){
console.log(json.reactions[keye])
$("#pub_" + id +" .re-"+keyeClass+"ct").text(json.reactions[keye])
$("#pub_" + id +" .re-"+keyeClass).removeClass("hide")
}else{

View File

@@ -129,7 +129,7 @@ function post(mode,postvis) {
}
if ($("#sch-box").hasClass("sch-avail")) {
var scheduled=formattimeutc(new Date(Date.parse($("#sch-date").val())))
console.log(scheduled)
console.log("This toot will be posted at:"+scheduled)
schedule();
toot.scheduled_at=scheduled;
} else {
@@ -164,7 +164,7 @@ function post(mode,postvis) {
hide_totals: htt
}
}
console.log(toot);
console.table(toot);
var httpreq = new XMLHttpRequest();
httpreq.open('POST', start, true);
httpreq.setRequestHeader('Content-Type', 'application/json');
@@ -245,7 +245,7 @@ function misskeyPost(){
localStorage.removeItem("stable")
}
var json = httpreq.response;
console.log(json);
console.log(["Success: toot",json]);
var box = localStorage.getItem("box");
if (box == "yes") {
hide();

View File

@@ -49,7 +49,6 @@ function vis(set){
}
function loadVis(){
var vist = localStorage.getItem("vis");
console.log(vist);
if (!vist) {
vis("public");
} else {
@@ -123,7 +122,6 @@ function schedule(){
$("#sch-box").show();
$("#sch-date").val(formattime(date));
console.log(formattime(date));
$("#sch-box").addClass("sch-avail");
}
}

View File

@@ -68,7 +68,7 @@ function rt(id, acct_id, remote) {
httpreq.onreadystatechange = function() {
if (httpreq.readyState === 4) {
var json = httpreq.response;
console.log(json);
console.log(["Success: boost",json]);
if (remote != "remote") {
$("[toot-id=" + id + "] .fav_ct").text(json.favourites_count);
if (!json.reblog) {
@@ -128,7 +128,6 @@ function follow(acct_id,remote) {
var start = "https://" + domain + "/api/v1/accounts/" + id + "/" + flag;
var ent={}
}
console.log(ent);
var httpreq = new XMLHttpRequest();
httpreq.open('POST', start, true);
httpreq.setRequestHeader('Content-Type', 'application/json');
@@ -138,7 +137,7 @@ function follow(acct_id,remote) {
httpreq.onreadystatechange = function() {
if (httpreq.readyState === 4) {
var json = httpreq.response;
console.log(json);
console.log(["Success: folllow",json]);
if ($("#his-data").hasClass("following")) {
$("#his-data").removeClass("following");
$("#his-follow-btn").text(lang.lang_status_follow);
@@ -266,7 +265,7 @@ function redraft(id, acct_id){
$("[toot-id="+id+"] img.toot-img").each(function(i, elem) {
if(i<ct){
var url=$(elem).attr("src");
console.log(url);
console.log("Play back image data:"+url);
$('#preview').append('<img src="' + url + '" style="width:50px; max-height:100px;">');
}
});
@@ -307,7 +306,7 @@ function pin(id, acct_id) {
httpreq.onreadystatechange = function() {
if (httpreq.readyState === 4) {
var json = httpreq.response;
console.log(json);
console.log(["Success: pinned",json]);
if ($("[toot-id=" + id + "]").hasClass("pined")) {
$("[toot-id=" + id + "]").removeClass("pined");
$(".pin_" + id).removeClass("blue-text");
@@ -333,7 +332,7 @@ function request(id, flag, acct_id) {
httpreq.onreadystatechange = function() {
if (httpreq.readyState === 4) {
var json = httpreq.response;
console.log(json);
console.log(["Success: request","type:"+flag,json]);
showReq();
}
}
@@ -356,7 +355,7 @@ function domainblock(add, flag, acct_id) {
httpreq.onreadystatechange = function() {
if (httpreq.readyState === 4) {
var json = httpreq.response;
console.log(json);
console.log(["Success: domain block",json]);
showDom();
}
}
@@ -371,7 +370,6 @@ function empUser(){
var usr = localStorage.getItem("user_emp");
var obj = JSON.parse(usr);
var id=$("#his-acct").attr("fullname");
console.log(id);
if(!obj){
var obj=[];
obj.push(id);
@@ -413,7 +411,6 @@ function pinUser(){
httpreq.onreadystatechange = function() {
if (httpreq.readyState === 4) {
var json = httpreq.response;
console.log(json);
if ($("#his-end-btn").hasClass("endorsed")) {
$("#his-end-btn").removeClass("endorsed")
$("#his-end-btn").text(lang.lang_status_endorse)

View File

@@ -68,7 +68,7 @@ input.addEventListener("focus", function() {
var at = localStorage.getItem("acct_"+ acct_id + "_at");
suggest = "https://" + domain + "/api/v1/search?q=" + q
if (suggest != oldSuggest) {
console.log(suggest)
console.log("Try to get suggest at "+suggest)
fetch(suggest, {
method: 'GET',
headers: {
@@ -152,7 +152,7 @@ function tagInsert(code, del) {
function cgNPs(q){
suggest = "https://cg.toot.app/api/v1/search/light?q=" + q
if (suggest != oldSuggest) {
console.log(suggest)
console.log("Try to get suggest at "+suggest)
fetch(suggest, {
method: 'GET',
headers: {
@@ -164,7 +164,6 @@ function cgNPs(q){
todo(error);
console.error(error);
}).then(function(json) {
console.log(json);
if (json[0]) {
var tags = "";
Object.keys(json).forEach(function(key4) {