Bläddra i källkod

Merge branch 'master' into master

Surplus_Up (2DU) 8 år sedan
förälder
incheckning
a1b481cb6f
11 ändrade filer med 603 tillägg och 418 borttagningar
  1. 292 185
      app.py
  2. 0 41
      back_reset.py
  3. 0 15
      delete_recaptcha.py
  4. 63 0
      emergency_tool.py
  5. 137 109
      func.py
  6. 38 6
      language/en-US.json
  7. 10 0
      language/ko-KR.json
  8. 10 4
      mark.py
  9. 23 21
      set_mark/start.py
  10. 8 24
      views/acme/css/style-responsive.css
  11. 22 13
      views/acme/index.html

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 292 - 185
app.py


+ 0 - 41
back_reset.py

@@ -1,41 +0,0 @@
-# 주요 모듈 불러옴
-import json
-import sqlite3
-import threading
-
-# 기타 코드 불러옴
-from func import *
-from mark import namumark
-
-# JSON 불러옴
-json_data = open('set.json').read()
-set_data = json.loads(json_data)
-
-# 디비 연결
-conn = sqlite3.connect(set_data['db'] + '.db', check_same_thread = False)
-curs = conn.cursor()
-
-# 파싱 해주는 함수
-def parser(data):
-    namumark(conn, data[0], data[1], 1)
-
-# 역링크 전부 삭제
-curs.execute("delete from back")
-conn.commit()
-
-# 데이터에서 제목이랑 내용 불러옴
-curs.execute("select title, data from data")
-data = curs.fetchall()
-
-# for 돌려서 처리
-for test in data:
-    # 제목 프린트
-    print(test[0])
-
-    # 스레드 기반으로 처리
-    t = threading.Thread(target = parser, args = [test])
-    t.start()
-    t.join()
-
-# 커밋
-conn.commit()

+ 0 - 15
delete_recaptcha.py

@@ -1,15 +0,0 @@
-import json
-import sqlite3
-
-# JSON 연결
-json_data = open('set.json').read()
-set_data = json.loads(json_data)
-
-# 디비 연결
-conn = sqlite3.connect(set_data['db'] + '.db', check_same_thread = False)
-curs = conn.cursor()
-
-# 데이터 삭제
-curs.execute("delete from other where name = 'recaptcha'")
-curs.execute("delete from other where name = 'sec_re'")
-conn.commit()

+ 63 - 0
emergency_tool.py

@@ -0,0 +1,63 @@
+# 주요 모듈 불러옴
+import json
+import sqlite3
+import threading
+
+# 기타 코드 불러옴
+from func import *
+from mark import namumark
+
+# JSON 불러옴
+json_data = open('set.json').read()
+set_data = json.loads(json_data)
+
+# 디비 연결
+conn = sqlite3.connect(set_data['db'] + '.db', check_same_thread = False)
+curs = conn.cursor()
+
+print('1. BackLink ReSet')
+print('2. ReCaptcha Delete')
+print('3. Ban Delete')
+print('')
+
+print('select : ', end = '')
+what_i_do = input()
+
+if what_i_do == '1':
+    # 파싱 해주는 함수
+    def parser(data):
+        namumark(conn, data[0], data[1], 1)
+
+    # 역링크 전부 삭제
+    curs.execute("delete from back")
+    conn.commit()
+
+    # 데이터에서 제목이랑 내용 불러옴
+    curs.execute("select title, data from data")
+    data = curs.fetchall()
+
+    # for 돌려서 처리
+    for test in data:
+        # 스레드 기반으로 처리
+        t = threading.Thread(target = parser, args = [test])
+        t.start()
+        t.join()
+elif what_i_do == '2':
+    # 데이터 삭제
+    curs.execute("delete from other where name = 'recaptcha'")
+    curs.execute("delete from other where name = 'sec_re'")
+elif what_i_do == '3':
+    print('IP or User_Name : ', end = '')
+    user_data = input()
+
+    if re.search("^([0-9]{1,3}\.[0-9]{1,3})$", user_data):
+        band = 'O'
+    else:
+        band = ''
+
+    # 데이터 삭제
+    curs.execute("insert into rb (block, end, today, blocker, why, band) values (?, ?, ?, ?, ?, ?)", [user_data, '해제', get_time(), 'localhost', '', band])
+    curs.execute("delete from ban where block = ?", [user_data])
+
+# 커밋
+conn.commit()

+ 137 - 109
func.py

@@ -21,12 +21,23 @@ from set_mark.tool import sha224
 # 나무마크 불러옴
 from mark import *
 
-def captcha_get(conn):
+# 서브 언어팩 불러옴
+json_data = open(os.path.join('language', 'en-US.json'), 'rt', encoding='utf-8').read()
+else_lang = json.loads(json_data)
+
+def load_conn(data):
+    global conn
+    global curs
+
+    conn = data
     curs = conn.cursor()
 
