mirror of
https://github.com/DarrenOfficial/dpaste.git
synced 2024-12-19 08:09:38 +11:00
The Django project driving dpaste.org
fee4bd1354
* Use shorthand notation for `$(document).ready`. This isn't
just shorter but also slightly faster as it uses a cached
instance or $(document) instead of re-instantiating jQuery.
* Use .prop('checked') instead of .attr('checked').
Form fields reflect live state in properties, attributes are
only used when parsing the HTML to set the initial values of
the DOM properties. In the past (upto jQuery 1.6) jQuery
would cover you by secretly calling .prop() for common mistakes
but this has been deprecated and removed.
* Use .toggleClass instead of `if hasClass/addClass/removeClass`.
* Cancel previous AJAX request before starting another one.
This fixes the bug where using the "Guess lexer" or "Diff" button
twice in a row can sometimes result in the second push being
ignored. Since the requests are asynchronous, one can arrive
before or after the other and the callback called in a different
order. It also saves a bit on the network I guess.
* DiffAjax: Moved location.hash assignment to before the request.
It is asynchronous anyway, so the assignment happened before
the request already. But now it is more obvious that this is
the case.
* Simplified various selectors to just an ID instead of element
with ID. IDs are unique. If you have more than one of them
with a different element, there's something wrong. I suppose
in a way it also saves potential maintenance in the future if
a minor detail changes (e.g. from <div> to <p>).
* Removed weird variable conflict that was incorrectly
copy-pasted in
|
||
---|---|---|
dpaste | ||
.gitignore | ||
.pylintrc | ||
.travis.yml | ||
fabfile.py | ||
manage.py | ||
README.md | ||
requirements.txt | ||
setup.py |
====== dpaste
dpaste is a Django based pastebin. It's intended to run separatly or installed into an existing Django project.
You can find a live example on http://dpaste.de/
Testing
$ pip install -r requirements.txt
$ pip install -e .
$ manage.py test dpaste