Parcourir la source

개발중인 마크다운 비활성화, 토론에서도 HTML 작동하게

Surplus_Up (2DU) il y a 6 ans
Parent
commit
1623076f6d

+ 1 - 1
route/api_topic_sub.py

@@ -76,7 +76,7 @@ def api_topic_sub_2(conn, name, sub, time):
                                 </td>
                                 </td>
                             </tr>
                             </tr>
                             <tr>
                             <tr>
-                                <td id="''' + b_color + '">' + render_set(data = t_data_f) + '''</td>
+                                <td id="''' + b_color + '">' + render_set(data = t_data_f, include = 'topic_' + i[0]) + '''</td>
                             </tr>
                             </tr>
                         </tbody>
                         </tbody>
                     </table>
                     </table>

+ 3 - 1
route/tool/func.py

@@ -394,7 +394,9 @@ def other2(data):
     js_filter = {
     js_filter = {
         'load_include.js' : '2',
         'load_include.js' : '2',
         'render_html.js' : '2',
         'render_html.js' : '2',
-        'do_open_foot.js' : '4'
+        'do_open_foot.js' : '4',
+        'topic_main_load.js' : '2',
+        'topic_plus_load.js' : '2'
     }
     }
     for i_data in os.listdir(os.path.join("views", "main_css", "js")):
     for i_data in os.listdir(os.path.join("views", "main_css", "js")):
         if i_data in js_filter:
         if i_data in js_filter:

+ 3 - 0
route/tool/init.py

@@ -43,6 +43,9 @@ def init(key):
     if env_dict[key] != None:
     if env_dict[key] != None:
         return env_dict[key]
         return env_dict[key]
     else:
     else:
+        if key == 'markup':
+            return server_set_var[key]['default']
+
         while 1:
         while 1:
             if server_set_var[key]['require'] == 'select':
             if server_set_var[key]['require'] == 'select':
                 list_ = '[' + ', '.join(server_set_var[key]['list']) + ']'
                 list_ = '[' + ', '.join(server_set_var[key]['list']) + ']'

+ 4 - 0
views/main_css/js/topic_main_load.js

@@ -36,6 +36,10 @@ function topic_main_load(name, sub, s_num) {
 
 
                     if(markup === 'markdown') {
                     if(markup === 'markdown') {
                         render_markdown();
                         render_markdown();
+                    } else {
+                        for(var key in t_data) {
+                            render_html('topic_' + String(key) + '-');
+                        }
                     }
                     }
                 }
                 }
             }
             }

+ 15 - 1
views/main_css/js/topic_plus_load.js

@@ -21,7 +21,7 @@ function topic_plus_load(name, sub, num) {
 
 
                 // https://programmingsummaries.tistory.com/379
                 // https://programmingsummaries.tistory.com/379
                 var options = {
                 var options = {
-                    body: 'New ' + n_num + ' topic'
+                    body: '#' + n_num
                 }
                 }
                
                
                 var notification = new Notification("openNAMU", options);
                 var notification = new Notification("openNAMU", options);
@@ -30,6 +30,20 @@ function topic_plus_load(name, sub, num) {
                     notification.close();
                     notification.close();
                 }, 5000);
                 }, 5000);
 
 
+                xhr_2.onreadystatechange = function() {
+                    if(xhr_2.readyState === 4 && xhr_2.status === 200) {
+                        markup = JSON.parse(xhr_2.responseText)['markup'];
+    
+                        if(markup === 'markdown') {
+                            render_markdown();
+                        } else {
+                            for(var key in t_data) {
+                                render_html('topic_' + String(key) + '-');
+                            }
+                        }
+                    }
+                }
+
                 topic_plus_load(name, sub, String(Number(num) + 1));
                 topic_plus_load(name, sub, String(Number(num) + 1));
                 clearInterval(test);
                 clearInterval(test);
             }
             }