Commit graph

179 commits

Author SHA1 Message Date
Martin Mahner
ba0cbcd7c5 UI fixes for error pages. 2013-11-24 19:19:47 +01:00
Martin Mahner
c1c43dd51a A better API that supports more values. 2013-11-24 19:18:56 +01:00
Martin Mahner
82cbb9f141 UI Improvements. 2013-11-24 18:25:30 +01:00
Martin Mahner
33a37aed8d Go back to homepage by clicking on the page title. 2013-11-24 18:20:00 +01:00
Martin Mahner
f1a0dbab49 Allow to delete all snippets at once. 2013-11-24 18:16:29 +01:00
Martin Mahner
5cea272b15 UI improvements. Bootstrap sucks. 2013-11-24 17:58:57 +01:00
Martin Mahner
6960f67026 Text snippets are now rendered as text. 2013-11-24 17:05:43 +01:00
Martin Mahner
691c21dd0f Allow to set the initial lexer via GET. 2013-11-23 16:31:13 +01:00
Martin Mahner
1fce9e38f6 Reorganised settings. Removed Redis cache from base settings. 2013-11-23 16:08:11 +01:00
Martin Mahner
77c259ee39 Merge branch 'master' into develop 2013-11-23 15:55:53 +01:00
Marius Gedminas
508d86ba31 Allow raw snippets without trailing slash
Fixes an asymmetry where both of

  curl https://dpaste.de/xXxx
  curl https://dpaste.de/xXxx/

work, but

  curl https://dpaste.de/xXxx/raw/

fails without a trailing slash (because curl doesn't follow redirects by
default).
2013-10-22 11:01:15 +03:00
Marius Gedminas
520332e151 Trailing newline on raw responses
Without this you cannot easily share patches:

    user@machine1 $ git diff | curl -F 'content=<-' https://dpaste.de/api/
    user@machine2 $ curl https://dpaste.de/xxxx/raw/ | git apply
    fatal: corrupt patch at line 67
2013-10-22 11:01:15 +03:00
Martin Mahner
fb20e91a7d Added session cache backend. Added redis. Updated requirements. 2013-09-28 12:34:57 +02:00
Martin Mahner
c711639bac About improvements 2013-09-27 19:40:14 +00:00
Martin Mahner
3db308f750 Fixed missing import 2013-09-27 19:30:23 +00:00
Martin Mahner
bf39d704d7 Fixed a bug that raised an error if a lexer is unknown 2013-09-27 19:27:46 +00:00
Martin Mahner
e34c46f9aa Fixed snippet delete function. 2013-09-27 17:54:05 +02:00
Martin Mahner
6e641290e2 Fixed couple of merge issues 2013-09-27 17:50:58 +02:00
Martin Mahner
0e251a0392 Merge branch 'develop'
Conflicts:
	dpaste/urls/dpaste.py
	dpaste/views.py
