143 Commits

Author SHA1 Message Date
Remy Sharp
fa871cf7da Add spike hook for the CSS 2012-06-16 09:56:24 +02:00
Aron Carroll
c030ee1857 Now appending spike scripts using events 2012-06-10 14:43:21 +01:00
Aron Carroll
a5cd69c46a Add "created" and "updated" events to BinHandler
It's possible these events should be triggered on the model level but
this works nicely at the moment. Also removed the spike.ping code
from the BinHandler.
2012-06-10 14:17:30 +01:00
Aron Carroll
d407301f79 Add utils.extend() for extending objects 2012-06-10 14:08:30 +01:00
Aron Carroll
66f8d28dd8 Move the spike code into BinHandler and remove old handlers.js 2012-06-10 14:07:02 +01:00
Aron Carroll
de04505b8b Now apply default values to the database results if null
This allows us to assume that the HTML, CSS and JavaScript will always
be a string.
2012-06-10 14:05:47 +01:00
Aron Carroll
164b56531c Merge branch 'feature/node' into 'feature/spike'
Conflicts:
	lib/app.js
	lib/handlers.js
	package.json
2012-06-10 12:24:02 +01:00
Aron Carroll
c2ec5b9e19 Add missing code_id_* template variables 2012-06-03 22:45:55 +01:00
Aron Carroll
87a99bb670 Make helpers.getUrlForBin() always return a valid url 2012-06-03 22:45:09 +01:00
Remy Sharp
26284047fc bin.javascript was undefined so we default the value just in case 2012-05-29 23:40:14 +01:00
Aron Carroll
1f3444fc39 Now correctly handling subdomains without a custom config 2012-05-27 12:59:16 +01:00
Aron Carroll
f08d133bde No adding custom css into base template 2012-05-27 12:29:07 +01:00
Aron Carroll
c466eb2d27 Allow a custom settings property to be set on the jsbin object 2012-05-27 12:02:56 +01:00
Aron Carroll
409d0458a5 Add settings property to jsbin object 2012-05-27 11:59:38 +01:00
Aron Carroll
7eb1ebfd38 Load custom user files into the editor based on subdomain 2012-05-26 19:14:59 +01:00
Aron Carroll
0eae778cd2 Rename custom config key from default to defaults 2012-05-26 19:14:59 +01:00
Aron Carroll
6f16cfa3ac Detect sub-domains and update relevant url settings 2012-05-26 19:14:58 +01:00
Aron Carroll
a7b7d02abf Add a custom module for loading config files 2012-05-26 19:14:58 +01:00
Remy Sharp
d0f628acf0 JS Bin would hang if this was the user's first ever login - yoinks! 2012-05-26 10:29:09 +01:00
Remy Sharp
0211a70905 Updating FIXMEs 2012-05-26 10:28:46 +01:00
Remy Sharp
cce8a1c769 Fixed #164 history ordering now correct 2012-05-26 10:11:49 +01:00
Remy Sharp
10c39bfe83 Moved regular expression to build once, fixed multiline matches 2012-05-26 10:11:13 +01:00
Remy Sharp
9fa706710f Remove debugger from commit 2012-05-26 00:12:51 +01:00
Remy Sharp
e9987c071d Big ass todo 2012-05-26 00:12:41 +01:00
Remy Sharp
7b9cc2ffe4 Fixing description detection logic 2012-05-25 22:12:28 +01:00
Remy Sharp
77fe7e7d7e Fixed path issues - fixes saving from changed urls, template restore, etc.
Basically, the ballache.
2012-05-25 17:03:26 +01:00
Aron Carroll
1d36ad58ee Pull bin title from description tag if found 2012-05-25 16:15:07 +01:00
Aron Carroll
bca56a2f24 Prefer body contents over title when extracting tile 2012-05-25 16:15:07 +01:00
Remy Sharp
c76a2c5bd4 Fixed url not being passed through the template 2012-05-25 16:13:55 +01:00
Aron Carroll
09e4d6b0af Include the page root in the jsbin object 2012-05-25 15:40:19 +01:00
Remy Sharp
d80376f881 Read port from env, then config, then 80 2012-05-25 14:26:39 +01:00
Aron Carroll
11f9b0361d Download is now a GET request
Will only download created bins. Download link in UI does not yet work.
2012-05-25 12:53:24 +01:00
Aron Carroll
2c9ecb7340 Add download endpoint
This takes a POST request containing html, css, javascript and filename
parameters and returns a built page.
2012-05-25 12:38:59 +01:00
Aron Carroll
4248e4d87a Switch console.log to process.stdout to keep JSHint happy 2012-05-25 12:35:06 +01:00
Aron Carroll
76bdfbc429 Allow adding analytics to a rendered bin to be optional 2012-05-25 12:34:00 +01:00
Aron Carroll
172aebb8b4 Add BinHandler#downloadBin() method 2012-05-25 12:33:28 +01:00
Aron Carroll
bee06c526e Add the .ajax flag to the Response object as well as Request 2012-05-20 21:45:17 +01:00
Aron Carroll
f25efb4455 Fix issue in helpers.production
Now correctly check the app.PRODUCTION rather than "this" which will be
undefined.
2012-05-20 21:43:58 +01:00
Aron Carroll
003f97e13a Fix issue with creating a bin returning a full url path
The client very much expects only the filepath. This is why unit tests
are useful...
2012-05-20 21:31:28 +01:00
Aron Carroll
37e18fbf04 Convert all models into observable objects 2012-05-20 21:29:38 +01:00
Aron Carroll
ef9f1c18d6 Update BinHandler and SessionHandler to use utils.bindAll() 2012-05-20 21:11:59 +01:00
Aron Carroll
23d6bac5ae Add utils.bindAll() for helping manage scope and objects 2012-05-20 21:11:25 +01:00
Aron Carroll
9a53b3f084 Updated app.js to use the new handlers module 2012-05-20 21:00:24 +01:00
Aron Carroll
0f0adbf78c Created handlers/index.js to load all the handlers into one module 2012-05-20 20:55:38 +01:00
Aron Carroll
d52d7468a7 Move session.js into handlers directory
Created SessionHandler observable and updated app.js to use this.
2012-05-20 20:54:53 +01:00
Aron Carroll
f11ba6c97f utils.index() now uses the module filename if it exists 2012-05-20 20:48:32 +01:00
Aron Carroll
003c77fbdf Add an utils.index helper method
This makes it very easy to create index modules for directories.
2012-05-20 20:19:24 +01:00
Aron Carroll
74fdbe344a Add an Observable object for others to inherit from 2012-05-20 20:15:39 +01:00
Aron Carroll
38a69c6d2b Simplify handlers.formatHistory() method
Removed an extraneous loop and simply append the revisions array to
the template context in the original loop.
2012-05-18 18:25:18 +01:00
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