+    load_conn2(data)
+
+def captcha_get():
     data = ''
 
-    if custom(conn)[2] == 0:
+    if custom()[2] == 0:
         curs.execute('select data from other where name = "recaptcha"')
         recaptcha = curs.fetchall()
         if recaptcha and recaptcha[0][0] != '':
@@ -37,11 +48,9 @@ def captcha_get(conn):
 
     return data
 
-def captcha_post(test, conn, num = 1):
-    curs = conn.cursor()
-
+def captcha_post(test, num = 1):
     if num == 1:
-        if custom(conn)[2] == 0 and captcha_get(conn) != '':
+        if custom()[2] == 0 and captcha_get() != '':
             curs.execute('select data from other where name = "sec_re"')
             sec_re = curs.fetchall()
             if sec_re and sec_re[0][0] != '':
@@ -61,24 +70,64 @@ def captcha_post(test, conn, num = 1):
     else:
         pass
 
-def ip_warring(conn):
-    curs = conn.cursor()
+def load_lang(data):
+    global lang
+
+    try:
+        if lang:
+            pass
+    except:
+        curs.execute("select data from other where name = 'language'")
+        rep_data = curs.fetchall()
 
-    if custom(conn)[2] == 0:    
+        json_data = open(os.path.join('language', rep_data[0][0] + '.json'), 'rt', encoding='utf-8').read()
+        lang = json.loads(json_data)
+
+    if data == 'please_all':
+        return lang
+    else:
+        if data in lang:
+            return lang[data]
+        else:
+            return else_lang[data]
+
+def edit_help_button():
+    # https://stackoverflow.com/questions/11076975/insert-text-into-textarea-at-cursor-position-javascript
+    '''<script>
+                function insertAtCursor(myField, myValue) {
+                    if (document.selection) { 
+                        document.getElementById(myField).focus();
+                        sel = document.selection.createRange(); 
+                        sel.text = myValue; 
+                    } else if (document.getElementById(myField).selectionStart || document.getElementById(myField).selectionStart == '0') { 
+                        var startPos = document.getElementById(myField).selectionStart; 
+                        var endPos = document.getElementById(myField).selectionEnd; 
+                        document.getElementById(myField).value = document.getElementById(myField).value.substring(0, startPos) + myValue + document.getElementById(myField).value.substring(endPos, document.getElementById(myField).value.length); 
+                    } else { 
+                        document.getElementById(myField).value += myValue;
+                    }
+                }
+            </script>
+        '''
+
+    '<a href="javascript:void(0);" onclick="insertAtCursor(\'content\', \'[[]]\');">(링크)</a> <a href="javascript:void(0);" onclick="insertAtCursor(\'content\', \'[macro()]\');">(매크로)</a> <a href="javascript:void(0);" onclick="insertAtCursor(\'content\', \'{{{#! }}}\');">(중괄호)</a><hr>'
+
+    return ['', '']
+
+def ip_warring():
+    if custom()[2] == 0:    
         curs.execute('select data from other where name = "no_login_warring"')
         data = curs.fetchall()
         if data and data[0][0] != '':
             text_data = '<span>' + data[0][0] + '</span><hr>'
         else:
-            text_data = '<span>비 로그인 상태입니다. 비 로그인으로 진행 시 아이피가 기록됩니다.</span><hr>'
+            text_data = '<span>' + load_lang('no_login_warring') + '</span><hr>'
     else:
         text_data = ''
 
     return text_data
 
-def skin_check(conn):
-    curs = conn.cursor()
-
+def skin_check():
     skin = './views/acme/'
     
     try:
@@ -103,20 +152,18 @@ def next_fix(link, num, page, end = 50):
 
     if num == 1:
         if len(page) == end:
-            list_data += '<hr><a href="' + link + str(num + 1) + '">(이후)</a>'
+            list_data += '<hr><a href="' + link + str(num + 1) + '">(' + load_lang('next') + ')</a>'
     elif len(page) != end:
-        list_data += '<hr><a href="' + link + str(num - 1) + '">(이전)</a>'
+        list_data += '<hr><a href="' + link + str(num - 1) + '">(' + load_lang('previous') + ')</a>'
     else:
-        list_data += '<hr><a href="' + link + str(num - 1) + '">(이전)</a> <a href="' + link + str(num + 1) + '">(이후)</a>'
+        list_data += '<hr><a href="' + link + str(num - 1) + '">(' + load_lang('previous') + ')</a> <a href="' + link + str(num + 1) + '">(' + load_lang('next') + ')</a>'
 
     return list_data
 
 def other2(origin):
-    return origin + ['제거 되었음. 스킨 업데이트 필요함.']    
-
-def wiki_set(conn, num):
-    curs = conn.cursor()
+    return origin + ['Deleted', load_lang('please_all')]
 
+def wiki_set(num):
     if num == 1:
         data_list = []
 