2013-09-27 17:47:09 +02:00
Martin Mahner
4ba94ce64e Shorter random URLs and no longer a trailing slash. 2013-09-27 17:39:12 +02:00
Martin Mahner
4c96e1eb17 Update test_api.py 2013-08-15 21:42:26 +02:00
Martin Mahner
2c072e2789 Huge cleanup. Simplified lexer massively. Cleaned up view code. Cleaned up syntax highlighting. 2013-08-15 20:42:02 +02:00
Martin Mahner
e3de35fa15 No need for a sendmail compatible smtp anymore. 2013-08-15 19:09:10 +02:00
Martin Mahner
1d6fea38c4 Cleaned up models. 2013-08-15 19:06:15 +02:00
Martin Mahner
2b402680f8 Allow anybody to delete a snippet.
I got too many requests in the past, most of because people created snippets via the API and can't delete them, or because of legal issues.
2013-07-19 09:54:18 +02:00
Martin Mahner
f6f04901d6 Create python files on Gist by default 2013-06-05 17:44:56 +00:00
Martin Mahner
8db8977910 Create a Github gist from a snippet.
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.
2013-06-05 19:40:41 +02:00
Martin Mahner
27f97ed458 Removed message 2013-05-31 09:47:02 +00:00
Martin Mahner
49edeecca0 Clickjacking middleware 2013-05-28 23:00:41 +00:00
Martin Mahner
30dd414a0f SSL example 2013-05-28 22:37:16 +00:00
Martin Mahner
4bbab1b324 New config files due to server movement 2013-05-26 19:40:16 +00:00
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
Timo Tijhof
b2265b1af8 Clean up: Drop redundant attributes, minor JS clean up, gitignore
* 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`).
2013-04-23 06:33:06 +02:00
Timo Tijhof
32dc8e5928 Use protocol-relative url for jQuery. Fixes #15.
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".
2013-04-23 06:03:21 +02:00
Martin Mahner
4aaa2973be Streamlined settings. Removed test settings and moved defaults to settings.py 2013-03-29 19:25:27 +01:00
Martin Mahner
241180a350 Updated to Django 1.5.1 2013-03-29 19:09:59 +01:00
Martin Mahner
4978538a97 Removed Django-Piston, added a very simple view to handle API calls. Fully backwards compatible. Fixes all tests. 2013-03-29 19:09:22 +01:00
Martin Mahner
c595d99e6d Added a test hint 2013-03-28 22:56:41 +01:00
Martin Mahner
ad7f7ccf49 Restructured the about page 2013-03-28 21:52:48 +01:00
Martin Mahner
16b4f0fc0a Better visual error display. Fixes issue #13 2013-03-28 21:45:32 +01:00
Martin Mahner
2996bb9a3b Increased contrast for text and diff text 2013-03-28 21:38:25 +01:00
Martin Mahner
1f173efd7e Custom test settings 2013-03-22 22:45:16 +01:00
Martin Mahner
bcdea97073 Snippet tests 2013-03-22 22:38:50 +01:00
Martin Mahner
ce29409340 Strip content before putting it in the db. 2013-03-22 22:38:39 +01:00
Martin Mahner
6302145007 Unittests for the API 2013-03-22 21:03:10 +01:00
Martin Mahner
198e5252fb Set a max_length for all snippets. Nobody needs more than 256k of space. 2013-03-22 19:41:39 +01:00
Martin Mahner
e9770293bb Autofocus the textfield for a new snippet. 2013-03-22 19:41:39 +01:00
Martin Mahner
9321195ff4 Now that there is no admin anymore I need a quick way to check the total snippet count, to see if something goes wrong or I'm DOSed. 2013-03-22 19:41:39 +01:00
Martin Mahner
4e4463faf7 Removed auth, sites and content types. Without the admin we no longer need em. 2013-03-22 19:41:39 +01:00
Martin Mahner
22bce7a008 Removed Django admin. It was never useful anyway. 2013-03-22 19:41:39 +01:00
Martin Mahner
ecf7653bf9 Added a smtp comment 2013-03-22 19:41:39 +01:00
Martin Mahner
c922a30dca Removed Raven/Sentry 2013-03-22 19:41:39 +01:00
Martin Mahner
ed29279b0a Added dpaste.org to ALLOWED_HOSTS 2013-03-21 18:26:35 +00:00
Martin Mahner
da66c18479 No left and right padding, looks better on mobile 2013-03-20 13:45:52 +01:00
Martin Mahner
1f863b345f Ability to link and open to diffs directly. Fixes issue #2. 2013-03-20 13:41:31 +01:00
Martin Mahner
e14192d2d1 Save the recently used lexer to use it next time again. Fixes issue #3 2013-03-20 13:08:41 +01:00
Martin Mahner
d42a2d3c79 Don't display the compare button if the snippet has no replies. Fixes issue #6. 2013-03-20 12:58:07 +01:00
Martin Mahner
ca1e12596c Fixed curl example 2013-03-20 12:49:44 +01:00
Martin Mahner
a202d88324 Highlight the API example. Fixes issue #7 2013-03-20 12:09:11 +01:00
Martin Mahner
638a62d775 Line numbers are 1 based. Fixes issue #5. 2013-03-20 12:03:39 +01:00
Martin Mahner
faf840a113 Decoupled functions 2013-03-19 21:13:13 +01:00
Martin Mahner
f3b5bad47c Merge branch 'master' of github.com:bartTC/dpaste 2013-03-19 19:37:18 +00:00
Martin Mahner
cdc4bc49bd enabled all lexers 2013-03-19 20:37:01 +01:00
Martin Mahner
8142f3476b Merge branch 'master' of github.com:bartTC/dpaste 2013-03-19 19:30:05 +00:00
Martin Mahner
a5bc2ac164 Error page fixes 2013-03-19 20:29:31 +01:00
Martin Mahner
43c6960f6d Added a missing init.py. 2013-03-19 19:26:15 +00:00
Martin Mahner
19e45995bf Removed print 2013-03-19 20:20:15 +01:00
Martin Mahner
2287efb3b7 Added ALLOWED_HOSTS and LOGGING settings 2013-03-19 19:13:24 +00:00
Martin Mahner
e7e38d409d Lexer handling. 2013-03-19 19:47:09 +01:00
Martin Mahner
f7916a6960 Huge design overhaul. 2013-03-19 19:17:07 +01:00
Martin Mahner
4183c58cdd Upgraded to Django 1.5. Fixed urls and paths 2013-03-19 14:46:06 +01:00
Martin Mahner
e894fa7324 Added bootstrap. 2013-03-19 14:41:11 +01:00
Martin Mahner
11b582cc6c Custom error views to load dpaste error templates. 2013-03-19 14:18:43 +01:00
Martin Mahner
82622db10c Moved all templates into the dpaste subdirectory.
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.
2013-03-19 14:11:52 +01:00
Martin Mahner
04fefe15a6 Little code cleanup. 2013-03-19 14:08:56 +01:00
Martin Mahner
9593853696 Splittet urlpatterns into several files. Will make it much easier to implement this as an app into an existing project. 2013-03-19 14:06:26 +01:00
Martin Mahner
833d0988db Added some example settings. 2013-03-19 13:55:46 +01:00
Martin Mahner
d539631da7 More project restructuring to make the project look more like a Django 1.5 project. 2013-03-19 13:54:25 +01:00
Martin Mahner
ee0fc79a3e Renamed pastebin > dpaste.
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.
2013-03-19 13:33:35 +01:00