ソースを参照

Merge pull request #760 from 2du/master

버그 수정
잉여개발기 (SPDV) 6 年 前
コミット
4eb4796054

+ 1 - 0
language/en-US.json

@@ -178,6 +178,7 @@
         "acl_record" : "ACL record",
         "last_edit_time" : "Last edited time",
         "admin_group" : "Admin group",
+        "topic_setting" : "Topic setting(s)",
         "_comment_2.1_" : "Filter",
             "_comment_2.1.1_" : "List",
                 "interwiki_list" : "Interwiki(s) list",

+ 2 - 1
language/ko-KR.json

@@ -295,5 +295,6 @@
     "owner_acl": "소유자만",
     "last_edit_time": "최근 수정 시각",
     "link": "링크",
-    "icon": "아이콘"
+    "icon": "아이콘",
+    "topic_setting" : "토론 설정"
 }

+ 1 - 1
route/api_topic_sub.py

@@ -22,7 +22,7 @@ def api_topic_sub_2(conn, name, sub, time):
         for i in data:
             if i[4] != 'O' or (i[4] == 'O' and admin == 1):
                 t_data_f = i[1]
-                b_color = ''
+                b_color = 'toron_color_grey'
             else:
                 curs.execute("select who from re_admin where what = ? order by time desc limit 1", ['blind (' + name + ' - ' + sub + '#' + str(i[0]) + ')'])
                 who_blind = curs.fetchall()

+ 1 - 1
route/func_upload.py

@@ -116,7 +116,7 @@ def func_upload_2(conn):
                 <form method="post" enctype="multipart/form-data" accept-charset="utf8">
                     <input type="file" name="f_data">
                     <hr class=\"main_hr\">
-                    <input placeholder="''' + load_lang('file_name') + '''" name="f_name" type="text">
+                    <input placeholder="''' + load_lang('file_name') + '''" name="f_name" type="text" value="''' + flask.request.args.get('name', '') + '''">
                     <hr class=\"main_hr\">
                     <select name="f_lice_sel">
                         ''' + license_list + '''

+ 12 - 2
route/tool/func.py

@@ -764,14 +764,24 @@ def acl_check(name = 'test', tool = '', sub = 'test'):
         if re.search("^file:", name) and admin_check(None, 'file edit (' + name + ')') != 1:
             return 1
 
-    for i in range(0, (2 if tool != 'render' else 1)):
+    if tool == '':
+        end = 3
+    elif tool == 'topic':
+        end = 2
+    else:
+        end = 1
+
+    for i in range(0, end):
         if tool == '':
             if i == 0:
                 curs.execute("select decu from acl where title = ?", [name])
                 acl_data = curs.fetchall()
-            else:
+            elif i == 1:
                 curs.execute('select data from other where name = "edit"')
                 acl_data = curs.fetchall()
+            else:
+                curs.execute("select view from acl where title = ?", [name])
+                acl_data = curs.fetchall()
 
             num = 5
         elif tool == 'topic':

+ 26 - 11
route/tool/set_mark/namu.py

@@ -781,25 +781,25 @@ def namu(conn, data, title, main_num, include_num):
             if re.search('^((?:file|파일)|(?:out|외부)):', main_link):
                 file_style = ''
 
-                width = re.search('width=((?:(?!&).)+)', see_link)
-                if width:
-                    file_width = width.groups()[0]
+                file_width = re.search('width=((?:(?!&).)+)', see_link)
+                if file_width:
+                    file_width = file_width.groups()[0]
                     if re.search('px$', file_width):
                         file_style += 'width: ' + file_width + ';'
                     else:
                         file_style += 'width: ' + file_width + 'px;'
                 
-                height = re.search('height=((?:(?!&).)+)', see_link)
-                if height:
-                    file_height = height.groups()[0]
+                file_height = re.search('height=((?:(?!&).)+)', see_link)
+                if file_height:
+                    file_height = file_height.groups()[0]
                     if re.search('px$', file_height):
                         file_style += 'height: ' + file_height + ';'
                     else:
                         file_style += 'height: ' + file_height + 'px;'
 
