zulip/static
Greg Price d053e07760 upload: Make filedrop error handling more consistent.
The first argument to the error callback is *usually* a string code
from a list in the filedrop source; but sometimes it was the text
the server sent in the HTTP status line, instead.  The latter isn't
predictable, and so it's not possible to write app code that uses it
to handle error consistently.

Instead, use that parameter for the numeric HTTP status code.  This
still isn't totally clean in that sometimes it's internal filedrop
errors, as strings, and sometimes it's HTTP status codes, as numbers;
but at least both of those are things we can sanely handle with a
`switch` statement.

Also pass through `serverResponse`, which for a nice JSON error from
the server will contain meaningful information about the error which
the calling code can use for nice error handling.  And just drop the
HTTP status text, which at best is redundant with the numeric code.

In passing, fix one case where for no obvious reason filedrop was
passing the file object but not the index.

This should be a pure refactor.
2018-01-29 16:06:11 -08:00
..
assets icons: Create framework for custom icons and add new bot icon. 2017-11-10 11:18:42 -08:00
audio
generated Move static/third/gemoji to static/generated/emoji. 2016-12-27 20:16:23 -08:00
html static/html/5xx.html: Clean up to use 4 space indentation. 2018-01-27 23:06:58 +05:30
icons/fonts Generate custom-icon-webfont on each provision or update-prod-static. 2017-11-20 16:36:49 -08:00
images settings: Makes selector look better in firefox. 2018-01-28 12:40:42 -08:00
js upload: Make filedrop error handling more consistent. 2018-01-29 16:06:11 -08:00
locale i18n: Check in mobile_info.json. 2018-01-29 12:49:51 -08:00
styles settings: Makes selector look better in firefox. 2018-01-28 12:40:42 -08:00
swagger docs: Update links from codebase to point to ReadTheDocs. 2017-11-16 10:53:49 -08:00
templates upload: Remove old per-user quota feature. 2018-01-29 16:06:11 -08:00
third upload: Make filedrop error handling more consistent. 2018-01-29 16:06:11 -08:00
ts Add typescript support to asset compilation. 2017-05-28 17:28:28 -07:00
.gitignore i18n: Make Git ignore mobile.json resources. 2018-01-29 12:49:51 -08:00
favicon.ico
node_modules