@@ -183,11 +230,9 @@ def diff(seqm):
             
     return ''.join(output)
            
-def admin_check(conn, num, what):
+def admin_check(num, what):
     ip = ip_check() 
 
-    curs = conn.cursor()
-
     curs.execute("select acl from user where id = ?", [ip])
     user = curs.fetchall()
     if user:
@@ -224,18 +269,17 @@ def admin_check(conn, num, what):
                 else:
                     break
 
-def ip_pas(conn, raw_ip):
-    curs = conn.cursor()
+def ip_pas(raw_ip):
     hide = 0
 
     if re.search("(\.|:)", raw_ip):
-        if not re.search("^도구:", raw_ip):    
+        if not re.search("^" + load_lang('tool') + ":", raw_ip):    
             curs.execute("select data from other where name = 'ip_view'")
             data = curs.fetchall()
             if data and data[0][0] != '':
                 ip = '<span style="font-size: 75%;">' + hashlib.md5(bytes(raw_ip, 'utf-8')).hexdigest() + '</span>'
 
-                if not admin_check(conn, 'ban', None):
+                if not admin_check('ban', None):
                     hide = 1
             else:
                 ip = raw_ip
@@ -243,20 +287,18 @@ def ip_pas(conn, raw_ip):
             ip = raw_ip
             hide = 1
     else:
-        curs.execute("select title from data where title = ?", ['사용자:' + raw_ip])
+        curs.execute("select title from data where title = ?", ['' + load_lang('user') + ':' + raw_ip])
         if curs.fetchall():
-            ip = '<a href="/w/' + url_pas('사용자:' + raw_ip) + '">' + raw_ip + '</a>'
+            ip = '<a href="/w/' + url_pas('' + load_lang('user') + ':' + raw_ip) + '">' + raw_ip + '</a>'
         else:
-            ip = '<a id="not_thing" href="/w/' + url_pas('사용자:' + raw_ip) + '">' + raw_ip + '</a>'
+            ip = '<a id="not_thing" href="/w/' + url_pas('' + load_lang('user') + ':' + raw_ip) + '">' + raw_ip + '</a>'
          
     if hide == 0:
-        ip += ' <a href="/record/' + url_pas(raw_ip) + '">(기록)</a>'
+        ip += ' <a href="/record/' + url_pas(raw_ip) + '">(' + load_lang('record') + ')</a>'
 
     return ip
 
-def custom(conn):
-    curs = conn.cursor()
-
+def custom():
     if 'MyMaiToNight' in session:
         user_head = session['MyMaiToNight']
     else:
@@ -284,26 +326,24 @@ def custom(conn):
     if user_icon != 0:
         user_name = ip_check()
     else:
-        user_name = '사용자'
+        user_name = '' + load_lang('user') + ''
 
     return ['', '', user_icon, user_head, email, user_name]
 
-def acl_check(conn, name):
-    curs = conn.cursor()
-
+def acl_check(name):
     ip = ip_check()
 
-    if ban_check(conn) == 1:
+    if ban_check() == 1:
         return 1
 
-    acl_c = re.search("^사용자:([^/]*)", name)
+    acl_c = re.search("^" + load_lang('user') + ":([^/]*)", name)
     if acl_c:
         acl_n = acl_c.groups()
 
-        if admin_check(conn, 5, None) == 1:
+        if admin_check(5, None) == 1:
             return 0
 
-        curs.execute("select dec from acl where title = ?", ['사용자:' + acl_n[0]])
+        curs.execute("select dec from acl where title = ?", ['' + load_lang('user') + ':' + acl_n[0]])
         acl_data = curs.fetchall()
         if acl_data:
             if acl_data[0][0] == 'all':
@@ -320,8 +360,8 @@ def acl_check(conn, name):
         else:
             return 1
 
-    file_c = re.search("^파일:(.*)", name)
-    if file_c and admin_check(conn, 5, 'edit (' + name + ')') != 1:
+    file_c = re.search("^" + load_lang('file') + ":(.*)", name)
+    if file_c and admin_check(5, 'edit (' + name + ')') != 1:
         return 1
 
     curs.execute("select acl from user where id = ?", [ip])
@@ -338,7 +378,7 @@ def acl_check(conn, name):
             if not user_data:
                 return 1
 
-            if not admin_check(conn, 5, 'edit (' + name + ')') == 1:
+            if not admin_check(5, 'edit (' + name + ')') == 1:
                 return 1
 
     curs.execute('select data from other where name = "edit"')
@@ -352,23 +392,21 @@ def acl_check(conn, name):
             if not user_data:
                 return 1
 
-            if not admin_check(conn, 5, None) == 1:
+            if not admin_check(5, None) == 1:
                 return 1
 
     return 0
 
-def ban_check(conn):
+def ban_check():
     ip = ip_check()
 
-    curs = conn.cursor()
-
     band = re.search("^([0-9]{1,3}\.[0-9]{1,3})", ip)
     if band:
