| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- function get_post() {
- check = document.getElementById('strike');
- if(check.value === 'normal') {
- document.cookie = 'del_strike=0;';
- } else if(check.value === 'change') {
- document.cookie = 'del_strike=1;';
- } else {
- document.cookie = 'del_strike=2;';
- }
- console.log(document.cookie);
- check = document.getElementById('include');
- if(check.checked === true) {
- document.cookie = 'include_link=true;';
- } else {
- document.cookie = 'include_link=false;';
- }
- history.go(0);
- }
- function regex_data(data) {
- r_data = new RegExp('(?:^|; )' + data + '=([^;]*)')
- return r_data;
- }
- cookies = document.cookie;
- function main_load() {
- head_data = document.querySelector('head');
- if(cookies.match(regex_data('del_strike'))) {
- if(cookies.match(regex_data('del_strike'))[1] === '1') {
- head_data.innerHTML += '<style>s { text-decoration: none; } s:hover { background-color: transparent; }</style>';
- } else if(cookies.match(regex_data('del_strike'))[1] === '2') {
- head_data.innerHTML += '<style>s { display: none; }</style>';
- }
- }
- if(
- cookies.match(regex_data('include_link')) &&
- cookies.match(regex_data('include_link'))[1] === 'true'
- ) {
- head_data.innerHTML += '<style>#include_link { display: inline; }</style>';
- }
- }
- main_load();
- window.onload = function () {
- if(window.location.pathname === '/skin_set') {
- document.getElementById("main_top").innerHTML = '<h1>Skin setting</h1>';
- document.title = document.title.replace(/.*(\- .*)$/, "Skin setting $1");
-
- data = document.getElementById("main_data");
- set_data = {};
- if(cookies.match(regex_data('del_strike'))) {
- if(cookies.match(regex_data('del_strike'))[1] === '0') {
- set_data["strike"] = ' \
- <option value="normal">Normal</option> \
- <option value="change">Change to normal text</option> \
- <option value="delete">Delete</option> \
- ';
- } else if(cookies.match(regex_data('del_strike'))[1] === '1') {
- set_data["strike"] = ' \
- <option value="change">Change to normal text</option> \
- <option value="normal">Normal</option> \
- <option value="delete">Delete</option> \
- ';
- } else {
- set_data["strike"] = ' \
- <option value="delete">Delete</option> \
- <option value="normal">Normal</option> \
- <option value="change">Change to normal text</option> \
- ';
- }
- } else {
- set_data["strike"] = ' \
- <option value="normal">Normal</option> \
- <option value="change">Change to normal text</option> \
- <option value="delete">Delete</option> \
- ';
- }
-
- if(
- cookies.match(regex_data('include_link')) &&
- cookies.match(regex_data('include_link'))[1] === 'true'
- ) {
- set_data["include"] = "checked";
- }
- data.innerHTML = ' \
- <h2>Strike</h2> \
- <hr class="main_hr"> \
- <select id="strike" name="strike"> \
- ' + set_data["strike"] + ' \
- </select> \
- <h2>Other</h2> \
- <input ' + set_data["include"] + ' type="checkbox" id="include" name="include" value="include"> Using include link \
- <hr class="main_hr"> \
- <button onclick="get_post();">Save</button> \
- ';
- }
- }
|