The Django project driving dpaste.org
Find a file
Timo Tijhof fee4bd1354 Update and enhance javascript code
* 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 1f863b345f.
  `var a;` when `a` already exists does nothing. It doesn't clear
  or reset it. It just weird syntax that should throw an error
  but is instead silently ignored. And `curLine` is already set
  and continues to be there.
2013-04-23 06:57:57 +02:00
dpaste Update and enhance javascript code 2013-04-23 06:57:57 +02:00
.gitignore Clean up: Drop redundant attributes, minor JS clean up, gitignore 2013-04-23 06:33:06 +02:00
.pylintrc Initial commit after move to linode 2011-05-30 01:03:04 +02:00
.travis.yml Fixed travis settings 2013-03-29 19:27:40 +01:00
fabfile.py Setting fixes 2013-03-19 19:58:10 +01:00
manage.py More project restructuring to make the project look more like a Django 1.5 project. 2013-03-19 13:54:25 +01:00
README.md Readme: Promote dpaste.de instead of www.dpaste.de 2013-04-23 06:33:19 +02:00
requirements.txt Updated to Django 1.5.1 2013-03-29 19:09:59 +01:00
setup.py Setting fixes 2013-03-19 19:58:10 +01:00

====== 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