From 160a9dae9580169350d2b31176f7650ca97661e9 Mon Sep 17 00:00:00 2001 From: manetta Date: Sat, 29 Feb 2020 09:44:42 +0100 Subject: [PATCH] sorting the xdex --- start.py | 31 +------- static/css/curves.css | 157 --------------------------------------- static/css/text-scan.css | 44 ----------- templates/test.html | 16 ---- templates/x-dex.html | 2 +- 5 files changed, 5 insertions(+), 245 deletions(-) delete mode 100644 static/css/curves.css delete mode 100644 static/css/text-scan.css delete mode 100644 templates/test.html diff --git a/start.py b/start.py index cc5f347..dff807a 100644 --- a/start.py +++ b/start.py @@ -3,23 +3,11 @@ import sys, os import flask from flask import request, redirect, url_for -from werkzeug.utils import secure_filename from functions import * -from flaskext.markdown import Markdown - -# Upload settings -UPLOAD_FOLDER_TRACES = 'static/traces/' -ALLOWED_EXTENSIONS = {'png', 'jpg', 'jpeg', 'gif'} - # Create the application. APP = flask.Flask(__name__) -APP.config['UPLOAD_FOLDER_TRACES'] = UPLOAD_FOLDER_TRACES - -def allowed_file(filename): - return '.' in filename and \ - filename.rsplit('.', 1)[1].lower() in ALLOWED_EXTENSIONS @APP.route('/', methods=['GET', 'POST']) def index(): @@ -33,12 +21,12 @@ def index(): x = request.args.get('x', '').strip() xdex, lastx = load_db('xdex.json') entries = [x for x in xdex.keys()] - + xs = sorted(xdex) + submit = request.args.get('submit', '').strip() if submit: if submit == 'add': - # if x not in xdex: if x: # new entry xdex[x] = {} @@ -50,6 +38,7 @@ def index(): xdex[x]['comment'] = comment xdex[x]['status'] = '-' write_db('xdex.json', xdex) + xs.append(x) else: # editing entry x = submit @@ -62,19 +51,7 @@ def index(): write_db('xdex.json', xdex) return redirect(url_for('index')) - return flask.render_template('x-dex.html', xdex=xdex) - - -# @APP.route('/test', methods=['GET', 'POST']) -# def test(): - -# if request.args.get('submit', ''): -# form = request.args.get('submit', '').strip() -# text = request.args.get('text', '').strip() -# else: -# form = 'none' -# text = 'none' -# return flask.render_template('test.html', form=form, text=text) + return flask.render_template('x-dex.html', xdex=xdex, xs=xs) if __name__ == '__main__': APP.debug=True diff --git a/static/css/curves.css b/static/css/curves.css deleted file mode 100644 index 5e8f4e3..0000000 --- a/static/css/curves.css +++ /dev/null @@ -1,157 +0,0 @@ -svg { - touch-action: none; - display: block; - clear: both; - /*border:1px dotted magenta;*/ - /*margin-top:-1px;*/ -} -.handle { - fill: none; - pointer-events: all; -} -/* including #handles is a hack to increase specificity */ -#handles .handle:hover { - /*fill: #f00;*/ - fill: black; -} -svg:hover .handle { - /*fill: #800;*/ - fill: black; -} -svg:hover .selected .handle { - /*fill: #fcb;*/ - fill: black; - stroke: black; -} -#handles line.target { - stroke: black; -} -#handles circle.target { - fill: none; - stroke: black; - stroke-opacity: 0.15; - stroke-width: 10; -} -svg:hover #handles line.tan { - /*stroke: #00f;*/ - fill: black; - stroke-width: 1; -} -svg:hover #handles .tanhandle { - /*fill: white;*/ - fill: black; - /*stroke: #00f;*/ -} -svg:hover #handles .tanhandle.computed { - /*fill: rgba(255, 255, 255, 0.3);*/ - fill: black; - /*stroke: rgba(0, 0, 255, 0.3);*/ -} -svg:hover #handles .tanhandle:hover { - /*fill: #fcb;*/ - fill: black; -} -#grid line { - stroke: #ddf; -} - -#nav { - position: relative; - font-size: 12px; - /* float: left; */ - height: 25px; - z-index: 10; - top: 0px; - left: 0; - padding: 0; - margin: 0; - width: 100%; - user-select: none; -} -#nav li { - float: left; - position: relative; - list-style: none; -} -#nav li a { - display: block; - padding: 5px 10px; - color: #000; - text-decoration: none; - cursor: default; -} -#nav a:hover:not(.inactive) { - background: #cdf; -} -#nav li ul { - position: absolute; - display: none; - background: #fff; - box-shadow: 2px 2px 5px 0 rgba(0, 0, 0, 0.3); - /*float: none;*/ -} -#nav li ul a { - width: 10em; - width: -moz-max-content; - width: max-content; - padding: 4px 10px; - cursor: default; -} -#nav li ul a.inactive { - color: #888; -} -#nav li:hover ul { - display: block; - left: 0; - margin: 0; - padding: 0; - border-width: 1px; - border-style: solid; - border-color: #000; -} -#nav li:hover ul.off { - display: none; -} - -.modal { - display: none; - position: fixed; - z-index: 1; - left: 0; - top: 0; - width: 100%; - height: 100%; - overflow: auto; - background-color: rgba(255, 255, 255, 0.3); -} - -.modal-content { - margin: 15% auto; - padding: 20px; - border: 1px solid #888; - width: 60%; - background-color: rgba(255, 255, 255, 0.8); -} -.modal-content pre { - white-space: pre-wrap; -} -.modal-content textarea { - width: 100%; -} -.modal-content button { - font-size: 14px; -} - -.close { - float: right; - font-size: 28px; - user-select: none; -} - -.close:hover, .close.focus { - cursor: pointer; -} - -.invisible { - opacity: 0; -} \ No newline at end of file diff --git a/static/css/text-scan.css b/static/css/text-scan.css deleted file mode 100644 index 0e768b2..0000000 --- a/static/css/text-scan.css +++ /dev/null @@ -1,44 +0,0 @@ -/* --------- */ -/* text-scan */ -#wrapper{ - width: calc(100% - 0em); -} -div#crossings, div#sentences, div#ADJ, div#PRE{ - position: relative; - display: inline-block; - width: calc(50% - 1.5em); - top:0; - left: 0; - margin:0 1em 2em 0; - padding:0; - vertical-align: top; - font-size: 90%; -} -div#crossings{ - float: right; -} -div#txtfiles{ - position: absolute; - width:200px; - top:0; - right: 40px; -} -div.sentence{ - margin:-0.5em 0 0; -} -strong.query{ - display: inline; - width: 100%; - height: 12em; - margin:10em -6em -10.5em -6em; - padding: 10em 6em; - text-align: center; -} -small, sup{ - font-family: monospace; - font-size: 10pt; -} -div.sentence small{ - display: block; - margin-bottom: 5em; -} \ No newline at end of file diff --git a/templates/test.html b/templates/test.html deleted file mode 100644 index 3d5ad74..0000000 --- a/templates/test.html +++ /dev/null @@ -1,16 +0,0 @@ -{% extends "base.html" %} - -{% block page %} -

test

-
-
- -
-
-
-
- -
-
-{{ form }}: {{ text }} -{% endblock %} diff --git a/templates/x-dex.html b/templates/x-dex.html index 80f70e7..2bea0ac 100644 --- a/templates/x-dex.html +++ b/templates/x-dex.html @@ -22,7 +22,7 @@ update - {% for x in xdex.keys() %} + {% for x in xs %}