I'm not yet sure how useful it is, since its creates Gists in a anomymous space and not under your account, but if you want to save Snippets permanently, thats the way to go.
* 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.
* Dropped redundant `type` attribute from script elements
(some had them removed already).
* Dropped redundant `media` attribute from link elements.
* <div> is not a valid self-closing tag.
* Dropped redundant / in self-closing tags in <hr/>, <br/>, <input/>.
Just like was done for <img> and <link> already).
* Aliasing $ to jQuery (local reference is cheaper and using
jQuery as global seems more stable, bootstrap.js does this too).
* Unminified it a bit (nothing extreme, just more consistent
other code here already).
* Consistently used single quotes in the js code
(most code used singled quotes already).
* Quoting attribute selectors $('input[name="foo"]').
Unquoted selectors have been deprecated.
* Ignore .pyc files (so they don't show up in `git status`, and
aren't accidentally committed with `git add`).
HTTP urls are blocked in modern browsers when accessing the page
over HTTPS (https://dpaste.de/), so jQuery wasn't being loaded
and the rest of the javascript failed on various ReferenceError
and TypeError exceptions around "$ is undefined".
This will make integration into projects again easier, it wont overwrite existing templates. Those projects only need to overwrite dpaste/base.html to integrate it into their project layout.
This is a way simpler project structure, its also backwards compatible. Its a huge cleanup and should make further development and also 3rd party integration much easier.