Merge branch 'staging' of github.com:xwiki-labs/cryptpad into staging

pull/1/head
yflory 8 years ago
commit f357ec32c2

@ -12,7 +12,6 @@ $(function () {
var Messages = Cryptpad.Messages; var Messages = Cryptpad.Messages;
var $body = $('body'); var $body = $('body');
var isMainApp = function () { var isMainApp = function () {
console.error("Checking if is main app");
return /^\/(pad|code|slide|poll|whiteboard|file|media|drive)\/$/.test(location.pathname); return /^\/(pad|code|slide|poll|whiteboard|file|media|drive)\/$/.test(location.pathname);
}; };
@ -119,57 +118,45 @@ $(function () {
var pathname = location.pathname; var pathname = location.pathname;
if (isMainApp()) { if (isMainApp()) {
console.log("Is main app");
if (typeof(Pages[pathname]) === 'function') { if (typeof(Pages[pathname]) === 'function') {
var $flash = $('body, #iframe-container, #pad-iframe, textarea');
$flash.css({
display: 'none',
opacity: 0,
overflow: 'hidden',
});
var ready = function () {
$flash.css({
display: '',
opacity: '',
overflow: '',
});
};
require([ require([
'less!/customize/src/less/loading.less' 'less!/customize/src/less/loading.less'
], function () { ], function () {
//$('body').html(h('body', Pages[pathname]()).innerHTML);
console.log("TEMPLATED");
if (/whiteboard/.test(pathname)) { if (/whiteboard/.test(pathname)) {
$('body').html(h('body', Pages[pathname]()).innerHTML); $('body').html(h('body', Pages[pathname]()).innerHTML);
setTimeout(function () { require(['/whiteboard/main.js'], ready);
require(['/whiteboard/main.js'], function () {
$('body').removeClass('noscroll');
});
});
} else if (/poll/.test(pathname)) { } else if (/poll/.test(pathname)) {
$('body').html(h('body', Pages[pathname]()).innerHTML); $('body').html(h('body', Pages[pathname]()).innerHTML);
setTimeout(function () { require(['/poll/main.js'], ready);
require(['/poll/main.js'], function () {
$('body').removeClass('noscroll');
console.log("TEMPLATE!");
});
});
} else if (/drive/.test(pathname)) { } else if (/drive/.test(pathname)) {
$('body').append(h('body', Pages[pathname]()).innerHTML); $('body').append(h('body', Pages[pathname]()).innerHTML);
setTimeout(function () { require(['/drive/main.js'], ready);
require(['/drive/main.js'], function () {
console.log("Templating done");
});
});
} else if (/file/.test(pathname)) { } else if (/file/.test(pathname)) {
$('body').append(h('body', Pages[pathname]()).innerHTML); $('body').append(h('body', Pages[pathname]()).innerHTML);
require([ '/file/main.js' ], function () { require([ '/file/main.js' ], ready);
console.log("Templating done");
});
} else if (/pad/.test(pathname)) { } else if (/pad/.test(pathname)) {
$('body').append(h('body', Pages[pathname]()).innerHTML); $('body').append(h('body', Pages[pathname]()).innerHTML);
require([ '/pad/main.js' ], function () { require([ '/pad/main.js' ], ready);
console.log("Templating done");
});
} else if (/code/.test(pathname)) { } else if (/code/.test(pathname)) {
$('body').append(h('body', Pages[pathname]()).innerHTML); $('body').append(h('body', Pages[pathname]()).innerHTML);
require([ '/code/main.js' ], function () { require([ '/code/main.js' ], ready);
console.log("Templating done");
});
} else if (/slide/.test(pathname)) { } else if (/slide/.test(pathname)) {
$('body').append(h('body', Pages[pathname]()).innerHTML); $('body').append(h('body', Pages[pathname]()).innerHTML);
require([ '/slide/main.js' ], function () { require([ '/slide/main.js' ], ready);
console.log("Templating done");
});
} }
}); });

@ -23,7 +23,7 @@ to others who want to participate.
Cryptpad depends on the Nodejs runtime. Cryptpad depends on the Nodejs runtime.
We recommend installing it via [NVM](https://github.com/creationix/nvm "Node Version Manager") to ensure that you are running an up to date version. We recommend installing it via [NVM](https://github.com/creationix/nvm "Node Version Manager") to ensure that you are running an up to date version.
Once you have a recent runtime: Once you have a recent runtime (we use v6.6.0):
``` ```
git clone <this repo> git clone <this repo>

@ -4,7 +4,6 @@
<meta content="text/html; charset=utf-8" http-equiv="content-type"/> <meta content="text/html; charset=utf-8" http-equiv="content-type"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<script async data-bootload="/customize/template.js" data-main="/common/boot.js?ver=1.0" src="/bower_components/requirejs/require.js?ver=2.1.15"></script> <script async data-bootload="/customize/template.js" data-main="/common/boot.js?ver=1.0" src="/bower_components/requirejs/require.js?ver=2.1.15"></script>
<style> .noscroll { overflow-y: hidden; } </style>
</head> </head>
<body class='noscroll'> <body>

Loading…
Cancel
Save