thedesk/app/js/post/secure.js

82 lines
2.0 KiB
JavaScript
Raw Normal View History

2018-01-28 23:22:43 +11:00
/*保護系*/
//画像保護
function nsfw(){
if($("#nsfw").hasClass("nsfw-avail")){
2018-05-02 14:14:03 +10:00
$("#nsfw").removeClass("yellow-text");
$("#nsfw").html("visibility_off");
2018-01-28 23:22:43 +11:00
$("#nsfw").removeClass("nsfw-avail");
}else{
2018-05-02 14:14:03 +10:00
$("#nsfw").addClass("yellow-text");
$("#nsfw").html("visibility");
2018-01-28 23:22:43 +11:00
$("#nsfw").addClass("nsfw-avail");
}
}
//投稿公開範囲
function vis(set){
$("#vis").text(set);
2018-05-02 14:14:03 +10:00
$("#vis-icon").removeClass("red-text");
$("#vis-icon").removeClass("orange-text");
$("#vis-icon").removeClass("blue-text");
$("#vis-icon").removeClass("purple-text");
2018-03-14 05:31:31 +11:00
if(set=="public"){
2018-05-02 14:14:03 +10:00
$("#vis-icon").text("public");
$("#vis-icon").addClass("purple-text");
2018-03-14 05:31:31 +11:00
}else if(set=="unlisted"){
2018-05-02 14:14:03 +10:00
$("#vis-icon").text("lock_open");
$("#vis-icon").addClass("blue-text");
2018-03-14 05:31:31 +11:00
}else if(set=="private"){
2018-05-02 14:14:03 +10:00
$("#vis-icon").text("lock");
$("#vis-icon").addClass("orange-text");
2018-03-14 05:31:31 +11:00
}else if(set=="direct"){
2018-05-02 14:14:03 +10:00
$("#vis-icon").text("mail");
$("#vis-icon").addClass("red-text");
2018-04-09 00:17:33 +10:00
}else if(set=="limited"){
2018-05-02 14:14:03 +10:00
$("#vis-icon").text("group");
$("#vis-icon").addClass("teal-text");
2018-03-14 05:31:31 +11:00
}
2018-01-28 23:22:43 +11:00
var vis=localStorage.getItem("vis");
if(vis=="memory"){
localStorage.setItem("vis-memory",set);
}
}
2018-03-14 05:31:31 +11:00
function loadVis(){
var vist = localStorage.getItem("vis");
if (!vist) {
vis("public");
} else {
if (vist == "memory") {
var memory = localStorage.getItem("vis-memory");
if (!memory) {
memory = "public";
}
vis(memory);
} else {
vis(vist);
}
}
}
loadVis();
2018-01-28 23:22:43 +11:00
//コンテンツワーニング
function cw(){
if($("#cw").hasClass("cw-avail")){
$("#cw-text").val();
$("#cw-text").hide();
2018-05-02 14:14:03 +10:00
$("#cw").removeClass("yellow-text");
2018-01-28 23:22:43 +11:00
$("#cw").removeClass("cw-avail");
}else{
$("#cw-text").show();
2018-05-02 14:14:03 +10:00
$("#cw").addClass("yellow-text");
2018-01-28 23:22:43 +11:00
$("#cw").addClass("cw-avail");
var cwt=localStorage.getItem("cw-text");
if(cwt){
$("#cw-text").val(cwt);
}
}
}
//TLでコンテンツワーニングを表示トグル
function cw_show(id){
$(".cw_hide_"+id).toggleClass("cw");
2018-02-13 06:16:46 +11:00
$(".cw-long-"+id).toggleClass("hide");
2018-01-28 23:22:43 +11:00
}