Peernote
Peernote in Python using Flask.
Dependencies
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 in Python using Flask.
Home Page: http://peernote.me
Peernote in Python using Flask.
pip install -r requirements.txt
To create a migration python migrate.py db migrate
.
To run all migrations python migrate.py db upgrade
.
they don't show up until you type another non-space character
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.
why jackson. why.
Hitting backspace with a selection doesn't do anything.
i was allowed to change my email from [email protected] to bryce_aebi@brownedu
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.
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.
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.
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"
For the essay index and other things, it would be nicer to have more readable dates. See the google drive document index.
The printer-friendly page needs to be updated now that the document format has changed.
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)
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}
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
no server-side confirmation that password and password confirmation match
If they press submit without changing any of the fields, they should see a flash that says "Information updated"
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.
so broken
the javascript sets the page height in pixels, but when css zoom is applied, the length of a pixel changes
In Safari, clicking on the email input field in the navbar doesn't move focus to the input field. Maybe the event is going to some other overlaying element? Shit is weird.
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
allegedly, the captcha sometimes shits itself with this error: http://cl.ly/image/2H1f0n091e45
i can fix it
Not sure if this is a problem or not.
the notepad is a contenteditable div. js from editor is affecting it i guess.
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.
If you have the text: Lo rem ip sum with the caret after "r", if you backspace and type, the new text should be bolded. Right now it's not.
There are also still issues with long titles
add pretty dates.
reverse order of drafts (most recent on top)
make essay titles autosave
There are a few api endpoints that don't have csrf protection like:
when you highlight multiple lines, the highlighting extends beyond the boundaries of the page. this is purely an aesthetic issue
right now, you can add a newline in the title. also, no handling for super long titles
Going to try and do this: http://stackoverflow.com/questions/2176861/javascript-get-clipboard-data-on-paste-event-cross-browser
Hitting enter with selected text doesn't do anything.
to repeat: zoom in. note that scrollbar is going beyond window bounds. fml
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
to reproduce: toggle to bold. wait any length of time then type a letter. The letter appears unbolded then is visibly rerendered as bold.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.