Commit 2c5f0da3 authored by Vivien Alger's avatar Vivien Alger

etherpad-lite: Draft for promises

parent b2b75254
......@@ -16,13 +16,18 @@ extends =
../../component/git/buildout.cfg
../../component/nodejs/buildout.cfg
../../component/postgresql/buildout.cfg
../../component/phantomjs/buildout.cfg
parts =
postgresql
nodejs
phantomjs
etherpad-lite-repository
install-deps
template
template-html10n
template-index-promise-js
template-pad-promise-js
lxml-python
eggs
instance-recipe-egg
......@@ -59,16 +64,24 @@ mode = 0644
[instance-etherpad-lite]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-etherpad-lite.cfg
md5sum = 64ae9271f20e432ddc0516fe1bb17076
md5sum = dea0ee49ff3a87bd146e3d6bd6d68167
output = ${buildout:directory}/template-etherpad-lite.cfg
mode = 0644
[template-html10n]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/templates/${:filename}
filename = html10n.js
mode = 0644
md5sum = 6f90afdcc50bb5020896c95162d83834
output = ${etherpad-lite-repository:location}/src/static/js/${:filename}
[template-conf]
recipe = slapos.recipe.download
url = ${:_profile_base_location_}/templates/${:filename}
mode = 0644
filename = settings.json.in
md5sum = f9baee09003676fc1141f9bf4481f6a3
md5sum = d95264e66e2691b094d40a65d88ce681
location = ${buildout:parts-directory}/${:_buildout_section_name_}
[template-run-script]
......@@ -96,5 +109,21 @@ recipe = plone.recipe.command
command = ${template-deps-script:output}
update-command = command
[template-index-promise-js]
recipe = slapos.recipe.download
url = ${:_profile_base_location_}/templates/${:filename}
filename = test-index.js.in
mode = 0644
md5sum = 7ee12b1c284c2c6260689b21bb35176e
location = ${buildout:parts-directory}/${:_buildout_section_name_}
[template-pad-promise-js]
recipe = slapos.recipe.download
url = ${:_profile_base_location_}/templates/${:filename}
filename = test-pad.js.in
mode = 0644
md5sum = 43dc2ee94e65cc7f5fa4c3d6a868eebe
location = ${buildout:parts-directory}/${:_buildout_section_name_}
[lxml-python]
python = python2.7
......@@ -2,6 +2,9 @@
parts =
etherpad-lite
publish-connection-informations
check-index-promise
# XXX-Vivien: postponed till we can make it fast enough
# check-pad-promise
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
......@@ -27,10 +30,11 @@ promises = $${rootdirectory:etc}/promise/
recipe = slapos.cookbook:mkdirectory
etherpad-conf = $${rootdirectory:etc}/etherpad/
etherpad-repository-location = $${buildout:directory}/parts/etherpad-lite-repository
promise-js = $${rootdirectory:etc}/js/
[publish-connection-informations]
recipe = slapos.cookbook:publish
url = $${request-frontend:connection-site_url}
url = $${request-frontend:config-url}
[etherpad-conf-generation]
recipe = slapos.recipe.template
......@@ -38,6 +42,7 @@ url = ${template-conf:location}/${template-conf:filename}
ip = $${slap-network-information:global-ipv6}
dirtydb-location = $${rootdirectory:var}/dirty.db
port = 9001
welcome-message = Bienvenue sur Etherpad!\n\nLe texte que vous écrivez est synchronisez en ce moment même, pour que tout le monde puisse voir la page avec le même texte. Cela vous permet de collaborer sur des documents sans aucun problème!\n
mode = 0644
output = $${directory:etherpad-conf}/settings.json
......@@ -67,5 +72,34 @@ name = Frontend
software-url = http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/software/apache-frontend/software.cfg
slave = true
config = url
config-url = http://$${etherpad-conf-generation:ip}:$${etherpad-conf-generation:port}
config-url = http://[$${etherpad-conf-generation:ip}]:$${etherpad-conf-generation:port}
return = site_url
[index-promise-js]
recipe = slapos.recipe.template
url = ${template-index-promise-js:location}/${template-index-promise-js:filename}
content-url = $${publish-connection-informations:url}
mode = 0644
output = $${directory:promise-js}/test-index.js
[pad-promise-js]
recipe = slapos.recipe.template
url = ${template-pad-promise-js:location}/${template-pad-promise-js:filename}
content-url = $${publish-connection-informations:url}
welcome-message = $${etherpad-conf-generation:welcome-message}
mode = 0644
output = $${directory:promise-js}/test-pad.js
[check-index-promise]
recipe = slapos.cookbook:check_page_content_phantomjs
path = $${basedirectory:promises}/check-index-promise
dash-path = ${dash:location}/bin/dash
phantomjs-path = ${phantomjs:location}/phantomjs-slapos
script-path = $${index-promise-js:output}
[check-pad-promise]
recipe = slapos.cookbook:check_page_content_phantomjs
path = $${basedirectory:promises}/check-pad-promise
dash-path = ${dash:location}/bin/dash
phantomjs-path = ${phantomjs:location}/phantomjs-slapos
script-path = $${pad-promise-js:output}
\ No newline at end of file
......@@ -15,7 +15,8 @@ develop =
recipe = slapos.recipe.build:gitclone
repository = http://git.erp5.org/repos/slapos.git
git-executable = ${git:location}/bin/git
revision = 45243101321daeecaf755b9788b11259dd6bdfff
#revision = 45243101321daeecaf755b9788b11259dd6bdfff
branch = etherpad-lite
[slapos.toolbox-repository]
recipe = slapos.recipe.build:gitclone
......
This diff is collapsed.
......@@ -52,7 +52,7 @@
*/
//the default text of a pad
"defaultPadText" : "Bienvenue sur Etherpad!\n\nLe texte que vous écrivez est synchronisez en ce moment même, pour que tout le monde puisse voir la page avec le même texte. Cela vous permet de collaborer sur des documents sans aucun problème!\n",
"defaultPadText" : "${:welcome-message}",
/* Users must have a session to access pads. This effectively allows only group pads to be accessed. */
"requireSession" : false,
......
var page = require('webpage').create();
url = '${:content-url}'
page.open(url, function (status) {
var text = page.evaluate(function(){
return document.getElementById('button').textContent
});
if(text !== "" && text !== null) {
phantom.exit();
} else {
phantom.exit(1);
}
});
var page = require('webpage').create();
url = '${:content-url}/p/test'
page.open(url, function (status) {
setTimeout(function(){
var text = page.evaluate(function(){
var container = document.getElementById('editorcontainer');
var iframe = container.firstChild;
container = iframe.contentDocument.getElementById('outerdocbody');
iframe = container.firstChild;
container = iframe.contentDocument.getElementById('innerdocbody');
return container.textContent;
});
if (text === null) {
phantom.exit();
} else {
phantom.exit(1);
}
},2500);
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment