TheDesk Akane (16.0.9)
This commit is contained in:
@@ -10,7 +10,7 @@ function mdCheck(){
|
||||
if(localStorage.getItem("post_" + acct_id)){
|
||||
$("#toot-post-btn").text(localStorage.getItem("post_" + acct_id)+"("+localStorage.getItem("domain_"+acct_id)+")");
|
||||
}else{
|
||||
$("#toot-post-btn").text(lang_toot[lang]+"("+localStorage.getItem("domain_"+acct_id).replace( "misskey::", "" )+")");
|
||||
$("#toot-post-btn").text(lang_toot[lang]+"("+localStorage.getItem("domain_"+acct_id)+")");
|
||||
}
|
||||
if(!localStorage.getItem("bb_"+acct_id) && !localStorage.getItem("md_"+acct_id)){
|
||||
$(".markdown").addClass("hide");
|
||||
@@ -39,7 +39,7 @@ function mdCheck(){
|
||||
}else{
|
||||
$("#trendtag").html("");
|
||||
}
|
||||
if(~domain.indexOf("misskey::")){
|
||||
if(localStorage.getItem("mode_" + domain)=="misskey"){
|
||||
Materialize.toast(lang_bbmd_misskey[lang], 5000);
|
||||
}
|
||||
if(idata[domain+"_letters"]){
|
||||
|
@@ -102,9 +102,9 @@ function media(b64, type, no) {
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_"+ acct_id + "_at");
|
||||
var httpreq = new XMLHttpRequest();
|
||||
if(~domain.indexOf("misskey::")){
|
||||
if(localStorage.getItem("mode_" + domain)=="misskey"){
|
||||
|
||||
var start = "https://" + domain.replace( "misskey::", "" ) + "/api/drive/files/create";
|
||||
var start = "https://" + domain + "/api/drive/files/create";
|
||||
httpreq.open('POST', start, true);
|
||||
httpreq.upload.addEventListener("progress", progshow, false);
|
||||
httpreq.responseType = 'json';
|
||||
@@ -183,6 +183,7 @@ function toBlob(base64, type) {
|
||||
//画像を貼り付けたら…
|
||||
var element = document.querySelector("#textarea");
|
||||
element.addEventListener("paste", function(e){
|
||||
console.log("paste")
|
||||
// 画像の場合
|
||||
// e.clipboardData.types.length == 0
|
||||
// かつ
|
||||
@@ -192,6 +193,7 @@ element.addEventListener("paste", function(e){
|
||||
|| !e.clipboardData.types
|
||||
|| (e.clipboardData.types.length != 1)
|
||||
|| (e.clipboardData.types[0] != "Files")) {
|
||||
console.log("not image")
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -206,7 +208,7 @@ element.addEventListener("paste", function(e){
|
||||
var base64 = e.target.result;
|
||||
var mediav = $("#media").val();
|
||||
if(mediav){
|
||||
var i=media.split(",").length;
|
||||
var i=mediav.split(",").length;
|
||||
}
|
||||
media(base64, "image/png", i)
|
||||
};
|
||||
|
@@ -6,7 +6,7 @@ function renote(id, acct_id, remote) {
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_"+ acct_id + "_at");
|
||||
var start = "https://" + domain + "/api/notes/create";
|
||||
if(domain!="misskey.xyz"){
|
||||
if(localStorage.getItem("mode_" + domain)!="misskey"){
|
||||
return false;
|
||||
}
|
||||
var httpreq = new XMLHttpRequest();
|
||||
@@ -52,7 +52,7 @@ function reactiontoggle(id,acct_id,tlid){
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_"+ acct_id + "_at");
|
||||
var start = "https://" + domain + "/api/notes/show";
|
||||
if(domain!="misskey.xyz"){
|
||||
if(localStorage.getItem("mode_" + domain)!="misskey"){
|
||||
return false;
|
||||
}
|
||||
var httpreq = new XMLHttpRequest();
|
||||
@@ -152,7 +152,7 @@ function reaction(mode,id,acct_id,tlid){
|
||||
var flag="create";
|
||||
}
|
||||
var start = "https://" + domain + "/api/notes/reactions/"+flag;
|
||||
if(domain!="misskey.xyz"){
|
||||
if(localStorage.getItem("mode_" + domain)!="misskey"){
|
||||
return false;
|
||||
}
|
||||
var httpreq = new XMLHttpRequest();
|
||||
@@ -171,7 +171,7 @@ function vote(acct_id,id,to){
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_"+ acct_id + "_at");
|
||||
var start = "https://" + domain + "/api/notes/polls/vote";
|
||||
if(domain!="misskey.xyz"){
|
||||
if(localStorage.getItem("mode_" + domain)!="misskey"){
|
||||
return false;
|
||||
}
|
||||
var httpreq = new XMLHttpRequest();
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*投稿系*/
|
||||
//投稿
|
||||
function post() {
|
||||
function post(mode) {
|
||||
if($("#toot-post-btn").prop("disabled")){
|
||||
return
|
||||
}
|
||||
@@ -26,7 +26,31 @@ function post() {
|
||||
}
|
||||
}
|
||||
}
|
||||
if(domain=="misskey.xyz"){
|
||||
if(mode!="pass" && !$("#cw").hasClass("cw-avail") && (str.length>localStorage.getItem("cw_sentence") || (str.split("\n").length - 1)>localStorage.getItem("cw_letters"))){
|
||||
var electron = require("electron");
|
||||
var remote=electron.remote;
|
||||
var dialog=remote.dialog;
|
||||
var plus=str.replace(/\n/g,"").slice(0,10)+"...";
|
||||
const options = {
|
||||
type: 'info',
|
||||
title: lang_post_cwtitle[lang],
|
||||
message: lang_post_cwtxt[lang]+plus,
|
||||
buttons: [lang_post_btn1[lang],lang_post_btn2[lang], lang_post_btn3[lang]]
|
||||
}
|
||||
dialog.showMessageBox(options, function(arg) {
|
||||
if(arg==1){
|
||||
$("#cw-text").show();
|
||||
$("#cw").addClass("yellow-text");
|
||||
$("#cw").addClass("cw-avail");
|
||||
$("#cw-text").val(plus);
|
||||
post("pass");
|
||||
}else if(arg==2){
|
||||
post("pass");
|
||||
}
|
||||
})
|
||||
return false;
|
||||
}
|
||||
if(localStorage.getItem("mode_" + domain)=="misskey"){
|
||||
misskeyPost();
|
||||
return;
|
||||
}
|
||||
@@ -90,7 +114,7 @@ function misskeyPost(){
|
||||
var str = $("#textarea").val();
|
||||
var acct_id = $("#post-acct-sel").val();
|
||||
localStorage.setItem("last-use", acct_id);
|
||||
var domain = "misskey.xyz"
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
$("#toot-post-btn").prop("disabled", true);
|
||||
todo("Posting");
|
||||
var at = localStorage.getItem("acct_"+ acct_id + "_at");
|
||||
|
@@ -116,7 +116,7 @@ function follow(acct_id,remote) {
|
||||
}
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_"+ acct_id + "_at");
|
||||
if(domain=="misskey.xyz"){
|
||||
if(localStorage.getItem("mode_" + domain)=="misskey"){
|
||||
var start = "https://" + domain + "/api/following/"+flagm;
|
||||
var user=$("#his-acct").text();
|
||||
var ent={"i":at,"userId":id}
|
||||
@@ -198,7 +198,7 @@ function mute(acct_id) {
|
||||
}
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_"+ acct_id + "_at");
|
||||
if(domain=="misskey.xyz"){
|
||||
if(localStorage.getItem("mode_" + domain)=="misskey"){
|
||||
var start = "https://" + domain + "/api/mute/"+flagm;
|
||||
var ent={"i":at,"userId":id}
|
||||
var rq=JSON.stringify(ent);
|
||||
@@ -229,7 +229,7 @@ function mute(acct_id) {
|
||||
function del(id, acct_id) {
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_"+ acct_id + "_at");
|
||||
if(domain=="misskey.xyz"){
|
||||
if(localStorage.getItem("mode_" + domain)=="misskey"){
|
||||
var start = "https://" + domain + "/api/notes/delete";
|
||||
var httpreq = new XMLHttpRequest();
|
||||
httpreq.open('POST', start, true);
|
||||
|
Reference in New Issue
Block a user