Code Monkey home page Code Monkey logo

peernote's Introduction

Peernote

Peernote in Python using Flask.

Dependencies

Sass/Scss

pip install -r requirements.txt

Migrations

To create a migration python migrate.py db migrate. To run all migrations python migrate.py db upgrade.

peernote's People

Contributors

al63 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

peernote's Issues

forms: submit error behavior

when a form is submitted that has an error, the page is refreshed with the appropriate error messages. the problem is that the textfields that were valid are emptied.

They should have their contents from before the submit.

scrollbars in scrollbars

On the editor, there's a scrollbar within the essay page and a scrollbar within the editor area. It's confusing and weird. plz fix.

Editor in multiple tabs

If you open two tabs for the same essay, whichever tab is written to last will be saved. This is awkward because lets say on tab1 you write one page, tab2 you write another page for the same essay. you close tab 2. then you accidentally press a key on tab1 and you've just lost that entire second page of your essay.

Basically, the way to fix this, open essays should periodically make an AJAX request for the saved essay content.

Undo commands on superset operations

If you have the text:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec tincidunt enim dui, quis fringilla lorem bibendum non. Ut leo nibh, tristique et vestibulum at, tristique et diam.

and then bold the entire paragraph, and then undo, the resulting text will have no bold.

We store commands on the undo/redo stack as 'bold' operation over this text range, which doesn't provide any data about the state of the region before the bold operation.

editor: random align bug

to reproduce: new doc -> write a few words on like 10 lines. select all. align right

js error:

Object
message: "Failed to execute 'setEnd' on 'Range': The node provided was null."
name: "NotFoundError"
path: "/essays/edit/42"
stack: "Error: Failed to execute 'setEnd' on 'Range': The node provided was null.↵ at Error (native)↵ at Object.$.extend.setCaret (http://localhost:3000/static/js/essays/document.js:332:16)↵ at http://localhost:3000/static/js/essays/editor.js:26:22↵ at HTMLButtonElement. (http://localhost:3000/static/js/errors.js:33:11)↵ at HTMLButtonElement.o.event.dispatch (http://localhost:3000/static/js/include/jquery-2.1.0.min.js:3:6055)↵ at HTMLButtonElement.r.handle (http://localhost:3000/static/js/include/jquery-2.1.0.min.js:3:2830)"
type: "error"
url: "http://localhost:3000/essays/edit/42"
user-agent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.116 Safari/537.36"

Pretty dates

For the essay index and other things, it would be nicer to have more readable dates. See the google drive document index.

Click to focus on empty block breaks when typing

Click to focus on an empty block. Type a character. There'll be a js error.

TypeError: Cannot read property 'startBlock' of null
    at http://localhost:3000/static/js/essays/editor.js:146:21
    at HTMLDivElement.<anonymous> (http://localhost:3000/static/js/errors.js:33:11)
    at HTMLDivElement.o.event.dispatch (http://localhost:3000/static/js/include/jquery-2.1.0.min.js:3:6055)
    at HTMLDivElement.r.handle (http://localhost:3000/static/js/include/jquery-2.1.0.min.js:3:2830)

Email submission doesn't always work on prod

A couple of instances of it happening in the log files:

sqlalchemy.exc.OperationalError: (OperationalError) SSL connection has been closed unexpectedly
 'SELECT email.eid AS email_eid, email.email AS email_email, email.signup_date AS email_signup_date \nFROM ema
il \nWHERE email.email = %(email_1)s \n LIMIT %(param_1)s' {'email_1': u'[email protected]', 'param_1': 1}
[pid: 29094|app: 0|req: 977/3889] 138.16.94.117 () {48 vars in 861 bytes} [Mon Mar  3 19:30:59 2014] POST /ema
il-signup => generated 0 bytes in 17 msecs (HTTP/1.1 500) 0 headers in 0 bytes (0 switches on core 0)
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1836, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1820, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1403, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "./app/blueprints/front/email_signup.py", line 18, in email_signup
    email_db_obj = Email.query.filter_by(email=email).first()
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2327, in first
    ret = list(self[0:1])
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2194, in __getitem__
    return list(res)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2398, in __iter__
    return self._execute_and_instances(context)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2413, in _execute_and_instances
    result = conn.execute(querycontext.statement, self._params)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 717, in execute
    return meth(self, multiparams, params)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/sql/elements.py", line 317, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 814, in _execute_clauseelement
    compiled_sql, distilled_params
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 927, in _execute_context
    context)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1076, in _handle_dbapi_exception
    exc_info
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/compat.py", line 185, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 920, in _execute_context
    context)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 425, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (OperationalError) SSL connection has been closed unexpectedly
 'SELECT email.eid AS email_eid, email.email AS email_email, email.signup_date AS email_signup_date \nFROM email \nWHERE email.email = %(email_1)s \n LIMIT %(param_1)s' {'email_1': u'[email protected]', 'param_1': 1}
[pid: 29096|app: 0|req: 1048/3890] 138.16.94.117 () {48 vars in 861 bytes} [Mon Mar  3 19:31:18 2014] POST /email-signup => generated 0 bytes in 12 msecs (HTTP/1.1 500) 0 headers in 0 bytes (0 switches on core 0)
sqlalchemy.exc.OperationalError: (OperationalError) SSL connection has been closed unexpectedly
 'SELECT email.eid AS email_eid, email.email AS email_email, email.signup_date AS email_signup_date \nFROM ema
il \nWHERE email.email = %(email_1)s \n LIMIT %(param_1)s' {'email_1': u'[email protected]', 'param_1': 1}
[pid: 29094|app: 0|req: 966/3842] 128.148.231.12 () {48 vars in 852 bytes} [Mon Mar  3 19:27:22 2014] POST /em
ail-signup => generated 0 bytes in 18 msecs (HTTP/1.1 500) 0 headers in 0 bytes (0 switches on core 0)
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1836, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1820, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1403, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/compat.py", line 185, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 920, in _execute_context
    context)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 425, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (OperationalError) SSL connection has been closed unexpectedly
 'SELECT email.eid AS email_eid, email.email AS email_email, email.signup_date AS email_signup_date \nFROM ema