-                align = re.search('align=((?:(?!&).)+)', see_link)
-                if align:
-                    file_align = align.groups()[0]
+                file_align = re.search('align=((?:(?!&).)+)', see_link)
+                if file_align:
+                    file_align = file_align.groups()[0]
                     if file_align == 'center':
                         file_align = 'display: block; text-align: center;'
                     else:
@@ -807,6 +807,12 @@ def namu(conn, data, title, main_num, include_num):
                 else:
                     file_align = ''
 
+                file_color = re.search('bgcolor=((?:(?!&).)+)', see_link)
+                if file_color:
+                    file_color = 'background: ' + file_color.groups()[0] + '; display: inline-block;'
+                else:
+                    file_color = ''
+
                 if re.search('^(?:out|외부):', main_link):
                     file_src = re.sub('^(?:out|외부):', '', main_link)
             
@@ -831,9 +837,18 @@ def namu(conn, data, title, main_num, include_num):
                     exist = curs.fetchall()
                 
                 if exist:
-                    data = re.sub('\[\[((?:(?!\[\[|\]\]).)+)\]\]', '<span style="' + file_align + '"><img style="' + file_style + '" alt="' + file_alt + '" src="' + file_src + '"></span>', data, 1)
+                    data = re.sub(
+                        '\[\[((?:(?!\[\[|\]\]).)+)\]\]', 
+                        '<span style="' + file_align + '">' + \
+                            '<span style="' + file_color + '">' + \
+                                '<img style="' + file_style + '" alt="' + file_alt + '" src="' + file_src + '">' + \
+                            '</span>' + \
+                        '</span>', 
+                        data, 
+                        1
+                    )
                 else:
-                    data = re.sub('\[\[((?:(?!\[\[|\]\]).)+)\]\]', '<a id="not_thing" href="/w/' + tool.url_pas(file_alt) + '">' + file_alt + '</a>', data, 1)
+                    data = re.sub('\[\[((?:(?!\[\[|\]\]).)+)\]\]', '<a id="not_thing" href="/upload?name=' + tool.url_pas(file_name) + '">' + file_alt + '</a>', data, 1)
             elif category_re.search(main_link):
                 main_link = category_re.sub('category:', main_link)
                 

+ 2 - 4
route/topic_stop.py

@@ -74,7 +74,7 @@ def topic_stop_2(conn, name, sub):
             agree_check = ''
 
         return easy_minify(flask.render_template(skin_check(),
-            imp = [name, wiki_set(), custom(), other2([' (topic_tool)', 0])],
+            imp = [name, wiki_set(), custom(), other2([' (' + load_lang('topic_setting') + ')', 0])],
             data = '''
                 <hr class=\"main_hr\">
                 <form method="post">
@@ -84,9 +84,7 @@ def topic_stop_2(conn, name, sub):
                     <hr class=\"main_hr\">
                     <input type="checkbox" name="agree" value="O" ''' + agree_check + '''> Agree
                     <hr class=\"main_hr\">
-                    <input placeholder="''' + load_lang('why') + '''" name="why" type="text">
-                    <hr class=\"main_hr\">
-                    <span>''' + load_lang('markup_enabled') + '''</span>
+                    <input placeholder="''' + load_lang('why') + ''' (''' + load_lang('markup_enabled') + ''')" name="why" type="text">
                     <hr class=\"main_hr\">
                     <button type="submit">''' + load_lang('save') + '''</button>
                 </form>

+ 1 - 1
route/topic_tool.py

@@ -21,7 +21,7 @@ def topic_tool_2(conn, name, sub):
         data = '''
             <h2>''' + load_lang('admin_tool') + '''</h2>
             <ul>
-                <li><a href="/topic/''' + url_pas(name) + '/sub/' + url_pas(sub) + '''/setting"> Topic setting</a></li>
+                <li><a href="/topic/''' + url_pas(name) + '/sub/' + url_pas(sub) + '''/setting">''' + load_lang('topic_setting') + '''</a></li>
             </ul>
         '''
     data += '''

+ 2 - 2
version.json

@@ -1,10 +1,10 @@
 {
     "master" : {
-        "r_ver" : "v3.1.3-stable-03",
+        "r_ver" : "v3.1.3-stable-04",
         "c_ver" : "400004",
         "s_ver" : "3"
     }, "stable" : {
-        "r_ver" : "v3.1.3-stable-03",
+        "r_ver" : "v3.1.3-stable-04",
         "c_ver" : "400004",
         "s_ver" : "3"
     }

+ 29 - 0
views/marisa/css/dark.css

@@ -0,0 +1,29 @@
+html, #main {
+    background: black;
+    color: white;
+}
+
+.cel_in_cel, #background, div#pre_search, #toc, #cate, #redirect, #mobile_menu {
+    background: #1f2023;
+    border-color: #1f2023;
+}
+
+#bottom {
+    background: black;
+    color: white;
+}
+
+#top .cel_in_cel a {
+    color: white;
+}
+
+textarea, input, button, select {
+    background: #1f2023;
+    color: white;
+    border-color: #1f2023;
+}
+
+#mobile_search_input, #mobile_search_input::placeholder {
+    background: gray;
+    color: white;
+}

