Comparing version 2.0.0alpha3 to 2.0.0alpha4
@@ -69,3 +69,3 @@ Backbone.Router.prototype.route = function(route, name, callback) { | ||
// Make the request. | ||
$.ajax(params); | ||
return $.ajax(params); | ||
}; |
#!/usr/bin/env node | ||
require('bones').load(__dirname); | ||
var bones = require('bones') | ||
// Bones load views/models/etc.. in alphabetical order. To explicity load | ||
// certain ones early simply require them here. | ||
require('./views/Main'); | ||
bones.load(__dirname); | ||
if (!module.parent) { | ||
require('bones').start(); | ||
bones.start(); | ||
} |
{ | ||
"name": "bones", | ||
"description": "Framework for using backbone.js on the client and server.", | ||
"version": "2.0.0alpha3", | ||
"version": "2.0.0alpha4", | ||
@@ -18,3 +18,3 @@ "author": { | ||
"backbone": "0.5.1", | ||
"jquery": "1.5.x", | ||
"jquery": "1.6.x", | ||
"optimist": "0.1.x", | ||
@@ -21,0 +21,0 @@ "mirror": "0.3.x" |
@@ -7,4 +7,11 @@ # Bones | ||
The [wiki](https://github.com/developmentseed/bones/wiki) contains more information on [**Getting Started**](https://github.com/developmentseed/bones/wiki/Getting-Started) and on the [concepts](https://github.com/developmentseed/bones/wiki/Plugin-Architecture) in Bones. | ||
The [wiki](https://github.com/developmentseed/bones/wiki) contains more information | ||
on [**Getting Started**](https://github.com/developmentseed/bones/wiki/Getting-Started) | ||
and on the [concepts](https://github.com/developmentseed/bones/wiki/Plugin-Architecture) in Bones. | ||
## Example Application | ||
* The [simple app example](https://github.com/developmentseed/bones/tree/master/examples/simple) is | ||
a good quickstart to making a bones application. | ||
## Testing | ||
@@ -17,2 +24,1 @@ | ||
Bones is [BSD licensed](https://github.com/developmentseed/bones/raw/master/LICENSE). | ||
@@ -44,3 +44,3 @@ var env = process.env.NODE_ENV || 'development'; | ||
return function(req, res, next) { | ||
if (req.method === 'GET') { | ||
if (req.method === 'GET' || req.method === 'HEAD') { | ||
next(); | ||
@@ -47,0 +47,0 @@ } else if (req.body && req.cookies['bones.token'] && req.body['bones.token'] === req.cookies['bones.token']) { |
@@ -56,3 +56,3 @@ var path = require('path'); | ||
module.exports.register = function(app) { | ||
if (app.assets) { | ||
if (app.assets && !(/\.server\._$/.test(filename))) { | ||
app.assets.templates.push({ | ||
@@ -59,0 +59,0 @@ filename: filename, |
@@ -56,3 +56,3 @@ var Backbone = require('./backbone'); | ||
this.server.get(route, function(req, res, next) { | ||
var fragment = (req.query && req.query['_escaped_fragment_']) || req.url; | ||
var fragment = (req.query && req.query['_escaped_fragment_']) || req.url.replace(/[#?].*$/, ''); | ||
var args = router._extractParameters(route, fragment); | ||
@@ -59,0 +59,0 @@ var context = Object.create(router, { req: { value: req }, res: { value: res } }); |
@@ -15,2 +15,20 @@ var Bones = Bones || {}; | ||
// Multifetch. Pass a hash of models and fetch each in parallel. | ||
Bones.utils.fetch = function(models, callback) { | ||
var remaining = _(models).size(); | ||
var error = null; | ||
_(models).each(function(model) { | ||
model.fetch({ | ||
success: function() { | ||
if (--remaining === 0) callback(error, models); | ||
}, | ||
error: function(m, err) { | ||
if (!error) error = err; | ||
model.error = err; | ||
if (--remaining === 0) callback(error, models); | ||
} | ||
}); | ||
}); | ||
}; | ||
// From https://github.com/visionmedia/lingo/blob/master/lib/languages/en.js | ||
@@ -17,0 +35,0 @@ Bones.utils.uncountable = [ 'advice', 'enegery', 'excretion', 'digestion', |
@@ -112,1 +112,19 @@ process.env.NODE_ENV = 'test'; | ||
}; | ||
exports['/assets/bones/templates.js'] = function() { | ||
assert.response(server, { | ||
url: '/assets/bones/templates.js', | ||
method: 'GET' | ||
}, { status: 200 }, function(res) { | ||
assert.ok(res.body.indexOf(require('bones/test/fixture/templates/Error._').toString()) >= 0); | ||
assert.ok(res.body.indexOf(require('bones/test/fixture/node_modules/othermodule/templates/Other._').toString()) >= 0); | ||
// Doesn't include server files. | ||
assert.ok(res.body.indexOf(require('bones/test/fixture/templates/ServerSide.server._').toString()) < 0); | ||
// Correct order. | ||
assert.ok(res.body.indexOf('// ---- start test/fixture/templates/Error._ ----') >= 0); | ||
assert.ok(res.body.indexOf('// ---- start test/fixture/templates/Error._ ----') > | ||
res.body.indexOf('// ---- start test/fixture/node_modules/othermodule/templates/Other._ ----')); | ||
}); | ||
}; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
190157
101
2060
23
21
+ Addedagent-base@7.1.1(transitive)
+ Addedasynckit@0.4.0(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addedcssstyle@4.1.0(transitive)
+ Addeddata-urls@5.0.0(transitive)
+ Addeddebug@4.3.7(transitive)
+ Addeddecimal.js@10.4.3(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addedentities@4.5.0(transitive)
+ Addedform-data@4.0.0(transitive)
+ Addedhtml-encoding-sniffer@4.0.0(transitive)
+ Addedhttp-proxy-agent@7.0.2(transitive)
+ Addedhttps-proxy-agent@7.0.5(transitive)
+ Addediconv-lite@0.6.3(transitive)
+ Addedis-potential-custom-element-name@1.0.1(transitive)
+ Addedjquery@1.6.3(transitive)
+ Addedjsdom@25.0.1(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedms@2.1.3(transitive)
+ Addednwsapi@2.2.13(transitive)
+ Addedparse5@7.1.2(transitive)
+ Addedpunycode@2.3.1(transitive)
+ Addedrrweb-cssom@0.7.1(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsaxes@6.0.0(transitive)
+ Addedsymbol-tree@3.2.4(transitive)
+ Addedtldts@6.1.49(transitive)
+ Addedtldts-core@6.1.49(transitive)
+ Addedtough-cookie@5.0.0(transitive)
+ Addedtr46@5.0.0(transitive)
+ Addedw3c-xmlserializer@5.0.0(transitive)
+ Addedwebidl-conversions@7.0.0(transitive)
+ Addedwhatwg-encoding@3.1.1(transitive)
+ Addedwhatwg-mimetype@4.0.0(transitive)
+ Addedwhatwg-url@14.0.0(transitive)
+ Addedws@8.18.0(transitive)
+ Addedxml-name-validator@5.0.0(transitive)
+ Addedxmlchars@2.2.0(transitive)
- Removedjquery@1.5.1(transitive)
Updatedjquery@1.6.x