244 Commits

Author SHA1 Message Date
Aron Carroll
8be36064e2 Add plain text option for bin creation
If the "format" parameter is set to "plain" then only the url will be
returned as a plain text string. Why it needs to do this I have no
idea!
2012-05-18 18:08:41 +01:00
Aron Carroll
944f5db195 Fix stupid implementation of blacklist
Previous version validated the last saved bin rather than the current
one.
2012-05-18 18:08:09 +01:00
Aron Carroll
47f37b55fd Implement the blacklist module 2012-05-18 17:40:25 +01:00
Aron Carroll
d9989fb16e Add blacklist module to validate a bin 2012-05-18 17:40:11 +01:00
Aron Carroll
d5b704b943 Improve errors.js and add BadRequest error 2012-05-18 17:39:44 +01:00
Aron Carroll
96353b35bc Add CORS support for cross origin GET requests 2012-05-18 16:55:34 +01:00
Aron Carroll
87b757c06c Assign ownership when a revision to a bin is created 2012-05-18 16:27:25 +01:00
Aron Carroll
a003526f88 History list now detects changed panels 2012-05-18 16:19:08 +01:00
Aron Carroll
f067daf3fa Tidied up the loading of default panels 2012-05-18 16:07:31 +01:00
Aron Carroll
9af55ebae7 Now render history with all bins 2012-05-18 15:58:25 +01:00
Aron Carroll
fc21633502 Add route for viewing current users history 2012-05-18 15:51:32 +01:00
Aron Carroll
b831501ec6 Add handlers for rendering user history 2012-05-18 15:51:20 +01:00
Aron Carroll
7139077f0e Add utils.since() to create a friendly timestamp 2012-05-18 15:50:30 +01:00
Aron Carroll
561fa1f9ea User model now has .getBins() method 2012-05-18 15:50:07 +01:00
Aron Carroll
61693f984d Add support for fetching user bins to the store 2012-05-18 15:49:47 +01:00
Remy Sharp
ed0b7af4f1 read the app port from the config file 2012-05-14 11:17:12 +01:00
Aron Carroll
f233bb60f6 Add ability to log out! 2012-05-09 22:31:44 +01:00
Aron Carroll
f6980cee25 Created bins are now assigned to user account when logged in 2012-05-09 21:57:34 +01:00
Aron Carroll
156d6d1c18 Now upgrade passwords from old JSBin accounts to new ones 2012-05-06 19:07:41 +01:00
Aron Carroll
a5811c6af9 Update "last_login" column when a user logs in 2012-05-06 18:45:48 +01:00
Remy Sharp
7ec4ec2f4c Throttling spikes 2012-05-06 11:08:07 +01:00
Aron Carroll
c2d79ba5c1 Integrate session handers into application
Now it is possible to login and create a new user. No support for
home namespace, logout or owning bins yet. Also not compatible with
PHP app yet.
2012-05-05 19:38:17 +01:00
Aron Carroll
80716d2393 Add user model and update models/index.js 2012-05-05 19:38:02 +01:00
Aron Carroll
fa08652d35 Add a user model and update models/index.js 2012-05-05 19:36:22 +01:00
Aron Carroll
8b90176308 Add user methods to the store and MySQL adapter 2012-05-05 19:35:11 +01:00
Aron Carroll
8a094f6dc9 Add sql templates for ownership table 2012-05-05 19:32:32 +01:00
Aron Carroll
ba1d2a9a04 Improved handling of accept header when requesting event stream 2012-05-05 16:31:03 +01:00
Aron Carroll
74b70eff72 Implement log portion of the string
I don't think this has yet been implemented in the client side though.
Logs are available at /:bin/:rev/log and can be created by posting to
the same endpoint.
2012-05-05 16:19:41 +01:00
Aron Carroll
cc96715758 Implement stream of changes to connected devices 2012-05-05 15:53:52 +01:00
Aron Carroll
ddebd2307f Initial work on the server side spike code
Needs a massive code refactor in the near future though :)
2012-05-04 16:32:39 +01:00
Remy Sharp
a8c505faac Include the spike for auto-refreshing 2012-05-04 16:01:52 +01:00
Remy Sharp
a67eba4087 Support root prefix 2012-05-04 16:01:30 +01:00
Aron Carroll
ab269fff14 Prevent CSRF attacks on all post requests 2012-05-03 21:14:34 +01:00
Aron Carroll
92f2362452 Allow automatic updates 2012-05-03 20:57:05 +01:00
Aron Carroll
f3ea6fe9e7 Now correctly checking for updated rows in mysql.js 2012-05-03 20:56:17 +01:00
Aron Carroll
52bdae30a0 Add cookie based session support
This uses signed cookies which is nice but we still should not store any
user data in the cookie.
2012-05-03 19:59:05 +01:00
Aron Carroll
b0c6d5491d Fix issue with "url prefix" check
Ideally the prefix should be left empty but this (I believe) will
break the PHP app.
2012-05-01 00:22:36 +01:00
Aron Carroll
a563f2d274 Update app.js to handle path prefix
This essentially mounts the application as middleware within another
connect server under the specified prefix. This means that when
redirecting that helpers.url() must be used to get the full path and
req.path will be missing the prefix.
2012-05-01 00:15:44 +01:00
Aron Carroll
b96427364e Not found page now renders preview correctly 2012-04-30 23:36:52 +01:00
Aron Carroll
602f1ad485 Move error objects into thier own module 2012-04-30 23:28:24 +01:00
Aron Carroll
fe5eae899c Move state onto Request instances via helper middleware
This seems a little hairy but essentially avoids creating modules
with factory functions which seems very clunky. We now provide various
helper functions that are bound to the application state such as
url, routing and models via the request object. This is massively
overloading this object but seems to be the common way in Express
apps to pass state into handlers.
2012-04-30 23:20:03 +01:00
Aron Carroll
84d4292d99 Create an index file for all models
Also refactored the model modules to export a factory function rather
than returning a function itself. This seems to read a bit better.
2012-04-30 23:19:08 +01:00
Aron Carroll
5396c12f20 Add analytics to the preview HTML 2012-04-24 09:46:16 +01:00
Aron Carroll
b0057de22f Add analytics view and helper method 2012-04-24 09:39:40 +01:00
Aron Carroll
834c2ab048 Add app.production for checking current environment 2012-04-24 09:39:12 +01:00
Aron Carroll
6be88b6e19 Implement the "quiet" flag for previewed bins 2012-04-24 09:18:44 +01:00
Aron Carroll
672f0b0f42 Add edit.js and attribution to preview page 2012-04-24 09:13:08 +01:00
Aron Carroll
a51920a9bd Add basic ability to preview bins
This is currently only a partial implementation of the PHP app.
2012-04-23 09:47:32 +01:00
Aron Carroll
f14555a272 Fix issue with utils.titleFromBin() where there is no CSS 2012-04-23 09:47:08 +01:00
Aron Carroll
09abcd34d5 Return bin title on successful creation 2012-04-23 08:58:49 +01:00