Renamed "events" array to "eventNames"

This commit is contained in:
Dallon Feldner
2012-11-21 09:31:00 -07:00
parent 60eee96291
commit 438342e426
6 changed files with 5 additions and 5 deletions

View File

@@ -13,6 +13,7 @@
### Breaking Changes
- All configuration properties on the `Resource` class have been moved to the prototype: `external`, `events`, `label`, `defaultPath`, `basicDashboard`, and `dashboard`.
- The configuration option `Resource.events` has been renamed `Resource.eventNames`.
### Major Bugfixes

View File

@@ -110,7 +110,7 @@ Resource.prototype.parse = function (url) {
Resource.prototype.load = function (fn) {
var resource = this
, eventNames = this.constructor && this.constructor.events
, eventNames = this.eventNames
, remaining = eventNames && eventNames.length
, configPath = this.options && this.options.configPath
, events = this.events = {};

View File

@@ -35,7 +35,7 @@ util.inherits(Collection, Resource);
Collection.prototype.external = {};
Collection.prototype.clientGeneration = true;
Collection.events = ['Get', 'Validate', 'Post', 'Put', 'Delete'];
Collection.prototype.eventNames = ['Get', 'Validate', 'Post', 'Put', 'Delete'];
Collection.dashboard = {
path: path.join(__dirname, 'dashboard')
, pages: ['Properties', 'Data', 'Events', 'API']

View File

@@ -134,7 +134,7 @@ Dashboard.prototype.loadPage = function(ctx, fn) {
options.resourceId = resourceId;
resourceType = resource.constructor;
options.resourceType = resourceType.id;
options.events = resourceType.events;
options.events = resource.eventNames;
options.scripts = [];
var page = parts[1];

View File

@@ -66,7 +66,7 @@ InternalResources.prototype.handle = function(ctx, next) {
var c = types[key]
, pages = c.dashboard && c.dashboard.pages;
if (!pages && c.events) {
if (!pages && c.eventNames) {
pages = ['Config', 'Events'];
}
result[key] = {

View File

@@ -38,7 +38,6 @@ function UserCollection(name, options) {
util.inherits(UserCollection, Collection);
UserCollection.dashboard = Collection.dashboard;
UserCollection.events = Collection.events;
/**
* Handle an incoming http `req` and `res` and execute