Jelajahi Sumber

취소선 변경 기능, 일부 디자인 수정

Surplus_Up (2DU) 7 tahun lalu
induk
melakukan
51c3f87eac

+ 1 - 0
route/tool/set_mark/namu.py

@@ -241,6 +241,7 @@ def middle_parser(data, fol_num, syntax_num, folding_num):
                                                         plus_data +=    '''
                                                                         <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css">
                                                                         <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
+                                                                        <script>hljs.initHighlightingOnLoad();</script>
                                                                         '''
 
                                                         syntax_num = 1

+ 0 - 2
views/main_css/main.js

@@ -47,8 +47,6 @@ function topic_load(name, sub) {
     }, 4000);
 }
 
-hljs.initHighlightingOnLoad(); 
-
 function folding(num) { 
     var fol = document.getElementById('folding_' + num); 
     if(fol.style.display == 'inline-block' || fol.style.display == 'block') { 

+ 0 - 1
views/neo_yousoro/css/main.css

@@ -227,7 +227,6 @@ h6 {
     position: absolute;
     background: white;
     margin-top: 10px;
-    width: 100px;
 }
 
 #top_tool_cel {

+ 46 - 16
views/neo_yousoro/js/skin_set.js

@@ -1,11 +1,15 @@
 function get_post() {
     check = document.getElementById('strike');
-    if(check.checked === true) {
-        document.cookie = 'del_strike=true;';
+    if(check.value === 'normal') {
+        document.cookie = 'del_strike=0;';
+    } else if(check.value === 'change') {
+        document.cookie = 'del_strike=1;';
     } else {
-        document.cookie = 'del_strike=false;';
+        document.cookie = 'del_strike=2;';
     }
 
+    console.log(document.cookie);
+
     check = document.getElementById('include');
     if(check.checked === true) {
         document.cookie = 'include_link=true;';
@@ -13,7 +17,7 @@ function get_post() {
         document.cookie = 'include_link=false;';
     }
 
-    window.location.reload(true);
+    history.go(0);
 }
 
 function regex_data(data) {
@@ -26,11 +30,12 @@ cookies = document.cookie;
 
 function main_load() {
     head_data = document.querySelector('head');
-    if(
-        cookies.match(regex_data('del_strike')) &&
-        cookies.match(regex_data('del_strike'))[1] === 'true'
-    ) {
-        head_data.innerHTML += '<style>s { display: none; }</style>';
+    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(
@@ -51,12 +56,33 @@ window.onload = function () {
         data = document.getElementById("main_data");
         set_data = {};
 
-        if(
-            cookies.match(regex_data('del_strike')) &&
-            cookies.match(regex_data('del_strike'))[1] === 'true'
-        ) {
-            set_data["strike"] = "checked";
-        } 
+        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')) &&
@@ -66,8 +92,12 @@ window.onload = function () {
         }
 
         data.innerHTML = ' \
-            <input ' + set_data["strike"] + ' type="checkbox" id="strike" name="strike" value="strike"> Remove strikethrough \
+            <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> \