Przeglądaj źródła

Merge pull request #2515 from openNAMU/dev

구조적 안정성을 위한 패치
잉여개발기 1 rok temu
rodzic
commit
26231d7db4
51 zmienionych plików z 411 dodań i 910 usunięć
  1. 32 31
      app.py
  2. 1 1
      requirements-optional.txt
  3. 17 22
      route/__init__.py
  4. 1 1
      route/give_delete_admin_group.py
  5. 4 1
      route/go_api_list_history.py
  6. 5 2
      route/go_api_list_old_page.py
  7. 4 1
      route/go_api_list_recent_change.py
  8. 2 0
      route/go_api_w_render.py
  9. 1 1
      route/list_admin_group.py
  10. 166 0
      route/list_history.py
  11. 32 0
      route/list_old_page.py
  12. 1 1
      route/login_login.py
  13. 1 1
      route/login_login_2fa.py
  14. 1 1
      route/login_login_2fa_email.py
  15. 1 1
      route/login_register.py
  16. 1 1
      route/login_register_email.py
  17. 1 1
      route/login_register_email_check.py
  18. 1 1
      route/login_register_submit.py
  19. 35 24
      route/main_sys_restart.py
  20. 1 1
      route/main_sys_shutdown.py
  21. 13 4
      route/main_sys_update.py
  22. 1 0
      route/main_tool_redirect.py
  23. 0 13
      route/n_list_history.py
  24. 0 19
      route/n_list_old_page.py
  25. 1 1
      route/n_list_recent_block.py
  26. 0 13
      route/n_list_recent_change.py
  27. 0 13
      route/n_main_redirect.py
  28. 0 15
      route/n_user_rankup.py
  29. 1 1
      route/recent_app_submit.py
  30. 35 43
      route/tool/func.py
  31. 11 2
      route/tool/func_render.py
  32. 26 10
      route/tool/func_render_namumark.py
  33. 5 1
      route/tool/func_tool.py
  34. 1 1
      route/user_setting_email.py
  35. 1 1
      route/user_setting_email_check.py
  36. 4 0
      run_ubuntu.sh
  37. 2 0
      run_windows.bat
  38. 0 7
      ubuntu.sh
  39. 1 1
      version.json
  40. 0 2
      views/main_css/js/func/func.js
  41. 0 98
      views/main_css/js/func/render.js
  42. 0 39
      views/main_css/js/func/shortcut.js
  43. 0 185
      views/main_css/js/route/list_history.js
  44. 0 36
      views/main_css/js/route/list_old_page.js
  45. 1 1
      views/main_css/js/route/list_recent_block.js
  46. 0 180
      views/main_css/js/route/list_recent_change.js
  47. 0 6
      views/main_css/js/route/list_recent_discuss.js
  48. 0 65
      views/main_css/js/route/main_redirect.js
  49. 0 25
      views/main_css/js/route/main_sys_restart.js
  50. 0 7
      views/main_css/js/route/user_rankup.js
  51. 0 29
      views/main_css/js/route/w.js

+ 32 - 31
app.py

@@ -1,6 +1,5 @@
 # Init
 import os
-import re
 import signal
 import atexit
 import logging
