Sfoglia il codice sorgente

새로운 각주 방법 임시 적용

Surplus_Up (2DU) 6 anni fa
parent
commit
af7e074256

+ 16 - 6
route/tool/set_mark/namu.py

@@ -915,7 +915,9 @@ def namu(conn, data, title, main_num, include_num):
 
                     footdata_all += '' + \
                         '<li>' + \
-                            '<a href="#' + include_num + 'rfn-' + str(footdata[0]) + '">' + \
+                            '<a href="#' + include_num + 'rfn-' + str(footdata[0]) + '" ' + \
+                                'id="' + include_num + 'cfn-' + str(footdata[0]) + '" ' + \
+                                'onclick="do_open_foot(\'' + include_num + 'fn-' + str(footdata[0]) + '\', 1);">' + \
                                 '(' + footdata[1] + ')' + \
                             '</a> <span id="' + include_num + 'fn-' + str(footdata[0]) + '">' + footdata_in + '</span>' + \
                         '</li>' + \
@@ -939,10 +941,12 @@ def namu(conn, data, title, main_num, include_num):
 
                         data = re_footnote.sub('' + \
                             '<sup>' + \
-                                '<a href="javascript:do_open_foot(\'' + include_num + 'fn-' + footshort + '\')" id="' + include_num + 'rfn-' + footshort + '">' + \
+                                '<a href="#' + include_num + 'fn-' + footshort + '" ' + \
+                                    'id="' + include_num + 'rfn-' + footshort + '" ' + \
+                                    'onclick="do_open_foot(\'' + include_num + 'fn-' + footshort + '\');">' + \
                                     '(' + footnote_name + ')' + \
                                 '</a>' + \
-                            '</sup> <div class="foot_plus" id="' + include_num + 'cfn-' + footshort + '"></div>' + \
+                            '</sup>' + \
                         '', data, 1)
                     else:
                         data = re_footnote.sub('<sup><a href="javascript:void(0);">(' + footnote_name + ')</a></sup>', data, 1)
@@ -963,10 +967,12 @@ def namu(conn, data, title, main_num, include_num):
                     
                     data = re_footnote.sub('' + \
                         '<sup>' + \
-                            '<a href="javascript:do_open_foot(\'' + include_num + 'fn-' + str(footnote_number) + '\')" id="' + include_num + 'rfn-' + str(footnote_number) + '">' + \
+                            '<a href="#' + include_num + 'fn-' + str(footnote_number) + '" ' + \
+                                'id="' + include_num + 'rfn-' + str(footnote_number) + '" ' + \
+                                'onclick="do_open_foot(\'' + include_num + 'fn-' + str(footnote_number) + '\');">' + \
                                 '(' + footnote_name + ')' + \
                             '</a>' + \
-                        '</sup> <div class="foot_plus" id="' + include_num + 'cfn-' + str(footnote_number) + '"></div>' + \
+                        '</sup>' + \
                     '', data, 1)
         else:
             break
@@ -983,7 +989,11 @@ def namu(conn, data, title, main_num, include_num):
 
         footdata_all += '' + \
             '<li>' + \
-                '<a href="#' + include_num + 'rfn-' + str(footdata[0]) + '">(' + footdata[1] + ')</a> <span id="' + include_num + 'fn-' + str(footdata[0]) + '">' + footdata_in + '</span>' + \
+                '<a href="#' + include_num + 'rfn-' + str(footdata[0]) + '" ' + \
+                    'id="' + include_num + 'cfn-' + str(footdata[0]) + '" ' + \
+                    'onclick="do_open_foot(\'' + include_num + 'fn-' + str(footdata[0]) + '\', 1);">' + \
+                    '(' + footdata[1] + ')' + \
+                '</a> <span id="' + include_num + 'fn-' + str(footdata[0]) + '">' + footdata_in + '</span>' + \
             '</li>' + \
         ''
 

+ 15 - 16
views/main_css/js/do_open_foot.js

@@ -1,22 +1,21 @@
-function do_open_foot(name) {
+function do_open_foot(name, num = 0) {
     var found_include = name.match(/^(include_(?:[0-9]+)\-)/);
     if(found_include) {
-        var o_data = document.getElementById(found_include[1] + 'c' + name.replace(/^(?:include_(?:[0-9]+)\-)/, ''));
+        var include_name = name.replace(/^(?:include_(?:[0-9]+)\-)/, '');
+        var d_color = document.getElementById(found_include[1] + 'c' + include_name).style.color;
+        if(d_color === 'red' || num === 1) {
+            document.getElementById(found_include[1] + 'c' + include_name).style.color = 'inherit';
+        } else {
+            document.getElementById(found_include[1] + 'c' + include_name).style.color = 'red';
+        }
     } else {
-        var o_data = document.getElementById('c' + name);
+        var d_color = document.getElementById('c' + name).style.color;
+        if(d_color === 'red' || num === 1) {
+            document.getElementById('c' + name).style.color = 'inherit';
+        } else {
+            document.getElementById('c' + name).style.color = 'red';
+        }
     }
-    
-    var g_data = document.getElementById(name.replace(/\.([0-9]+)$/, ''));
 
-    if(o_data.innerHTML === '') {
-        o_data.style.display = 'block';
-        o_data.innerHTML += '' + 
-            '<div class="foot_in">' + 
-                '<a onclick="do_open_foot(\'' + name + '\')" href="javascript:void(0);">(X)</a> <a onclick="do_open_foot(\'' + name + '\')" href="#' + name + '">(Go)</a> ' + g_data.innerHTML + 
-            '</div>' + 
-        '';
-    } else {
-        o_data.style.display = 'none';
-        o_data.innerHTML = '';
-    }
+    
 }

+ 22 - 0
views/main_css/js/dummy_do_open_foot.js

@@ -0,0 +1,22 @@
+function dummy_do_open_foot(name) {
+    var found_include = name.match(/^(include_(?:[0-9]+)\-)/);
+    if(found_include) {
+        var o_data = document.getElementById(found_include[1] + 'c' + name.replace(/^(?:include_(?:[0-9]+)\-)/, ''));
+    } else {
+        var o_data = document.getElementById('c' + name);
+    }
+    
+    var g_data = document.getElementById(name.replace(/\.([0-9]+)$/, ''));
+
+    if(o_data.innerHTML === '') {
+        o_data.style.display = 'block';
+        o_data.innerHTML += '' + 
+            '<div class="foot_in">' + 
+                '<a onclick="do_open_foot(\'' + name + '\')" href="javascript:void(0);">(X)</a> <a onclick="do_open_foot(\'' + name + '\')" href="#' + name + '">(Go)</a> ' + g_data.innerHTML + 
+            '</div>' + 
+        '';
+    } else {
+        o_data.style.display = 'none';
+        o_data.innerHTML = '';
+    }
+}

+ 0 - 1
views/main_css/js/render_html.js

@@ -1,7 +1,6 @@
 function render_html(name = '') {
     var num = 0;
     while(1) {
-        console.log(name + 'render_contect_' + String(num));
         num += 1
         if(document.getElementById(name + 'render_contect_' + String(num))) {
             data = document.getElementById(name + 'render_contect_' + String(num)).innerHTML;