The Big Renaming - etherpad is now an NPM module

This commit is contained in:
Egil Moeller 2012-02-26 13:07:51 +01:00
parent 1955bdec9a
commit 1239ce7f28
116 changed files with 9721 additions and 30 deletions

View File

@ -23,7 +23,7 @@ node-inspector &
echo "If you are new to node-inspector, take a look at this video: http://youtu.be/AOnK3NVnxL8"
cd "node"
node --debug server.js
node --debug node_modules/pluginomatic_etherpad-lite/node/server.js $*
#kill node-inspector before ending
kill $!

View File

@ -21,9 +21,9 @@ if [ "$(id -u)" -eq 0 ]; then
fi
#prepare the enviroment
bin/installDeps.sh $* || exit 1
#bin/installDeps.sh $* || exit 1
npm link ./src
#Move to the node folder and start
echo "start..."
cd "node"
node server.js $*
node node_modules/pluginomatic_etherpad-lite/node/server.js $*

View File

@ -41,10 +41,6 @@ exports.formatHooks = function () {
exports.update = function (cb) {
exports.getPackages(function (er, packages) {
packages.__builtin__ = {
"path": path.resolve(npm.dir, "../..")
};
var parts = [];
var plugins = {};
// Load plugin metadata pluginomatic.json
@ -66,8 +62,7 @@ exports.update = function (cb) {
exports.getPackages = function (cb) {
// Load list of installed NPM packages, flatten it to a list, and filter out only packages with names that
// ../.. and not just .. because current dir is like ETHERPAD_ROOT/node/node_modules (!!!!)
var dir = path.resolve(npm.dir, "../..")
var dir = path.resolve(npm.dir, '..');
readInstalled(dir, function (er, data) {
if (er) cb(er, null);
var packages = {};
@ -107,14 +102,22 @@ exports.loadPlugin = function (packages, plugin_name, plugins, parts, cb) {
fs.readFile(
plugin_path,
function (er, data) {
var plugin = JSON.parse(data);
plugin.package = packages[plugin_name];
plugins[plugin_name] = plugin;
plugin.parts.forEach(function (part) {
part.plugin = plugin_name;
part.full_name = plugin_name + "/" + part.name;
parts[part.full_name] = part;
});
if (er) {
console.error("Unable to load plugin definition file " + plugin_path);
return cb();
}
try {
var plugin = JSON.parse(data);
plugin.package = packages[plugin_name];
plugins[plugin_name] = plugin;
plugin.parts.forEach(function (part) {
part.plugin = plugin_name;
part.full_name = plugin_name + "/" + part.name;
parts[part.full_name] = part;
});
} catch (ex) {
console.error("Unable to parse plugin definition file " + plugin_path + ": " + ex.toString());
}
cb();
}
);

View File

@ -36,7 +36,7 @@ var os = require('os');
var ROOT_DIR = path.normalize(__dirname + "/../" );
var JS_DIR = ROOT_DIR + '../static/js/';
var CSS_DIR = ROOT_DIR + '../static/css/';
var CACHE_DIR = ROOT_DIR + '../var/';
var CACHE_DIR = path.join(settings.root, 'var');
var TAR_PATH = path.join(__dirname, 'tar.json');
var tar = JSON.parse(fs.readFileSync(TAR_PATH, 'utf8'));
@ -160,7 +160,7 @@ function _handle(req, res, jsFilename, jsFiles) {
//write the results plain in a file
function(callback)
{
fs.writeFile(CACHE_DIR + "minified_" + jsFilename, result, "utf8", callback);
fs.writeFile(CACHE_DIR + "/minified_" + jsFilename, result, "utf8", callback);
},
//write the results compressed in a file
function(callback)
@ -171,7 +171,7 @@ function _handle(req, res, jsFilename, jsFiles) {
if(ERR(err, callback)) return;
fs.writeFile(CACHE_DIR + "minified_" + jsFilename + ".gz", compressedResult, callback);
fs.writeFile(CACHE_DIR + "/minified_" + jsFilename + ".gz", compressedResult, callback);
});
}
],callback);
@ -189,12 +189,12 @@ function _handle(req, res, jsFilename, jsFiles) {
var pathStr;
if(gzipSupport && os.type().indexOf("Windows") == -1)
{
pathStr = path.normalize(CACHE_DIR + "minified_" + jsFilename + ".gz");
pathStr = path.normalize(CACHE_DIR + "/minified_" + jsFilename + ".gz");
res.header('Content-Encoding', 'gzip');
}
else
{
pathStr = path.normalize(CACHE_DIR + "minified_" + jsFilename );
pathStr = path.normalize(CACHE_DIR + "/minified_" + jsFilename );
}
res.sendfile(pathStr, { maxAge: server.maxAge });

View File

@ -23,6 +23,10 @@ var fs = require("fs");
var os = require("os");
var path = require('path');
var argv = require('./Cli').argv;
var npm = require("npm/lib/npm.js");
/* Root path of the installation */
exports.root = path.normalize(path.join(npm.dir, ".."));
/**
* The IP ep-lite should listen to
@ -40,7 +44,7 @@ exports.dbType = "dirty";
/**
* This setting is passed with dbType to ueberDB to set up the database
*/
exports.dbSettings = { "filename" : "../var/dirty.db" };
exports.dbSettings = { "filename" : path.join(exports.root, "var/dirty.db") };
/**
* The default Text of a new pad
*/
@ -91,10 +95,12 @@ exports.abiwordAvailable = function()
// Discover where the settings file lives
var settingsFilename = argv.settings || "settings.json";
var settingsPath = settingsFilename.charAt(0) == '/' ? '' : path.normalize(__dirname + "/../../");
if (settingsFilename.charAt(0) != '/') {
settingsFilename = path.normalize(path.join(root, settingsFilename));
}
//read the settings sync
var settingsStr = fs.readFileSync(settingsPath + settingsFilename).toString();
var settingsStr = fs.readFileSync(settingsFilename).toString();
//remove all comments
settingsStr = settingsStr.replace(/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+/gm,"").replace(/#.*/g,"").replace(/\/\/.*/g,"");

View File

@ -1,5 +1,5 @@
{
"name" : "etherpad-lite",
"name" : "pluginomatic_etherpad-lite",
"description" : "A Etherpad based on node.js",
"homepage" : "https://github.com/Pita/etherpad-lite",
"keywords" : ["etherpad", "realtime", "collaborative", "editor"],

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 697 B

After

Width:  |  Height:  |  Size: 697 B

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1009 B

After

Width:  |  Height:  |  Size: 1009 B

View File

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 494 B

After

Width:  |  Height:  |  Size: 494 B

View File

Before

Width:  |  Height:  |  Size: 658 B

After

Width:  |  Height:  |  Size: 658 B

View File

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

Before

Width:  |  Height:  |  Size: 123 B

After

Width:  |  Height:  |  Size: 123 B

View File

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 131 B

View File

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

Before

Width:  |  Height:  |  Size: 182 B

After

Width:  |  Height:  |  Size: 182 B

View File

Before

Width:  |  Height:  |  Size: 686 B

After

Width:  |  Height:  |  Size: 686 B

View File

Before

Width:  |  Height:  |  Size: 517 B

After

Width:  |  Height:  |  Size: 517 B

9266
src/static/js/jquery.js vendored Normal file

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More