فهرست منبع

aa32c3b 커밋으로 롤백, #588 은 issue-588 브랜치에서 계속 수정함

넘쳐나는 버그때문에 일단 분리
hoparkgo9ma 7 سال پیش
والد
کامیت
07d612d2ef
6فایلهای تغییر یافته به همراه7 افزوده شده و 136 حذف شده
  1. 0 1
      .gitignore
  2. 1 63
      app.py
  3. 0 42
      func.py
  4. 6 0
      views/easter_egg.html
  5. 0 18
      views/easter_egg.py
  6. 0 12
      views/main_css/egg.css

+ 0 - 1
.gitignore

@@ -1,7 +1,6 @@
 set.json
 
 set_mark/__pycache__
-views/__pycache__
 /__pycache__
 /app_session
 .vscode

+ 1 - 63
app.py

@@ -14,7 +14,6 @@ import logging
 import random
 
 from func import *
-from views.easter_egg import *
 
 r_ver = 'v3.0.8-master-100'
 c_ver = ''.join(re.findall('[0-9]', r_ver))
@@ -271,11 +270,6 @@ if not adsense_result:
     curs.execute('insert into other (name, data) values ("adsense", "False")')
     curs.execute('insert into other (name, data) values ("adsense_code", "")')
 
-curs.execute('select data from other where name = "easter_egg"')
-sc_egg_result = curs.fetchall()
-if not sc_egg_result:
-    curs.execute('insert into other (name, data) values ("easter_egg", "True")')
-
 ask_this = [[['markup', 'markup'], ['namumark']], [['encryption method', 'encode'], ['sha256', 'sha3', 'bcrypt']]]
 for ask_data in ask_this:
     curs.execute('select data from other where name = ?', [ask_data[0][1]])
@@ -2310,30 +2304,6 @@ def manager(num = 1):
         return easy_minify(flask.render_template(skin_check(), 
             imp = [load_lang('admin') + ' ' + load_lang('tool'), wiki_set(), custom(), other2([0, 0])],
             data =  '''
-                    <script>
-                    function config_easter_egg (target) {
-                        if (target.checked === true) {
-                            console.log('okay')
-                        }
-                        else {
-                            console.log('fucku')
-                        }
-                        
-                        $.ajax({
-                            type: 'POST',
-                            url : '/request/scrambled_eggs',
-                            data : {"config_easter_egg" : "True"},
-                            contentType : 'application/json',
-                            dataType : 'json',
-                            success : function(data) {
-                                console.log(data)
-                            },
-                            error : function(e) {
-                                console.log(e.responseText)
-                            }
-                        })
-                    }
-                    </script>
                     <h2>''' + load_lang('admin') + '''</h2>
                     <ul>
                         <li><a href="/manager/2">''' + load_lang('document') + ''' acl</a></li>
@@ -2348,7 +2318,7 @@ def manager(num = 1):
                         <li><a href="/manager/8">''' + load_lang('admin_group') + ' ' + load_lang('create') + '''</a></li>
                         <li><a href="/setting">''' + load_lang('setting') + ' ' + load_lang('edit') + '''</a></li>
                     </ul>
-                    <h2>''' + load_lang('filter') + '''</h2>
+                    <h3>''' + load_lang('filter') + '''</h3>
                     <ul>
                         <li><a href="/inter_wiki">''' + load_lang('interwiki') + '''</a></li>
                         <li><a href="/html_filter">html ''' + load_lang('filter') + '''</a></li>
@@ -2364,10 +2334,6 @@ def manager(num = 1):
                         <li><a href="/oauth_settings">''' + load_lang('oauth_settings') + '''</a></li>
                         <li><a href="/adsense_settings">''' + load_lang('adsense') + ' ' + load_lang('setting') + '''</a></li>
                     </ul>
-                    <h2>''' + load_lang('other') + '''</h2>
-                    <ul>
-                        <li><label for="enable_easter_egg"><input type="checkbox" id="enable_easter_egg" name="enable_easter_egg" onChange="config_easter_egg(this)">이스터에그 활성화</label</li>
-                    </ul>
                     ''',
             menu = [['other', load_lang('other')]]
         ))
