mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-02-01 03:12:42 +01:00
Merge branch 'develop' of https://github.com/Pita/etherpad-lite into develop
This commit is contained in:
commit
d56135476e
6 changed files with 31 additions and 15 deletions
|
@ -6,10 +6,6 @@ set JQUERY_VERSION=1.7
|
||||||
cd bin
|
cd bin
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
echo _
|
|
||||||
echo Setting up settings.json...
|
|
||||||
copy settings.json.template_windows settings.json
|
|
||||||
|
|
||||||
echo _
|
echo _
|
||||||
echo Updating node...
|
echo Updating node...
|
||||||
curl -lo bin\node.exe http://nodejs.org/dist/v%NODE_VERSION%/node.exe
|
curl -lo bin\node.exe http://nodejs.org/dist/v%NODE_VERSION%/node.exe
|
||||||
|
@ -23,13 +19,20 @@ echo Updating jquery...
|
||||||
curl -lo "node_modules\ep_etherpad-lite\static\js\jquery.min.js" "http://code.jquery.com/jquery-%JQUERY_VERSION%.min.js"
|
curl -lo "node_modules\ep_etherpad-lite\static\js\jquery.min.js" "http://code.jquery.com/jquery-%JQUERY_VERSION%.min.js"
|
||||||
|
|
||||||
echo _
|
echo _
|
||||||
echo Some other stuff...
|
echo Copying custom templates...
|
||||||
copy node_modules\ep_etherpad-lite\static\custom\js.template node_modules\ep_etherpad-lite\static\custom\index.template
|
set custom_dir=node_modules\ep_etherpad-lite\static\custom
|
||||||
copy node_modules\ep_etherpad-lite\static\custom\js.template node_modules\ep_etherpad-lite\static\custom\pad.template
|
FOR %%f IN (index pad timeslider) DO (
|
||||||
copy node_modules\ep_etherpad-lite\static\custom\js.template node_modules\ep_etherpad-lite\static\custom\timeslider.template
|
if NOT EXIST %custom_dir%\%%f.js copy %custom_dir%\js.template %custom_dir%\%%f.js
|
||||||
copy node_modules\ep_etherpad-lite\static\custom\css.template node_modules\ep_etherpad-lite\static\custom\index.template
|
if NOT EXIST %custom_dir%\%%f.css copy %custom_dir%\css.template %custom_dir%\%%f.css
|
||||||
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 Clearing cache.
|
||||||
|
del /S var\minified*
|
||||||
|
|
||||||
|
echo _
|
||||||
|
echo Setting up settings.json...
|
||||||
|
IF NOT EXIST settings.json copy settings.json.template_windows settings.json
|
||||||
|
|
||||||
echo _
|
echo _
|
||||||
echo Installed Etherpad-lite!
|
echo Installed Etherpad-lite!
|
|
@ -48,6 +48,7 @@ exports.createGroupPad = groupManager.createGroupPad;
|
||||||
exports.createAuthor = authorManager.createAuthor;
|
exports.createAuthor = authorManager.createAuthor;
|
||||||
exports.createAuthorIfNotExistsFor = authorManager.createAuthorIfNotExistsFor;
|
exports.createAuthorIfNotExistsFor = authorManager.createAuthorIfNotExistsFor;
|
||||||
exports.listPadsOfAuthor = authorManager.listPadsOfAuthor;
|
exports.listPadsOfAuthor = authorManager.listPadsOfAuthor;
|
||||||
|
exports.padUsersCount = padMessageHandler.padUsersCount;
|
||||||
|
|
||||||
/**********************/
|
/**********************/
|
||||||
/**SESSION FUNCTIONS***/
|
/**SESSION FUNCTIONS***/
|
||||||
|
|
|
@ -65,7 +65,8 @@ var functions = {
|
||||||
"getPublicStatus" : ["padID"],
|
"getPublicStatus" : ["padID"],
|
||||||
"setPassword" : ["padID", "password"],
|
"setPassword" : ["padID", "password"],
|
||||||
"isPasswordProtected" : ["padID"],
|
"isPasswordProtected" : ["padID"],
|
||||||
"listAuthorsOfPad" : ["padID"]
|
"listAuthorsOfPad" : ["padID"],
|
||||||
|
"padUsersCount" : ["padID"]
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1348,3 +1348,14 @@ function composePadChangesets(padId, startNum, endNum, callback)
|
||||||
callback(null, changeset);
|
callback(null, changeset);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the number of users in a pad
|
||||||
|
*/
|
||||||
|
exports.padUsersCount = function (padID, callback) {
|
||||||
|
if (!pad2sessions[padID] || typeof pad2sessions[padID] != typeof []) {
|
||||||
|
callback(null, {padUsersCount: 0});
|
||||||
|
} else {
|
||||||
|
callback(null, {padUsersCount: pad2sessions[padID].length});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ exports.expressCreateServer = function (hook_name, args, cb) {
|
||||||
//the pad id was sanitized, so we redirect to the sanitized version
|
//the pad id was sanitized, so we redirect to the sanitized version
|
||||||
if(sanitizedPadId != padId)
|
if(sanitizedPadId != padId)
|
||||||
{
|
{
|
||||||
var real_url = req.url.replace(/^\/p\/[^\/]+/, '/p/' + sanitizedPadId);
|
var real_url = sanitizedPadId;
|
||||||
var query = url.parse(req.url).query;
|
var query = url.parse(req.url).query;
|
||||||
if ( query ) real_url += '?' + query;
|
if ( query ) real_url += '?' + query;
|
||||||
res.header('Location', real_url);
|
res.header('Location', real_url);
|
||||||
|
|
|
@ -57,8 +57,8 @@ exports.loadFn = function (path, hookName) {
|
||||||
var functionName
|
var functionName
|
||||||
, parts = path.split(":");
|
, parts = path.split(":");
|
||||||
|
|
||||||
// on windows
|
// on windows: C:\foo\bar:xyz
|
||||||
if(process.platform == 'win32') {
|
if(parts[0].length == 1) {
|
||||||
if(parts.length == 3)
|
if(parts.length == 3)
|
||||||
functionName = parts.pop();
|
functionName = parts.pop();
|
||||||
path = parts.join(":");
|
path = parts.join(":");
|
||||||
|
|
Loading…
Reference in a new issue