+ 33 - 17
views/marisa/css/main.css

@@ -3,7 +3,7 @@ body {
     word-break: break-all;
     word-wrap: break-word;
     margin: 0;
-    font-family: "나눔고딕", "nanumgothic", "Nanum Gothic", "KoPub Dotum", "Malgun Gothic", "맑은 고딕", "sans-serif";
+    font-family: 'Noto Sans KR', '나눔고딕', 'Nanum Gothic', 'Malgun Gothic', '맑은 고딕', sans-serif;
 }
 
 ul {
@@ -50,7 +50,7 @@ li {
 #top {
     width: 100%;
     background: #4a4a4a;
-    padding: 15px;
+    padding: 20px;
     padding-right: 0;
     padding-left: 0;
     position: relative;
@@ -80,14 +80,12 @@ li {
 
 #bottom_main {
     margin: auto;
-    margin-top: 20px;
+    padding-top: 20px;
 }
 
 #tool {
     float: right;
-    border: 2px solid gainsboro;
-    padding: 10px;
-    border-radius: 10px;
+    border: none;
 }
 
 @media (min-width: 780px) and (max-width: 1350px) {
@@ -243,7 +241,26 @@ h6 {
 
 #search_input {
     width: 220px;
-    border-radius: 10px;
+    height: 35px;
+    border-radius: 17.5px;
+    padding-left: 10px;
+    background-color: gray;
+    border: solid 1px gray;
+    color: #fff;
+    transition: .2s ease-in-out;
+    outline: none;
+}
+#search_input::placeholder {
+    color: #fff;
+}
+#search_input:hover, #search_input:focus {
+    border-color: #ababab;
+    background-color: #eaeaea;
+    color: #000;
+    transition: .2s ease-in-out;
+}
+#search_input:hover::placeholder, #search_input:focus::placeholder {
+    color: #000;
 }
 
 div#pre_search {
@@ -333,13 +350,13 @@ pre {
 
 textarea {
     border: 2px solid gainsboro;
-    font-family: '나눔고딕', 'nanumgothic', "Nanum Gothic","KoPub Dotum","Malgun Gothic","맑은 고딕",sans-serif;
+    font-family: 'Noto Sans KR', '나눔고딕', 'Nanum Gothic', 'Malgun Gothic', '맑은 고딕', sans-serif;
     padding: 0;
 }
 
 input {
     border: 2px solid gainsboro;
-    font-family: '나눔고딕', 'nanumgothic', "Nanum Gothic","KoPub Dotum","Malgun Gothic","맑은 고딕",sans-serif;
+    font-family: 'Noto Sans KR', '나눔고딕', 'Nanum Gothic', 'Malgun Gothic', '맑은 고딕', sans-serif;
 }
 
 #toc {
@@ -347,7 +364,7 @@ input {
     border-radius: 10px;
 }
 
-#cate {
+#cate, #redirect {
     border: 2px solid gainsboro;
     border-radius: 10px;
 }
@@ -356,11 +373,6 @@ input {
     background: transparent;
 }
 
-#redirect {
-    border: 2px solid gainsboro;
-    border-radius: 10px;
-}
-
 #go_toc {
     display: inline-block;
     padding: 10px;
@@ -404,8 +416,8 @@ blockquote {
 }
 
 #out_link::before {
-    font-family: "Font Awesome 5 Free";
-    content: "\f360";
+    font-family: 'Font Awesome 5 Free';
+    content: '\f360';
     font-weight: 900;
     background: transparent;
     color: green;
@@ -429,4 +441,8 @@ div#last_edit {
 
 #topic_color {
     color: limegreen;
+}
+
+#mobile_search_input {
+    border-radius: 10px;
 }

+ 1 - 0
views/marisa/index.html

@@ -13,6 +13,7 @@
                 href="https://use.fontawesome.com/releases/v5.7.2/css/all.css"
                 integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr"
                 crossorigin="anonymous">
+        <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Noto+Sans+KR&display=swap">
         <link rel="shortcut icon" href="/views/main_css/file/favicon.ico?ver=1">
         {{imp[1][5]|safe}}
         {{imp[2][3]|safe}}

+ 1 - 1
views/marisa/info.json

@@ -1,5 +1,5 @@
 {
     "name" : "Marisa",
-    "skin_ver" : "v1.0.8",
+    "skin_ver" : "v1.0.9",
     "require_ver" : "3"
 }

+ 65 - 68
views/marisa/js/skin_set.js