@@ -579,13 +578,13 @@ app.route('/auth/ban_regex/<everything:name>', methods = ['POST', 'GET'], defaul
 # /auth/list
 # /auth/list/add/<name>
 # /auth/list/delete/<name>
-app.route('/auth/list')(list_admin_group_2)
+app.route('/auth/list')(list_admin_group)
 app.route('/auth/list/add/<name>', methods = ['POST', 'GET'])(give_admin_groups)
-app.route('/auth/list/delete/<name>', methods = ['POST', 'GET'])(give_delete_admin_group_2)
+app.route('/auth/list/delete/<name>', methods = ['POST', 'GET'])(give_delete_admin_group)
 
 app.route('/auth/give/fix/<user_name>', methods = ['POST', 'GET'])(give_user_fix)
 
-app.route('/app_submit', methods = ['POST', 'GET'])(recent_app_submit_2)
+app.route('/app_submit', methods = ['POST', 'GET'])(recent_app_submit)
 
 # /auth/history
 app.route('/recent_block')(list_recent_block)
@@ -605,9 +604,9 @@ app.route('/recent_block/private/<int:num>', defaults = { 'tool' : 'private' })(
 app.route('/recent_block/ongoing', defaults = { 'tool' : 'ongoing' })(list_recent_block)
 app.route('/recent_block/ongoing/<int:num>', defaults = { 'tool' : 'ongoing' })(list_recent_block)
 
-app.route('/recent_change')(list_recent_change)
-app.route('/recent_changes')(list_recent_change)
-app.route('/recent_change/<int:num>/<set_type>')(list_recent_change)
+app.route('/recent_change', defaults = { 'tool' : 'recent_change' })(list_history)
+app.route('/recent_changes', defaults = { 'tool' : 'recent_change' })(list_history)
+app.route('/recent_change/<int:num>/<set_type>', defaults = { 'tool' : 'recent_change' })(list_history)
 
 app.route('/recent_discuss', defaults = { 'tool' : 'normal' })(list_recent_discuss)
 app.route('/recent_discuss/<int:num>/<tool>')(list_recent_discuss)
@@ -723,7 +722,6 @@ app.route('/user')(user_info)
 app.route('/user/<name>')(user_info)
 
 app.route('/challenge', methods = ['GET', 'POST'])(user_challenge)
-app.route('/rankup')(user_rankup)
 
 app.route('/edit_filter/<name>', methods = ['GET', 'POST'])(user_edit_filter)
 
@@ -743,9 +741,9 @@ app.route('/star_doc/<everything:name>', defaults = { 'tool' : 'star_doc' })(use
 app.route('/star_doc_from/<everything:name>', defaults = { 'tool' : 'star_doc_from' })(user_watch_list_name)
 
 # 개편 보류중 S
-app.route('/change/email', methods = ['POST', 'GET'])(user_setting_email_2)
+app.route('/change/email', methods = ['POST', 'GET'])(user_setting_email)
 app.route('/change/email/delete')(user_setting_email_delete)
-app.route('/change/email/check', methods = ['POST', 'GET'])(user_setting_email_check_2)
+app.route('/change/email/check', methods = ['POST', 'GET'])(user_setting_email_check)
 # 개편 보류중 E
 
 # Func-login
@@ -755,12 +753,12 @@ app.route('/change/email/check', methods = ['POST', 'GET'])(user_setting_email_c
 # register -> register/email -> regiter/email/check with reg_id
 # pass_find -> pass_find/email with find_id
 
-app.route('/login', methods = ['POST', 'GET'])(login_login_2)
-app.route('/login/2fa', methods = ['POST', 'GET'])(login_login_2fa_2)
-app.route('/register', methods = ['POST', 'GET'])(login_register_2)
-app.route('/register/email', methods = ['POST', 'GET'])(login_register_email_2)
-app.route('/register/email/check', methods = ['POST', 'GET'])(login_register_email_check_2)
-app.route('/register/submit', methods = ['POST', 'GET'])(login_register_submit_2)
+app.route('/login', methods = ['POST', 'GET'])(login_login)
+app.route('/login/2fa', methods = ['POST', 'GET'])(login_login_2fa)
+app.route('/register', methods = ['POST', 'GET'])(login_register)
+app.route('/register/email', methods = ['POST', 'GET'])(login_register_email)
+app.route('/register/email/check', methods = ['POST', 'GET'])(login_register_email_check)
+app.route('/register/submit', methods = ['POST', 'GET'])(login_register_submit)
 
 app.route('/login/find')(login_find)
 app.route('/login/find/key', methods = ['POST', 'GET'])(login_find_key)
@@ -802,8 +800,8 @@ app.route('/bbs/delete/<int:bbs_num>/<int:post_num>/<comment_num>', methods = ['
 
 # Func-api
 ## v1 API
-app.route('/api/render', methods = ['POST'])(api_w_render)
-app.route('/api/render/<tool>', methods = ['POST'])(api_w_render)
+app.route('/api/render', methods = ['POST'])(api_w_render_exter)
+app.route('/api/render/<tool>', methods = ['POST'])(api_w_render_exter)
 
 app.route('/api/raw_exist/<everything:name>', defaults = { 'exist_check' : 'on' })(api_w_raw)
 app.route('/api/raw_rev/<int(signed = True):rev>/<everything:name>')(api_w_raw)
@@ -832,13 +830,13 @@ app.route('/api/search_page/<int:num>/<everything:name>')(api_func_search_exter)
 app.route('/api/search_data/<everything:name>', defaults = { 'search_type' : 'data' })(api_func_search_exter)
 app.route('/api/search_data_page/<int:num>/<everything:name>', defaults = { 'search_type' : 'data' })(api_func_search_exter)
 
-app.route('/api/recent_change')(api_list_recent_change)
-app.route('/api/recent_changes')(api_list_recent_change)
-app.route('/api/recent_change/<int:limit>')(api_list_recent_change)
-app.route('/api/recent_change/<int:limit>/<set_type>/<int:num>')(api_list_recent_change)
+app.route('/api/recent_change')(api_list_recent_change_exter)
+app.route('/api/recent_changes')(api_list_recent_change_exter)
+app.route('/api/recent_change/<int:limit>')(api_list_recent_change_exter)
+app.route('/api/recent_change/<int:limit>/<set_type>/<int:num>')(api_list_recent_change_exter)
 
-app.route('/api/recent_edit_request')(api_list_recent_edit_request)
-app.route('/api/recent_edit_request/<int:limit>/<set_type>/<int:num>')(api_list_recent_edit_request)
+app.route('/api/recent_edit_request')(api_list_recent_edit_request_exter)
+app.route('/api/recent_edit_request/<int:limit>/<set_type>/<int:num>')(api_list_recent_edit_request_exter)
 
 app.route('/api/recent_discuss/<set_type>/<int:limit>')(api_list_recent_discuss)
 app.route('/api/recent_discuss/<int:limit>')(api_list_recent_discuss)
@@ -853,19 +851,19 @@ app.route('/api/image/<everything:name>')(api_image_view)
 
 ## v2 API
 app.route('/api/v2/recent_edit_request/<set_type>/<int:num>', defaults = { 'limit' : 50 })(api_list_recent_edit_request)
-app.route('/api/v2/recent_change/<set_type>/<int:num>', defaults = { 'legacy' : '', 'limit' : 50 })(api_list_recent_change)
+app.route('/api/v2/recent_change/<set_type>/<int:num>', defaults = { 'legacy' : '', 'limit' : 50 })(api_list_recent_change_exter)
 app.route('/api/v2/recent_discuss/<set_type>/<int:num>', defaults = { 'legacy' : '', 'limit' : 50 })(api_list_recent_discuss)
 app.route('/api/v2/recent_block/<set_type>/<int:num>')(api_list_recent_block)
 app.route('/api/v2/recent_block/<set_type>/<int:num>/<everything:why>')(api_list_recent_block)
 app.route('/api/v2/recent_block_user/<set_type>/<int:num>/<user_name>')(api_list_recent_block)
 app.route('/api/v2/recent_block_user/<set_type>/<int:num>/<user_name>/<everything:why>')(api_list_recent_block)
-app.route('/api/v2/list/document/old/<int:num>', defaults = { 'set_type' : 'old' })(api_list_old_page)
-app.route('/api/v2/list/document/new/<int:num>', defaults = { 'set_type' : 'new' })(api_list_old_page)
+app.route('/api/v2/list/document/old/<int:num>', defaults = { 'set_type' : 'old' })(api_list_old_page_exter)
+app.route('/api/v2/list/document/new/<int:num>', defaults = { 'set_type' : 'new' })(api_list_old_page_exter)
 app.route('/api/v2/list/document/<int:num>')(api_list_title_index)
 app.route('/api/v2/list/auth')(api_list_auth)
 app.route('/api/v2/list/markup')(api_list_markup)
 app.route('/api/v2/list/acl/<data_type>')(api_list_acl)
-app.route('/api/v2/history/<int:num>/<set_type>/<everything:doc_name>')(api_list_history)
+app.route('/api/v2/history/<int:num>/<set_type>/<everything:doc_name>')(api_list_history_exter)
 
 app.route('/api/v2/topic/<int:num>/<set_type>/<everything:name>')(api_topic_list)
 
@@ -903,7 +901,6 @@ app.route('/other')(main_tool_other)
 app.route('/manager', methods = ['POST', 'GET'])(main_tool_admin)
 app.route('/manager/<int:num>', methods = ['POST', 'GET'])(main_tool_redirect)
 app.route('/manager/<int:num>/<everything:add_2>', methods = ['POST', 'GET'])(main_tool_redirect)
-app.route('/redirect_to/<int:n>')(main_redirect)
 
 app.route('/search', methods=['POST'])(main_search)
 app.route('/search/<everything:name>', methods = ['POST', 'GET'])(main_search_deep)
@@ -942,14 +939,18 @@ app.route('/image/<path:name>')(main_view_image)
 app.route('/<regex("[^.]+\\.(?:txt|xml|ico)"):data>')(main_view_file)
 
 app.route('/shutdown', methods = ['POST', 'GET'])(main_sys_shutdown)
-app.route('/restart', methods = ['POST', 'GET'])(main_sys_restart)
-app.route('/update', methods = ['POST', 'GET'])(main_sys_update)
+app.route('/restart', defaults = { 'golang_process' : golang_process }, methods = ['POST', 'GET'])(main_sys_restart)
+app.route('/update', defaults = { 'golang_process' : golang_process }, methods = ['POST', 'GET'])(main_sys_update)
 
 app.errorhandler(404)(main_func_error_404)
 
 def terminate_golang():
     if golang_process.poll() is None:
         golang_process.terminate()
+        try:
+            golang_process.wait(timeout = 5)
+        except subprocess.TimeoutExpired:
+            golang_process.kill()
 
 def signal_handler(signal, frame):
     terminate_golang()

+ 1 - 1
requirements-optional.txt

@@ -1,3 +1,3 @@
 mysqlclient
-
+regex
 orjson

+ 17 - 22
route/__init__.py

@@ -30,14 +30,15 @@ from route.filter_all_add import filter_all_add
 from route.filter_all_delete import filter_all_delete
 
 from route.give_admin_groups import give_admin_groups
-from route.give_delete_admin_group import give_delete_admin_group_2
+from route.give_delete_admin_group import give_delete_admin_group
 from route.give_user_ban import give_user_ban
 from route.give_user_fix import give_user_fix
 
 from route.list_acl import list_acl
 from route.list_admin import list_admin
 from route.list_admin_auth_use import list_admin_auth_use
-from route.list_admin_group import list_admin_group_2
+from route.list_old_page import list_old_page
+from route.list_admin_group import list_admin_group
 from route.list_image_file import list_image_file
 from route.list_long_page import list_long_page
 from route.list_no_link import list_no_link
@@ -46,20 +47,21 @@ from route.list_title_index import list_title_index
 from route.list_user import list_user
 from route.list_user_check import list_user_check
 from route.list_user_check_delete import list_user_check_delete
+from route.list_history import list_history
 
 from route.login_find import login_find
 from route.login_find_email import login_find_email
 from route.login_find_email_check import login_find_email_check
 from route.login_find_key import login_find_key
-from route.login_login import login_login_2
-from route.login_login_2fa import login_login_2fa_2
-from route.login_login_2fa_email import login_login_2fa_email_2
+from route.login_login import login_login
+from route.login_login_2fa import login_login_2fa
+from route.login_login_2fa_email import login_login_2fa_email
 from route.login_logout import login_logout
 
-from route.login_register import login_register_2
-from route.login_register_email import login_register_email_2
-from route.login_register_email_check import login_register_email_check_2
-from route.login_register_submit import login_register_submit_2
+from route.login_register import login_register
+from route.login_register_email import login_register_email
+from route.login_register_email_check import login_register_email_check
+from route.login_register_submit import login_register_submit
 
 from route.main_func_error_404 import main_func_error_404
 
@@ -92,7 +94,7 @@ from route.main_view import main_view
 from route.main_view_file import main_view_file
 from route.main_view_image import main_view_image
 
-from route.recent_app_submit import recent_app_submit_2
+from route.recent_app_submit import recent_app_submit
 
 from route.recent_change import recent_change
 from route.recent_edit_request import recent_edit_request
@@ -124,8 +126,8 @@ from route.user_info import user_info
 from route.user_edit_filter import user_edit_filter
 
 from route.user_setting import user_setting
-from route.user_setting_email import user_setting_email_2
-from route.user_setting_email_check import user_setting_email_check_2
+from route.user_setting_email import user_setting_email
+from route.user_setting_email_check import user_setting_email_check
 from route.user_setting_email_delete import user_setting_email_delete
 from route.user_setting_head import user_setting_head
 from route.user_setting_head_reset import user_setting_head_reset
@@ -155,23 +157,16 @@ from route.vote_end import vote_end
 from route.vote_list import vote_list
 from route.vote_select import vote_select
 
-from route.n_list_recent_change import list_recent_change
 from route.n_list_recent_discuss import list_recent_discuss
 from route.n_list_recent_block import list_recent_block
-from route.n_list_old_page import list_old_page
 from route.n_list_user_check_submit import list_user_check_submit
-from route.n_list_history import list_history
 
 from route.n_w_watch_list import w_watch_list
 
-from route.n_user_rankup import user_rankup
-
 from route.n_topic_list import topic_list
 
 from route.n_give_auth import give_auth
 
-from route.n_main_redirect import main_redirect
-
 from route.n_setting_404_page import setting_404_page
 
 from route.n_bbs_main import bbs_main
@@ -191,16 +186,16 @@ from route.go_api_func_search import api_func_search, api_func_search_exter
 
 from route.go_api_give_auth import api_give_auth
 
-from route.go_api_list_recent_change import api_list_recent_change
+from route.go_api_list_recent_change import api_list_recent_change, api_list_recent_change_exter
 from route.go_api_list_recent_discuss import api_list_recent_discuss
 from route.go_api_list_recent_block import api_list_recent_block
 from route.go_api_list_recent_edit_request import api_list_recent_edit_request, api_list_recent_edit_request_exter
-from route.go_api_list_old_page import api_list_old_page
+from route.go_api_list_old_page import api_list_old_page, api_list_old_page_exter
 from route.go_api_list_title_index import api_list_title_index
 from route.go_api_list_acl import api_list_acl
 from route.go_api_list_auth import api_list_auth
 from route.go_api_list_markup import api_list_markup
-from route.go_api_list_history import api_list_history
+from route.go_api_list_history import api_list_history, api_list_history_exter
 
 from route.go_api_bbs import api_bbs
 from route.go_api_bbs_list import api_bbs_list

+ 1 - 1
route/give_delete_admin_group.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-async def give_delete_admin_group_2(name = 'test'):
+async def give_delete_admin_group(name = 'test'):
     with get_db_connect() as conn:
         curs = conn.cursor()
 

+ 4 - 1
route/go_api_list_history.py

@@ -7,4 +7,7 @@ async def api_list_history(num = 1, set_type = 'normal', doc_name = 'Test'):
     other_set["set_type"] = set_type
     other_set["ip"] = ip_check()
     
-    return flask.jsonify(await python_to_golang(sys._getframe().f_code.co_name, other_set))
+    return await python_to_golang(sys._getframe().f_code.co_name, other_set)
+
+async def api_list_history_exter(num = 1, set_type = 'normal', doc_name = 'Test'):
+    return flask.jsonify(await api_list_history(num, set_type, doc_name))

+ 5 - 2
route/go_api_list_old_page.py

@@ -4,5 +4,8 @@ async def api_list_old_page(num = 1, set_type = 'old'):
     other_set = {}
     other_set["num"] = str(num)
     other_set["set_type"] = set_type
-    
-    return flask.jsonify(await python_to_golang(sys._getframe().f_code.co_name, other_set))
+
+    return await python_to_golang(sys._getframe().f_code.co_name, other_set)
+
+async def api_list_old_page_exter(num = 1, set_type = 'old'):
+    return flask.jsonify(await api_list_old_page(num, set_type))

+ 4 - 1
route/go_api_list_recent_change.py

@@ -8,7 +8,10 @@ async def api_list_recent_change(num = 1, set_type = 'normal', limit = 10, legac
     other_set["legacy"] = legacy
     other_set["ip"] = ip_check()
 
-    response = flask.make_response(flask.jsonify(await python_to_golang(sys._getframe().f_code.co_name, other_set)))
+    return await python_to_golang(sys._getframe().f_code.co_name, other_set)
+
+async def api_list_recent_change_exter(num = 1, set_type = 'normal', limit = 10, legacy = 'on'):
+    response = flask.make_response(flask.jsonify(await api_list_recent_change(num, set_type, limit, legacy)))
     
     response.headers.add("Access-Control-Allow-Origin", "*")
     response.headers.add('Access-Control-Allow-Headers', "Content-Type")

+ 2 - 0
route/go_api_w_render.py

@@ -1,5 +1,7 @@
 from .tool.func import *
 
+from .go_api_w_raw import api_w_raw
+
 async def api_w_render(name = '', tool = '', request_method = '', request_data = {}):
     with get_db_connect() as conn:
         curs = conn.cursor()

+ 1 - 1
route/list_admin_group.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-async def list_admin_group_2():
+async def list_admin_group():
     with get_db_connect() as conn:
         curs = conn.cursor()
 

+ 166 - 0
route/list_history.py

@@ -0,0 +1,166 @@
+from .tool.func import *
+
+from .go_api_list_history import api_list_history
+from .go_api_list_recent_change import api_list_recent_change
+
+from .recent_change import recent_change_send_render
+
+async def option_lang(lang_in, lang):
+    if lang_in == 'user':
+        lang_in = lang.get('user_document')
+    elif lang_in in lang:
+        lang_in = lang[lang_in]
+    
+    return lang_in
+
+async def list_history(tool = 'history', num = 1, set_type = 'normal', doc_name = 'Test'):
+    with get_db_connect() as conn:
+        if flask.request.method == 'POST':
+            a = flask.request.form.get('a')
+            b = flask.request.form.get('b')
+
+            return redirect(conn, f'/diff/{b}/{a}/{doc_name}')
+        else:
+            if tool == "history":
+                data = await api_list_history(num, set_type, doc_name)
+
+                title = doc_name
+                sub = '(' + get_lang(conn, 'history') + ') (' + get_lang(conn, set_type) + ')'
+                menu = [['other', get_lang(conn, 'return')], ['history_add/' + url_pas(doc_name), get_lang(conn, 'history_add')], ['history_reset/' + url_pas(doc_name), get_lang(conn, 'history_reset')]]
+            else:
+                data = await api_list_recent_change(num, set_type, 50, '')
+
+                title = get_lang(conn, 'recent_change')
+                sub = '(' + get_lang(conn, set_type) + ')'
+                menu = [['other', get_lang(conn, 'return')], ['recent_edit_request', get_lang(conn, 'edit_request')]]
+
+            lang = data["language"]
+            auth = data["auth"]
+            data = data["data"]
+            
+            data_html = ''
+
+            if tool == "history":
+                option_list = ['normal', 'edit', 'move', 'delete', 'revert', 'r1', 'setting']
+                for option in option_list:
+                    label = await option_lang(option, lang)
+                    data_html += f'<a href="/history_page/1/{option}/{doc_name}">({label})</a> '
+            else:
+                option_list = ['normal', 'edit', 'move', 'delete', 'revert', 'r1', 'edit_request', 'user', 'file', 'category']
+                for option in option_list:
+                    label = await option_lang(option, lang)
+                    data_html += f'<a href="/recent_change/1/{option}">({label})</a> '
+
+            date_heading = ''
+            select = ''
+
+            for for_a in range(len(data)):
+                if data[for_a][6] != "" and data[for_a][1] == "":
+                    if date_heading != '----':
+                        data_html += '<h2>----</h2>'
+                        date_heading = '----'
+
+                    data_html += await opennamu_make_list('----', '', '', '')
+                    continue
+
+                doc_name = url_pas(data[for_a][1])
+
+                left = '<a href="/w/' + doc_name + '">' + html.escape(data[for_a][1]) + '</a> '
+                rev = ''
+
+                if data[for_a][6] != "":
+                    rev += f'<span style="color: red;">r{data[for_a][0]}</span>'
+                else:
+                    rev += f'r{data[for_a][0]}'
+
+                select += f'<option value="{data[for_a][0]}">{data[for_a][0]}</option>'
+
+                if int(data[for_a][0]) > 1:
+                    before_rev = str(int(data[for_a][0]) - 1)
+                    rev = f'<a href="/diff/{before_rev}/{data[for_a][0]}/{doc_name}">{rev}</a>'
+
+                right = f'<span id="opennamu_list_history_{for_a}_over">'
+                right += f'<a id="opennamu_list_history_{for_a}" href="javascript:void(0);">'
+                right += '<span class="opennamu_svg opennamu_svg_tool">&nbsp;</span></a>'
+                right += f'<span class="opennamu_popup_footnote" id="opennamu_list_history_{for_a}_load" style="display: none;"></span>'
+                right += '</span> | '
+                right += rev + ' | '
+
+                diff_size = data[for_a][5]
+                if diff_size == '0':
+                    right += f'<span style="color: gray;">{diff_size}</span>'
+                elif '+' in diff_size:
+                    right += f'<span style="color: green;">{diff_size}</span>'
+                else:
+                    right += f'<span style="color: red;">{diff_size}</span>'
+
+                right += ' | '
+                right += f'{data[for_a][7]} | '
+
+                edit_type = data[for_a][8] if data[for_a][8] != '' else 'edit'
+                right += f'{await option_lang(edit_type, lang)} | '
+
+                time_split = data[for_a][2].split(' ')
+                if date_heading != time_split[0]:
+                    data_html += f'<h2>{time_split[0]}</h2>'
+                    date_heading = time_split[0]
+
+                if len(time_split) > 1:
+                    right += time_split[1]
+
+                right += f'<span style="display: none;" id="opennamu_history_tool_{for_a}">'
+
+                right += f'<a href="/raw_rev/{data[for_a][0]}/{doc_name}">{lang["raw"]}</a>'
+                right += f' | <a href="/revert/{data[for_a][0]}/{doc_name}">{lang["revert"]} (r{data[for_a][0]})</a>'
+
+                if int(data[for_a][0]) > 1:
+                    before_rev = str(int(data[for_a][0]) - 1)
+                    right += f' | <a href="/revert/{before_rev}/{doc_name}">{lang["revert"]} (r{before_rev})</a>'
+                    right += f' | <a href="/diff/{before_rev}/{data[for_a][0]}/{doc_name}">{lang["compare"]}</a>'
+
+                right += f' | <a href="/history/{doc_name}">{lang["history"]}</a>'
+
+                if auth.get("owner") or auth.get("hidel"):
+                    right += f' | <a href="/history_hidden/{data[for_a][0]}/{doc_name}">{lang["hide"]}</a>'
+
+                if auth.get("owner"):
+                    right += f' | <a href="/history_delete/{data[for_a][0]}/{doc_name}">{lang["history_delete"]}</a>'
+                    right += f' | <a href="/history_send/{data[for_a][0]}/{doc_name}">{lang["send_edit"]}</a>'
+
+                right += '</span>'
+
+                bottom = ''
+                if data[for_a][4] != "":
+                    bottom = recent_change_send_render(html.escape(data[for_a][4]))
+
+                data_html += await opennamu_make_list(left, right, bottom)
+
+                data_html += f'''
+                    <script>
+                        document.getElementById('opennamu_list_history_{for_a}').addEventListener("click", function() {{
+                            opennamu_do_footnote_popover('opennamu_list_history_{for_a}', '', 'opennamu_history_tool_{for_a}', 'open');
+                        }});
+                        document.addEventListener("click", function() {{
+                            opennamu_do_footnote_popover('opennamu_list_history_{for_a}', '', 'opennamu_history_tool_{for_a}', 'close');
+                        }});
+                    </script>
+                '''
+
+            if tool == "history":
+                data_html += get_next_page_bottom(conn, f'/history_page/{{}}/{set_type}/{doc_name}', num, data)
+                data_html = (
+                    '<form method="post">'
+                    f'<select name="a">{select}</select> '
+                    f'<select name="b">{select}</select> '
+                    f'<button type="submit">{lang["compare"]}</button>'
+                    '</form>'
+                    '<hr class="main_hr"></hr>' + data_html
+                )
+            else:
+                data_html += get_next_page_bottom(conn, f'/recent_change/{{}}/{set_type}', num, data)
+
+            return easy_minify(conn, flask.render_template(skin_check(conn),
+                imp = [title, wiki_set(conn), await wiki_custom(conn), wiki_css([sub, 0])],
+                data = data_html,
+                menu = menu
+            ))

+ 32 - 0
route/list_old_page.py

@@ -0,0 +1,32 @@
+from .tool.func import *
+
+from .go_api_list_old_page import api_list_old_page
+
+async def list_old_page(num = 1, set_type = 'old'):
+    with get_db_connect() as conn:
+        title = ''
+        if set_type == 'old':
+            title = get_lang(conn, 'old_page')
+        else:
+            title = get_lang(conn, 'new_page')
+
+        data = await api_list_old_page(num, set_type)
+        data = data["data"]
+
+        data_html = ''
+
+        for for_a in range(len(data)):
+            doc_name_encoded = url_pas(data[for_a][0])
+            doc_title_filtered = html.escape(data[for_a][0])
+
+            right = f'<a href="/w/{doc_name_encoded}">{doc_title_filtered}</a> '
+
+            data_html += await opennamu_make_list(right, data[for_a][1])
+
+        data_html += get_next_page_bottom(conn, f'/list/document/{set_type}/{{}}', int(num), data)
+
+        return easy_minify(conn, flask.render_template(skin_check(conn),
+            imp = [title, wiki_set(conn), await wiki_custom(conn), wiki_css([0, 0])],
+            data = data_html,
+            menu = [['other', get_lang(conn, 'return')]]
+        ))

+ 1 - 1
route/login_login.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-async def login_login_2():
+async def login_login():
     with get_db_connect() as conn:
         curs = conn.cursor()
 

+ 1 - 1
route/login_login_2fa.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-async def login_login_2fa_2():
+async def login_login_2fa():
     with get_db_connect() as conn:
         curs = conn.cursor()
 

+ 1 - 1
route/login_login_2fa_email.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-async def login_login_2fa_email_2():
+async def login_login_2fa_email():
     with get_db_connect() as conn:
         curs = conn.cursor()
 

+ 1 - 1
route/login_register.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-async def login_register_2():
+async def login_register():
     with get_db_connect() as conn:
         curs = conn.cursor()
 

+ 1 - 1
route/login_register_email.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-async def login_register_email_2():
+async def login_register_email():
     with get_db_connect() as conn:
         curs = conn.cursor()
 

+ 1 - 1
route/login_register_email_check.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-async def login_register_email_check_2():
+async def login_register_email_check():
     with get_db_connect() as conn:
         curs = conn.cursor()
 

+ 1 - 1
route/login_register_submit.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-async def login_register_submit_2():
+async def login_register_submit():
     with get_db_connect() as conn:
         curs = conn.cursor()
 

+ 35 - 24
route/main_sys_restart.py

@@ -1,6 +1,31 @@
 from .tool.func import *
 
-async def main_sys_restart():
+async def main_sys_restart_do():
+    print('Restart')
+
+    python_ver = ''
+    python_ver = str(sys.version_info.major) + '.' + str(sys.version_info.minor)
+
+    run_list = [sys.executable, 'python' + python_ver, 'python3', 'python', 'py -' + python_ver]
+    for exe_name in run_list:
+        try:
+            os.execl(exe_name, sys.executable, *sys.argv)
+        except:
+            pass
+
+        try:
+            os.execl(exe_name, '"' + sys.executable + '"', *sys.argv)
+        except:
+            pass
+
+        try:
+            os.execl(exe_name, os.path.abspath(__file__), *sys.argv)
+        except:
+            pass
+    else:
+        return 0
+
+async def main_sys_restart(golang_process):
     with get_db_connect() as conn:
         if await acl_check('', 'owner_auth', '', '') == 1:
             return await re_error(conn, 3)
@@ -8,36 +33,22 @@ async def main_sys_restart():
         if flask.request.method == 'POST':
             await acl_check(tool = 'owner_auth', memo = 'restart')
 
-            print('Restart')
-
-            python_ver = ''
-            python_ver = str(sys.version_info.major) + '.' + str(sys.version_info.minor)
-
-            run_list = [sys.executable, 'python' + python_ver, 'python3', 'python', 'py -' + python_ver]
-            for exe_name in run_list:
+            if golang_process.poll() is None:
+                golang_process.terminate()
                 try:
-                    os.execl(exe_name, sys.executable, *sys.argv)
-                except:
-                    pass
+                    golang_process.wait(timeout = 5)
+                except subprocess.TimeoutExpired:
+                    golang_process.kill()
 
-                try:
-                    os.execl(exe_name, '"' + sys.executable + '"', *sys.argv)
-                except:
-                    pass
-
-                try:
-                    os.execl(exe_name, os.path.abspath(__file__), *sys.argv)
-                except:
-                    pass
-            else:
+            if await main_sys_restart_do() == 0:
                 return await re_error(conn, 33)
         else:
             return easy_minify(conn, flask.render_template(skin_check(conn),
                 imp = [get_lang(conn, 'wiki_restart'), wiki_set(conn), await wiki_custom(conn), wiki_css([0, 0])],
                 data = '''
-                    <div id="opennamu_main_sys_restart"></div>
-                    <script defer src="/views/main_css/js/route/main_sys_restart.js''' + cache_v() + '''"></script>
-                    <script>window.addEventListener("DOMContentLoaded", function() { opennamu_main_sys_restart(); });</script>
+                    <form method="post">
+                        <button type="submit">''' + get_lang(conn, 'restart') + '''</button>
+                    </form>
                 ''',
                 menu = [['manager', get_lang(conn, 'return')]]
             ))

+ 1 - 1
route/main_sys_shutdown.py

@@ -10,7 +10,7 @@ async def main_sys_shutdown():
 
             print('Shutdown')
 
-            os._exit(0)
+            sys.exit()
         else:
             return easy_minify(conn, flask.render_template(skin_check(conn),
                 imp = [get_lang(conn, 'wiki_shutdown'), wiki_set(conn), await wiki_custom(conn), wiki_css([0, 0])],

+ 13 - 4
route/main_sys_update.py

@@ -3,7 +3,9 @@ import urllib.request
 
 from .tool.func import *
 
-async def main_sys_update():
+from .main_sys_restart import main_sys_restart_do
+
+async def main_sys_update(golang_process):
     with get_db_connect() as conn:
         curs = conn.cursor()
 
@@ -18,6 +20,13 @@ async def main_sys_update():
             up_data = up_data[0][0] if up_data and up_data[0][0] in ['stable', 'beta', 'dev', 'dont_use'] else 'stable'
 
             print('Update')
+
+            if golang_process.poll() is None:
+                golang_process.terminate()
+                try:
+                    golang_process.wait(timeout = 5)
+                except subprocess.TimeoutExpired:
+                    golang_process.kill()
             
             if platform.system() == 'Linux' or platform.system() == 'Darwin':
                 ok = []
@@ -30,8 +39,8 @@ async def main_sys_update():
                         break
                 else:
                     linux_exe_chmod()
-                    
-                    return redirect(conn, '/restart')
+
+                    await main_sys_restart_do()
                 
                 print('Error : update failed')
             elif platform.system() == 'Windows':
@@ -46,7 +55,7 @@ async def main_sys_update():
                     os.system('rd /s /q opennamu-' + up_data)
                     os.system('del update.zip')
 
-                    return redirect(conn, '/restart')
+                    await main_sys_restart_do()
             
             print('Error : update failed')
 

+ 1 - 0
route/main_tool_redirect.py

@@ -20,6 +20,7 @@ async def main_tool_redirect(num = 1, add_2 = ''):
             13 : [get_lang(conn, 'document_name'), '/edit', get_lang(conn, 'load')],
             14 : [get_lang(conn, 'document_name'), '/star_doc', get_lang(conn, 'add_star_doc')],
             16 : [0, '/auth/give/fix', get_lang(conn, 'user_fix')],
+            17 : [get_lang(conn, 'search'), '/recent_block/all/1', get_lang(conn, 'search')],
         }
         
         if num == 1:

+ 0 - 13
route/n_list_history.py

@@ -1,13 +0,0 @@
-from .tool.func import *
-
-async def list_history(num = 1, set_type = 'normal', doc_name = 'Test'):
-    with get_db_connect() as conn:
-        return easy_minify(conn, flask.render_template(skin_check(conn),
-            imp = [doc_name, wiki_set(conn), await wiki_custom(conn), wiki_css(['(' + get_lang(conn, 'history') + ')', 0])],
-            data = '' + \
-                '<div id="opennamu_list_history"></div>' + \
-                '<script defer src="/views/main_css/js/route/list_history.js' + cache_v() + '"></script>' + \
-                '<script>window.addEventListener("DOMContentLoaded", function() { opennamu_list_history(); });</script>' + \
-            '',
-            menu = [['other', get_lang(conn, 'return')], ['history_add/' + url_pas(doc_name), get_lang(conn, 'history_add')], ['history_reset/' + url_pas(doc_name), get_lang(conn, 'history_reset')]]
-        ))

+ 0 - 19
route/n_list_old_page.py

@@ -1,19 +0,0 @@
-from .tool.func import *
-
-async def list_old_page(num = 1, set_type = 'old'):
-    with get_db_connect() as conn:
-        title = ''
-        if set_type == 'old':
-            title = get_lang(conn, 'old_page')
-        else:
-            title = get_lang(conn, 'new_page')
-
-        return easy_minify(conn, flask.render_template(skin_check(conn),
-            imp = [title, wiki_set(conn), await wiki_custom(conn), wiki_css([0, 0])],
-            data = '' + \
-                '<div id="opennamu_list_old_page"></div>' + \
-                '<script defer src="/views/main_css/js/route/list_old_page.js' + cache_v() + '"></script>' + \
-                '<script>window.addEventListener("DOMContentLoaded", function() { opennamu_list_old_page(); });</script>' + \
-            '',
-            menu = [['other', get_lang(conn, 'return')]]
-        ))

+ 1 - 1
route/n_list_recent_block.py

@@ -13,7 +13,7 @@ async def list_recent_block(user_name = 'Test', tool = 'all', num = 1, why = '')
             sub = '(' + get_lang(conn, 'cidr') + ')'
         elif tool == 'private':
             sub = '(' + get_lang(conn, 'private') + ')'
-        else:
+        elif tool == 'admin':
             sub = '(' + get_lang(conn, 'admin') + ')'
 
         return easy_minify(conn, flask.render_template(skin_check(conn),

+ 0 - 13
route/n_list_recent_change.py

@@ -1,13 +0,0 @@
-from .tool.func import *
-
-async def list_recent_change(num = 1, set_type = 'normal'):
-    with get_db_connect() as conn:
-        return easy_minify(conn, flask.render_template(skin_check(conn),
-            imp = [get_lang(conn, 'recent_change'), wiki_set(conn), await wiki_custom(conn), wiki_css(['(' + get_lang(conn, set_type) + ')', 0])],
-            data = '' + \
-                '<div id="opennamu_list_recent_change"></div>' + \
-                '<script defer src="/views/main_css/js/route/list_recent_change.js' + cache_v() + '"></script>' + \
-                '<script>window.addEventListener("DOMContentLoaded", function() { opennamu_list_recent_change(); });</script>' + \
-            '',
-            menu = [['other', get_lang(conn, 'return')], ['recent_edit_request', get_lang(conn, 'edit_request')]]
-        ))

+ 0 - 13
route/n_main_redirect.py

@@ -1,13 +0,0 @@
-from .tool.func import *
-
-async def main_redirect(n = 1):
-    with get_db_connect() as conn:
-        return easy_minify(conn, flask.render_template(skin_check(conn),
-            imp = [get_lang(conn, 'redirect'), wiki_set(conn), await wiki_custom(conn), wiki_css([0, 0])],
-            data = '' + \
-                '<div id="opennamu_main_redirect"></div>' + \
-                '<script defer src="/views/main_css/js/route/main_redirect.js' + cache_v() + '"></script>' + \
-                '<script>window.addEventListener("DOMContentLoaded", function() { opennamu_main_redirect(); });</script>' + \
-            '',
-            menu = [['manager', get_lang(conn, 'return')]]
-        ))

+ 0 - 15
route/n_user_rankup.py

@@ -1,15 +0,0 @@
-from .tool.func import *
-
-async def user_rankup():
-    with get_db_connect() as conn:
-        ip = ip_check()
-
-        return easy_minify(conn, flask.render_template(skin_check(conn),
-            imp = [get_lang(conn, 'rankup'), wiki_set(conn), await wiki_custom(conn), wiki_css(['(' + ip + ')', 0])],
-            data = '' + \
-                '<div id="opennamu_user_rankup"></div>' + \
-                '<script defer src="/views/main_css/js/route/user_rankup.js' + cache_v() + '"></script>' + \
-                '<script>window.addEventListener("DOMContentLoaded", function() { opennamu_user_rankup(); });</script>' + \
-            '',
-            menu = [['user/' + url_pas(ip)]]
-        ))

+ 1 - 1
route/recent_app_submit.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-async def recent_app_submit_2():
+async def recent_app_submit():
     with get_db_connect() as conn:
         curs = conn.cursor()
 

+ 35 - 43
route/tool/func.py

@@ -30,44 +30,6 @@ if os.path.exists(os.path.join('data', 'version.json')):
     if data_load_ver == version_list['r_ver']:
         data_up_date = 0
 
-if data_up_date == 1:
-    with open(os.path.join('data', 'version.json'), 'w', encoding = 'utf8') as f:
-        f.write(version_list['r_ver'])
-    
-    if platform.system() in ('Linux', 'Darwin', 'Windows'):
-        python_ver = ''
-        python_ver = str(sys.version_info.major) + '.' + str(sys.version_info.minor)
-
-        run_list = [sys.executable, 'python' + python_ver, 'python3', 'python', 'py -' + python_ver]
-        for exe_name in run_list:
-            try:
-                subprocess.check_call([exe_name, "-m", "pip", "install", "--upgrade", "--user", "-r", "requirements.txt"])
-
-                try:
-                    os.execl(exe_name, sys.executable, *sys.argv)
-                except:
-                    pass
-
-                try:
-                    os.execl(exe_name, '"' + sys.executable + '"', *sys.argv)
-                except:
-                    pass
-
-                try:
-                    os.execl(exe_name, os.path.abspath(__file__), *sys.argv)
-                except:
-                    pass
-            except:
-                pass
-        else:
-            print('Error : automatic installation is not supported.')
-            print('Help : try "python3 -m pip install -r requirements.txt"')
-    else:
-        print('Error : automatic installation is not supported.')
-        print('Help : try "python3 -m pip install -r requirements.txt"')
-else:
-    print('PIP check pass')
-
 # Init-Load
 from .func_tool import *
 from .func_render import class_do_render
@@ -172,6 +134,27 @@ async def python_to_golang(func_name, other_set = {}):
                     raise Exception(f"API returned error: {data}")
                 else:
                     return data
+                
+async def opennamu_make_list(left = '', right = '', bottom = '', class_name = ''):
+    data_html = f'<span class="{class_name}">'
+    data_html += '<div class="opennamu_recent_change">'
+    data_html += left
+
+    data_html += '<div style="float: right;">'
+    data_html += right
+    data_html += '</div>'
+
+    data_html += '<div style="clear: both;"></div>'
+
+    if bottom != '':
+        data_html += '<hr>'
+        data_html += bottom
+
+    data_html += '</div>'
+    data_html += '<hr class="main_hr">'
+    data_html += '</span>'
+
+    return data_html
 
 # Func-init
 def get_init_set_list(need = 'all'):
@@ -1155,7 +1138,7 @@ def get_lang_name(conn, tool = ''):
 
 def get_lang(conn, data, safe = 0):
     lang_name = get_lang_name(conn)
-    
+
     if (lang_name + '_' + data) in global_lang_data:
         if safe == 1:
             return global_lang_data[lang_name + '_' + data]
@@ -1166,8 +1149,8 @@ def get_lang(conn, data, safe = 0):
         if (lang_name + '.json') in lang_list:
             lang = orjson.loads(open(os.path.join('lang', lang_name + '.json'), encoding = 'utf8').read())
             
-            for data in lang:
-                global_lang_data[lang_name + '_' + data] = lang[data] 
+            for title in lang:
+                global_lang_data[lang_name + '_' + title] = lang[title] 
         else:
             lang = {}
 
@@ -1253,7 +1236,6 @@ def wiki_css(data):
         data_css += '<script defer src="/views/main_css/js/func/insert_http_warning_text.js' + data_css_ver + '"></script>'
         
         data_css += '<script defer src="/views/main_css/js/func/ie_end_of_life.js' + data_css_ver + '"></script>'
-        data_css += '<script defer src="/views/main_css/js/func/shortcut.js' + data_css_ver + '"></script>'
         data_css += '<script defer src="/views/main_css/js/func/editor.js' + data_css_ver + '"></script>'
         data_css += '<script defer src="/views/main_css/js/func/render.js' + data_css_ver + '"></script>'
         
@@ -1527,7 +1509,17 @@ def render_set(conn, doc_name = '', doc_data = '', data_type = 'view', markup =
     if db_data and db_data[0][0] != '':
         render_lang_data['category'] = db_data[0][0]
 
-    get_class_render = class_do_render(conn, render_lang_data, markup, parameter).do_render(doc_name, doc_data, data_type)
+    get_class_render = class_do_render(
+        conn,
+        render_lang_data,
+        markup,
+        parameter,
+        render_set
+    ).do_render(
+        doc_name,
+        doc_data,
+        data_type
+    )
     if data_type == 'backlink':
         return ''
 

+ 11 - 2
route/tool/func_render.py

@@ -5,7 +5,7 @@ from .func_render_namumark import class_do_render_namumark
 # 커스텀 마크 언젠간 다시 추가 예정
 
 class class_do_render:
-    def __init__(self, conn, lang_data = {}, markup = '', parameter = {}):
+    def __init__(self, conn, lang_data = {}, markup = '', parameter = {}, parent = None):
         self.conn = conn
 
         if lang_data == '{}':
@@ -17,6 +17,7 @@ class class_do_render:
         self.lang_data = lang_data
         self.markup = markup
         self.parameter = parameter
+        self.parent = parent
 
     def generate_random_string(self, length = 32):
         characters = string.ascii_letters + string.digits
@@ -54,7 +55,15 @@ class class_do_render:
             rep_data = db_data[0][0] if db_data else 'namumark'
 
         if rep_data == 'namumark' or rep_data == 'namumark_beta':
-            data_end = class_do_render_namumark(self.conn, doc_name, doc_data, doc_set, self.lang_data, parameter = self.parameter)()
+            data_end = class_do_render_namumark(
+                self.conn,
+                doc_name,
+                doc_data,
+                doc_set,
+                self.lang_data,
+                parameter = self.parameter,
+                parent = self.parent
+            )()
         elif rep_data == 'raw':
             data_end = [html.escape(doc_data).replace('\n', '<br>'), '', {}]
         else:

+ 26 - 10
route/tool/func_render_namumark.py

@@ -3,7 +3,17 @@ from .func_tool import *
 from typing import Any
 
 class class_do_render_namumark:
-    def __init__(self, conn, doc_name, doc_data, doc_set, lang_data, do_type = 'exter', parameter = {}):
+    def __init__(
+        self,
+        conn,
+        doc_name,
+        doc_data,
+        doc_set,
+        lang_data,
+        do_type = 'exter',
+        parameter = {},
+        parent = None
+    ):
         self.conn = conn
         self.curs = self.conn.cursor()
 
@@ -13,6 +23,7 @@ class class_do_render_namumark:
 
         self.do_type = do_type
         self.parameter = parameter
+        self.parent = parent
 
         self.lang_data = lang_data
         try:
@@ -1401,7 +1412,7 @@ class class_do_render_namumark:
                     self.data_backlink[include_name]['include'] = ''
 
                     # load include db data
-                    self.curs.execute(db_change("select title from data where title = ?"), [include_name])
+                    self.curs.execute(db_change("select data from data where title = ?"), [include_name])
                     db_data = self.curs.fetchall()
                     if db_data:
                         # include link func
@@ -1409,14 +1420,22 @@ class class_do_render_namumark:
                         if include_set_data == 'use':
                             include_link = '<div><a href="/w/' + url_pas(include_name) + '">(' + include_name_org + ')</a></div>'
 
+                        include_data = ''
+                        if self.parent:
+                            include_data_tmp = self.parent(
+                                self.conn,
+                                doc_data = db_data[0][0], 
+                                data_type = 'api_include',
+                                parameter = include_change_list
+                            )
+
+                            include_data = include_data_tmp[0] + '<script>window.addEventListener("DOMContentLoaded", function() {' + include_data_tmp[1] + '});</script>'
+
                         include_sub_name = self.doc_set['doc_include'] + 'opennamu_include_' + str(include_num)
-                        self.render_data_js += '''
-                            opennamu_do_include("''' + self.get_tool_js_safe(include_name) + '''", "''' + self.get_tool_js_safe(self.doc_name) + '''", "''' + self.get_tool_js_safe(include_sub_name) + '''", "''' + self.get_tool_js_safe(include_sub_name) + '''");\n
-                        '''
                         data_name = self.get_tool_data_storage('' + \
                             include_link + \
-                            '<div id="' + include_sub_name + '" style="display: none;">' + urllib.parse.quote(json.dumps(include_change_list)) + '</div>' + \
-                        '', '', match_org)
+                            '<div id="' + include_sub_name + '"></div>' + \
+                        '', include_data, match_org)
                     else:
                         self.data_backlink[include_name]['no'] = ''
 
@@ -2535,9 +2554,6 @@ class class_do_render_namumark:
         self.render_data = re.sub(r'<a fn_target="([^"]+)"', do_render_last_footnote, self.render_data)
 
         self.render_data_js += '''
-            document.querySelectorAll('details').forEach((el) => {
-                new Accordion(el);
-            });
             if(window.location.hash !== '' && document.getElementById(window.location.hash.replace(/^#/, ''))) {
                 document.getElementById(window.location.hash.replace(/^#/, '')).focus();
             }\n

+ 5 - 1
route/tool/func_tool.py

@@ -4,7 +4,6 @@ import hashlib
 import flask
 import random
 import string
-import re
 
 import os
 import html
@@ -17,6 +16,11 @@ try:
   import orjson
 except:
   import json as orjson
+  
+try:
+    import regex as re
+except:
+    import re
 
 global_func_some_set = {}
 

+ 1 - 1
route/user_setting_email.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-async def user_setting_email_2():
+async def user_setting_email():
     with get_db_connect() as conn:
         curs = conn.cursor()
 

+ 1 - 1
route/user_setting_email_check.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-async def user_setting_email_check_2():
+async def user_setting_email_check():
     with get_db_connect() as conn:
         curs = conn.cursor()
 

+ 4 - 0
run_ubuntu.sh

@@ -0,0 +1,4 @@
+chmod +x ./route_go/bin
+
+pip3 install --upgrade -r requirements.txt
+python3 app.py

+ 2 - 0
run_windows.bat

@@ -0,0 +1,2 @@
+pip3 install --upgrade -r requirements.txt
+python3 app.py

+ 0 - 7
ubuntu.sh

@@ -1,7 +0,0 @@
-sudo apt-get install python3
-sudo apt-get install python3-pip
-
-chmod +x ./route_go/bin
-
-pip3 install -r requirements.txt
-python3 app.py

+ 1 - 1
version.json

@@ -1,5 +1,5 @@
 {
-    "r_ver" : "v3.6.0-v6",
+    "r_ver" : "v3.6.0-v9",
     "c_ver" : "20250323",
     "s_ver" : "20240426",
     "bin_link" : "https://github.com/openNAMU/GopenNAMU/releases/download/v2025-03-21-v2/"

+ 0 - 2
views/main_css/js/func/func.js

@@ -175,8 +175,6 @@ function opennamu_do_ip_click(obj) {
     }
 }
 
-
-
 function opennamu_do_ip_render() {
     for (let for_a = 0; for_a < document.getElementsByClassName('opennamu_render_ip').length; for_a++) {
         let ip = document.getElementsByClassName('opennamu_render_ip')[for_a].innerHTML.replace(/&amp;/g, '&');

+ 0 - 98
views/main_css/js/func/render.js

@@ -1,83 +1,5 @@
 "use strict";
 
-// https://css-tricks.com/how-to-animate-the-details-element/
-class Accordion {
-    constructor(el) {
-        this.el = el;
-        this.summary = el.querySelector('summary');
-        this.content = el.querySelector('.opennamu_folding');
-    
-        this.animation = null;
-        this.isClosing = false;
-        this.isExpanding = false;
-        this.summary.addEventListener('click', (e) => this.onClick(e));
-    }
-  
-    onClick(e) {
-        e.preventDefault();
-        this.el.style.overflow = 'hidden';
-        if(this.isClosing || !this.el.open) {
-            this.open();
-        } else if(this.isExpanding || this.el.open) {
-            this.shrink();
-        }
-    }
-  
-    shrink() {
-        this.isClosing = true;
-        
-        const startHeight = `${this.el.offsetHeight}px`;
-        const endHeight = `${this.summary.offsetHeight}px`;
-        
-        if(this.animation) {
-            this.animation.cancel();
-        }
-        
-        this.animation = this.el.animate({
-            height: [startHeight, endHeight]
-        }, {
-            duration: 200,
-            easing: 'ease-out'
-        });
-        
-        this.animation.onfinish = () => this.onAnimationFinish(false);
-        this.animation.oncancel = () => this.isClosing = false;
-    }
-  
-    open() {
-        this.el.style.height = `${this.el.offsetHeight}px`;
-        this.el.open = true;
-        window.requestAnimationFrame(() => this.expand());
-    }
-  
-    expand() {
-        this.isExpanding = true;
-        const startHeight = `${this.el.offsetHeight}px`;
-        const endHeight = `${this.summary.offsetHeight + this.content.offsetHeight}px`;
-        
-        if(this.animation) {
-            this.animation.cancel();
-        }
-        
-        this.animation = this.el.animate({
-            height: [startHeight, endHeight]
-        }, {
-            duration: 200,
-            easing: 'ease-out'
-        });
-        this.animation.onfinish = () => this.onAnimationFinish(true);
-        this.animation.oncancel = () => this.isExpanding = false;
-    }
-  
-    onAnimationFinish(open) {
-        this.el.open = open;
-        this.animation = null;
-        this.isClosing = false;
-        this.isExpanding = false;
-        this.el.style.height = this.el.style.overflow = '';
-    }
-}
-
 function opennamu_heading_folding(data, element = '') {
     let fol = document.getElementById(data);
     if(fol.style.display === '' || fol.style.display === 'inline-block' || fol.style.display === 'block') {
@@ -273,26 +195,6 @@ function opennamu_do_category_spread() {
     }
 }
 
-function opennamu_do_include(name, render_name, to_obj, option_obj) {
-    let option = {};
-    if(option_obj !== '') {
-        if(document.getElementById(option_obj)) {
-            option = document.getElementById(option_obj).innerHTML;
-            option = decodeURIComponent(option);
-        }
-    }
-
-    fetch("/api/raw/" + opennamu_do_url_encode(name)).then(function(res) {
-        return res.json();
-    }).then(function(data) {
-        if(data["data"]) {
-            opennamu_do_render(to_obj, data["data"], render_name, 'include', option, function() {
-                document.getElementById(option_obj).style.display = "inline";
-            });
-        }
-    });
-}
-
 function opennamu_do_toc() {
     let data = document.getElementById('opennamu_render_complete');
     let h_tag = data.querySelectorAll("h1, h2, h3, h4, h5, h6");

+ 0 - 39
views/main_css/js/func/shortcut.js

@@ -1,39 +0,0 @@
-"use strict";
-
-let shortcut_key_list = [];
-document.onkeyup = function(e) {
-    delete shortcut_key_list[e.key];
-}
-
-document.onkeypress = function(e) {
-    let shortcut_check = event.target.tagName.toLowerCase();
-    if(
-        shortcut_check !== 'input' &&
-        shortcut_check !== 'textarea'
-    ) {
-        let doc_shortcut = /^\/(w|w_from|history|edit|acl|topic|xref)\//i;
-
-        shortcut_key_list[e.key] = 1;
-        if(shortcut_key_list['f'] === 1) {
-            window.location.href = '/';
-        } else if(shortcut_key_list['c'] === 1) {
-            window.location.href = '/recent_change';
-        } else if(shortcut_key_list['d'] === 1) {
-            window.location.href = '/recent_discuss';
-        } else if(shortcut_key_list['a'] === 1) {
-            window.location.href = '/random';
-        }
-
-        if(window.location.pathname.match(doc_shortcut)) {
-            let doc_href = window.location.pathname.replace(doc_shortcut, '');
-            
-            if(shortcut_key_list['w'] === 1) {
-                window.location.pathname = '/w/' + doc_href;
-            } else if(shortcut_key_list['e'] === 1) {
-                window.location.pathname = '/edit/' + doc_href;
-            } else if(shortcut_key_list['h'] === 1) {
-                window.location.pathname = '/history/' + doc_href;
-            }
-        }
-    }
-}

+ 0 - 185
views/main_css/js/route/list_history.js

@@ -1,185 +0,0 @@
-"use strict";
-
-function opennamu_list_history_post() {
-    const url = window.location.pathname;
-    const url_split = url.split('/');
-
-    let doc_name = '';
-    if(url_split[1] === 'history') {
-        doc_name = url_split.slice(2).join('/');
-    } else {
-        doc_name = url_split.slice(4).join('/');
-    }
-
-    let a = document.getElementById('opennamu_list_history_a').value;
-    let b = document.getElementById('opennamu_list_history_b').value;
-
-    window.location.pathname = '/diff/' + b + '/' + a + '/' + doc_name;
-}
-
-function opennamu_list_history() {
-    const option_lang = function(lang_in, lang) {
-        if(lang_in === 'user') {
-            lang_in = lang['user_document'];
-        } else if(lang[lang_in] !== undefined) {
-            lang_in = lang[lang_in];
-        }
-    
-        return lang_in;
-    }
-
-    const url = window.location.pathname;
-    const url_split = url.split('/');
-    
-    let set_type = '';
-    let num = '';
-    let doc_name = '';
-    if(url_split[1] === 'history') {
-        set_type = 'normal';
-        num = '1';
-        doc_name = url_split.slice(2).join('/');
-    } else {
-        set_type = url_split[3];
-        num = url_split[2];
-        doc_name = url_split.slice(4).join('/');
-    }
-
-    fetch('/api/v2/history/' + num + '/' + set_type + '/' + doc_name).then(function(res) {
-        return res.json();
-    }).then(function(data) {
-        let lang = data["language"];
-        let auth = data["auth"];
-        data = data["data"];
-        console.log(auth);
-
-        let data_html = '';
-
-        data_html += '<style id="opennamu_list_hidden_style">.opennamu_list_hidden { display: none; }</style>';
-        data_html += '<label><input type="checkbox" onclick="opennamu_list_hidden_remove();" checked> ' + lang['remove_hidden'] + '</label>';
-        data_html += '<hr class="main_hr">';
-
-        let option_list = ['normal', 'edit', 'move', 'delete', 'revert', 'r1', 'setting'];
-        for(let for_a = 0; for_a < option_list.length; for_a++) {
-            data_html += '<a href="/history_page/1/' + option_list[for_a] + '/' + doc_name + '">(' + option_lang(option_list[for_a], lang) + ')</a> ';
-        }
-
-        let date_heading = '';
-        let select = '';
-        for(let for_a = 0; for_a < data.length; for_a++) {
-            if(data[for_a][6] !== "" && data[for_a][1] === "") {
-                if(date_heading !== '----') {
-                    data_html += '<h2 class="opennamu_list_hidden">----</h2>';
-                    date_heading = '----';
-                }
-
-                data_html += opennamu_make_list('----', '', '', 'opennamu_list_hidden');
-
-                continue;
-            }
-
-            let left = '';
-            let rev = '';
-            if(data[for_a][6] !== "") {
-                rev += '<span style="color: red;">r' + data[for_a][0] + '</span>';
-            } else {
-                rev += 'r' + data[for_a][0];
-            }
-
-            select += '<option value="' + data[for_a][0] + '">' + data[for_a][0] + '</option>';
-
-            if(Number(data[for_a][0]) > 1) {
-                let before_rev = String(Number(data[for_a][0]) - 1);
-                rev = '<a href="/diff/' + before_rev + '/' + data[for_a][0] + '/' + doc_name + '">' + rev + '</a>';
-            }
-
-            left += rev;
-
-            let right = '<span id="opennamu_list_history_' + String(for_a) + '_over">';
-
-            right += '<a id="opennamu_list_history_' + String(for_a) + '" href="javascript:void(0);">';
-            right += '<span class="opennamu_svg opennamu_svg_tool">&nbsp;</span>';
-            right += '</a>';
-            right += '<span class="opennamu_popup_footnote" id="opennamu_list_history_' + String(for_a) + '_load" style="display: none;"></span>';
-            right += '</span>';
-            right += ' | ';
-            
-            if(data[for_a][5] === '0') {
-                right += '<span style="color: gray;">' + data[for_a][5] + '</span>';
-            } else if(data[for_a][5].match(/\+/)) {
-                right += '<span style="color: green;">' + data[for_a][5] + '</span>';
-            } else {
-                right += '<span style="color: red;">' + data[for_a][5] + '</span>';
-            }
-            right += ' | ';
-            
-            right += data[for_a][7] + ' | ';
-            
-            let edit_type = 'edit';
-            if(data[for_a][8] !== '') {
-                edit_type = data[for_a][8];
-            }
-
-            right += option_lang(edit_type, lang) + ' | ';
-
-            let time_split = data[for_a][2].split(' ');
-
-            if(date_heading !== time_split[0]) {
-                data_html += '<h2>' + time_split[0] + '</h2>';
-                date_heading = time_split[0];
-            }
-
-            if(time_split.length > 1) {
-                right += time_split[1];
-            }
-            
-            right += '<span style="display: none;" id="opennamu_history_tool_' + String(for_a) + '">';
-
-            right += '<a href="/raw_rev/' + data[for_a][0] + '/' + doc_name + '">' + lang['raw'] + '</a>';
-            right += ' | <a href="/revert/' + data[for_a][0] + '/' + doc_name + '">' + lang['revert'] + ' (r' + data[for_a][0] + ')</a>';
-            if(Number(data[for_a][0]) > 1) {
-                let before_rev = String(Number(data[for_a][0]) - 1);
-                right += ' | <a href="/revert/' + before_rev + '/' + doc_name + '">' + lang['revert'] + ' (r' + before_rev + ')</a>';
-                right += ' | <a href="/diff/' + before_rev + '/' + data[for_a][0] + '/' + doc_name + '">' + lang['compare'] + '</a>';
-            }
-            right += ' | <a href="/history/' + doc_name + '">' + lang['history'] + '</a>';
-
-            if(auth["owner"] === true || auth["hidel"] === true) {
-                right += ' | <a href="/history_hidden/' + data[for_a][0] + '/' + doc_name + '">' + lang['hide'] + '</a>';
-            }
-
-            if(auth["owner"] === true) {
-                right += ' | <a href="/history_delete/' + data[for_a][0] + '/' + doc_name + '">' + lang['history_delete'] + '</a>';
-                right += ' | <a href="/history_send/' + data[for_a][0] + '/' + doc_name + '">' + lang['send_edit'] + '</a>';
-            }
-
-            right += '</span>';
-            
-            let bottom = '';
-            if(data[for_a][4] !== "") {
-                bottom = opennamu_send_render(opennamu_xss_filter(data[for_a][4]));
-            }
-
-            data_html += opennamu_make_list(left, right, bottom);
-        }
-
-        data_html += opennamu_page_control('/recent_change/{}/' + set_type, Number(num), data.length);
-        data_html = '' +
-            '<form method="post">' +
-                '<select id="opennamu_list_history_a">' + select + '</select> <select id="opennamu_list_history_b">' + select + '</select> ' +
-                '<button onclick="opennamu_list_history_post();" type="button">' + lang["compare"] + '</button>' +
-            '</form>' +
-            '<hr class="main_hr"></hr>' +
-        '' + data_html;
-
-        document.getElementById('opennamu_list_history').innerHTML = data_html;
-
-        for(let for_a = 0; for_a < data.length; for_a++) {
-            if(data[for_a][6] !== "" && data[for_a][1] === "") {
-                continue;
-            }
-
-            document.getElementById('opennamu_list_history_' + String(for_a)).addEventListener("click", function() { opennamu_do_footnote_popover('opennamu_list_history_' + String(for_a), '', 'opennamu_history_tool_' + String(for_a), 'open'); });
-            document.addEventListener("click", function() { opennamu_do_footnote_popover('opennamu_list_history_' + String(for_a), '', 'opennamu_history_tool_' + String(for_a), 'close'); });
-        }
-    });
-}

+ 0 - 36
views/main_css/js/route/list_old_page.js

@@ -1,36 +0,0 @@
-"use strict";
-
-function opennamu_list_old_page() {
-    const url = window.location.pathname;
-    const url_split = url.split('/');
-    
-    let set_type = '';
-    let num = '';
-    if(url_split.length === 4) {
-        set_type = url_split[3];
-        num = '1';
-    } else {
-        set_type = url_split[3];
-        num = url_split[4];
-    }
-
-    fetch('/api/v2/list/document/' + set_type + '/' + num).then(function(res) {
-        return res.json();
-    }).then(function(data) {
-        data = data["data"];
-
-        let data_html = '';
-
-        for(let for_a = 0; for_a < data.length; for_a++) {
-            let doc_name = opennamu_do_url_encode(data[for_a][0]);
-
-            let right = '<a href="/w/' + doc_name + '">' + opennamu_xss_filter(data[for_a][0]) + '</a> ';
-
-            data_html += opennamu_make_list(right, data[for_a][1]);
-        }
-
-        data_html += opennamu_page_control('/list/document/' + set_type + '/{}', Number(num), data.length);
-
-        document.getElementById('opennamu_list_old_page').innerHTML = data_html;
-    });
-}

+ 1 - 1
views/main_css/js/route/list_recent_block.js

@@ -47,7 +47,7 @@ function opennamu_list_recent_block() {
             data_html += '<a href="/recent_block/' + option_list[for_a][0] + '">(' + lang[option_list[for_a][1]] + ')</a> ';
         }
 
-        option_list = [['/manager/11', 'blocked'], ['/manager/12', 'admin'], ['/redirect_to/1', 'why']];
+        option_list = [['/manager/11', 'blocked'], ['/manager/12', 'admin'], ['/manager/19', 'why']];
         for(let for_a = 0; for_a < option_list.length; for_a++) {
             data_html += '<a href="' + option_list[for_a][0] + '">(' + lang[option_list[for_a][1]] + ')</a> ';
         }

+ 0 - 180
views/main_css/js/route/list_recent_change.js

@@ -1,180 +0,0 @@
-"use strict";
-
-function opennamu_list_recent_change() {
-    const option_lang = function(lang_in, lang) {
-        if(lang_in === 'user') {
-            lang_in = lang['user_document'];
-        } else if(lang[lang_in] !== undefined) {
-            lang_in = lang[lang_in];
-        }
-    
-        return lang_in;
-    }
-
-    const url = window.location.pathname;
-    const url_split = url.split('/');
-    
-    let set_type = '';
-    let num = '';
-    if(url_split.length === 2) {
-        set_type = 'normal';
-        num = '1';
-    } else {
-        set_type = url_split[3];
-        num = url_split[2];
-    }
-
-    fetch('/api/v2/recent_change/' + set_type + '/' + num).then(function(res) {
-        return res.json();
-    }).then(function(data) {
-        let lang = data["language"];
-        let auth = data["auth"];
-        data = data["data"];
-
-        let data_html = '';
-
-        data_html += '<style id="opennamu_list_hidden_style">.opennamu_list_hidden { display: none; }</style>';
-        data_html += '<label><input type="checkbox" onclick="opennamu_list_hidden_remove();" checked> ' + lang['remove_hidden'] + '</label>';
-        data_html += '<hr class="main_hr">';
-
-        let option_list = ['normal', 'edit', 'move', 'delete', 'revert', 'r1', 'edit_request', 'user', 'file', 'category'];
-        for(let for_a = 0; for_a < option_list.length; for_a++) {
-            data_html += '<a href="/recent_change/1/' + option_list[for_a] + '">(' + option_lang(option_list[for_a], lang) + ')</a> ';
-        }
-
-        if(auth["hidel"] === true) {
-            data_html += '<hr class="main_hr">';
-            
-            data_html += '<a id="opennamu_list_admin_tool_button" href="javascript:void(0);">(' + lang["admin_tool"] + ')</a>';
-
-            data_html += '<span id="opennamu_list_admin_tool" style="display: none;">';
-            data_html += 'test';
-            data_html += '</span>';
-
-            data_html += '<span class="opennamu_popup_footnote" style="display: none;" id="opennamu_list_admin_tool_button_load">';
-            data_html += '</span>';
-        }
-
-        let date_heading = '';
-        for(let for_a = 0; for_a < data.length; for_a++) {
-            if(data[for_a][6] !== "" && data[for_a][1] === "") {
-                if(date_heading !== '----') {
-                    data_html += '<h2 class="opennamu_list_hidden">----</h2>';
-                    date_heading = '----';
-                }
-
-                data_html += opennamu_make_list('----', '', '', 'opennamu_list_hidden');
-
-                continue;
-            }
-
-            let doc_name = opennamu_do_url_encode(data[for_a][1]);
-            
-            let left = '<a href="/w/' + doc_name + '">' + opennamu_xss_filter(data[for_a][1]) + '</a> ';
-            
-            if(auth["hidel"] === true) {
-                left = '<label><input type="checkbox"> ' + left + '</label>';
-            }
-
-            let right = '<span id="opennamu_list_recent_change_' + String(for_a) + '_over">';
-
-            right += '<a id="opennamu_list_recent_change_' + String(for_a) + '" href="javascript:void(0);">';
-            right += '<span class="opennamu_svg opennamu_svg_tool">&nbsp;</span>';
-            right += '</a>';
-            right += '<span class="opennamu_popup_footnote" id="opennamu_list_recent_change_' + String(for_a) + '_load" style="display: none;"></span>';
-            right += '</span>';
-            right += ' | ';
-
-            let rev = '';
-            if(data[for_a][6] !== "") {
-                rev += '<span style="color: red;">r' + data[for_a][0] + '</span>';
-            } else {
-                rev += 'r' + data[for_a][0];
-            }
-
-            if(Number(data[for_a][0]) > 1) {
-                let before_rev = String(Number(data[for_a][0]) - 1);
-                rev = '<a href="/diff/' + before_rev + '/' + data[for_a][0] + '/' + doc_name + '">' + rev + '</a>';
-            }
-
-            right += rev + ' | ';
-            
-            if(data[for_a][5] === '0') {
-                right += '<span style="color: gray;">' + data[for_a][5] + '</span>';
-            } else if(data[for_a][5].match(/\+/)) {
-                right += '<span style="color: green;">' + data[for_a][5] + '</span>';
-            } else {
-                right += '<span style="color: red;">' + data[for_a][5] + '</span>';
-            }
-            right += ' | ';
-            
-            right += data[for_a][7] + ' | ';
-            
-            let edit_type = 'edit';
-            if(data[for_a][8] !== '') {
-                edit_type = data[for_a][8];
-            }
-
-            right += option_lang(edit_type, lang) + ' | ';
-
-            let time_split = data[for_a][2].split(' ');
-
-            if(date_heading !== time_split[0]) {
-                data_html += '<h2>' + time_split[0] + '</h2>';
-                date_heading = time_split[0];
-            }
-
-            if(time_split.length > 1) {
-                right += time_split[1];
-            }
-            
-            right += '<span style="display: none;" id="opennamu_history_tool_' + String(for_a) + '">';
-
-            right += '<a href="/raw_rev/' + data[for_a][0] + '/' + doc_name + '">' + lang['raw'] + '</a>';
-            right += ' | <a href="/revert/' + data[for_a][0] + '/' + doc_name + '">' + lang['revert'] + ' (r' + data[for_a][0] + ')</a>';
-            if(Number(data[for_a][0]) > 1) {
-                let before_rev = String(Number(data[for_a][0]) - 1);
-                right += ' | <a href="/revert/' + before_rev + '/' + doc_name + '">' + lang['revert'] + ' (r' + before_rev + ')</a>';
-                right += ' | <a href="/diff/' + before_rev + '/' + data[for_a][0] + '/' + doc_name + '">' + lang['compare'] + '</a>';
-            }
-            right += ' | <a href="/history/' + doc_name + '">' + lang['history'] + '</a>';
-
-            if(auth["hidel"] === true) {
-                right += ' | <a href="/history_hidden/' + data[for_a][0] + '/' + doc_name + '">' + lang['hide'] + '</a>';
-            }
-
-            if(auth["owner"] === true) {
-                right += ' | <a href="/history_delete/' + data[for_a][0] + '/' + doc_name + '">' + lang['history_delete'] + '</a>';
-                right += ' | <a href="/history_send/' + data[for_a][0] + '/' + doc_name + '">' + lang['send_edit'] + '</a>';
-            }
-
-            right += '</span>';
-            
-            let bottom = '';
-            if(data[for_a][4] !== "") {
-                bottom = opennamu_send_render(opennamu_xss_filter(data[for_a][4]));
-            }
-
-            data_html += opennamu_make_list(left, right, bottom);
-        }
-
-        data_html += opennamu_page_control('/recent_change/{}/' + set_type, Number(num), data.length);
-
-        document.getElementById('opennamu_list_recent_change').innerHTML = data_html;
-
-        for(let for_a = 0; for_a < data.length; for_a++) {
-            if(data[for_a][6] !== "" && data[for_a][1] === "") {
-                continue;
-            }
-
-            document.getElementById('opennamu_list_recent_change_' + String(for_a)).addEventListener("click", function() { opennamu_do_footnote_popover('opennamu_list_recent_change_' + String(for_a), '', 'opennamu_history_tool_' + String(for_a), 'open'); });
-            document.addEventListener("click", function() { opennamu_do_footnote_popover('opennamu_list_recent_change_' + String(for_a), '', 'opennamu_history_tool_' + String(for_a), 'close'); });
-        }
-
-        if(document.getElementById('opennamu_list_admin_tool_button')) {
-            document.getElementById('opennamu_list_admin_tool_button').addEventListener("click", function() { opennamu_do_footnote_popover('opennamu_list_admin_tool_button', '', 'opennamu_list_admin_tool', 'open'); });
-        }
-        
-        document.addEventListener("click", function() { opennamu_do_footnote_popover('opennamu_list_admin_tool_button', '', 'opennamu_list_admin_tool', 'close'); });
-    });
-}

+ 0 - 6
views/main_css/js/route/list_recent_discuss.js

@@ -78,11 +78,5 @@ function opennamu_list_recent_discuss() {
         data_html += opennamu_page_control('/recent_discuss/{}/' + set_type, Number(num), data.length);
 
         document.getElementById('opennamu_list_recent_discuss').innerHTML = data_html;
-
-        if(document.getElementById('opennamu_list_admin_tool_button')) {
-            document.getElementById('opennamu_list_admin_tool_button').addEventListener("click", function() { opennamu_do_footnote_popover('opennamu_list_admin_tool_button', '', 'opennamu_list_admin_tool', 'open'); });
-        }
-        
-        document.addEventListener("click", function() { opennamu_do_footnote_popover('opennamu_list_admin_tool_button', '', 'opennamu_list_admin_tool', 'close'); });
     });
 }

+ 0 - 65
views/main_css/js/route/main_redirect.js

@@ -1,65 +0,0 @@
-"use strict";
-
-function opennamu_main_redirect() {
-    const url = window.location.pathname;
-    const url_split = url.split('/');
-
-    const post_n = [];
-    const n = url_split[2];
-    
-    if(post_n.includes(n)) {
-        opennamu_main_redirect_post(n);
-    } else {
-        opennamu_main_redirect_get(n);
-    }
-}
-
-function opennamu_main_redirect_send() {
-    const url = window.location.pathname;
-    const url_split = url.split('/');
-
-    const n = url_split[2];
-    const data = document.getElementById('opennamu_main_redirect_input').value;
-
-    if(n === '1') {
-        window.location.pathname = '/recent_block/all/1/' + opennamu_do_url_encode(data);
-    }
-}
-
-function opennamu_main_redirect_get(n) {
-    let lang_data = new FormData();
-    lang_data.append('data', 'send search');
-    
-    fetch('/api/lang', {
-        method : 'POST',
-        body : lang_data,
-    }).then(function(res) {
-        return res.json();
-    }).then(function(lang) {
-        lang = lang["data"];
-
-        let data_html = '';
-        
-        if(n === '1') {
-            data_html += '<input id="opennamu_main_redirect_input" placeholder="' + lang[1] + '">';
-        } else {
-            data_html += '<input id="opennamu_main_redirect_input">';
-        }
-
-        data_html += '<hr class="main_hr">';
-        data_html += '<button onclick="opennamu_main_redirect_send();">' + lang[0] + '</button>';
-
-        document.getElementById('opennamu_main_redirect').innerHTML = data_html;
-    });
-}
-
-function opennamu_main_redirect_post(n) {
-    let url = '';
-    let input = '';
-
-    let data_html = '<form action="' + url + '">';
-    data_html += input;
-    data_html += '</form>';
-
-    document.getElementById('opennamu_main_redirect').innerHTML = '';
-}

+ 0 - 25
views/main_css/js/route/main_sys_restart.js

@@ -1,25 +0,0 @@
-"use strict";
-
-function opennamu_main_sys_restart() {
-    let lang_data = new FormData();
-    lang_data.append('data', 'restart');
-    
-    fetch('/api/lang', {
-        method : 'POST',
-        body : lang_data,
-    }).then(function(res) {
-        return res.json();
-    }).then(function(lang) {
-        lang = lang["data"];
-
-        document.getElementById('opennamu_main_sys_restart').innerHTML = '<button id="opennamu_main_sys_restart_button">' + lang[0] + '</button>';
-
-        document.getElementById('opennamu_main_sys_restart_button').addEventListener('click', function() {
-            fetch('/restart', {
-                method : 'POST'
-            });
-
-            window.location.href = '/';
-        });
-    });
-}

+ 0 - 7
views/main_css/js/route/user_rankup.js

@@ -1,7 +0,0 @@
-function opennamu_user_rankup() {
-    fetch('/api/v2/user/rankup').then(function(res) {
-        return res.json();
-    }).then(function(data) {
-        console.log(data);
-    });
-}

+ 0 - 29
views/main_css/js/route/w.js

@@ -1,29 +0,0 @@
-"use strict";
-
-function opennamu_w(do_type = '') {
-    let name = "test";
-    if(document.getElementById('opennamu_editor_doc_name')) {
-        name = opennamu_xss_filter_decode(document.getElementById('opennamu_editor_doc_name').innerHTML);
-    }
-
-    fetch("/api/raw/" + opennamu_do_url_encode(name)).then(function(res) {
-        return res.json();
-    }).then(function(data) {
-        if(data["data"]) {
-            opennamu_do_render('opennamu_preview_area', data["data"], name, do_type);
-        }
-    });
-}
-
-function opennamu_w_page_view() {
-    let name = "test";
-    if(document.getElementById('opennamu_editor_doc_name')) {
-        name = opennamu_xss_filter_decode(document.getElementById('opennamu_editor_doc_name').innerHTML);
-    }
-
-    fetch("/api/v2/page_view/" + opennamu_do_url_encode(name));
-}
-
-function opennamu_w_comment() {
-    
-}