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

pull/1/head
yflory 7 years ago
commit f06683e949

@ -10,7 +10,13 @@ define([
var module = { exports: {} }; var module = { exports: {} };
var key = Config.requireConf.urlArgs; var key = Config.requireConf.urlArgs;
var localStorage = window.localStorage || {}; var localStorage;
try {
localStorage = window.localStorage || {};
} catch (e) {
console.error(e);
localStorage = {};
}
var fixURL = function (url) { var fixURL = function (url) {
var mark = (url.indexOf('?') !== -1) ? '&' : '?'; var mark = (url.indexOf('?') !== -1) ? '&' : '?';

@ -1,7 +1,7 @@
// Stage 0, this gets cached which means we can't change it. boot2-sframe.js is changable. // 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. // Note that this file is meant to be executed only inside of a sandbox iframe.
;(function () { ;(function () {
var req = JSON.parse(decodeURIComponent(window.location.hash.substring(1))); var afterLoaded = function (req) {
req.cfg = req.cfg || {}; req.cfg = req.cfg || {};
if (req.pfx) { if (req.pfx) {
req.cfg.onNodeCreated = function (node /*, config, module, path*/) { req.cfg.onNodeCreated = function (node /*, config, module, path*/) {
@ -27,4 +27,14 @@ var onReply = function (msg) {
require(['/common/sframe-boot2.js'], function () { }); require(['/common/sframe-boot2.js'], function () { });
}; };
window.addEventListener('message', onReply); window.addEventListener('message', onReply);
};
var intr = setInterval(function () {
try {
var req = JSON.parse(decodeURIComponent(window.location.hash.substring(1)));
clearInterval(intr);
afterLoaded(req);
} catch (e) { console.error(e); }
}, 100);
}()); }());

@ -2,7 +2,7 @@
<html class="cp pad"> <html class="cp pad">
<head> <head>
<meta content="text/html; charset=utf-8" http-equiv="content-type"/> <meta content="text/html; charset=utf-8" http-equiv="content-type"/>
<script async data-bootload="/pad/inner.js" data-main="/common/sframe-boot.js?ver=1.1" src="/bower_components/requirejs/require.js?ver=2.3.5"></script> <script async data-bootload="/pad/inner.js" data-main="/common/sframe-boot.js?ver=1.2" src="/bower_components/requirejs/require.js?ver=2.3.5"></script>
<style> <style>
html, body { html, body {
margin: 0px; margin: 0px;

Loading…
Cancel
Save