From f370a6f7fa90550ed17a63a165b2b6f78c43e52a Mon Sep 17 00:00:00 2001 From: Fabian Jakobs Date: Mon, 13 Dec 2010 10:39:25 +0100 Subject: [PATCH] remove lib directory from plugins otherwise the modules cannot be loaded with nodejs --- demo/boot.js | 3 +- plugins/cockpit/{lib => }/cli.js | 0 plugins/cockpit/{lib => }/index.js | 0 plugins/cockpit/{lib => }/test/assert.js | 0 plugins/cockpit/{lib => }/test/testCli.js | 0 plugins/cockpit/{lib => }/test/testNothing.js | 0 plugins/cockpit/{lib => }/ui/plain.css | 0 plugins/cockpit/{lib => }/ui/plain.js | 0 plugins/pilot/{lib => }/canon.js | 0 plugins/pilot/{lib => }/catalog.js | 0 plugins/pilot/{lib => }/commands/settings.js | 0 plugins/pilot/{lib => }/console.js | 0 plugins/pilot/{lib => }/core.js | 0 plugins/pilot/{lib => }/dom.js | 0 plugins/pilot/{lib => }/event.js | 0 plugins/pilot/{lib => }/event_emitter.js | 0 plugins/pilot/fixoldbrowsers.js | 145 +++++++++++++++++ plugins/pilot/{lib => }/index.js | 1 - plugins/pilot/{lib => }/keyboard/index.js | 0 plugins/pilot/{lib => }/keyboard/keyutil.js | 0 .../{lib => }/keyboard/tests/testKeyboard.js | 0 plugins/pilot/{lib => }/lang.js | 0 plugins/pilot/lib/fixoldbrowsers.js | 147 ------------------ plugins/pilot/{lib => }/oop.js | 0 plugins/pilot/{lib => }/plugin_manager.js | 0 plugins/pilot/{lib => }/promise.js | 0 plugins/pilot/{lib => }/proxy.js | 0 plugins/pilot/{lib => }/rangeutils.js | 0 plugins/pilot/{lib => }/settings.js | 0 plugins/pilot/{lib => }/settings/canon.js | 0 plugins/pilot/{lib => }/stacktrace.js | 0 .../pilot/{lib => }/tests/testRangeutils.js | 0 plugins/pilot/{lib => }/types.js | 0 plugins/pilot/{lib => }/types/basic.js | 0 plugins/pilot/{lib => }/types/command.js | 0 plugins/pilot/{lib => }/types/settings.js | 0 plugins/pilot/{lib => }/util.js | 0 37 files changed, 147 insertions(+), 149 deletions(-) rename plugins/cockpit/{lib => }/cli.js (100%) rename plugins/cockpit/{lib => }/index.js (100%) rename plugins/cockpit/{lib => }/test/assert.js (100%) rename plugins/cockpit/{lib => }/test/testCli.js (100%) rename plugins/cockpit/{lib => }/test/testNothing.js (100%) rename plugins/cockpit/{lib => }/ui/plain.css (100%) rename plugins/cockpit/{lib => }/ui/plain.js (100%) rename plugins/pilot/{lib => }/canon.js (100%) rename plugins/pilot/{lib => }/catalog.js (100%) rename plugins/pilot/{lib => }/commands/settings.js (100%) rename plugins/pilot/{lib => }/console.js (100%) rename plugins/pilot/{lib => }/core.js (100%) rename plugins/pilot/{lib => }/dom.js (100%) rename plugins/pilot/{lib => }/event.js (100%) rename plugins/pilot/{lib => }/event_emitter.js (100%) create mode 100644 plugins/pilot/fixoldbrowsers.js rename plugins/pilot/{lib => }/index.js (99%) rename plugins/pilot/{lib => }/keyboard/index.js (100%) rename plugins/pilot/{lib => }/keyboard/keyutil.js (100%) rename plugins/pilot/{lib => }/keyboard/tests/testKeyboard.js (100%) rename plugins/pilot/{lib => }/lang.js (100%) delete mode 100644 plugins/pilot/lib/fixoldbrowsers.js rename plugins/pilot/{lib => }/oop.js (100%) rename plugins/pilot/{lib => }/plugin_manager.js (100%) rename plugins/pilot/{lib => }/promise.js (100%) rename plugins/pilot/{lib => }/proxy.js (100%) rename plugins/pilot/{lib => }/rangeutils.js (100%) rename plugins/pilot/{lib => }/settings.js (100%) rename plugins/pilot/{lib => }/settings/canon.js (100%) rename plugins/pilot/{lib => }/stacktrace.js (100%) rename plugins/pilot/{lib => }/tests/testRangeutils.js (100%) rename plugins/pilot/{lib => }/types.js (100%) rename plugins/pilot/{lib => }/types/basic.js (100%) rename plugins/pilot/{lib => }/types/command.js (100%) rename plugins/pilot/{lib => }/types/settings.js (100%) rename plugins/pilot/{lib => }/util.js (100%) diff --git a/demo/boot.js b/demo/boot.js index 8cb3e6e3..95b704b9 100644 --- a/demo/boot.js +++ b/demo/boot.js @@ -96,7 +96,8 @@ var setupPlugins = function(config, callback) { for (i = 0; i < packages.length; i++) { location.push({ name: packages[i], - main: "index" + main: "index", + lib: "." }); knownPlugins.push(packages[i]); } diff --git a/plugins/cockpit/lib/cli.js b/plugins/cockpit/cli.js similarity index 100% rename from plugins/cockpit/lib/cli.js rename to plugins/cockpit/cli.js diff --git a/plugins/cockpit/lib/index.js b/plugins/cockpit/index.js similarity index 100% rename from plugins/cockpit/lib/index.js rename to plugins/cockpit/index.js diff --git a/plugins/cockpit/lib/test/assert.js b/plugins/cockpit/test/assert.js similarity index 100% rename from plugins/cockpit/lib/test/assert.js rename to plugins/cockpit/test/assert.js diff --git a/plugins/cockpit/lib/test/testCli.js b/plugins/cockpit/test/testCli.js similarity index 100% rename from plugins/cockpit/lib/test/testCli.js rename to plugins/cockpit/test/testCli.js diff --git a/plugins/cockpit/lib/test/testNothing.js b/plugins/cockpit/test/testNothing.js similarity index 100% rename from plugins/cockpit/lib/test/testNothing.js rename to plugins/cockpit/test/testNothing.js diff --git a/plugins/cockpit/lib/ui/plain.css b/plugins/cockpit/ui/plain.css similarity index 100% rename from plugins/cockpit/lib/ui/plain.css rename to plugins/cockpit/ui/plain.css diff --git a/plugins/cockpit/lib/ui/plain.js b/plugins/cockpit/ui/plain.js similarity index 100% rename from plugins/cockpit/lib/ui/plain.js rename to plugins/cockpit/ui/plain.js diff --git a/plugins/pilot/lib/canon.js b/plugins/pilot/canon.js similarity index 100% rename from plugins/pilot/lib/canon.js rename to plugins/pilot/canon.js diff --git a/plugins/pilot/lib/catalog.js b/plugins/pilot/catalog.js similarity index 100% rename from plugins/pilot/lib/catalog.js rename to plugins/pilot/catalog.js diff --git a/plugins/pilot/lib/commands/settings.js b/plugins/pilot/commands/settings.js similarity index 100% rename from plugins/pilot/lib/commands/settings.js rename to plugins/pilot/commands/settings.js diff --git a/plugins/pilot/lib/console.js b/plugins/pilot/console.js similarity index 100% rename from plugins/pilot/lib/console.js rename to plugins/pilot/console.js diff --git a/plugins/pilot/lib/core.js b/plugins/pilot/core.js similarity index 100% rename from plugins/pilot/lib/core.js rename to plugins/pilot/core.js diff --git a/plugins/pilot/lib/dom.js b/plugins/pilot/dom.js similarity index 100% rename from plugins/pilot/lib/dom.js rename to plugins/pilot/dom.js diff --git a/plugins/pilot/lib/event.js b/plugins/pilot/event.js similarity index 100% rename from plugins/pilot/lib/event.js rename to plugins/pilot/event.js diff --git a/plugins/pilot/lib/event_emitter.js b/plugins/pilot/event_emitter.js similarity index 100% rename from plugins/pilot/lib/event_emitter.js rename to plugins/pilot/event_emitter.js diff --git a/plugins/pilot/fixoldbrowsers.js b/plugins/pilot/fixoldbrowsers.js new file mode 100644 index 00000000..1f7f1033 --- /dev/null +++ b/plugins/pilot/fixoldbrowsers.js @@ -0,0 +1,145 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Mozilla Skywriter. + * + * The Initial Developer of the Original Code is + * Mozilla. + * Portions created by the Initial Developer are Copyright (C) 2009 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Kevin Dangoor (kdangoor@mozilla.com) + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +define(function(require, exports, module) { + +// Narwhal's shim for ES5 defineProperty +// ES5 15.2.3.6 +if (!Object.defineProperty) { + Object.defineProperty = function(object, property, descriptor) { + var has = Object.prototype.hasOwnProperty; + if (typeof descriptor == "object" && object.__defineGetter__) { + if (has.call(descriptor, "value")) { + if (!object.__lookupGetter__(property) && !object.__lookupSetter__(property)) { + // data property defined and no pre-existing accessors + object[property] = descriptor.value; + } + if (has.call(descriptor, "get") || has.call(descriptor, "set")) { + // descriptor has a value property but accessor already exists + throw new TypeError("Object doesn't support this action"); + } + } + // fail silently if "writable", "enumerable", or "configurable" + // are requested but not supported + /* + // alternate approach: + if ( // can't implement these features; allow false but not true + !(has.call(descriptor, "writable") ? descriptor.writable : true) || + !(has.call(descriptor, "enumerable") ? descriptor.enumerable : true) || + !(has.call(descriptor, "configurable") ? descriptor.configurable : true) + ) + throw new RangeError( + "This implementation of Object.defineProperty does not " + + "support configurable, enumerable, or writable." + ); + */ + else if (typeof descriptor.get == "function") { + object.__defineGetter__(property, descriptor.get); + } + if (typeof descriptor.set == "function") { + object.__defineSetter__(property, descriptor.set); + } + } + return object; + }; +} + +// ES5 15.2.3.7 +if (!Object.defineProperties) { + Object.defineProperties = function(object, properties) { + for (var property in properties) { + if (Object.prototype.hasOwnProperty.call(properties, property)) { + Object.defineProperty(object, property, properties[property]); + } + } + return object; + }; +} + + + +/** + * Array detector. + * Firefox 3.5 and Safari 4 have this already. Chrome 4 however ... + * Note to Dojo - your isArray is still broken: instanceof doesn't work with + * Arrays taken from a different frame/window. + */ +if (!Array.isArray) { + Array.isArray = function(data) { + return data && Object.prototype.toString.call(data) === "[object Array]"; + }; +} + +/** + * Retrieves the list of keys on an object. + */ +if (!Object.keys) { + Object.keys = function(obj) { + var k, ret = []; + for (k in obj) { + if (obj.hasOwnProperty(k)) { + ret.push(k); + } + } + return ret; + }; +} + +if (!Function.prototype.bind) { + // From Narwhal + Function.prototype.bind = function () { + var args = Array.prototype.slice.call(arguments); + var self = this; + var bound = function () { + return self.call.apply( + self, + args.concat( + Array.prototype.slice.call(arguments) + ) + ); + }; + bound.name = this.name; + bound.displayName = this.displayName; + bound.length = this.length; + bound.unbound = self; + return bound; + }; +} + +exports.globalsLoaded = true; + +}); \ No newline at end of file diff --git a/plugins/pilot/lib/index.js b/plugins/pilot/index.js similarity index 99% rename from plugins/pilot/lib/index.js rename to plugins/pilot/index.js index 73262d42..157d4f1c 100644 --- a/plugins/pilot/lib/index.js +++ b/plugins/pilot/index.js @@ -50,7 +50,6 @@ packages.unshift("require", "exports", "module"); define(packages, function(require, exports, module) { -console.log(packages); exports.startup = function(data, reason) { deps.forEach(function(dep) { console.log("test startup for " + dep); diff --git a/plugins/pilot/lib/keyboard/index.js b/plugins/pilot/keyboard/index.js similarity index 100% rename from plugins/pilot/lib/keyboard/index.js rename to plugins/pilot/keyboard/index.js diff --git a/plugins/pilot/lib/keyboard/keyutil.js b/plugins/pilot/keyboard/keyutil.js similarity index 100% rename from plugins/pilot/lib/keyboard/keyutil.js rename to plugins/pilot/keyboard/keyutil.js diff --git a/plugins/pilot/lib/keyboard/tests/testKeyboard.js b/plugins/pilot/keyboard/tests/testKeyboard.js similarity index 100% rename from plugins/pilot/lib/keyboard/tests/testKeyboard.js rename to plugins/pilot/keyboard/tests/testKeyboard.js diff --git a/plugins/pilot/lib/lang.js b/plugins/pilot/lang.js similarity index 100% rename from plugins/pilot/lib/lang.js rename to plugins/pilot/lang.js diff --git a/plugins/pilot/lib/fixoldbrowsers.js b/plugins/pilot/lib/fixoldbrowsers.js deleted file mode 100644 index 995afb8a..00000000 --- a/plugins/pilot/lib/fixoldbrowsers.js +++ /dev/null @@ -1,147 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Skywriter. - * - * The Initial Developer of the Original Code is - * Mozilla. - * Portions created by the Initial Developer are Copyright (C) 2009 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Kevin Dangoor (kdangoor@mozilla.com) - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - -exports.startup = function(data, reason) { - // Narwhal's shim for ES5 defineProperty - // ES5 15.2.3.6 - if (!Object.defineProperty) { - Object.defineProperty = function(object, property, descriptor) { - var has = Object.prototype.hasOwnProperty; - if (typeof descriptor == "object" && object.__defineGetter__) { - if (has.call(descriptor, "value")) { - if (!object.__lookupGetter__(property) && !object.__lookupSetter__(property)) { - // data property defined and no pre-existing accessors - object[property] = descriptor.value; - } - if (has.call(descriptor, "get") || has.call(descriptor, "set")) { - // descriptor has a value property but accessor already exists - throw new TypeError("Object doesn't support this action"); - } - } - // fail silently if "writable", "enumerable", or "configurable" - // are requested but not supported - /* - // alternate approach: - if ( // can't implement these features; allow false but not true - !(has.call(descriptor, "writable") ? descriptor.writable : true) || - !(has.call(descriptor, "enumerable") ? descriptor.enumerable : true) || - !(has.call(descriptor, "configurable") ? descriptor.configurable : true) - ) - throw new RangeError( - "This implementation of Object.defineProperty does not " + - "support configurable, enumerable, or writable." - ); - */ - else if (typeof descriptor.get == "function") { - object.__defineGetter__(property, descriptor.get); - } - if (typeof descriptor.set == "function") { - object.__defineSetter__(property, descriptor.set); - } - } - return object; - }; - } - - // ES5 15.2.3.7 - if (!Object.defineProperties) { - Object.defineProperties = function(object, properties) { - for (var property in properties) { - if (Object.prototype.hasOwnProperty.call(properties, property)) { - Object.defineProperty(object, property, properties[property]); - } - } - return object; - }; - } - - - - /** - * Array detector. - * Firefox 3.5 and Safari 4 have this already. Chrome 4 however ... - * Note to Dojo - your isArray is still broken: instanceof doesn't work with - * Arrays taken from a different frame/window. - */ - if (!Array.isArray) { - Array.isArray = function(data) { - return data && Object.prototype.toString.call(data) === "[object Array]"; - }; - } - - /** - * Retrieves the list of keys on an object. - */ - if (!Object.keys) { - Object.keys = function(obj) { - var k, ret = []; - for (k in obj) { - if (obj.hasOwnProperty(k)) { - ret.push(k); - } - } - return ret; - }; - } - - if (!Function.prototype.bind) { - // From Narwhal - Function.prototype.bind = function () { - var args = Array.prototype.slice.call(arguments); - var self = this; - var bound = function () { - return self.call.apply( - self, - args.concat( - Array.prototype.slice.call(arguments) - ) - ); - }; - bound.name = this.name; - bound.displayName = this.displayName; - bound.length = this.length; - bound.unbound = self; - return bound; - }; - } - - exports.globalsLoaded = true; -}; - -}); \ No newline at end of file diff --git a/plugins/pilot/lib/oop.js b/plugins/pilot/oop.js similarity index 100% rename from plugins/pilot/lib/oop.js rename to plugins/pilot/oop.js diff --git a/plugins/pilot/lib/plugin_manager.js b/plugins/pilot/plugin_manager.js similarity index 100% rename from plugins/pilot/lib/plugin_manager.js rename to plugins/pilot/plugin_manager.js diff --git a/plugins/pilot/lib/promise.js b/plugins/pilot/promise.js similarity index 100% rename from plugins/pilot/lib/promise.js rename to plugins/pilot/promise.js diff --git a/plugins/pilot/lib/proxy.js b/plugins/pilot/proxy.js similarity index 100% rename from plugins/pilot/lib/proxy.js rename to plugins/pilot/proxy.js diff --git a/plugins/pilot/lib/rangeutils.js b/plugins/pilot/rangeutils.js similarity index 100% rename from plugins/pilot/lib/rangeutils.js rename to plugins/pilot/rangeutils.js diff --git a/plugins/pilot/lib/settings.js b/plugins/pilot/settings.js similarity index 100% rename from plugins/pilot/lib/settings.js rename to plugins/pilot/settings.js diff --git a/plugins/pilot/lib/settings/canon.js b/plugins/pilot/settings/canon.js similarity index 100% rename from plugins/pilot/lib/settings/canon.js rename to plugins/pilot/settings/canon.js diff --git a/plugins/pilot/lib/stacktrace.js b/plugins/pilot/stacktrace.js similarity index 100% rename from plugins/pilot/lib/stacktrace.js rename to plugins/pilot/stacktrace.js diff --git a/plugins/pilot/lib/tests/testRangeutils.js b/plugins/pilot/tests/testRangeutils.js similarity index 100% rename from plugins/pilot/lib/tests/testRangeutils.js rename to plugins/pilot/tests/testRangeutils.js diff --git a/plugins/pilot/lib/types.js b/plugins/pilot/types.js similarity index 100% rename from plugins/pilot/lib/types.js rename to plugins/pilot/types.js diff --git a/plugins/pilot/lib/types/basic.js b/plugins/pilot/types/basic.js similarity index 100% rename from plugins/pilot/lib/types/basic.js rename to plugins/pilot/types/basic.js diff --git a/plugins/pilot/lib/types/command.js b/plugins/pilot/types/command.js similarity index 100% rename from plugins/pilot/lib/types/command.js rename to plugins/pilot/types/command.js diff --git a/plugins/pilot/lib/types/settings.js b/plugins/pilot/types/settings.js similarity index 100% rename from plugins/pilot/lib/types/settings.js rename to plugins/pilot/types/settings.js diff --git a/plugins/pilot/lib/util.js b/plugins/pilot/util.js similarity index 100% rename from plugins/pilot/lib/util.js rename to plugins/pilot/util.js