Minor tidyups

This commit is contained in:
Joe Walker 2010-11-23 12:28:29 +00:00
commit fca0eeb1ff
2 changed files with 12 additions and 16 deletions

View file

@ -47,9 +47,9 @@ var setupPlugins = function(config, callback) {
config.pluginDirs["../plugins"] = { config.pluginDirs["../plugins"] = {
packages: ["pilot"] packages: ["pilot"]
}; };
var knownPlugins = []; var knownPlugins = [];
var pluginPackageInfo = { var pluginPackageInfo = {
"../lib": [ "../lib": [
{ {
@ -58,11 +58,11 @@ var setupPlugins = function(config, callback) {
} }
] ]
}; };
var paths = {}; var paths = {};
var i; var i;
var location; var location;
// we need to ensure that the core plugin directory is loaded first // we need to ensure that the core plugin directory is loaded first
var pluginDirs = []; var pluginDirs = [];
var pluginDir; var pluginDir;
@ -76,13 +76,13 @@ var setupPlugins = function(config, callback) {
return 1; return 1;
} else if (a < b) { } else if (a < b) {
return -1; return -1;
} else if (b < a) { } else if (b < a) {
return 1; return 1;
} else { } else {
return 0; return 0;
} }
}); });
// set up RequireJS to know that our plugins all have a main module called "index" // set up RequireJS to know that our plugins all have a main module called "index"
for (var dirNum = 0; dirNum < pluginDirs.length; dirNum++) { for (var dirNum = 0; dirNum < pluginDirs.length; dirNum++) {
pluginDir = pluginDirs[dirNum]; pluginDir = pluginDirs[dirNum];
@ -109,7 +109,7 @@ var setupPlugins = function(config, callback) {
} }
} }
} }
require({ require({
packagePaths: pluginPackageInfo, packagePaths: pluginPackageInfo,
paths: paths paths: paths

View file

@ -1,7 +1,3 @@
// TODO this file can likely be deleted. The useful functionality has moved to
// index.js
/* ***** BEGIN LICENSE BLOCK ***** /* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
* *
@ -44,7 +40,7 @@ define(function(require, exports, module) {
* Most of our types are 'static' e.g. there is only one type of 'text', however * Most of our types are 'static' e.g. there is only one type of 'text', however
* some types like 'selection' and 'deferred' are customizable. The basic * some types like 'selection' and 'deferred' are customizable. The basic
* Type type isn't useful, but does provide documentation about what types do. * Type type isn't useful, but does provide documentation about what types do.
* *
*/ */
function Type() { function Type() {
}; };
@ -77,7 +73,7 @@ Type.prototype = {
* extra data, however this function returns only the name, not the extra * extra data, however this function returns only the name, not the extra
* data. * data.
*/ */
name: "unknown", name: "unknown"
// Methods from the original type system that we might need, but not now. // Methods from the original type system that we might need, but not now.
@ -111,14 +107,14 @@ var types = {};
*/ */
exports.registerType = function(type) { exports.registerType = function(type) {
types[type.name] = type; types[type.name] = type;
} };
/** /**
* Remove a type from the list available to the system * Remove a type from the list available to the system
*/ */
exports.deregisterType = function(type) { exports.deregisterType = function(type) {
delete types[type.name]; delete types[type.name];
} };
/** /**
* Find a type, previously registered using #registerType() * Find a type, previously registered using #registerType()
@ -144,6 +140,6 @@ exports.getType = function(typeSpec) {
if (typeof type === 'function') { if (typeof type === 'function') {
return type(typeSpec); return type(typeSpec);
} }
} };
}); });