-        band_it = band.groups()
+        band_it = band.groups()[0]
     else:
-        band_it = ['Not']
+        band_it = 'Not'
         
-    curs.execute("select block from ban where block = ? and band = 'O'", [band_it[0]])
+    curs.execute("select block from ban where block = ?", [band_it])
     band_d = curs.fetchall()
     
     curs.execute("select block from ban where block = ?", [ip])
@@ -378,12 +416,10 @@ def ban_check(conn):
     
     return 0
         
-def topic_check(conn, name, sub):
+def topic_check(name, sub):
     ip = ip_check()
 
-    curs = conn.cursor()
-
-    if ban_check(conn) == 1:
+    if ban_check() == 1:
         return 1
         
     curs.execute("select acl from user where id = ?", [ip])
@@ -400,19 +436,17 @@ def topic_check(conn, name, sub):
             if not user_data:
                 return 1
 
-            if not admin_check(conn, 3, 'topic (' + name + ')') == 1:
+            if not admin_check(3, 'topic (' + name + ')') == 1:
                 return 1
         
     curs.execute("select title from stop where title = ? and sub = ?", [name, sub])
     if curs.fetchall():
-        if not admin_check(conn, 3, 'topic (' + name + ')') == 1:
+        if not admin_check(3, 'topic (' + name + ')') == 1:
             return 1
 
     return 0
 
-def ban_insert(conn, name, end, why, login, blocker):
-    curs = conn.cursor()
-
+def ban_insert(name, end, why, login, blocker):
     time = get_time()
 
     if re.search("^([0-9]{1,3}\.[0-9]{1,3})$", name):
@@ -422,7 +456,7 @@ def ban_insert(conn, name, end, why, login, blocker):
 
     curs.execute("select block from ban where block = ?", [name])
     if curs.fetchall():
-        curs.execute("insert into rb (block, end, today, blocker, why, band) values (?, ?, ?, ?, ?, ?)", [name, '해제', time, blocker, '', band])
+        curs.execute("insert into rb (block, end, today, blocker, why, band) values (?, ?, ?, ?, ?, ?)", [name, '' + load_lang('release') + '', time, blocker, '', band])
         curs.execute("delete from ban where block = ?", [name])
     else:
         if login != '':
@@ -438,24 +472,20 @@ def ban_insert(conn, name, end, why, login, blocker):
     
     conn.commit()
 
-def rd_plus(conn, title, sub, date):
-    curs = conn.cursor()
-
+def rd_plus(title, sub, date):
     curs.execute("select title from rd where title = ? and sub = ?", [title, sub])
     if curs.fetchall():
         curs.execute("update rd set date = ? where title = ? and sub = ?", [date, title, sub])
     else:
         curs.execute("insert into rd (title, sub, date) values (?, ?, ?)", [title, sub, date])
 
-def history_plus(conn, title, data, date, ip, send, leng):
-    curs = conn.cursor()
-
+def history_plus(title, data, date, ip, send, leng):
     curs.execute("select id from history where title = ? order by id + 0 desc limit 1", [title])
     id_data = curs.fetchall()
     if id_data:
         curs.execute("insert into history (id, title, data, date, ip, send, leng) values (?, ?, ?, ?, ?, ?, ?)", [str(int(id_data[0][0]) + 1), title, data, date, ip, send, leng])
     else:
-        curs.execute("insert into history (id, title, data, date, ip, send, leng) values ('1', ?, ?, ?, ?, ?, ?)", [title, data, date, ip, send + ' (새 문서)', leng])
+        curs.execute("insert into history (id, title, data, date, ip, send, leng) values ('1', ?, ?, ?, ?, ?, ?)", [title, data, date, ip, send + ' (' + load_lang('new') + ' ' + load_lang('document') + ')', leng])
 
 def leng_check(first, second):
     if first < second:
@@ -470,25 +500,23 @@ def leng_check(first, second):
 def redirect(data):
     return '<meta http-equiv="refresh" content="0; url=' + data + '">'
 
-def re_error(conn, data):
-    curs = conn.cursor()
-
+def re_error(data):
     if data == '/ban':
         ip = ip_check()
 
-        end = '<li>사유 : 권한이 맞지 않는 상태 입니다.</li>'
+        end = '<li>Why : 권한이 맞지 않는 상태 입니다.</li>'
 
-        if ban_check(conn) == 1:
+        if ban_check() == 1:
             curs.execute("select end, why from ban where block = ?", [ip])
             end_data = curs.fetchall()
             if not end_data:
                 match = re.search("^([0-9]{1,3}\.[0-9]{1,3})", ip)
                 if match:
-                    curs.execute("select end, why from ban where block = ? and band = 'O'", [m.groups()[0]])
+                    curs.execute("select end, why from ban where block = ?", [match.groups()[0]])
                     end_data = curs.fetchall()
             
             if end_data:
