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

pull/1/head
yflory 7 years ago
commit 548a32090e

@ -9,7 +9,7 @@ const Pull = require('pull-stream');
const isValidChannelId = function (id) { const isValidChannelId = function (id) {
return typeof(id) === 'string' && return typeof(id) === 'string' &&
[32, 48].indexOf(id.length) > -1 && id.length >= 32 && id.length < 50 &&
/^[a-zA-Z0-9=+-]*$/.test(id); /^[a-zA-Z0-9=+-]*$/.test(id);
}; };
@ -470,4 +470,4 @@ module.exports.create = function (
setInterval(function () { setInterval(function () {
flushUnusedChannels(env, function () { }); flushUnusedChannels(env, function () { });
}, 5000); }, 5000);
}; };

@ -37,6 +37,15 @@ define([
window.alert("CryptPad needs localStorage to work, try a different browser"); window.alert("CryptPad needs localStorage to work, try a different browser");
}; };
window.onerror = function (e) {
if (/requirejs\.org/.test(e)) {
console.log();
console.error("Require.js threw a Script Error. This probably means you're missing a dependency for CryptPad.\nIt is recommended that the admin of this server runs `bower install && bower update` to get the latest code, then modify their cache version.\nBest of luck,\nThe CryptPad Developers");
return void console.log();
}
throw e;
};
try { try {
var test_key = 'localStorage_test'; var test_key = 'localStorage_test';
var testval = Math.random().toString(); var testval = Math.random().toString();

@ -111,12 +111,14 @@ define([
return input; return input;
}; };
dialog.okButton = function (content) { dialog.okButton = function (content, classString) {
return h('button.ok.primary', { tabindex: '2', }, content || Messages.okButton); var sel = typeof(classString) === 'string'? 'button.ok.' + classString:'button.ok.primary';
return h(sel, { tabindex: '2', }, content || Messages.okButton);
}; };
dialog.cancelButton = function (content) { dialog.cancelButton = function (content, classString) {
return h('button.cancel', { tabindex: '1'}, content || Messages.cancelButton); var sel = typeof(classString) === 'string'? 'button.' + classString:'button.cancel';
return h(sel, { tabindex: '1'}, content || Messages.cancelButton);
}; };
dialog.message = function (text) { dialog.message = function (text) {
@ -464,8 +466,8 @@ define([
message = dialog.message(msg); message = dialog.message(msg);
} }
var ok = dialog.okButton(opt.ok); var ok = dialog.okButton(opt.ok, opt.okClass);
var cancel = dialog.cancelButton(opt.cancel); var cancel = dialog.cancelButton(opt.cancel, opt.cancelClass);
var frame = dialog.frame([ var frame = dialog.frame([
message, message,

@ -36,5 +36,14 @@ define([
// This test is completed in common-interface.js // This test is completed in common-interface.js
Test(function (t) { Test.__ASYNC_BLOCKER__ = t; }); Test(function (t) { Test.__ASYNC_BLOCKER__ = t; });
window.onerror = function (e) {
if (/requirejs\.org/.test(e)) {
console.log();
console.error("Require.js threw a Script Error. This probably means you're missing a dependency for CryptPad.\nIt is recommended that the admin of this server runs `bower install && bower update` to get the latest code, then modify their cache version.\nBest of luck,\nThe CryptPad Developers");
return void console.log();
}
throw e;
};
require([document.querySelector('script[data-bootload]').getAttribute('data-bootload')]); require([document.querySelector('script[data-bootload]').getAttribute('data-bootload')]);
}); });

Loading…
Cancel
Save