Merge branch 'pad2' of github.com:xwiki-labs/cryptpad into pad2
This commit is contained in:
31
www/common/loading.js
Normal file
31
www/common/loading.js
Normal file
@@ -0,0 +1,31 @@
|
||||
define([
|
||||
'less!/customize/src/less/cryptpad.less'
|
||||
], function () {
|
||||
var urlArgs = window.location.href.replace(/^.*\?([^\?]*)$/, function (all, x) { return x; });
|
||||
var elem = document.createElement('div');
|
||||
elem.setAttribute('id', 'loading');
|
||||
elem.innerHTML = [
|
||||
'<div class="loadingContainer">',
|
||||
'<img class="cryptofist" src="/customize/cryptpad-new-logo-colors-logoonly.png?' + urlArgs + '">',
|
||||
'<div class="spinnerContainer">',
|
||||
'<span class="fa fa-circle-o-notch fa-spin fa-4x fa-fw"></span>',
|
||||
'</div>',
|
||||
'<p id="cp-loading-message"></p>',
|
||||
'</div>'
|
||||
].join('');
|
||||
var intr;
|
||||
var append = function () {
|
||||
if (!document.body) { return; }
|
||||
clearInterval(intr);
|
||||
document.body.appendChild(elem);
|
||||
require([
|
||||
'/customize/messages.js',
|
||||
|
||||
'css!/bower_components/components-font-awesome/css/font-awesome.min.css',
|
||||
], function (Messages) {
|
||||
document.getElementById('cp-loading-message').innerText = Messages.loading;
|
||||
});
|
||||
};
|
||||
intr = setInterval(append, 100);
|
||||
append();
|
||||
});
|
||||
@@ -4,7 +4,7 @@ define([
|
||||
var out = {
|
||||
// fix up locations so that relative urls work.
|
||||
baseUrl: window.location.pathname,
|
||||
paths: {
|
||||
paths: {
|
||||
// jquery declares itself as literally "jquery" so it cannot be pulled by path :(
|
||||
"jquery": "/bower_components/jquery/dist/jquery.min",
|
||||
// json.sortify same
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
// Stage 0, this gets cached which means we can't change it. boot2-sframe.js is changable.
|
||||
// Note that this file is meant to be executed only inside of a sandbox iframe.
|
||||
;(function () {
|
||||
window.addEventListener('message', function (msg) {
|
||||
var data = JSON.parse(msg.data);
|
||||
if (data.q !== 'INIT') { return; }
|
||||
msg.source.postMessage(JSON.stringify({ txid: data.txid, content: 'OK' }), '*');
|
||||
if (data.content && data.content.requireConf) { require.config(data.content.requireConf); }
|
||||
require(['/common/sframe-boot2.js'], function () { });
|
||||
});
|
||||
});
|
||||
var req = JSON.parse(decodeURIComponent(window.location.hash.substring(1)));
|
||||
if (req.cfg) { require.config(req.cfg); }
|
||||
if (req.req) { require(req.req, function () { }); }
|
||||
}());
|
||||
@@ -50,10 +50,7 @@ define(['jquery'], function ($) {
|
||||
exp.updateTitle = function (newTitle, cb) {
|
||||
cb = cb || $.noop;
|
||||
if (newTitle === exp.title) { return; }
|
||||
// Change the title now, and set it back to the old value if there is an error
|
||||
//var oldTitle = exp.title;
|
||||
Common.updateTitle(newTitle, cb)
|
||||
//cb(null, newTitle);
|
||||
Common.updateTitle(newTitle, cb);
|
||||
};
|
||||
|
||||
// TODO not needed?
|
||||
|
||||
Reference in New Issue
Block a user