-                end = '<li>상태 : '
+                end = '<li>Info : '
 
                 if end_data[0][0]:
                     now = int(re.sub('(\-| |:)', '', get_time()))
@@ -498,20 +526,20 @@ def re_error(conn, data):
                         curs.execute("delete from ban where block = ?", [ip])
                         conn.commit()
 
-                        end += '차단이 풀렸습니다. 다시 해보세요.'
+                        end += 'Re Try.'
                     else:
-                        end += '차단 중 : ' + end_data[0][0]
+                        end += 'Ban : ' + end_data[0][0]
                 else:
-                    end += '무기한 차단 상태 입니다.'
+                    end += 'Ban : No End'
                 
                 end += '</li>'
 
                 if end_data[0][1] != '':
-                    end += '<li>사유 : ' + end_data[0][1] + '</li>'
+                    end += '<li>Why : ' + end_data[0][1] + '</li>'
 
-        return html_minify(render_template(skin_check(conn), 
-            imp = ['권한 오류', wiki_set(conn, 1), custom(conn), other2([0, 0])],
-            data = '<h2>권한 상태</h2><ul>' + end + '</ul>',
+        return html_minify(render_template(skin_check(), 
+            imp = ['Authority Error', wiki_set(1), custom(), other2([0, 0])],
+            data = '<h2>Info</h2><ul>' + end + '</ul>',
             menu = 0
         ))
 
@@ -519,76 +547,76 @@ def re_error(conn, data):
     if error_data:
         num = int(error_data.groups()[0])
         if num == 1:
-            title = '권한 오류'
+            title = 'Authority Error'
             data = '비 로그인 상태 입니다.'
         elif num == 2:
-            title = '권한 오류'
+            title = 'Authority Error'
             data = '이 계정이 없습니다.'
         elif num == 3:
-            title = '권한 오류'
+            title = 'Authority Error'
             data = '권한이 모자랍니다.'
         elif num == 4:
-            title = '권한 오류'
+            title = 'Authority Error'
             data = '관리자는 차단, 검사 할 수 없습니다.'
         elif num == 5:
-            title = '사용자 오류'
+            title = 'User Error'
             data = '그런 계정이 없습니다.'
         elif num == 6:
-            title = '가입 오류'
+            title = 'Register Error'
             data = '동일한 아이디의 사용자가 있습니다.'
         elif num == 7:
-            title = '가입 오류'
+            title = 'Register Error'
             data = '아이디는 20글자보다 짧아야 합니다.'
         elif num == 8:
-            title = '가입 오류'
+            title = 'Register Error'
             data = '아이디에는 한글과 알파벳과 공백만 허용 됩니다.'
         elif num == 9:
-            title = '파일 올리기 오류'
+            title = 'Upload Error'
             data = '파일이 없습니다.'
         elif num == 10:
-            title = '변경 오류'
+            title = 'PassWord Error'
             data = '비밀번호가 다릅니다.'
         elif num == 11:
-            title = '로그인 오류'
+            title = 'Login Error'
             data = '이미 로그인 되어 있습니다.'
         elif num == 13:
-            title = '리캡차 오류'
+            title = 'reCAPTCHA Error'
             data = '리캡차를 통과하세요.'
         elif num == 14:
-            title = '파일 올리기 오류'
+            title = 'Upload Error'
             data = 'jpg, gif, jpeg, png, webp만 가능 합니다.'
         elif num == 15:
-            title = '편집 오류'
+            title = 'Edit Error'
             data = '편집 기록은 500자를 넘을 수 없습니다.'
         elif num == 16:
-            title = '파일 올리기 오류'
+            title = 'Upload Error'
             data = '동일한 이름의 파일이 있습니다.'
         elif num == 17:
-            title = '파일 올리기 오류'
-            data = '파일 용량은 ' + wiki_set(conn, 3) + 'MB를 넘길 수 없습니다.'
+            title = 'Upload Error'
+            data = '파일 용량은 ' + wiki_set(3) + 'MB를 넘길 수 없습니다.'
         elif num == 18:
-            title = '편집 오류'
+            title = 'Edit Error'
             data = '내용이 원래 문서와 동일 합니다.'
         elif num == 19:
-            title = '이동 오류'
+            title = 'Move Error'
             data = '이동 하려는 곳에 문서가 이미 있습니다.'
         elif num == 20:
-            title = '비밀번호 오류'
+            title = 'PassWord Error'
             data = '재 확인이랑 비밀번호가 다릅니다.'
         elif num == 21:
-            title = '편집 오류'
+            title = 'Edit Error'
             data = '편집 필터에 의해 검열 되었습니다.'
         elif num == 22:
-            title = '파일 올리기 오류'
+            title = 'Upload Error'
             data = '파일 이름은 알파벳, 한글, 띄어쓰기, 언더바, 빼기표만 허용 됩니다.'
         else:
-            title = '정체 불명의 오류'
+            title = 'Error'
             data = '???'
 
         if title:
-            return html_minify(render_template(skin_check(conn), 
-                imp = [title, wiki_set(conn, 1), custom(conn), other2([0, 0])],
-                data = '<h2>오류 발생</h2><ul><li>' + data + '</li></ul>',
+            return html_minify(render_template(skin_check(), 
+                imp = [title, wiki_set(1), custom(), other2([0, 0])],
+                data = '<h2>Error</h2><ul><li>' + data + '</li></ul>',
                 menu = 0
             ))
         else:

+ 38 - 6
language/en-US.json

@@ -2,13 +2,14 @@
     "edit" : "Edit",
     "history" : "History",
     "delete" : "Delete",
-    "bulk_delete" : "Bulk delete",
-    "edit_filter" : "Edit filtering",
+    "bulk_delete" : "Bulk Delete",
+    "edit_filter" : "Edit Filtering",
     "move" : "Move",
     "hide" : "Hide",
     "list" : "List",
     "revert" : "Undo",
-    "version" : "Version",
+    "version" : " Ver",
+    "new" : "New",
     "document" : "Documents",
     "all" : "Everything",
     "ban" : "Ban",
@@ -17,10 +18,38 @@
     "other" : "Others",
     "tool" : "Tools",
     "plus" : "Add",
+    "open" : "Open",
+    "search" : "Search",
+    "need" : "Needful",
+    "upload" : "File Upload",
+    "record" : "Record",
+    "name" : "Name",
+    "license" : "License",
+    "interwiki" : "Inter Wiki",
+    "update" : "Update",
+    "setting" : "Setting",
+    "create" : "Create",
+    "editor" : "Editor",
+    "hour" : "Hour",
+    "time" : "Time",
+    "close" : "Close",
+    "stop" : "Stop",
+    "restart" : "Restart",
+    "agreement" : "Agreement",
+    "backlink" : "Back Link",
+    "why" : "Why",
+    "random" : "Random",
+    "authority" : "Authority",
+    "file" : "File",
+    "change" : "Change",
+    "compare" : "Compare",
+    "count" : "Count",
+    "check" : "Check",
     "user" : "User",
     "alarm" : "Alarm",
-    "watchlist" : "Watching list",
-    "my_info" : "About me",
+    "preview" : "Preview",
+    "watchlist" : "Watching List",
+    "my_info" : "About Me",
     "recent" : "Recently",
     "recent_changes" : "Recently changed",
     "discussion" : "Discussions",
@@ -35,8 +64,11 @@
     "normal" : "Normal",
     "subscriber" : "User",
     "admin" : "Admin",
+    "next" : "Next",
+    "previous" : "Previous",
     "owner" : "Owner",
     "admin_group" : "MOD group",
     "user_css_warring" : "User's CSS will deleted if you close the browser or when you are editting as guest",
-    "http_warring" : "Warning : If you are not on HTTPS connection, your information can be leaked. We won't response to that."
+    "http_warring" : "Warning : If you are not on HTTPS connection, your information can be leaked. We won't response to that.",
+    "no_login_warring" : "Non-login status. IP is logged when working with non-login."
 }

+ 10 - 0
language/ko-KR.json

@@ -17,26 +17,36 @@
     "other" : "기타",
     "tool" : "도구",
     "plus" : "추가",
+    "open" : "열린",
+    "search" : "검색",
+
     "user" : "사용자",
     "alarm" : "알림",
     "watchlist" : "주시 문서",
     "my_info" : "내 정보",
+    
     "recent" : "최근",
     "recent_changes" : "최근 변경",
+    
     "discussion" : "토론",
+    
     "login" : "로그인",
     "logout" : "로그아웃",
     "register" : "회원가입",
     "no_alarm" : "알림이 없습니다.",
+    
     "able" : "가능",
+    
     "year" : "년",
     "month" : "월",
     "day" : "일",
+    
     "normal" : "일반",
     "subscriber" : "가입자",
     "admin" : "관리자",
     "owner" : "소유자",
     "admin_group" : "관리 그룹",
+
     "user_css_warring" : "비 로그인의 경우에는 사용자 CSS가 로그인하거나 브라우저 닫으면 날아갑니다.",
     "http_warring" : "주의 : 만약 HTTPS 연결이 아닌 경우 데이터가 유출될 가능성이 있습니다. 이에 대해 책임지지 않습니다."
 }

+ 10 - 4
mark.py

@@ -7,6 +7,13 @@ from urllib import parse
 import time
 import threading
 
+def load_conn2(data):
+    global conn
+    global curs
+
+    conn = data
+    curs = conn.cursor()
+
 def send_parser(data):
     data = html.escape(data)
     
@@ -17,17 +24,16 @@ def send_parser(data):
     
     return data
     
-def plusing(conn, name, link, backtype):
-    curs = conn.cursor()
+def plusing(name, link, backtype):
     curs.execute("select title from back where title = ? and link = ? and type = ?", [link, name, backtype])
     if not curs.fetchall():
         curs.execute("insert into back (title, link, type) values (?, ?, ?)", [link, name, backtype])
 
-def namumark(conn, title, data, num):
+def namumark(title, data, num):
     data = start(conn, data, title)
     if num == 1:        
         for back_data in data[2]:
-            thread_start = threading.Thread(target = plusing, args = [conn, back_data[0], back_data[1], back_data[2]])
+            thread_start = threading.Thread(target = plusing, args = [back_data[0], back_data[1], back_data[2]])
             thread_start.start()
             thread_start.join()
 

+ 23 - 21
set_mark/start.py

@@ -184,23 +184,25 @@ def start(conn, data, title):
     # 초기 설정
     data = '\n' + data + '\n'
     backlink = []
-    plus_data = '''<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css">
-                    <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
-                    <script>
-                        hljs.initHighlightingOnLoad(); 
-                        function folding(num) { 
-                            var fol = document.getElementById('folding_' + num); 
-                            if(fol.style.display == 'inline-block' || fol.style.display == 'block') { 
-                                fol.style.display = 'none';
-                            } else {
-                                if(num % 2 == 0) { 
-                                    fol.style.display = 'block'; 
-                                } else { 
-                                    fol.style.display = 'inline-block'; 
-                                } 
+    plus_data = '''
+                <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css">
+                <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
+                <script>
+                    hljs.initHighlightingOnLoad(); 
+                    function folding(num) { 
+                        var fol = document.getElementById('folding_' + num); 
+                        if(fol.style.display == 'inline-block' || fol.style.display == 'block') { 
+                            fol.style.display = 'none';
+                        } else {
+                            if(num % 2 == 0) { 
+                                fol.style.display = 'block'; 
+                            } else { 
+                                fol.style.display = 'inline-block'; 
                             } 
-                        }
-                    </script>'''
+                        } 
+                    }
+                </script>
+                '''
     end_data= []
     
     # XSS 이스케이프
@@ -368,7 +370,7 @@ def start(conn, data, title):
                                                 else:
                                                     middle_data_2 = ['']
 
-                                                middle_list += ['div']
+                                                middle_list += ['div_end']
                                                 
                                                 data = re.sub('{{{#!wiki(?: style=(?:&quot;|&#x27;)((?:(?!&quot;|&#x27;).)*)(?:&quot;|&#x27;))?\n?', '<div id="wiki_div" style="' + str(middle_data_2[0]) + '">', data, 1)
                                             else:
@@ -400,7 +402,7 @@ def start(conn, data, title):
                                                             else:
                                                                 folding_data = ['Test']
                                                             
-                                                            data = re.sub('{{{#!folding ?((?:(?!\n).)*)\n?', '<div>' + str(folding_data[0]) + ' <div style="display: inline-block;"><a href="javascript:void(0);" onclick="folding(' + str(fol_num) + ');">[작동]</a></div_end><div id="folding_' + str(fol_num) + '" style="display: none;">', data, 1)
+                                                            data = re.sub('{{{#!folding ?((?:(?!\n).)*)\n?', '<div>' + str(folding_data[0]) + ' <div style="display: inline-block;"><a href="javascript:void(0);" onclick="folding(' + str(fol_num) + ');">[작동]</a></div_end><div id="folding_' + str(fol_num) + '" style="display: none;"><div id="wiki_div" style="">', data, 1)
                                                             
                                                             fol_num += 1
                                                         else:
@@ -429,7 +431,7 @@ def start(conn, data, title):
                             middle_number -= 1
                             
                         if middle_list[middle_number] == '2div':
-                            data = re.sub('(?:{{{((?:(?! |{{{|}}}).)*) ?|(}}}))', '</div_end></div_end>', data, 1)
+                            data = re.sub('(?:{{{((?:(?! |{{{|}}}).)*) ?|(}}}))', '</div_end></div_end></div_end>', data, 1)
                         elif middle_list[middle_number] == 'pre':
                             data = re.sub('(?:{{{((?:(?! |{{{|}}}).)*) ?|(}}}))', '</code></pre>', data, 1)
                         else:
@@ -471,7 +473,7 @@ def start(conn, data, title):
            
     # 이중 표 처리
     while 1:
-        wiki_table_data = re.search('<div id="wiki_div" ((?:(?!>).)+)>((?:(?!<div id="wiki_div"|<\/div>).\n*)+)<\/div>', data)
+        wiki_table_data = re.search('<div id="wiki_div" ((?:(?!>).)+)>((?:(?!<div id="wiki_div"|<\/div_end>).\n*)+)<\/div_end>', data)
         if wiki_table_data:
             wiki_table_data = wiki_table_data.groups()
             if re.search('\|\|', wiki_table_data[1]):
@@ -479,7 +481,7 @@ def start(conn, data, title):
             else:
                 end_parser = wiki_table_data[1]
 
-            data = re.sub('<div id="wiki_div" ((?:(?!>).)+)>((?:(?!<div id="wiki_div"|<\/div>).\n*)+)<\/div>', '<div ' + wiki_table_data[0] + '>' + end_parser + '</div_end>', data, 1)
+            data = re.sub('<div id="wiki_div" ((?:(?!>).)+)>((?:(?!<div id="wiki_div"|<\/div_end>).\n*)+)<\/div_end>', '<div ' + wiki_table_data[0] + '>' + end_parser + '</div>', data, 1)
         else:
             break
             

+ 8 - 24
views/acme/css/style-responsive.css

@@ -373,11 +373,13 @@ td {
 }
 
 s, strike, del {
-    color:gray;
+    color: gray;
 }
 
 s:hover, strike:hover, del:hover {
-    color:#666;background-color:#eee;text-decoration:none;
+    color: #666;
+    background-color: #eee;
+    text-decoration: none;
 }
 
 .scroll-buttons a:link, .scroll-buttons a:visited {
@@ -459,22 +461,12 @@ div.scroll-buttons a {
     background-color: #f3c2c2;
 }
 
-#toron_color {
-    background-color: #d5d5d5;
+#toron_color_blue {
+    background: #c1ebff;
 }
 
-.popup {
-    position: fixed;
-    padding: 10px;
-    background: #f5f5f5;
-    width: 100%;
-    bottom: 0px;
-    left: 0px;
-    text-align: center;
-    box-shadow: 0 -1px 8px 0 rgba(0,0,0,0.35);
-    z-index: 100000;
-    max-height: 30%;
-    overflow-y: scroll;
+#toron_color {
+    background-color: #d5d5d5;
 }
 
 @media (max-width: 768px) {
@@ -503,10 +495,6 @@ textarea {
     font-family: FontAwesome;
 }
 
-#open {
-    color: yellow;
-}
-
 h1, h2, h3, h4, h5, h6 {
     margin-bottom: 10px;
     margin-top: 10px;
@@ -519,10 +507,6 @@ h1, h2, h3, h4, h5, h6 {
     font-size: 28px;
 }
 
-#toron_color_blue {
-    background: #c1ebff;
-}
-
 footer#footer {
     bottom: 0;
     position: relative;

+ 22 - 13
views/acme/index.html

@@ -38,35 +38,44 @@
                                 <input style="display: inline-block;" class="form-control search" type="search" name="search" placeholder="Search" id="searchInput" autocomplete="off">
                             </form>                
                         </li>
-                        <li>
-                            <a href="/recent_changes">
-                                <i class="fa fa-refresh" aria-hidden="true"></i>
-                                최근 변경
-                            </a>
-                        </li>
-                        <li>
-                            <a href="/recent_discuss">
-                                <i class="fa fa-comment" aria-hidden="true"></i>
-                                최근 토론
+                        <li class="dropdown">
+                            <a class="dropdown-toggle" data-close-others="false" data-delay="0" data-hover="dropdown" data-toggle="dropdown" href="javascript:void(0);">
+                                <i class="fa fa-plus-circle" aria-hidden="true"></i>
+                                {{imp[3][3]['recent']}}
+                                <i class="fa fa-angle-down"></i>
                             </a>
+                            <ul role="menu" class="dropdown-menu">
+                                <li>
+                                    <a href="/recent_changes">
+                                        <i class="fa fa-refresh" aria-hidden="true"></i>
+                                        {{imp[3][3]['change']}}
+                                    </a>
+                                </li>
+                                <li>
+                                    <a href="/recent_discuss">
+                                        <i class="fa fa-comment" aria-hidden="true"></i>
+                                        {{imp[3][3]['discussion']}}
+                                    </a>
+                                </li>
+                            </ul>
                         </li>
                         <li class="dropdown">
                             <a class="dropdown-toggle" data-close-others="false" data-delay="0" data-hover="dropdown" data-toggle="dropdown" href="javascript:void(0);">
                                 <i class="fa fa-plus-circle" aria-hidden="true"></i>
-                                나머지
+                                {{imp[3][3]['other']}}
                                 <i class="fa fa-angle-down"></i>
                             </a>
                             <ul role="menu" class="dropdown-menu">
                                 <li>
                                     <a href="/random">
                                         <i class="fa fa-random" aria-hidden="true"></i>
-                                        무작위
+                                        {{imp[3][3]['random']}}
                                     </a>
                                 </li>
                                 <li>
                                     <a href="/other">
                                         <i class="fa fa-cogs" aria-hidden="true"></i>
-                                        기타
+                                        {{imp[3][3]['tool']}}
                                     </a>
                                 </li>
                             </ul>

Vissa filer visades inte eftersom för många filer har ändrats