@@ -1,83 +1,80 @@
-function skin_set() {
-    function get_post() {
-        check = document.getElementById('strike');
-        if(check.value === 'normal') {
-            document.cookie = 'del_strike=0;';
-        } else if(check.value === 'change') {
-            document.cookie = 'del_strike=1;';
-        } else {
-            document.cookie = 'del_strike=2;';
-        }
-
-        check = document.getElementById('bold');
-        if(check.value === 'normal') {
-            document.cookie = 'del_bold=0;';
-        } else if(check.value === 'change') {
-            document.cookie = 'del_bold=1;';
-        } else {
-            document.cookie = 'del_bold=2;';
-        }
-
-        check = document.getElementById('include');
-        if(check.checked === true) {
-            document.cookie = 'include_link=1;';
-        } else {
-            document.cookie = 'include_link=0;';
-        }
-
-        check = document.getElementById('invert');
-        if(check.checked === true) {
-            document.cookie = 'invert=1;';
-        } else {
-            document.cookie = 'invert=0;';
-        }
+function get_post() {
+    check = document.getElementById('strike');
+    if(check.value === 'normal') {
+        document.cookie = 'del_strike=0;';
+    } else if(check.value === 'change') {
+        document.cookie = 'del_strike=1;';
+    } else {
+        document.cookie = 'del_strike=2;';
+    }
 
-        history.go(0);
+    check = document.getElementById('bold');
+    if(check.value === 'normal') {
+        document.cookie = 'del_bold=0;';
+    } else if(check.value === 'change') {
+        document.cookie = 'del_bold=1;';
+    } else {
+        document.cookie = 'del_bold=2;';
     }
 
-    function regex_data(data) {
-        r_data = new RegExp('(?:^|; )' + data + '=([^;]*)')
+    check = document.getElementById('include');
+    if(check.checked === true) {
+        document.cookie = 'include_link=1;';
+    } else {
+        document.cookie = 'include_link=0;';
+    }
 
-        return r_data;
+    check = document.getElementById('invert');
+    if(check.checked === true) {
+        document.cookie = 'invert=1;';
+    } else {
+        document.cookie = 'invert=0;';
     }
 
-    cookies = document.cookie;
+    history.go(0);
+}
 
-    function main_load() {
-        head_data = document.querySelector('head');
-        if(cookies.match(regex_data('del_strike'))) {
-            if(cookies.match(regex_data('del_strike'))[1] === '1') {
-                head_data.innerHTML += '<style>s { text-decoration: none; } s:hover { background-color: transparent; }</style>';
-            } else if(cookies.match(regex_data('del_strike'))[1] === '2') {
-                head_data.innerHTML += '<style>s { display: none; }</style>';
-            }
+function main_load() {
+    head_data = document.querySelector('head');
+    if(cookies.match(regex_data('del_strike'))) {
+        if(cookies.match(regex_data('del_strike'))[1] === '1') {
+            head_data.innerHTML += '<style>s { text-decoration: none; } s:hover { background-color: transparent; }</style>';
+        } else if(cookies.match(regex_data('del_strike'))[1] === '2') {
+            head_data.innerHTML += '<style>s { display: none; }</style>';
         }
+    }
 
-        if(cookies.match(regex_data('del_bold'))) {
-            if(cookies.match(regex_data('del_bold'))[1] === '1') {
-                head_data.innerHTML += '<style>b { font-weight: normal; }</style>';
-            } else if(cookies.match(regex_data('del_bold'))[1] === '2') {
-                head_data.innerHTML += '<style>b { display: none; }</style>';
-            }
+    if(cookies.match(regex_data('del_bold'))) {
+        if(cookies.match(regex_data('del_bold'))[1] === '1') {
+            head_data.innerHTML += '<style>b { font-weight: normal; }</style>';
+        } else if(cookies.match(regex_data('del_bold'))[1] === '2') {
+            head_data.innerHTML += '<style>b { display: none; }</style>';
         }
+    }
 
-        if(
-            cookies.match(regex_data('include_link')) &&
-            cookies.match(regex_data('include_link'))[1] === '1'
-        ) {
-            head_data.innerHTML += '<style>#include_link { display: inline; }</style>';
-        }
+    if(
+        cookies.match(regex_data('include_link')) &&
+        cookies.match(regex_data('include_link'))[1] === '1'
+    ) {
+        head_data.innerHTML += '<style>#include_link { display: inline; }</style>';
+    }
 
-        if(
-            cookies.match(regex_data('invert')) &&
-            cookies.match(regex_data('invert'))[1] === '1'
-        ) {
-            head_data.innerHTML += '<style>body { -webkit-filter: invert(100%); filter: invert(100%); background: black; }</style>';
-        }
+    if(
+        cookies.match(regex_data('invert')) &&
+        cookies.match(regex_data('invert'))[1] === '1'
+    ) {
+        head_data.innerHTML += '<link rel="stylesheet" href="/views/marisa/css/dark.css?ver=1">';
     }
+}
 
-    main_load();
+function regex_data(data) {
+    return new RegExp('(?:^|; )' + data + '=([^;]*)');
+}
 
+cookies = document.cookie;
+main_load();
+
+function skin_set() {
     if(window.location.pathname === '/skin_set') {
         set_language = {
             "en-US" : {
@@ -90,7 +87,7 @@ function skin_set() {
                 "strike" : "Strike",
                 "bold" : "Bold",
                 "other" : "Other",
-                "invert" : "Reversal of color"
+                "darkmode" : "Darkmode"
             }, "ko-KR" : {
                 "default" : "기본값",
                 "change_to_normal" : "일반 텍스트로 변경",
@@ -101,7 +98,7 @@ function skin_set() {
                 "strike" : "취소선",
                 "bold" : "볼드체",
                 "other" : "기타",
-                "invert" : "색 반전"
+                "darkmode" : "다크모드"
             }
         }
 
@@ -204,7 +201,7 @@ function skin_set() {
             <h2>' + set_language[language]['other'] + '</h2> \
             <input ' + set_data["include"] + ' type="checkbox" id="include" name="include" value="include"> ' + set_language[language]['include_link'] + ' \
             <hr class="main_hr"> \
-            <input ' + set_data["invert"] + ' type="checkbox" id="invert" name="invert" value="invert"> ' + set_language[language]['invert'] + ' \
+            <input ' + set_data["invert"] + ' type="checkbox" id="invert" name="invert" value="invert"> ' + set_language[language]['darkmode'] + ' \
             <hr class="main_hr"> \
             <button onclick="get_post();">' + set_language[language]['save'] + '</button> \
         ';