il \nWHERE email.email = %(email_1)s \n LIMIT %(param_1)s' {'email_1': u'[email protected]', 'param_1': 1}
[pid: 29094|app: 0|req: 966/3842] 128.148.231.12 () {48 vars in 852 bytes} [Mon Mar  3 19:27:22 2014] POST /em
ail-signup => generated 0 bytes in 18 msecs (HTTP/1.1 500) 0 headers in 0 bytes (0 switches on core 0)
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1836, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1820, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1403, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "./app/blueprints/front/email_signup.py", line 18, in email_signup
    email_db_obj = Email.query.filter_by(email=email).first()
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2327, in first
    ret = list(self[0:1])
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2194, in __getitem__
    return list(res)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2398, in __iter__
    return self._execute_and_instances(context)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2413, in _execute_and_instances
    result = conn.execute(querycontext.statement, self._params)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 717, in execute
    return meth(self, multiparams, params)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/sql/elements.py", line 317, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 814, in _execute_clauseelement
    compiled_sql, distilled_params
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 927, in _execute_context
    context)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1076, in _handle_dbapi_exception
    exc_info
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/compat.py", line 185, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 920, in _execute_context
    context)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 425, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (OperationalError) SSL connection has been closed unexpectedly
 'SELECT email.eid AS email_eid, email.email AS email_email, email.signup_date AS email_signup_date \nFROM email \nWHERE email.email = %(email_1)s \n LIMIT %(param_1)s' {'email_1': u'[email protected]', 'param_1': 1}

editor: next draft in readonly mode

while in readonly mode, don't hide the "next draft" button.

if the user clicks "next draft," just go to the next (existing) draft.

so if the user has 3 drafts and is looking at draft 1, pressing "next draft" will switch the editor to draft 2

this makes more sense than hiding the button and it simplifies the UI

editor: navigating away from peernote, then pressing back button

type something in the editor, navigate away from the page, press back. The stuff that was typed will not be visible. refresh the page. the stuff that was typed is now visible.

this will probably be solved when the issue "editor in multiple tabs" is solved.

editor: linespacing toggle bug

to reproduce: click linespacing button, click essay

note that the selected view of the linespacing button remains, though it should no longer look like it is selected

Printer-friendly page doesn't automatically close in Google Chrome

The printer-friendly page uses the onafterprint event to close the window once the printer dialog box is exited. The onafterprint event exists on Firefox and Internet Explorer but not Chrome. The focus event's interaction with the printer dialog is pretty unpredictable, so I think we need to find some other way to detect when the user is done with the dialog box. It'll probably have to be real hacky.

Scss Compiler does not properly recompile shared/ files

If you change a css rule in a shared/ .scss file, it is not reflected on the page. It seems that when you add a new css rule, it is taken into account. But when you change a css rule, the change does not occur.

Wazzup

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.