From b0d369883b17d8ab60eff0738f2f4ec8bb82e29f Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Thu, 28 Jun 2012 15:58:28 +0200 Subject: [PATCH 1/2] Fix plugin loader to work with windows paths (e.g. 'D:\foo\...') --- src/static/js/pluginfw/plugins.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/static/js/pluginfw/plugins.js b/src/static/js/pluginfw/plugins.js index 1d4862230..455dd203b 100644 --- a/src/static/js/pluginfw/plugins.js +++ b/src/static/js/pluginfw/plugins.js @@ -54,10 +54,22 @@ exports.formatHooks = function (hook_set_name) { }; exports.loadFn = function (path, hookName) { - var x = path.split(":"); - var fn = require(x[0]); - var functionName = x[1] ? x[1] : hookName; + var functionName + , parts = path.split(":"); + // on windows + if(process.platform == 'win32') { + if(parts.length == 3) + functionName = parts.pop(); + path = parts.join(":"); + }else{ + path = parts[0]; + functionName = parts[1]; + } + + var fn = require(path); + functionName = functionName ? functionName : hookName; + _.each(functionName.split("."), function (name) { fn = fn[name]; }); From c0ee0d8430a9d998a0383db3f856ef0f976a54ea Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Thu, 28 Jun 2012 15:58:39 +0200 Subject: [PATCH 2/2] Add windows install script --- bin/installOnWindows.bat | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 bin/installOnWindows.bat diff --git a/bin/installOnWindows.bat b/bin/installOnWindows.bat new file mode 100644 index 000000000..b6f699de8 --- /dev/null +++ b/bin/installOnWindows.bat @@ -0,0 +1,35 @@ +@echo off +set NODE_VERSION=0.6.5 +set JQUERY_VERSION=1.7 + +:: change directory to etherpad-lite root +cd bin +cd .. + +echo _ +echo Setting up settings.json... +copy settings.json.template_windows settings.json + +echo _ +echo Updating node... +curl -lo bin\node.exe http://nodejs.org/dist/v%NODE_VERSION%/node.exe + +echo _ +echo Installing etherpad-lite and dependencies... +cmd /C npm install src/ + +echo _ +echo Updating jquery... +curl -lo "node_modules\ep_etherpad-lite\static\js\jquery.min.js" "http://code.jquery.com/jquery-%JQUERY_VERSION%.min.js" + +echo _ +echo Some other stuff... +copy node_modules\ep_etherpad-lite\static\custom\js.template node_modules\ep_etherpad-lite\static\custom\index.template +copy node_modules\ep_etherpad-lite\static\custom\js.template node_modules\ep_etherpad-lite\static\custom\pad.template +copy node_modules\ep_etherpad-lite\static\custom\js.template node_modules\ep_etherpad-lite\static\custom\timeslider.template +copy node_modules\ep_etherpad-lite\static\custom\css.template node_modules\ep_etherpad-lite\static\custom\index.template +copy node_modules\ep_etherpad-lite\static\custom\css.template node_modules\ep_etherpad-lite\static\custom\pad.template +copy node_modules\ep_etherpad-lite\static\custom\css.template node_modules\ep_etherpad-lite\static\custom\timeslider.template + +echo _ +echo Installed Etherpad-lite! \ No newline at end of file