2018-01-28 23:22:43 +11:00
|
|
|
//設定(setting.html)で読む
|
|
|
|
//設定ボタン押した。
|
|
|
|
function settings() {
|
|
|
|
var dd = $("[name=time]:checked").val();
|
2018-02-24 03:02:44 +11:00
|
|
|
var dt = $("[for="+dd+"]").text();
|
|
|
|
if (dd != localStorage.getItem("datetype")) {
|
|
|
|
Materialize.toast("時間設定を" + dt + "に設定しました。", 3000);
|
2018-01-28 23:22:43 +11:00
|
|
|
}
|
|
|
|
localStorage.setItem("datetype", dd);
|
2018-02-24 03:02:44 +11:00
|
|
|
|
2018-01-28 23:22:43 +11:00
|
|
|
var cd = $("[name=theme]:checked").val();
|
2018-02-24 03:02:44 +11:00
|
|
|
var ct = $("[for="+cd+"]").text();
|
2018-01-28 23:22:43 +11:00
|
|
|
if (cd != localStorage.getItem("theme")) {
|
2018-02-24 03:02:44 +11:00
|
|
|
Materialize.toast("テーマ設定を" + ct + "に設定しました。", 3000);
|
2018-01-28 23:22:43 +11:00
|
|
|
}
|
|
|
|
//テーマはこの場で設定
|
|
|
|
themes(cd);
|
|
|
|
localStorage.setItem("theme", cd);
|
2018-02-24 03:02:44 +11:00
|
|
|
|
2018-01-28 23:22:43 +11:00
|
|
|
var nd = $("[name=nsfw]:checked").val();
|
2018-02-24 03:02:44 +11:00
|
|
|
var nt = $("[for=n_"+nd+"]").text();
|
2018-01-28 23:22:43 +11:00
|
|
|
if (nd != localStorage.getItem("nsfw")) {
|
2018-02-24 03:02:44 +11:00
|
|
|
Materialize.toast("画像表示設定を" + nt + "に設定しました。", 3000);
|
2018-01-28 23:22:43 +11:00
|
|
|
}
|
|
|
|
localStorage.setItem("nsfw", nd);
|
2018-02-24 03:02:44 +11:00
|
|
|
|
2018-01-28 23:22:43 +11:00
|
|
|
var cwd = $("[name=cw]:checked").val();
|
2018-02-24 03:02:44 +11:00
|
|
|
var cwt = $("[for=c_"+cwd+"]").text();
|
2018-01-28 23:22:43 +11:00
|
|
|
if (cwd != localStorage.getItem("cw")) {
|
2018-02-24 03:02:44 +11:00
|
|
|
Materialize.toast("テキスト表示設定を" + cwt + "に設定しました。", 3000);
|
2018-01-28 23:22:43 +11:00
|
|
|
}
|
|
|
|
localStorage.setItem("cw", cwd);
|
2018-02-24 03:02:44 +11:00
|
|
|
|
2018-01-28 23:22:43 +11:00
|
|
|
var cwtd = $("#cw-text").val();
|
|
|
|
if (cwtd != localStorage.getItem("cw-text")) {
|
|
|
|
Materialize.toast("デフォルトの警告文を「" + cwtd + "」に設定しました。", 3000);
|
|
|
|
}
|
|
|
|
localStorage.setItem("cw-text", cwtd);
|
2018-02-24 03:02:44 +11:00
|
|
|
|
2018-01-28 23:22:43 +11:00
|
|
|
var visd = $("[name=vis]:checked").val();
|
2018-02-24 03:02:44 +11:00
|
|
|
var vist = $("[for="+visd+"]").text();
|
2018-01-28 23:22:43 +11:00
|
|
|
if (visd != localStorage.getItem("vis")) {
|
2018-02-24 03:02:44 +11:00
|
|
|
Materialize.toast("デフォルトの公開設定を" + vist + "に設定しました。", 3000);
|
2018-01-28 23:22:43 +11:00
|
|
|
}
|
|
|
|
localStorage.setItem("vis", visd);
|
2018-02-24 03:02:44 +11:00
|
|
|
|
2018-01-28 23:22:43 +11:00
|
|
|
var popd = $("#popup").val();
|
|
|
|
if (popd > 0 && popd != localStorage.getItem("popup")) {
|
|
|
|
Materialize.toast("ポップアップお知らせを" + popd + "秒に設定しました。", 3000);
|
|
|
|
} else if (popd != localStorage.getItem("popup")) {
|
|
|
|
Materialize.toast("ポップアップお知らせをオフに設定しました。", 3000);
|
|
|
|
}
|
|
|
|
localStorage.setItem("popup", popd);
|
2018-02-24 03:02:44 +11:00
|
|
|
|
2018-01-28 23:22:43 +11:00
|
|
|
var boxd = $("[name=box]:checked").val();
|
2018-02-24 03:02:44 +11:00
|
|
|
var boxt = $("[for=b_"+boxd+"]").text();
|
2018-01-28 23:22:43 +11:00
|
|
|
if (boxd != localStorage.getItem("box")) {
|
2018-02-24 03:02:44 +11:00
|
|
|
Materialize.toast("デフォルトでのボックスの挙動を" + boxt + "に設定しました。", 3000);
|
2018-01-28 23:22:43 +11:00
|
|
|
}
|
|
|
|
localStorage.setItem("box", boxd);
|
2018-02-24 03:02:44 +11:00
|
|
|
|
2018-02-18 18:29:06 +11:00
|
|
|
var gifd = $("[name=gif]:checked").val();
|
2018-02-24 03:02:44 +11:00
|
|
|
var gift = $("[for=g_"+gifd+"]").text();
|
2018-02-18 18:29:06 +11:00
|
|
|
if (gifd != localStorage.getItem("gif")) {
|
2018-02-24 03:02:44 +11:00
|
|
|
Materialize.toast("アイコンアニメーション再生を" + gift + "に設定しました。", 3000);
|
2018-02-18 18:29:06 +11:00
|
|
|
}
|
|
|
|
localStorage.setItem("gif", gifd);
|
2018-02-24 03:02:44 +11:00
|
|
|
|
2018-01-28 23:22:43 +11:00
|
|
|
var sentd = $("#sentence").val();
|
2018-02-24 03:02:44 +11:00
|
|
|
var ltrd = $("#letters").val();
|
|
|
|
if (sentd != localStorage.getItem("sentence") || ltrd != localStorage.getItem("letters")) {
|
|
|
|
Materialize.toast(sentd + "行以上または"+ltrd+"文字以上でテキストを隠します。", 3000);
|
2018-01-28 23:22:43 +11:00
|
|
|
}
|
|
|
|
localStorage.setItem("sentence", sentd);
|
2018-02-24 03:02:44 +11:00
|
|
|
localStorage.setItem("letters", ltrd);
|
|
|
|
|
2018-01-28 23:22:43 +11:00
|
|
|
var widthd = $("#width").val();
|
|
|
|
if (widthd != localStorage.getItem("width")) {
|
|
|
|
Materialize.toast("横幅最低を" + widthd + "pxに設定しました。", 3000);
|
|
|
|
}
|
|
|
|
localStorage.setItem("width", widthd);
|
2018-02-24 03:02:44 +11:00
|
|
|
|
2018-01-28 23:22:43 +11:00
|
|
|
var imgd = $("[name=img]:checked").val();
|
2018-02-24 03:02:44 +11:00
|
|
|
var imgt = $("[for=i_"+imgd+"]").text();
|
2018-01-28 23:22:43 +11:00
|
|
|
if (imgd != localStorage.getItem("img")) {
|
2018-02-24 03:02:44 +11:00
|
|
|
Materialize.toast("画像投稿後の設定を「" + imgt + "」に設定しました。", 3000);
|
2018-01-28 23:22:43 +11:00
|
|
|
}
|
2018-02-18 03:44:03 +11:00
|
|
|
var sized = $("#size").val();
|
|
|
|
if (sized != localStorage.getItem("size")) {
|
|
|
|
Materialize.toast("フォントサイズを" + sized + "pxに設定しました。", 3000);
|
|
|
|
}
|
|
|
|
localStorage.setItem("size", sized);
|
2018-01-28 23:22:43 +11:00
|
|
|
localStorage.setItem("img", imgd);
|
|
|
|
}
|
|
|
|
|
|
|
|
//読み込み時の設定ロード
|
|
|
|
function load() {
|
|
|
|
var prof = localStorage.getItem("prof");
|
|
|
|
$("#my-prof").attr("src", prof);
|
|
|
|
var datetype = localStorage.getItem("datetype");
|
|
|
|
if (!datetype) {
|
|
|
|
var datetype = "absolute";
|
|
|
|
}
|
|
|
|
$("#" + datetype).prop("checked", true);
|
|
|
|
|
|
|
|
var theme = localStorage.getItem("theme");
|
|
|
|
if (!theme) {
|
|
|
|
var theme = "white";
|
|
|
|
}
|
|
|
|
$("#" + theme).prop("checked", true);
|
|
|
|
|
|
|
|
var nsfw = localStorage.getItem("nsfw");
|
|
|
|
if (!nsfw) {
|
|
|
|
var nsfw = "yes";
|
|
|
|
}
|
|
|
|
$("#n_" + nsfw).prop("checked", true);
|
|
|
|
|
|
|
|
var cw = localStorage.getItem("cw");
|
|
|
|
if (!cw) {
|
|
|
|
var cw = "yes";
|
|
|
|
}
|
|
|
|
$("#c_" + cw).prop("checked", true);
|
|
|
|
|
|
|
|
var popup = localStorage.getItem("popup");
|
|
|
|
if (!popup) {
|
|
|
|
var popup = "0";
|
|
|
|
}
|
|
|
|
$("#popup").val(popup);
|
|
|
|
|
|
|
|
var box = localStorage.getItem("box");
|
|
|
|
if (!box) {
|
|
|
|
var box = "no";
|
|
|
|
}
|
|
|
|
$("#b_" + box).prop("checked", true);
|
|
|
|
|
2018-02-18 18:29:06 +11:00
|
|
|
var gif = localStorage.getItem("gif");
|
|
|
|
if (!gif) {
|
|
|
|
var gif = "yes";
|
|
|
|
}
|
|
|
|
$("#g_" + gif).prop("checked", true);
|
|
|
|
|
2018-01-28 23:22:43 +11:00
|
|
|
var sent = localStorage.getItem("sentence");
|
|
|
|
if (!sent) {
|
|
|
|
var sent = "500";
|
|
|
|
}
|
|
|
|
$("#sentence").val(sent);
|
2018-02-24 03:02:44 +11:00
|
|
|
var ltrs = localStorage.getItem("letters");
|
|
|
|
if (!ltrs) {
|
|
|
|
var ltrs = "500";
|
|
|
|
}
|
|
|
|
$("#letters").val(ltrs);
|
2018-01-28 23:22:43 +11:00
|
|
|
|
|
|
|
var width = localStorage.getItem("width");
|
|
|
|
if (!width) {
|
|
|
|
var width = "300";
|
|
|
|
}
|
|
|
|
$("#width").val(width);
|
|
|
|
|
|
|
|
var cwt = localStorage.getItem("cw-text");
|
|
|
|
if (!cwt) {
|
|
|
|
var cwt = "";
|
|
|
|
}
|
|
|
|
$("#cw-text").val(cwt);
|
|
|
|
|
|
|
|
var vis = localStorage.getItem("vis");
|
|
|
|
if (!vis) {
|
|
|
|
var vis = "public";
|
|
|
|
}
|
|
|
|
$("#" + vis).prop("checked", true);
|
|
|
|
|
|
|
|
var img = localStorage.getItem("img");
|
|
|
|
if (!img) {
|
|
|
|
var img = "no-act";
|
|
|
|
}
|
|
|
|
$("#i_" + img).prop("checked", true);
|
2018-02-18 03:44:03 +11:00
|
|
|
|
|
|
|
var size = localStorage.getItem("size");
|
|
|
|
if (!size) {
|
|
|
|
var size = "15";
|
|
|
|
}
|
|
|
|
$("#size").val(size);
|
|
|
|
|
2018-02-05 01:56:31 +11:00
|
|
|
//並べ替え
|
|
|
|
sortload();
|
2018-01-28 23:22:43 +11:00
|
|
|
}
|
|
|
|
//最初に読む
|
2018-02-05 01:56:31 +11:00
|
|
|
load();
|