More prettier
This commit is contained in:
@@ -6,52 +6,52 @@ localStorage.removeItem("kirishima")
|
||||
localStorage.removeItem("imas")
|
||||
localStorage.removeItem("image");
|
||||
localStorage.removeItem("stable")
|
||||
localStorage.setItem("mode_misskey.xyz","misskey")
|
||||
localStorage.setItem("mode_misskey.xyz", "misskey")
|
||||
function ck() {
|
||||
var main = localStorage.getItem("main");
|
||||
if(!main){
|
||||
localStorage.setItem("main",0)
|
||||
if (!main) {
|
||||
localStorage.setItem("main", 0)
|
||||
}
|
||||
var domainz = localStorage.getItem("domain_0");
|
||||
var at = localStorage.getItem("acct_0_at");
|
||||
//コード受信
|
||||
if(location.search){
|
||||
if (location.search) {
|
||||
var m = location.search.match(/\?mode=([a-zA-Z-0-9]+)\&code=(.+)/);
|
||||
var mode=m[1];
|
||||
var codex=m[2];
|
||||
if(mode=="manager" || mode=="login"){
|
||||
code(codex,mode);
|
||||
}else{
|
||||
var mode = m[1];
|
||||
var codex = m[2];
|
||||
if (mode == "manager" || mode == "login") {
|
||||
code(codex, mode);
|
||||
} else {
|
||||
}
|
||||
}
|
||||
var multi = localStorage.getItem("multi");
|
||||
if(!multi || multi=="[]"){
|
||||
location.href="acct.html?mode=first&code=true"
|
||||
}else{
|
||||
if (!multi || multi == "[]") {
|
||||
location.href = "acct.html?mode=first&code=true"
|
||||
} else {
|
||||
var obj = JSON.parse(multi);
|
||||
Object.keys(obj).forEach(function(key) {
|
||||
var acct=obj[key];
|
||||
if(acct.domain){
|
||||
refresh(key,true)
|
||||
Object.keys(obj).forEach(function (key) {
|
||||
var acct = obj[key];
|
||||
if (acct.domain) {
|
||||
refresh(key, true)
|
||||
}
|
||||
});
|
||||
if (obj[0].domain) {
|
||||
$("#tl").show();
|
||||
ticker();
|
||||
multiSelector();
|
||||
verck(ver);
|
||||
$("#something-wrong img").attr("src", "../../img/thinkingdesk.png")
|
||||
}
|
||||
});
|
||||
if (obj[0].domain) {
|
||||
$("#tl").show();
|
||||
ticker();
|
||||
multiSelector();
|
||||
verck(ver);
|
||||
$("#something-wrong img").attr("src","../../img/thinkingdesk.png")
|
||||
}
|
||||
}
|
||||
}
|
||||
ck();
|
||||
ck();
|
||||
|
||||
|
||||
//ログインポップアップ
|
||||
function login(url) {
|
||||
if($('#linux:checked').val()=="on"){
|
||||
if ($('#linux:checked').val() == "on") {
|
||||
var red = "urn:ietf:wg:oauth:2.0:oob"
|
||||
}else{
|
||||
} else {
|
||||
var red = 'thedesk://login';
|
||||
}
|
||||
localStorage.setItem("redirect", red);
|
||||
@@ -66,27 +66,27 @@ function login(url) {
|
||||
redirect_uris: red,
|
||||
website: "https://thedesk.top"
|
||||
}));
|
||||
httpreq.onreadystatechange = function() {
|
||||
httpreq.onreadystatechange = function () {
|
||||
if (httpreq.readyState === 4) {
|
||||
var json = httpreq.response;
|
||||
var auth = "https://" + url + "/oauth/authorize?client_id=" + json[
|
||||
"client_id"] + "&client_secret=" + json["client_secret"] +
|
||||
"&response_type=code&redirect_uri="+red+"&scope=read+write+follow";
|
||||
localStorage.setItem("domain_" + acct_id, url);
|
||||
localStorage.setItem("client_id", json["client_id"]);
|
||||
localStorage.setItem("client_secret", json["client_secret"]);
|
||||
$("#auth").show();
|
||||
$("#masara").hide();
|
||||
const { shell } = require('electron');
|
||||
"&response_type=code&redirect_uri=" + red + "&scope=read+write+follow";
|
||||
localStorage.setItem("domain_" + acct_id, url);
|
||||
localStorage.setItem("client_id", json["client_id"]);
|
||||
localStorage.setItem("client_secret", json["client_secret"]);
|
||||
$("#auth").show();
|
||||
$("#masara").hide();
|
||||
const { shell } = require('electron');
|
||||
|
||||
shell.openExternal(auth);
|
||||
|
||||
if($('#linux:checked').val()=="on"){
|
||||
}else{
|
||||
var electron = require("electron");
|
||||
var ipc = electron.ipcRenderer;
|
||||
ipc.send('quit', 'go');
|
||||
}
|
||||
shell.openExternal(auth);
|
||||
|
||||
if ($('#linux:checked').val() == "on") {
|
||||
} else {
|
||||
var electron = require("electron");
|
||||
var ipc = electron.ipcRenderer;
|
||||
ipc.send('quit', 'go');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -99,15 +99,15 @@ function instance() {
|
||||
|
||||
|
||||
//コードを入れた後認証
|
||||
function code(code,mode) {
|
||||
function code(code, mode) {
|
||||
var red = localStorage.getItem("redirect");
|
||||
localStorage.removeItem("redirect")
|
||||
if(!code){
|
||||
if (!code) {
|
||||
var code = $("#code").val();
|
||||
}
|
||||
if(localStorage.getItem("domain_tmp")){
|
||||
if (localStorage.getItem("domain_tmp")) {
|
||||
var url = localStorage.getItem("domain_tmp");
|
||||
}else{
|
||||
} else {
|
||||
var url = localStorage.getItem("domain_" + acct_id);
|
||||
}
|
||||
var start = "https://" + url + "/oauth/token";
|
||||
@@ -125,21 +125,21 @@ function code(code,mode) {
|
||||
client_secret: secret,
|
||||
code: code
|
||||
})
|
||||
}).then(function(response) {
|
||||
}).then(function (response) {
|
||||
return response.json();
|
||||
}).catch(function(error) {
|
||||
}).catch(function (error) {
|
||||
todo(error);
|
||||
console.error(error);
|
||||
}).then(function(json) {
|
||||
}).then(function (json) {
|
||||
todo(json);
|
||||
if (json["access_token"]) {
|
||||
localStorage.setItem(url + "_at", json["access_token"]);
|
||||
if(mode=="manager"){
|
||||
if (mode == "manager") {
|
||||
getdataAdv(url, json["access_token"]);
|
||||
}else{
|
||||
} else {
|
||||
getdata();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -148,7 +148,7 @@ function code(code,mode) {
|
||||
function getdata() {
|
||||
var acct_id = 0;
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_"+ acct_id + "_at");
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
var start = "https://" + domain + "/api/v1/accounts/verify_credentials";
|
||||
fetch(start, {
|
||||
method: 'GET',
|
||||
@@ -156,22 +156,22 @@ function getdata() {
|
||||
'content-type': 'application/json',
|
||||
'Authorization': 'Bearer ' + at
|
||||
},
|
||||
}).then(function(response) {
|
||||
}).then(function (response) {
|
||||
return response.json();
|
||||
}).catch(function(error) {
|
||||
}).catch(function (error) {
|
||||
todo(error);
|
||||
console.error(error);
|
||||
}).then(function(json) {
|
||||
}).then(function (json) {
|
||||
if (json.error) {
|
||||
console.error("Error:" + json.error);
|
||||
Materialize.toast(lang.lang_fatalerroroccured+"Error:" + json.error,
|
||||
Materialize.toast(lang.lang_fatalerroroccured + "Error:" + json.error,
|
||||
5000);
|
||||
return;
|
||||
}
|
||||
var avatar=json["avatar"];
|
||||
var avatar = json["avatar"];
|
||||
//missingがmissingなやつ
|
||||
if(avatar=="/avatars/original/missing.png"){
|
||||
avatar="./img/missing.svg";
|
||||
if (avatar == "/avatars/original/missing.png") {
|
||||
avatar = "./img/missing.svg";
|
||||
}
|
||||
var obj = [{
|
||||
at: at,
|
||||
@@ -204,27 +204,27 @@ function getdataAdv(domain, at) {
|
||||
'content-type': 'application/json',
|
||||
'Authorization': 'Bearer ' + at
|
||||
},
|
||||
}).then(function(response) {
|
||||
}).then(function (response) {
|
||||
return response.json();
|
||||
}).catch(function(error) {
|
||||
}).catch(function (error) {
|
||||
todo(error);
|
||||
console.error(error);
|
||||
}).then(function(json) {
|
||||
}).then(function (json) {
|
||||
if (json.error) {
|
||||
console.error("Error:" + json.error);
|
||||
Materialize.toast(lang.lang_fatalerroroccured+"Error:" + json.error,
|
||||
Materialize.toast(lang.lang_fatalerroroccured + "Error:" + json.error,
|
||||
5000);
|
||||
return;
|
||||
}
|
||||
var avatar=json["avatar"];
|
||||
var avatar = json["avatar"];
|
||||
//missingがmissingなやつ
|
||||
if(avatar=="/avatars/original/missing.png"){
|
||||
avatar="../../img/missing.svg";
|
||||
if (avatar == "/avatars/original/missing.png") {
|
||||
avatar = "../../img/missing.svg";
|
||||
}
|
||||
if(json["source"]["privacy"]){
|
||||
var priv=json["source"]["privacy"];
|
||||
}else{
|
||||
var priv="public";
|
||||
if (json["source"]["privacy"]) {
|
||||
var priv = json["source"]["privacy"];
|
||||
} else {
|
||||
var priv = "public";
|
||||
}
|
||||
var add = {
|
||||
at: at,
|
||||
@@ -245,14 +245,14 @@ function getdataAdv(domain, at) {
|
||||
localStorage.setItem("prof_" + target, avatar);
|
||||
var json = JSON.stringify(obj);
|
||||
localStorage.setItem("multi", json);
|
||||
location.href="index.html";
|
||||
location.href = "index.html";
|
||||
});
|
||||
}
|
||||
//ユーザーデータ更新
|
||||
function refresh(target,loadskip) {
|
||||
function refresh(target, loadskip) {
|
||||
var multi = localStorage.getItem("multi");
|
||||
var obj = JSON.parse(multi);
|
||||
if(obj[target].mode=="misskey"){
|
||||
if (obj[target].mode == "misskey") {
|
||||
return
|
||||
}
|
||||
var start = "https://" + obj[target].domain +
|
||||
@@ -263,22 +263,22 @@ function refresh(target,loadskip) {
|
||||
'content-type': 'application/json',
|
||||
'Authorization': 'Bearer ' + obj[target].at
|
||||
},
|
||||
}).then(function(response) {
|
||||
}).then(function (response) {
|
||||
return response.json();
|
||||
}).catch(function(error) {
|
||||
}).catch(function (error) {
|
||||
todo(error);
|
||||
console.error(error);
|
||||
}).then(function(json) {
|
||||
}).then(function (json) {
|
||||
if (json.error) {
|
||||
console.error("Error:" + json.error);
|
||||
Materialize.toast(lang.lang_fatalerroroccured+"Error:" + json.error,
|
||||
Materialize.toast(lang.lang_fatalerroroccured + "Error:" + json.error,
|
||||
5000);
|
||||
return;
|
||||
}
|
||||
var avatar=json["avatar"];
|
||||
var avatar = json["avatar"];
|
||||
//missingがmissingなやつ
|
||||
if(avatar=="/avatars/original/missing.png" || !avatar){
|
||||
avatar="./img/missing.svg";
|
||||
if (avatar == "/avatars/original/missing.png" || !avatar) {
|
||||
avatar = "./img/missing.svg";
|
||||
}
|
||||
var ref = {
|
||||
at: obj[target].at,
|
||||
@@ -297,7 +297,7 @@ function refresh(target,loadskip) {
|
||||
obj[target] = ref;
|
||||
var json = JSON.stringify(obj);
|
||||
localStorage.setItem("multi", json);
|
||||
if(!loadskip){
|
||||
if (!loadskip) {
|
||||
load();
|
||||
}
|
||||
});
|
||||
@@ -316,94 +316,94 @@ function ckdb(acct_id) {
|
||||
localStorage.removeItem("fav_" + acct_id);
|
||||
localStorage.removeItem("bt_" + acct_id);
|
||||
localStorage.removeItem("followlocale_" + acct_id);
|
||||
if(domain=="kirishima.cloud"){
|
||||
if (domain == "kirishima.cloud") {
|
||||
localStorage.setItem("kirishima", "true");
|
||||
$("#ranking-btn").show();
|
||||
}else if(domain=="imastodon.net"){
|
||||
} else if (domain == "imastodon.net") {
|
||||
localStorage.setItem("imas", "true");
|
||||
$(".imasonly").show();
|
||||
}
|
||||
var at = localStorage.getItem("acct_"+ acct_id + "_at");
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
var bbcode = domain + "_bbcode";
|
||||
var letters = domain + "_letters";
|
||||
if(localStorage.getItem("instance")){
|
||||
var json=JSON.parse(localStorage.getItem("instance"));
|
||||
if (json[bbcode]) {
|
||||
if (json[bbcode] == "enabled") {
|
||||
localStorage.setItem("bb_" + acct_id, "true");
|
||||
} else {
|
||||
localStorage.removeItem("bb_" + acct_id);
|
||||
$("[data-activates='bbcode']").addClass("disabled");
|
||||
$("[data-activates='bbcode']").prop("disabled", true);
|
||||
}
|
||||
if (localStorage.getItem("instance")) {
|
||||
var json = JSON.parse(localStorage.getItem("instance"));
|
||||
if (json[bbcode]) {
|
||||
if (json[bbcode] == "enabled") {
|
||||
localStorage.setItem("bb_" + acct_id, "true");
|
||||
} else {
|
||||
localStorage.removeItem("bb_" + acct_id);
|
||||
$("[data-activates='bbcode']").addClass("disabled");
|
||||
$("[data-activates='bbcode']").addClass("disabled", true);
|
||||
}
|
||||
|
||||
if (json[domain + "_markdown"] == "enabled") {
|
||||
localStorage.setItem("md_" + acct_id, "true");
|
||||
$(".markdown").show();
|
||||
}else{
|
||||
$(".anti-markdown").hide();
|
||||
$(".markdown").hide();
|
||||
localStorage.removeItem("bb_" + acct_id);
|
||||
}
|
||||
if(json[domain + "_home"]){
|
||||
localStorage.setItem("home_" + acct_id, json[domain + "_home"]);
|
||||
}
|
||||
if(json[domain + "_local"]){
|
||||
localStorage.setItem("local_" + acct_id, json[domain + "_local"]);
|
||||
}
|
||||
if(json[domain + "_public"]){
|
||||
localStorage.setItem("public_" + acct_id, json[domain + "_public"]);
|
||||
}
|
||||
if(json[domain + "_notification"]){
|
||||
localStorage.setItem("notification_" + acct_id, json[domain + "_notification"]);
|
||||
}
|
||||
if(json[domain + "_post"]){
|
||||
localStorage.setItem("post_" + acct_id, json[domain + "_post"]);
|
||||
}
|
||||
if(json[domain + "_fav"]){
|
||||
localStorage.setItem("fav_" + acct_id, json[domain + "_fav"]);
|
||||
}
|
||||
if(json[domain + "_bt"]){
|
||||
localStorage.setItem("bt_" + acct_id, json[domain + "_bt"]);
|
||||
}
|
||||
if(json[domain + "_follow"]){
|
||||
localStorage.setItem("followlocale_" + acct_id, json[domain + "_follow"]);
|
||||
$("[data-activates='bbcode']").prop("disabled", true);
|
||||
}
|
||||
} else {
|
||||
localStorage.removeItem("bb_" + acct_id);
|
||||
$("[data-activates='bbcode']").addClass("disabled");
|
||||
$("[data-activates='bbcode']").addClass("disabled", true);
|
||||
}
|
||||
|
||||
if (json[domain + "_markdown"] == "enabled") {
|
||||
localStorage.setItem("md_" + acct_id, "true");
|
||||
$(".markdown").show();
|
||||
} else {
|
||||
$(".anti-markdown").hide();
|
||||
$(".markdown").hide();
|
||||
localStorage.removeItem("bb_" + acct_id);
|
||||
}
|
||||
if (json[domain + "_home"]) {
|
||||
localStorage.setItem("home_" + acct_id, json[domain + "_home"]);
|
||||
}
|
||||
if (json[domain + "_local"]) {
|
||||
localStorage.setItem("local_" + acct_id, json[domain + "_local"]);
|
||||
}
|
||||
if (json[domain + "_public"]) {
|
||||
localStorage.setItem("public_" + acct_id, json[domain + "_public"]);
|
||||
}
|
||||
if (json[domain + "_notification"]) {
|
||||
localStorage.setItem("notification_" + acct_id, json[domain + "_notification"]);
|
||||
}
|
||||
if (json[domain + "_post"]) {
|
||||
localStorage.setItem("post_" + acct_id, json[domain + "_post"]);
|
||||
}
|
||||
if (json[domain + "_fav"]) {
|
||||
localStorage.setItem("fav_" + acct_id, json[domain + "_fav"]);
|
||||
}
|
||||
if (json[domain + "_bt"]) {
|
||||
localStorage.setItem("bt_" + acct_id, json[domain + "_bt"]);
|
||||
}
|
||||
if (json[domain + "_follow"]) {
|
||||
localStorage.setItem("followlocale_" + acct_id, json[domain + "_follow"]);
|
||||
}
|
||||
}
|
||||
if(localStorage.getItem("mode_" + domain)!="misskey"){
|
||||
if (localStorage.getItem("mode_" + domain) != "misskey") {
|
||||
var start = "https://" + domain + "/api/v1/instance";
|
||||
fetch(start, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'content-type': 'application/json'
|
||||
},
|
||||
}).then(function(response) {
|
||||
}).then(function (response) {
|
||||
return response.json();
|
||||
}).catch(function(error) {
|
||||
}).catch(function (error) {
|
||||
console.error(error);
|
||||
}).then(function(json) {
|
||||
}).then(function (json) {
|
||||
if (json.error) {
|
||||
console.error(json.error);
|
||||
return;
|
||||
}
|
||||
if(json){
|
||||
if(json["max_toot_chars"]){
|
||||
if (json) {
|
||||
if (json["max_toot_chars"]) {
|
||||
localStorage.setItem("letters_" + acct_id, json["max_toot_chars"]);
|
||||
}
|
||||
if(json["urls"]["streaming_api"]){
|
||||
if (json["urls"]["streaming_api"]) {
|
||||
localStorage.setItem("streaming_" + acct_id, json["urls"]["streaming_api"]);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}else{
|
||||
|
||||
} else {
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -418,90 +418,90 @@ function multiSelector() {
|
||||
var obj = JSON.parse(multi);
|
||||
}
|
||||
var templete;
|
||||
if(localStorage.getItem("mainuse")=="main"){
|
||||
if (localStorage.getItem("mainuse") == "main") {
|
||||
var last = localStorage.getItem("main");
|
||||
}else if(localStorage.getItem("last-use")){
|
||||
} else if (localStorage.getItem("last-use")) {
|
||||
var last = localStorage.getItem("last-use");
|
||||
}else{
|
||||
var last=0;
|
||||
} else {
|
||||
var last = 0;
|
||||
}
|
||||
var sel;
|
||||
if(obj.length<1){
|
||||
if (obj.length < 1) {
|
||||
$("#src-acct-sel").html('<option value="tootsearch">Tootsearch</option>');
|
||||
$("#add-acct-sel").html('<option value="noauth">'+lang.lang_login_noauth+'</option>');
|
||||
}else{
|
||||
Object.keys(obj).forEach(function(key) {
|
||||
var acct = obj[key];
|
||||
var list = key * 1 + 1;
|
||||
if (key == last) {
|
||||
sel = "selected";
|
||||
var domain = acct.domain;
|
||||
localStorage.setItem("domain_" + key, domain);
|
||||
if(idata[domain+"_letters"]){
|
||||
$("#textarea").attr("data-length", idata[domain+"_letters"])
|
||||
}else{
|
||||
var maxletters = localStorage.getItem("letters_" + key);
|
||||
if(maxletters>0){
|
||||
$("#textarea").attr("data-length", maxletters)
|
||||
}else{
|
||||
$("#textarea").attr("data-length", 500)
|
||||
$("#add-acct-sel").html('<option value="noauth">' + lang.lang_login_noauth + '</option>');
|
||||
} else {
|
||||
Object.keys(obj).forEach(function (key) {
|
||||
var acct = obj[key];
|
||||
var list = key * 1 + 1;
|
||||
if (key == last) {
|
||||
sel = "selected";
|
||||
var domain = acct.domain;
|
||||
localStorage.setItem("domain_" + key, domain);
|
||||
if (idata[domain + "_letters"]) {
|
||||
$("#textarea").attr("data-length", idata[domain + "_letters"])
|
||||
} else {
|
||||
var maxletters = localStorage.getItem("letters_" + key);
|
||||
if (maxletters > 0) {
|
||||
$("#textarea").attr("data-length", maxletters)
|
||||
} else {
|
||||
$("#textarea").attr("data-length", 500)
|
||||
}
|
||||
}
|
||||
if (idata[domain + "_glitch"]) {
|
||||
$("#local-button").removeClass("hide")
|
||||
}
|
||||
var profimg = acct.prof;
|
||||
localStorage.setItem("prof_" + key, profimg);
|
||||
if (!profimg) {
|
||||
profimg = "../../img/missing.svg";
|
||||
}
|
||||
$("#acct-sel-prof").attr("src", profimg);
|
||||
if (domain) {
|
||||
var cc = "(" + domain + ")";
|
||||
} else {
|
||||
var cc = "";
|
||||
}
|
||||
$("#toot-post-btn").text(lang.lang_toot + cc);
|
||||
if (acct.background && acct.background != "def" && acct.text && acct.text != "def") {
|
||||
$("#toot-post-btn").removeClass("indigo");
|
||||
$("#toot-post-btn").css("background-color", "#" + acct.background);
|
||||
$("#toot-post-btn").css("color", acct.text);
|
||||
} else {
|
||||
}
|
||||
if (domain == "kirishima.cloud") {
|
||||
$("#faicon-btn").show();
|
||||
} else {
|
||||
$("#faicon-btn").hide();
|
||||
}
|
||||
if (domain == "imastodon.net") {
|
||||
trendTag();
|
||||
} else {
|
||||
$("#trendtag").html("");
|
||||
}
|
||||
} else {
|
||||
sel = "";
|
||||
}
|
||||
if(idata[domain+"_glitch"]){
|
||||
$("#local-button").removeClass("hide")
|
||||
}
|
||||
var profimg = acct.prof;
|
||||
localStorage.setItem("prof_" + key, profimg);
|
||||
if(!profimg){
|
||||
profimg="../../img/missing.svg";
|
||||
}
|
||||
$("#acct-sel-prof").attr("src",profimg);
|
||||
if(domain){
|
||||
var cc="("+domain+")";
|
||||
}else{
|
||||
var cc="";
|
||||
}
|
||||
$("#toot-post-btn").text(lang.lang_toot+cc);
|
||||
if(acct.background && acct.background!="def" && acct.text && acct.text!="def"){
|
||||
$("#toot-post-btn").removeClass("indigo");
|
||||
$("#toot-post-btn").css("background-color","#"+acct.background);
|
||||
$("#toot-post-btn").css("color",acct.text);
|
||||
}else{
|
||||
}
|
||||
if(domain=="kirishima.cloud"){
|
||||
$("#faicon-btn").show();
|
||||
}else{
|
||||
$("#faicon-btn").hide();
|
||||
}
|
||||
if(domain=="imastodon.net"){
|
||||
trendTag();
|
||||
}else{
|
||||
$("#trendtag").html("");
|
||||
}
|
||||
} else {
|
||||
sel = "";
|
||||
}
|
||||
templete = '<option value="' + key + '" data-icon="' + acct.prof +
|
||||
'" class="left circle" ' + sel + '>' + acct.user + '@' + acct.domain +
|
||||
'</option>';
|
||||
$(".acct-sel").append(templete);
|
||||
|
||||
});
|
||||
templete = '<option value="' + key + '" data-icon="' + acct.prof +
|
||||
'" class="left circle" ' + sel + '>' + acct.user + '@' + acct.domain +
|
||||
'</option>';
|
||||
$(".acct-sel").append(templete);
|
||||
|
||||
});
|
||||
$("#src-acct-sel").append('<option value="tootsearch">Tootsearch</option>');
|
||||
$("#add-acct-sel").append('<option value="noauth">'+lang.lang_login_noauth+'</option><option value="webview">Twitter</option>');
|
||||
$("#add-acct-sel").append('<option value="noauth">' + lang.lang_login_noauth + '</option><option value="webview">Twitter</option>');
|
||||
}
|
||||
$('select').material_select('update');
|
||||
parseColumn(true);
|
||||
}
|
||||
|
||||
//バージョンエンコ
|
||||
function enc(ver){
|
||||
var ver = ver.replace( /\s/g , "" );
|
||||
var ver = ver.replace( /\(/g , "-" );
|
||||
var ver = ver.replace( /\)/g , "" );
|
||||
var ver = ver.replace( /\[/g , "_" );
|
||||
var ver = ver.replace( /\]/g , "" );
|
||||
return ver;
|
||||
function enc(ver) {
|
||||
var ver = ver.replace(/\s/g, "");
|
||||
var ver = ver.replace(/\(/g, "-");
|
||||
var ver = ver.replace(/\)/g, "");
|
||||
var ver = ver.replace(/\[/g, "_");
|
||||
var ver = ver.replace(/\]/g, "");
|
||||
return ver;
|
||||
}
|
||||
//インスタンスティッカー
|
||||
function ticker() {
|
||||
@@ -511,15 +511,15 @@ function ticker() {
|
||||
headers: {
|
||||
'content-type': 'application/json'
|
||||
},
|
||||
}).then(function(response) {
|
||||
}).then(function (response) {
|
||||
return response.json();
|
||||
}).catch(function(error) {
|
||||
}).catch(function (error) {
|
||||
console.error(error);
|
||||
}).then(function(json) {
|
||||
}).then(function (json) {
|
||||
if (json.error) {
|
||||
return;
|
||||
}
|
||||
if(json){
|
||||
if (json) {
|
||||
localStorage.setItem("ticker", JSON.stringify(json));
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user