@@ -4749,34 +4715,6 @@ def main_file(data = None):
     else:
         return redirect('/w/' + url_pas(wiki_set(2)))
 
-@app.route('/request/egg')
-def request_egg():
-    return easter_egg[random.randint(0, len(easter_egg) - 1)]
-
-@app.route('/request/scrambled_eggs', methods=['POST'])
-def request_sc_egg():
-    #if admin_check(None, 'update') != 1:
-    #   return '{"request" : "err", "err_code" : "err_authority_not_enough"}'
-
-    #req = flask.request.form
-    #print(req)
-    #config = bool(flask.request.form.getlist('config_easter_egg'))
-
-    #curs.execute('update other set data = ? where name = "easter_egg"', [str(config)])
-    #conn.commit()
-
-    print(flask.request.headers['Content-Type'])
-    if flask.request.headers['Content-Type'] == 'application/json':
-        print(flask.request)
-        #print(flask.request.json())
-        print(flask.request.form.get('config_easter_egg'))
-
-    config = "True"
-    data = {'request' : "success", 'now' : config}
-    return str(data)
-    #else:
-    #    return '{"request" : "err", "err_code" : "err_no_data_required"}'
-
 @app.errorhandler(404)
 def error_404(e):
     return redirect('/w/' + url_pas(wiki_set(2)))

+ 0 - 42
func.py

@@ -395,48 +395,6 @@ def wiki_set(num = 1):
         else:
             data_list += ['']
 
-        curs.execute("select data from other where name = 'easter_egg'")
-        db_data = curs.fetchall()
-        if db_data:
-            data_list[5] += '''
-            <link rel="stylesheet" href="/views/main_css/egg.css">
-            <script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script></head>
-            <script>
-            easter_count = 0;
-
-            let log = document.getElementById('bottom_main');
-            document.onclick = easter;
-
-            function easter(e) {
-                easter_count++;
-                if (easter_count > 3) {
-                    data = get_egg();
-                    console.log(data);
-                    egg_overlay = document.getElementById('egg');
-                    egg.innerHTML = data;
-                    egg.style.display = 'block';
-                }
-            }
-
-            function get_egg(e) {
-                $.ajax({
-                    type: 'GET',
-                    url : '/request/egg',
-                    dataType : 'text',
-                    success : function(e) {
-                        return e.responseText;
-                    },
-                    error : function(e) {
-                        return e.responseText;
-                    }
-                })
-            }
-            </script>
-
-            <div id="egg">
-            </div>
-            '''
-
         return data_list
 
     if num == 2:

+ 6 - 0
views/easter_egg.html

@@ -0,0 +1,6 @@
+<iframe width="560" height="315" src="https://www.youtube.com/embed/O6BJiije6m4" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
+<br>
+<br>
+<div>
+    노라조와 영접하십셔.
+</div>

+ 0 - 18
views/easter_egg.py

@@ -1,18 +0,0 @@
-easter_egg = [
-"""
-<iframe width="560" height="315" src="https://www.youtube.com/embed/O6BJiije6m4" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
-<br>
-<br>
-<div>
-    노라조와 영접하십셔.
-</div>
-""",
-"""
-<iframe width="560" height="315" src="https://www.youtube.com/embed/qnYWeY6aybg?autoplay=1&start=97" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
-<br>
-<br>
-<div>
-    사람들은 알수 있어 누가 착한지 나쁜지
-</div>
-"""
-]

+ 0 - 12
views/main_css/egg.css

@@ -1,12 +0,0 @@
-#egg {
-    position: fixed;
-    display: none;
-    width: 100%;
-    height: 100%;
-    top: 0;
-    left: 0;
-    right: 0;
-    bottom: 0;
-    background-color: rgba(0,0,0,0.5);
-    z-index: 2;
-}