Merge branch 'soon' into staging

pull/1/head
ansuz 4 years ago
commit 9a637a6dcd

@ -1,3 +1,40 @@
# YunnanLakeNewt (3.24.0)
## Goals
We are once again working to develop some significant new features. This release is fairly small but includes some significant changes to detect and handle a variety of errors.
## Update notes
This release includes some minor corrections the recommended NGINX configuration supplied in `cryptpad/docs/example.nginx.conf`.
To update from 3.23.2 to 3.24.0:
1. Update your NGINX config to replicate the most recent changes and reload NGINX to apply them.
2. Stop the nodejs server.
3. Pull the latest code from the `3.24.0` tag or the `main` branch using `git`.
4. Ensure you have the latest clientside and serverside dependencies with `bower update` and `npm install`.
5. Restart the nodejs server.
## Features
* A variety of CryptPad's pages now feature a much-improved loading screen which provides a more informative account of what is being loaded. It also implements some generic error handling to detect and report when something has failed in a catastrophic way. This is intended to both inform users that the page is in a broken state as well as to improve the quality of the debugging information they can provide to us so that we can fix the underlying cause.
* It is now possible to create spreadsheets from templates. Template functionality has existed for a long time in our other editors, however, OnlyOffice's architecture differs significantly and required the implementation of a wholly different system.
* One user reported some confusion regarding the use of the Kanban app's _tag_ functionality. We've updated the UI to be a little more informative.
* The "table of contents" in rich text pads now includes "anchors" created via the editor's toolbar.
## Bug fixes
* Recent changes to CryptPad's recommended CSP headers enabled Firefox to export spreadsheets to XLSX format, but they also triggered some regressions due to a number of incompatible APIs.
* Our usage of the `sessionStorage` for the purpose of passing important information to editors opened in a new tab stopped working. This meant that when you created a document in a folder, the resulting new tab would not receive the argument describing where it should be stored, and would instead save it to the default location. We've addressed this by replacing our usage of sessionStorage with a new format for passing the same arguments via the hash in the new document's URL.
* The `window.print` API also failed in a variety of cases. We've updated the relevant CSP headers to only be applied on the sheet editor (to support XSLX export) but allow printing elsewhere. We've also updated some print styles to provide more appealing results.
* The table of contents available in rich text pads failed to scroll when there were a sufficient number of heading to flow beyond the length of the page. Now a scrollbar appears when necessary.
* We discovered a number of cases where the presence of an allow list prevented some valid behaviour due to the server incorrectly concluding that users were not authenticated. We've improved the client's ability to detect these cases and re-authenticate when necessary.
* We also found that when the server was under very heavy load some database queries were timing out because they were slow (but not stopped). We've addressed this to only terminate such queries if they have been entirely inactive for several minutes.
* It was possible for "safe links" to include a mode ("edit" or "view") which did not match the rights of the user opening them. For example, if a user loaded a safe link with edit rights though they only had read-only access via their "viewer" role in a team. CryptPad will now recover from such cases and open the document with the closest set of access rights that they possess.
* We found that the server query `"IS_NEW_PAD"` could return an error but that clients would incorrectly interpret such a response as a `false`. This has been corrected.
* Finally, we've modified the "trash" UI for user and team drives such that when users attempt to empty their trash of owned shared folders they are prompted to remove the items or delete them from the server entirely, as they would be with other owned assets.
# XerusDaamsi reloaded (3.23.2) # XerusDaamsi reloaded (3.23.2)
A number of instance administrators reported issues following our 3.23.1 release. We suspect the issues were caused by applying the recommended update steps out of order which would result in the incorrect HTTP header values getting cached for the most recent version of a file. Since the most recently updated headers modified some security settings, this caused a catastrophic error on clients receiving the incorrect headers which caused them to fail to load under certain circumstances. A number of instance administrators reported issues following our 3.23.1 release. We suspect the issues were caused by applying the recommended update steps out of order which would result in the incorrect HTTP header values getting cached for the most recent version of a file. Since the most recently updated headers modified some security settings, this caused a catastrophic error on clients receiving the incorrect headers which caused them to fail to load under certain circumstances.

@ -312,25 +312,36 @@ button.primary:hover{
return bar; return bar;
}; };
var hasErrored = false;
var updateLoadingProgress = function (data) { var updateLoadingProgress = function (data) {
if (!built) { return; } if (!built || !data) { return; }
var c = types.indexOf(data.type); var c = types.indexOf(data.type);
if (c < current) { return console.error(data); } if (c < current) { return console.error(data); }
try { try {
document.querySelector('.cp-loading-spinner-container').style.display = 'none'; document.querySelector('.cp-loading-spinner-container').style.display = 'none';
document.querySelector('.cp-loading-progress-list').innerHTML = makeList(data); document.querySelector('.cp-loading-progress-list').innerHTML = makeList(data);
document.querySelector('.cp-loading-progress-container').innerHTML = makeBar(data); document.querySelector('.cp-loading-progress-container').innerHTML = makeBar(data);
} catch (e) { console.error(e); } } catch (e) {
if (!hasErrored) { console.error(e); }
}
}; };
window.CryptPad_updateLoadingProgress = updateLoadingProgress; window.CryptPad_updateLoadingProgress = updateLoadingProgress;
window.CryptPad_loadingError = function (err) { window.CryptPad_loadingError = function (err) {
if (!built) { return; } if (!built) { return; }
hasErrored = true;
var err2;
if (err === 'Script error.') {
err2 = Messages.error_unhelpfulScriptError;
}
try { try {
var node = document.querySelector('.cp-loading-progress'); var node = document.querySelector('.cp-loading-progress');
if (!node) { return; }
if (node.parentNode) { node.parentNode.removeChild(node); } if (node.parentNode) { node.parentNode.removeChild(node); }
document.querySelector('.cp-loading-spinner-container').setAttribute('style', 'display:none;'); document.querySelector('.cp-loading-spinner-container').setAttribute('style', 'display:none;');
document.querySelector('#cp-loading-message').setAttribute('style', 'display:block;'); document.querySelector('#cp-loading-message').setAttribute('style', 'display:block;');
document.querySelector('#cp-loading-message').innerText = err; document.querySelector('#cp-loading-message').innerText = err2 || err;
} catch (e) { console.error(e); } } catch (e) { console.error(e); }
}; };
return function () { return function () {

@ -26,7 +26,9 @@ var getStoredLanguage = function () { return localStorage && localStorage.getIte
var getBrowserLanguage = function () { return navigator.language || navigator.userLanguage || ''; }; var getBrowserLanguage = function () { return navigator.language || navigator.userLanguage || ''; };
var getLanguage = messages._getLanguage = function () { var getLanguage = messages._getLanguage = function () {
if (window.cryptpadLanguage) { return window.cryptpadLanguage; } if (window.cryptpadLanguage) { return window.cryptpadLanguage; }
if (getStoredLanguage()) { return getStoredLanguage(); } try {
if (getStoredLanguage()) { return getStoredLanguage(); }
} catch (e) { console.log(e); }
var l = getBrowserLanguage(); var l = getBrowserLanguage();
// Edge returns 'fr-FR' --> transform it to 'fr' and check again // Edge returns 'fr-FR' --> transform it to 'fr' and check again
return map[l] ? l : return map[l] ? l :
@ -65,7 +67,9 @@ define(req, function(AppConfig, Default, Language) {
if (AppConfig.availableLanguages.indexOf(language) === -1) { if (AppConfig.availableLanguages.indexOf(language) === -1) {
language = defaultLanguage; language = defaultLanguage;
Language = Default; Language = Default;
localStorage.setItem(LS_LANG, language); try {
localStorage.setItem(LS_LANG, language);
} catch (e) { console.log(e); }
} }
Object.keys(map).forEach(function (l) { Object.keys(map).forEach(function (l) {
if (l === defaultLanguage) { return; } if (l === defaultLanguage) { return; }

@ -17,7 +17,7 @@ SyslogIdentifier=cryptpad
User=cryptpad User=cryptpad
Group=cryptpad Group=cryptpad
# modify to match your working directory # modify to match your working directory
Environment='PWD="/home/cryptpad/cryptpad/cryptpad"' Environment='PWD="/home/cryptpad/cryptpad"'
# systemd sets the open file limit to 4000 unless you override it # systemd sets the open file limit to 4000 unless you override it
# cryptpad stores its data with the filesystem, so you should increase this to match the value of `ulimit -n` # cryptpad stores its data with the filesystem, so you should increase this to match the value of `ulimit -n`

@ -2,7 +2,7 @@
<html class="cp-app-noscroll"> <html class="cp-app-noscroll">
<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="/admin/inner.js" data-main="/common/sframe-boot.js?ver=1.6" src="/bower_components/requirejs/require.js?ver=2.3.5"></script> <script async data-bootload="/admin/inner.js" data-main="/common/sframe-boot.js?ver=1.7" src="/bower_components/requirejs/require.js?ver=2.3.5"></script>
<style> <style>
.loading-hidden { display: none; } .loading-hidden { display: none; }
</style> </style>

@ -3,38 +3,14 @@ define([
'/bower_components/nthen/index.js', '/bower_components/nthen/index.js',
'/api/config', '/api/config',
'/common/dom-ready.js', '/common/dom-ready.js',
'/common/requireconfig.js',
'/common/sframe-common-outer.js', '/common/sframe-common-outer.js',
], function (nThen, ApiConfig, DomReady, RequireConfig, SFCommonO) { ], function (nThen, ApiConfig, DomReady, SFCommonO) {
var requireConfig = RequireConfig();
// Loaded in load #2 // Loaded in load #2
nThen(function (waitFor) { nThen(function (waitFor) {
DomReady.onReady(waitFor()); DomReady.onReady(waitFor());
}).nThen(function (waitFor) { }).nThen(function (waitFor) {
var req = { SFCommonO.initIframe(waitFor);
cfg: requireConfig,
req: [ '/common/loading.js' ],
pfx: window.location.origin
};
window.rc = requireConfig;
window.apiconf = ApiConfig;
document.getElementById('sbox-iframe').setAttribute('src',
ApiConfig.httpSafeOrigin + '/admin/inner.html?' + requireConfig.urlArgs +
'#' + encodeURIComponent(JSON.stringify(req)));
// This is a cheap trick to avoid loading sframe-channel in parallel with the
// loading screen setup.
var done = waitFor();
var onMsg = function (msg) {
var data = JSON.parse(msg.data);
if (data.q !== 'READY') { return; }
window.removeEventListener('message', onMsg);
var _done = done;
done = function () { };
_done();
};
window.addEventListener('message', onMsg);
}).nThen(function (/*waitFor*/) { }).nThen(function (/*waitFor*/) {
var addRpc = function (sframeChan, Cryptpad/*, Utils*/) { var addRpc = function (sframeChan, Cryptpad/*, Utils*/) {
// Adding a new avatar from the profile: pin it and store it in the object // Adding a new avatar from the profile: pin it and store it in the object

@ -2,7 +2,7 @@
<html class="cp-app-noscroll cp-app-print"> <html class="cp-app-noscroll cp-app-print">
<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="/code/inner.js" data-main="/common/sframe-boot.js?ver=1.6" src="/bower_components/requirejs/require.js?ver=2.3.5"></script> <script async data-bootload="/code/inner.js" data-main="/common/sframe-boot.js?ver=1.7" src="/bower_components/requirejs/require.js?ver=2.3.5"></script>
<style> <style>
.loading-hidden { display: none; } .loading-hidden { display: none; }
#editor1 { display: none; } #editor1 { display: none; }

@ -148,20 +148,19 @@ define([
send(); send();
}; };
common.setTabHref = function (href) { (function () {
var ohc = window.onhashchange; var bypassHashChange = function (key) {
window.onhashchange = function () {}; return function (value) {
window.location.href = href; var ohc = window.onhashchange;
window.onhashchange = ohc; window.onhashchange = function () {};
ohc({reset: true}); window.location[key] = value;
}; window.onhashchange = ohc;
common.setTabHash = function (hash) { ohc({reset: true});
var ohc = window.onhashchange; };
window.onhashchange = function () {}; };
window.location.hash = hash; common.setTabHref = bypassHashChange('href');
window.onhashchange = ohc; common.setTabHash = bypassHashChange('hash');
ohc({reset: true}); }());
};
// RESTRICTED // RESTRICTED
// Settings only // Settings only

@ -2070,7 +2070,9 @@ define([
// Import template // Import template
var $template = common.createButton('importtemplate', true, {}, openTemplatePicker); var $template = common.createButton('importtemplate', true, {}, openTemplatePicker);
$template.appendTo(toolbar.$drawer); if ($template && typeof($template.appendTo) === 'function') {
$template.appendTo(toolbar.$drawer);
}
})(); })();
} }

@ -3,54 +3,23 @@ define([
'/bower_components/nthen/index.js', '/bower_components/nthen/index.js',
'/api/config', '/api/config',
'/common/dom-ready.js', '/common/dom-ready.js',
'/common/requireconfig.js',
'/common/common-hash.js', '/common/common-hash.js',
'/common/sframe-common-outer.js' '/common/sframe-common-outer.js'
], function (nThen, ApiConfig, DomReady, RequireConfig, Hash, SFCommonO) { ], function (nThen, ApiConfig, DomReady, Hash, SFCommonO) {
var requireConfig = RequireConfig();
// Loaded in load #2 // Loaded in load #2
var hash, href, version; var hash, href, version;
nThen(function (waitFor) { nThen(function (waitFor) {
DomReady.onReady(waitFor()); DomReady.onReady(waitFor());
}).nThen(function (waitFor) { }).nThen(function (waitFor) {
var req = { var obj = SFCommonO.initIframe(waitFor, true, true);
cfg: requireConfig, href = obj.href;
req: [ '/common/loading.js' ], hash = obj.hash;
pfx: window.location.origin
};
window.rc = requireConfig;
window.apiconf = ApiConfig;
// Hidden hash
hash = window.location.hash;
href = window.location.href;
if (window.history && window.history.replaceState && hash) {
window.history.replaceState({}, window.document.title, '#');
}
var parsed = Hash.parsePadUrl(href); var parsed = Hash.parsePadUrl(href);
if (parsed && parsed.hashData) { if (parsed && parsed.hashData) {
var opts = parsed.getOptions(); var opts = parsed.getOptions();
version = opts.versionHash; version = opts.versionHash;
} }
document.getElementById('sbox-iframe').setAttribute('src',
ApiConfig.httpSafeOrigin + window.location.pathname + 'inner.html?' +
requireConfig.urlArgs + '#' + encodeURIComponent(JSON.stringify(req)));
// This is a cheap trick to avoid loading sframe-channel in parallel with the
// loading screen setup.
var done = waitFor();
var onMsg = function (msg) {
var data = JSON.parse(msg.data);
if (data.q !== 'READY') { return; }
window.removeEventListener('message', onMsg);
var _done = done;
done = function () { };
_done();
};
window.addEventListener('message', onMsg);
}).nThen(function (/*waitFor*/) { }).nThen(function (/*waitFor*/) {
var addData = function (obj) { var addData = function (obj) {
obj.ooType = window.location.pathname.replace(/^\//, '').replace(/\/$/, ''); obj.ooType = window.location.pathname.replace(/^\//, '').replace(/\/$/, '');

@ -3,46 +3,16 @@ define([
'/bower_components/nthen/index.js', '/bower_components/nthen/index.js',
'/api/config', '/api/config',
'/common/dom-ready.js', '/common/dom-ready.js',
'/common/requireconfig.js',
'/common/sframe-common-outer.js' '/common/sframe-common-outer.js'
], function (nThen, ApiConfig, DomReady, RequireConfig, SFCommonO) { ], function (nThen, ApiConfig, DomReady, SFCommonO) {
var requireConfig = RequireConfig();
var hash, href; var hash, href;
nThen(function (waitFor) { nThen(function (waitFor) {
DomReady.onReady(waitFor()); DomReady.onReady(waitFor());
}).nThen(function (waitFor) { }).nThen(function (waitFor) {
var req = { var obj = SFCommonO.initIframe(waitFor, true);
cfg: requireConfig, href = obj.href;
req: [ '/common/loading.js' ], hash = obj.hash;
pfx: window.location.origin
};
window.rc = requireConfig;
window.apiconf = ApiConfig;
// Hidden hash
hash = window.location.hash;
href = window.location.href;
if (window.history && window.history.replaceState && hash) {
window.history.replaceState({}, window.document.title, '#');
}
document.getElementById('sbox-iframe').setAttribute('src',
ApiConfig.httpSafeOrigin + window.location.pathname + 'inner.html?' +
requireConfig.urlArgs + '#' + encodeURIComponent(JSON.stringify(req)));
// This is a cheap trick to avoid loading sframe-channel in parallel with the
// loading screen setup.
var done = waitFor();
var onMsg = function (msg) {
var data = JSON.parse(msg.data);
if (data.q !== 'READY') { return; }
window.removeEventListener('message', onMsg);
var _done = done;
done = function () { };
_done();
};
window.addEventListener('message', onMsg);
}).nThen(function (/*waitFor*/) { }).nThen(function (/*waitFor*/) {
SFCommonO.start({ SFCommonO.start({
hash: hash, hash: hash,

@ -21,6 +21,7 @@ var afterLoaded = function (req) {
window.parent.postMessage(JSON.stringify({ q: 'READY', txid: txid }), '*'); window.parent.postMessage(JSON.stringify({ q: 'READY', txid: txid }), '*');
}, 1); }, 1);
}; };
window.cryptpadLanguage = req.lang;
if (req.req) { require(req.req, ready); } else { ready(); } if (req.req) { require(req.req, ready); } else { ready(); }
var onReply = function (msg) { var onReply = function (msg) {
var data = JSON.parse(msg.data); var data = JSON.parse(msg.data);
@ -61,7 +62,6 @@ var afterLoaded = function (req) {
updated: lsUpdated, updated: lsUpdated,
store: data.localStore store: data.localStore
}; };
window.cryptpadLanguage = data.language;
require(['/common/sframe-boot2.js'], function () { }); require(['/common/sframe-boot2.js'], function () { });
}; };
window.addEventListener('message', onReply); window.addEventListener('message', onReply);

@ -43,7 +43,7 @@ define([
return void console.log(); return void console.log();
} }
if (window.CryptPad_loadingError) { if (window.CryptPad_loadingError) {
window.CryptPad_loadingError(e); return void window.CryptPad_loadingError(e);
} }
throw e; throw e;
}; };

@ -2,10 +2,57 @@
define([ define([
'/bower_components/nthen/index.js', '/bower_components/nthen/index.js',
'/api/config', '/api/config',
'/common/requireconfig.js',
'/customize/messages.js',
'jquery', 'jquery',
], function (nThen, ApiConfig, $) { ], function (nThen, ApiConfig, RequireConfig, Messages, $) {
var common = {}; var common = {};
common.initIframe = function (waitFor, isRt) {
var requireConfig = RequireConfig();
var lang = Messages._languageUsed;
var req = {
cfg: requireConfig,
req: [ '/common/loading.js' ],
pfx: window.location.origin,
lang: lang
};
window.rc = requireConfig;
window.apiconf = ApiConfig;
var hash, href;
if (isRt) {
// Hidden hash
hash = window.location.hash;
href = window.location.href;
if (window.history && window.history.replaceState && hash) {
window.history.replaceState({}, window.document.title, '#');
}
}
document.getElementById('sbox-iframe').setAttribute('src',
ApiConfig.httpSafeOrigin + window.location.pathname + 'inner.html?' +
requireConfig.urlArgs + '#' + encodeURIComponent(JSON.stringify(req)));
// This is a cheap trick to avoid loading sframe-channel in parallel with the
// loading screen setup.
var done = waitFor();
var onMsg = function (msg) {
var data = JSON.parse(msg.data);
if (data.q !== 'READY') { return; }
window.removeEventListener('message', onMsg);
var _done = done;
done = function () { };
_done();
};
window.addEventListener('message', onMsg);
return {
hash: hash,
href: href
};
};
common.start = function (cfg) { common.start = function (cfg) {
cfg = cfg || {}; cfg = cfg || {};
var realtime = !cfg.noRealtime; var realtime = !cfg.noRealtime;
@ -74,6 +121,7 @@ define([
Utils.Feedback = _Feedback; Utils.Feedback = _Feedback;
Utils.LocalStore = _LocalStore; Utils.LocalStore = _LocalStore;
Utils.UserObject = _UserObject; Utils.UserObject = _UserObject;
Utils.currentPad = currentPad;
AppConfig = _AppConfig; AppConfig = _AppConfig;
Test = _Test; Test = _Test;
@ -557,7 +605,7 @@ define([
for (var k in additionalPriv) { metaObj.priv[k] = additionalPriv[k]; } for (var k in additionalPriv) { metaObj.priv[k] = additionalPriv[k]; }
if (cfg.addData) { if (cfg.addData) {
cfg.addData(metaObj.priv, Cryptpad, metaObj.user); cfg.addData(metaObj.priv, Cryptpad, metaObj.user, Utils);
} }
sframeChan.event('EV_METADATA_UPDATE', metaObj); sframeChan.event('EV_METADATA_UPDATE', metaObj);

@ -1467,5 +1467,6 @@
"loading_state_2": "Inhalte aktualisieren", "loading_state_2": "Inhalte aktualisieren",
"loading_state_1": "Drive laden", "loading_state_1": "Drive laden",
"loading_state_0": "Oberfläche vorbereiten", "loading_state_0": "Oberfläche vorbereiten",
"loading_state_5": "Dokument rekonstruieren" "loading_state_5": "Dokument rekonstruieren",
"error_unhelpfulScriptError": "Skriptfehler: Siehe Konsole im Browser für Details"
} }

@ -1459,5 +1459,14 @@
"history_cantRestore": "Palauttaminen epäonnistui. Yhteytesi on katkennut.", "history_cantRestore": "Palauttaminen epäonnistui. Yhteytesi on katkennut.",
"history_close": "Sulje", "history_close": "Sulje",
"history_restore": "Palauta", "history_restore": "Palauta",
"share_bar": "Luo linkki" "share_bar": "Luo linkki",
"error_unhelpfulScriptError": "Skriptivirhe: Lisätietoja selaimen kehittäjäkonsolissa",
"tag_edit": "Muokkaa",
"tag_add": "Lisää",
"loading_state_5": "Uudelleenrakenna asiakirja",
"loading_state_4": "Lataa Teams",
"loading_state_3": "Lataa jaetut kansiot",
"loading_state_2": "Päivitä sisältö",
"loading_state_1": "Lataa Drive",
"loading_state_0": "Rakenna käyttöliittymä"
} }

@ -1467,5 +1467,6 @@
"loading_state_1": "Chargement du drive", "loading_state_1": "Chargement du drive",
"loading_state_0": "Construction de l'interface", "loading_state_0": "Construction de l'interface",
"tag_edit": "Modifier", "tag_edit": "Modifier",
"tag_add": "Ajouter" "tag_add": "Ajouter",
"error_unhelpfulScriptError": "Erreur de script : consultez la console du navigateur pour plus de détails"
} }

@ -1467,5 +1467,6 @@
"loading_state_4": "Load Teams", "loading_state_4": "Load Teams",
"loading_state_5": "Reconstruct document", "loading_state_5": "Reconstruct document",
"tag_add": "Add", "tag_add": "Add",
"tag_edit": "Edit" "tag_edit": "Edit",
"error_unhelpfulScriptError": "Script Error: See browser console for details"
} }

@ -2,7 +2,7 @@
<html class="cp-app-noscroll"> <html class="cp-app-noscroll">
<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="/contacts/inner.js" data-main="/common/sframe-boot.js?ver=1.6" src="/bower_components/requirejs/require.js?ver=2.3.5"></script> <script async data-bootload="/contacts/inner.js" data-main="/common/sframe-boot.js?ver=1.7" src="/bower_components/requirejs/require.js?ver=2.3.5"></script>
<style> <style>
.loading-hidden { display: none; } .loading-hidden { display: none; }
</style> </style>

@ -3,38 +3,14 @@ define([
'/bower_components/nthen/index.js', '/bower_components/nthen/index.js',
'/api/config', '/api/config',
'/common/dom-ready.js', '/common/dom-ready.js',
'/common/requireconfig.js',
'/common/sframe-common-outer.js' '/common/sframe-common-outer.js'
], function (nThen, ApiConfig, DomReady, RequireConfig, SFCommonO) { ], function (nThen, ApiConfig, DomReady, SFCommonO) {
var requireConfig = RequireConfig();
// Loaded in load #2 // Loaded in load #2
nThen(function (waitFor) { nThen(function (waitFor) {
DomReady.onReady(waitFor()); DomReady.onReady(waitFor());
}).nThen(function (waitFor) { }).nThen(function (waitFor) {
var req = { SFCommonO.initIframe(waitFor);
cfg: requireConfig,
req: [ '/common/loading.js' ],
pfx: window.location.origin
};
window.rc = requireConfig;
window.apiconf = ApiConfig;
document.getElementById('sbox-iframe').setAttribute('src',
ApiConfig.httpSafeOrigin + '/contacts/inner.html?' + requireConfig.urlArgs +
'#' + encodeURIComponent(JSON.stringify(req)));
// This is a cheap trick to avoid loading sframe-channel in parallel with the
// loading screen setup.
var done = waitFor();
var onMsg = function (msg) {
var data = JSON.parse(msg.data);
if (data.q !== 'READY') { return; }
window.removeEventListener('message', onMsg);
var _done = done;
done = function () { };
_done();
};
window.addEventListener('message', onMsg);
}).nThen(function (/*waitFor*/) { }).nThen(function (/*waitFor*/) {
SFCommonO.start({ SFCommonO.start({
noRealtime: true, noRealtime: true,

@ -2,7 +2,7 @@
<html class="cp-app-noscroll"> <html class="cp-app-noscroll">
<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="/debug/inner.js" data-main="/common/sframe-boot.js?ver=1.6" src="/bower_components/requirejs/require.js?ver=2.3.5"></script> <script async data-bootload="/debug/inner.js" data-main="/common/sframe-boot.js?ver=1.7" src="/bower_components/requirejs/require.js?ver=2.3.5"></script>
<style> <style>
.loading-hidden { display: none; } .loading-hidden { display: none; }
#editor1 { display: none; } #editor1 { display: none; }

@ -2,7 +2,7 @@
<html class="cp-app-noscroll"> <html class="cp-app-noscroll">
<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="/drive/inner.js" data-main="/common/sframe-boot.js?ver=1.6" src="/bower_components/requirejs/require.js?ver=2.3.5"></script> <script async data-bootload="/drive/inner.js" data-main="/common/sframe-boot.js?ver=1.7" src="/bower_components/requirejs/require.js?ver=2.3.5"></script>
<style> <style>
.loading-hidden { display: none; } .loading-hidden { display: none; }
#editor1 { display: none; } #editor1 { display: none; }

@ -3,47 +3,17 @@ define([
'/bower_components/nthen/index.js', '/bower_components/nthen/index.js',
'/api/config', '/api/config',
'/common/dom-ready.js', '/common/dom-ready.js',
'/common/requireconfig.js',
'/common/sframe-common-outer.js', '/common/sframe-common-outer.js',
], function (nThen, ApiConfig, DomReady, RequireConfig, SFCommonO) { ], function (nThen, ApiConfig, DomReady, SFCommonO) {
var requireConfig = RequireConfig();
// Loaded in load #2 // Loaded in load #2
var hash, href; var hash, href;
nThen(function (waitFor) { nThen(function (waitFor) {
DomReady.onReady(waitFor()); DomReady.onReady(waitFor());
}).nThen(function (waitFor) { }).nThen(function (waitFor) {
var req = { var obj = SFCommonO.initIframe(waitFor, true);
cfg: requireConfig, href = obj.href;
req: [ '/common/loading.js' ], hash = obj.hash;
pfx: window.location.origin
};
window.rc = requireConfig;
window.apiconf = ApiConfig;
// Hidden hash
hash = window.location.hash;
href = window.location.href;
if (window.history && window.history.replaceState && hash) {
window.history.replaceState({}, window.document.title, '#');
}
document.getElementById('sbox-iframe').setAttribute('src',
ApiConfig.httpSafeOrigin + '/drive/inner.html?' + requireConfig.urlArgs +
'#' + encodeURIComponent(JSON.stringify(req)));
// This is a cheap trick to avoid loading sframe-channel in parallel with the
// loading screen setup.
var done = waitFor();
var onMsg = function (msg) {
var data = JSON.parse(msg.data);
if (data.q !== 'READY') { return; }
window.removeEventListener('message', onMsg);
var _done = done;
done = function () { };
_done();
};
window.addEventListener('message', onMsg);
}).nThen(function (/*waitFor*/) { }).nThen(function (/*waitFor*/) {
var afterSecrets = function (Cryptpad, Utils, secret, cb, sframeChan) { var afterSecrets = function (Cryptpad, Utils, secret, cb, sframeChan) {
var parsed = Utils.Hash.parsePadUrl(href); var parsed = Utils.Hash.parsePadUrl(href);

@ -2,7 +2,7 @@
<html class="cp-app-noscroll"> <html class="cp-app-noscroll">
<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="/file/inner.js" data-main="/common/sframe-boot.js?ver=1.6" src="/bower_components/requirejs/require.js?ver=2.3.5"></script> <script async data-bootload="/file/inner.js" data-main="/common/sframe-boot.js?ver=1.7" src="/bower_components/requirejs/require.js?ver=2.3.5"></script>
<style> <style>
.loading-hidden { display: none; } .loading-hidden { display: none; }
#editor1 { display: none; } #editor1 { display: none; }

@ -3,47 +3,17 @@ define([
'/bower_components/nthen/index.js', '/bower_components/nthen/index.js',
'/api/config', '/api/config',
'/common/dom-ready.js', '/common/dom-ready.js',
'/common/requireconfig.js',
'/common/sframe-common-outer.js' '/common/sframe-common-outer.js'
], function (nThen, ApiConfig, DomReady, RequireConfig, SFCommonO) { ], function (nThen, ApiConfig, DomReady, SFCommonO) {
var requireConfig = RequireConfig();
// Loaded in load #2 // Loaded in load #2
var hash, href; var hash, href;
nThen(function (waitFor) { nThen(function (waitFor) {
DomReady.onReady(waitFor()); DomReady.onReady(waitFor());
}).nThen(function (waitFor) { }).nThen(function (waitFor) {
var req = { var obj = SFCommonO.initIframe(waitFor, true);
cfg: requireConfig, href = obj.href;
req: [ '/common/loading.js' ], hash = obj.hash;
pfx: window.location.origin
};
window.rc = requireConfig;
window.apiconf = ApiConfig;
// Hidden hash
hash = window.location.hash;
href = window.location.href;
if (window.history && window.history.replaceState && hash) {
window.history.replaceState({}, window.document.title, '#');
}
document.getElementById('sbox-iframe').setAttribute('src',
ApiConfig.httpSafeOrigin + '/file/inner.html?' + requireConfig.urlArgs +
'#' + encodeURIComponent(JSON.stringify(req)));
// This is a cheap trick to avoid loading sframe-channel in parallel with the
// loading screen setup.
var done = waitFor();
var onMsg = function (msg) {
var data = JSON.parse(msg.data);
if (data.q !== 'READY') { return; }
window.removeEventListener('message', onMsg);
var _done = done;
done = function () { };
_done();
};
window.addEventListener('message', onMsg);
}).nThen(function (/*waitFor*/) { }).nThen(function (/*waitFor*/) {
var addData = function (meta, Cryptpad) { var addData = function (meta, Cryptpad) {
meta.filehash = Cryptpad.currentPad.hash; meta.filehash = Cryptpad.currentPad.hash;

@ -3,7 +3,7 @@
<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="/kanban/inner.js" data-main="/common/sframe-boot.js?ver=1.6" src="/bower_components/requirejs/require.js?ver=2.3.5"></script> <script async data-bootload="/kanban/inner.js" data-main="/common/sframe-boot.js?ver=1.7" src="/bower_components/requirejs/require.js?ver=2.3.5"></script>
<style> <style>
.loading-hidden { .loading-hidden {
display: none; display: none;

@ -2,7 +2,7 @@
<html class="cp-app-noscroll"> <html class="cp-app-noscroll">
<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="/notifications/inner.js" data-main="/common/sframe-boot.js?ver=1.6" src="/bower_components/requirejs/require.js?ver=2.3.5"></script> <script async data-bootload="/notifications/inner.js" data-main="/common/sframe-boot.js?ver=1.7" src="/bower_components/requirejs/require.js?ver=2.3.5"></script>
<style> <style>
.loading-hidden { display: none; } .loading-hidden { display: none; }
</style> </style>

@ -3,38 +3,14 @@ define([
'/bower_components/nthen/index.js', '/bower_components/nthen/index.js',
'/api/config', '/api/config',
'/common/dom-ready.js', '/common/dom-ready.js',
'/common/requireconfig.js',
'/common/sframe-common-outer.js', '/common/sframe-common-outer.js',
], function (nThen, ApiConfig, DomReady, RequireConfig, SFCommonO) { ], function (nThen, ApiConfig, DomReady, SFCommonO) {
var requireConfig = RequireConfig();
// Loaded in load #2 // Loaded in load #2
nThen(function (waitFor) { nThen(function (waitFor) {
DomReady.onReady(waitFor()); DomReady.onReady(waitFor());
}).nThen(function (waitFor) { }).nThen(function (waitFor) {
var req = { SFCommonO.initIframe(waitFor);
cfg: requireConfig,
req: [ '/common/loading.js' ],
pfx: window.location.origin
};
window.rc = requireConfig;
window.apiconf = ApiConfig;
document.getElementById('sbox-iframe').setAttribute('src',
ApiConfig.httpSafeOrigin + '/notifications/inner.html?' + requireConfig.urlArgs +
'#' + encodeURIComponent(JSON.stringify(req)));
// This is a cheap trick to avoid loading sframe-channel in parallel with the
// loading screen setup.
var done = waitFor();
var onMsg = function (msg) {
var data = JSON.parse(msg.data);
if (data.q !== 'READY') { return; }
window.removeEventListener('message', onMsg);
var _done = done;
done = function () { };
_done();
};
window.addEventListener('message', onMsg);
}).nThen(function (/*waitFor*/) { }).nThen(function (/*waitFor*/) {
var category; var category;
if (window.location.hash) { if (window.location.hash) {

@ -2,7 +2,7 @@
<html class="cp-app-noscroll"> <html class="cp-app-noscroll">
<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="/common/onlyoffice/inner.js" data-main="/common/sframe-boot.js?ver=1.6" src="/bower_components/requirejs/require.js?ver=2.3.5"></script> <script async data-bootload="/common/onlyoffice/inner.js" data-main="/common/sframe-boot.js?ver=1.7" src="/bower_components/requirejs/require.js?ver=2.3.5"></script>
<style> <style>
.loading-hidden { display: none; } .loading-hidden { display: none; }
</style> </style>

@ -2,7 +2,7 @@
<html class="cp-app-noscroll"> <html class="cp-app-noscroll">
<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="/common/onlyoffice/inner.js" data-main="/common/sframe-boot.js?ver=1.6" src="/bower_components/requirejs/require.js?ver=2.3.5"></script> <script async data-bootload="/common/onlyoffice/inner.js" data-main="/common/sframe-boot.js?ver=1.7" src="/bower_components/requirejs/require.js?ver=2.3.5"></script>
<style> <style>
.loading-hidden { display: none; } .loading-hidden { display: none; }
</style> </style>

@ -27,6 +27,7 @@ body.cp-app-pad {
#cp-app-pad-toc { #cp-app-pad-toc {
@toc-level-indent: 15px; @toc-level-indent: 15px;
overflow-y: auto;
margin-top: 10px; margin-top: 10px;
margin-left: 10px; margin-left: 10px;
width: 200px; width: 200px;

@ -2,7 +2,7 @@
<html class="cp-app-noscroll cp-app-print"> <html class="cp-app-noscroll cp-app-print">
<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.6" 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.7" src="/bower_components/requirejs/require.js?ver=2.3.5"></script>
<style> <style>
html, body { html, body {
margin: 0px; margin: 0px;

@ -650,9 +650,25 @@ define([
}, 500); // 500ms to make sure it is sent after chainpad sync }, 500); // 500ms to make sure it is sent after chainpad sync
}; };
var isAnchor = function (el) { return el.nodeName === 'A'; };
var getAnchorName = function (el) {
return el.getAttribute('id') ||
el.getAttribute('data-cke-saved-name') ||
el.getAttribute('name') ||
Util.stripTags($(el).text());
};
var updateTOC = Util.throttle(function () { var updateTOC = Util.throttle(function () {
var toc = []; var toc = [];
$inner.find('h1, h2, h3').each(function (i, el) { $inner.find('h1, h2, h3, a[id][data-cke-saved-name]').each(function (i, el) {
if (isAnchor(el)) {
return void toc.push({
level: 2,
el: el,
title: getAnchorName(el),
});
}
toc.push({ toc.push({
level: Number(el.tagName.slice(1)), level: Number(el.tagName.slice(1)),
el: el, el: el,
@ -661,6 +677,8 @@ define([
}); });
var content = [h('h2', Messages.markdown_toc)]; var content = [h('h2', Messages.markdown_toc)];
toc.forEach(function (obj) { toc.forEach(function (obj) {
var title = (obj.title || "").trim();
if (!title) { return; }
// Only include level 2 headings // Only include level 2 headings
var level = obj.level; var level = obj.level;
var a = h('a.cp-pad-toc-link', { var a = h('a.cp-pad-toc-link', {
@ -672,7 +690,7 @@ define([
if (!obj.el || UIElements.isVisible(obj.el, $inner)) { return; } if (!obj.el || UIElements.isVisible(obj.el, $inner)) { return; }
obj.el.scrollIntoView(); obj.el.scrollIntoView();
}); });
a.innerHTML = obj.title; a.innerHTML = title;
content.push(h('p.cp-pad-toc-'+level, a)); content.push(h('p.cp-pad-toc-'+level, a));
}); });
$toc.html('').append(content); $toc.html('').append(content);
@ -1098,7 +1116,7 @@ define([
*/ */
Ckeditor.dom.element.prototype.setHtml = function(a){ Ckeditor.dom.element.prototype.setHtml = function(a){
if (/callFunction/.test(a)) { if (/callFunction/.test(a)) {
a = a.replace(/on(mousedown|blur|keydown|focus|click|dragstart)/g, function (value) { a = a.replace(/on(mousedown|blur|keydown|focus|click|dragstart|mouseover|mouseout)/g, function (value) {
return 'o' + value; return 'o' + value;
}); });
} }

@ -3,7 +3,7 @@
<head> <head>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<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="/poll/inner.js" data-main="/common/sframe-boot.js?ver=1.6" src="/bower_components/requirejs/require.js?ver=2.3.5"></script> <script async data-bootload="/poll/inner.js" data-main="/common/sframe-boot.js?ver=1.7" src="/bower_components/requirejs/require.js?ver=2.3.5"></script>
<style> <style>
.loading-hidden { display: none; } .loading-hidden { display: none; }
#editor1 { display: none; } #editor1 { display: none; }

@ -3,47 +3,17 @@ define([
'/bower_components/nthen/index.js', '/bower_components/nthen/index.js',
'/api/config', '/api/config',
'/common/dom-ready.js', '/common/dom-ready.js',
'/common/requireconfig.js',
'/common/sframe-common-outer.js', '/common/sframe-common-outer.js',
], function (nThen, ApiConfig, DomReady, RequireConfig, SFCommonO) { ], function (nThen, ApiConfig, DomReady, SFCommonO) {
var requireConfig = RequireConfig();
// Loaded in load #2 // Loaded in load #2
var hash, href; var hash, href;
nThen(function (waitFor) { nThen(function (waitFor) {
DomReady.onReady(waitFor()); DomReady.onReady(waitFor());
}).nThen(function (waitFor) { }).nThen(function (waitFor) {
var req = { var obj = SFCommonO.initIframe(waitFor, true);
cfg: requireConfig, href = obj.href;
req: [ '/common/loading.js' ], hash = obj.hash;
pfx: window.location.origin
};
window.rc = requireConfig;
window.apiconf = ApiConfig;
// Hidden hash
hash = window.location.hash;
href = window.location.href;
if (window.history && window.history.replaceState && hash) {
window.history.replaceState({}, window.document.title, '#');
}
document.getElementById('sbox-iframe').setAttribute('src',
ApiConfig.httpSafeOrigin + '/poll/inner.html?' + requireConfig.urlArgs +
'#' + encodeURIComponent(JSON.stringify(req)));
// This is a cheap trick to avoid loading sframe-channel in parallel with the
// loading screen setup.
var done = waitFor();
var onMsg = function (msg) {
var data = JSON.parse(msg.data);
if (data.q !== 'READY') { return; }
window.removeEventListener('message', onMsg);
var _done = done;
done = function () { };
_done();
};
window.addEventListener('message', onMsg);
}).nThen(function (/*waitFor*/) { }).nThen(function (/*waitFor*/) {
SFCommonO.start({ SFCommonO.start({
hash: hash, hash: hash,

@ -2,7 +2,7 @@
<html class="cp-app-noscroll"> <html class="cp-app-noscroll">
<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="/profile/inner.js" data-main="/common/sframe-boot.js?ver=1.6" src="/bower_components/requirejs/require.js?ver=2.3.5"></script> <script async data-bootload="/profile/inner.js" data-main="/common/sframe-boot.js?ver=1.7" src="/bower_components/requirejs/require.js?ver=2.3.5"></script>
<style> <style>
.loading-hidden { display: none; } .loading-hidden { display: none; }
</style> </style>

@ -3,38 +3,14 @@ define([
'/bower_components/nthen/index.js', '/bower_components/nthen/index.js',
'/api/config', '/api/config',
'/common/dom-ready.js', '/common/dom-ready.js',
'/common/requireconfig.js',
'/common/sframe-common-outer.js', '/common/sframe-common-outer.js',
], function (nThen, ApiConfig, DomReady, RequireConfig, SFCommonO) { ], function (nThen, ApiConfig, DomReady, SFCommonO) {
var requireConfig = RequireConfig();
// Loaded in load #2 // Loaded in load #2
nThen(function (waitFor) { nThen(function (waitFor) {
DomReady.onReady(waitFor()); DomReady.onReady(waitFor());
}).nThen(function (waitFor) { }).nThen(function (waitFor) {
var req = { SFCommonO.initIframe(waitFor);
cfg: requireConfig,
req: [ '/common/loading.js' ],
pfx: window.location.origin
};
window.rc = requireConfig;
window.apiconf = ApiConfig;
document.getElementById('sbox-iframe').setAttribute('src',
ApiConfig.httpSafeOrigin + '/profile/inner.html?' + requireConfig.urlArgs +
'#' + encodeURIComponent(JSON.stringify(req)));
// This is a cheap trick to avoid loading sframe-channel in parallel with the
// loading screen setup.
var done = waitFor();
var onMsg = function (msg) {
var data = JSON.parse(msg.data);
if (data.q !== 'READY') { return; }
window.removeEventListener('message', onMsg);
var _done = done;
done = function () { };
_done();
};
window.addEventListener('message', onMsg);
}).nThen(function (/*waitFor*/) { }).nThen(function (/*waitFor*/) {
var getSecrets = function (Cryptpad, Utils, cb) { var getSecrets = function (Cryptpad, Utils, cb) {
var Hash = Utils.Hash; var Hash = Utils.Hash;

@ -2,7 +2,7 @@
<html style="height: 100%; background: transparent;"> <html style="height: 100%; background: transparent;">
<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="/secureiframe/inner.js" data-main="/common/sframe-boot.js?ver=1.6" src="/bower_components/requirejs/require.js?ver=2.3.5"></script> <script async data-bootload="/secureiframe/inner.js" data-main="/common/sframe-boot.js?ver=1.7" src="/bower_components/requirejs/require.js?ver=2.3.5"></script>
<style> <style>
.loading-hidden { display: none; } .loading-hidden { display: none; }
body #cp-loading { body #cp-loading {

@ -4,7 +4,8 @@ define([
'/api/config', '/api/config',
'jquery', 'jquery',
'/common/requireconfig.js', '/common/requireconfig.js',
], function (nThen, ApiConfig, $, RequireConfig) { '/customize/messages.js',
], function (nThen, ApiConfig, $, RequireConfig, Messages) {
var requireConfig = RequireConfig(); var requireConfig = RequireConfig();
var ready = false; var ready = false;
@ -15,10 +16,12 @@ define([
nThen(function (waitFor) { nThen(function (waitFor) {
$(waitFor()); $(waitFor());
}).nThen(function (waitFor) { }).nThen(function (waitFor) {
var lang = Messages._languageUsed;
var req = { var req = {
cfg: requireConfig, cfg: requireConfig,
req: [ '/common/loading.js' ], req: [ '/common/loading.js' ],
pfx: window.location.origin pfx: window.location.origin,
lang: lang
}; };
window.rc = requireConfig; window.rc = requireConfig;
window.apiconf = ApiConfig; window.apiconf = ApiConfig;

@ -2,7 +2,7 @@
<html class="cp-app-noscroll"> <html class="cp-app-noscroll">
<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="/settings/inner.js" data-main="/common/sframe-boot.js?ver=1.6" src="/bower_components/requirejs/require.js?ver=2.3.5"></script> <script async data-bootload="/settings/inner.js" data-main="/common/sframe-boot.js?ver=1.7" src="/bower_components/requirejs/require.js?ver=2.3.5"></script>
<style> <style>
.loading-hidden { display: none; } .loading-hidden { display: none; }
</style> </style>

@ -3,38 +3,14 @@ define([
'/bower_components/nthen/index.js', '/bower_components/nthen/index.js',
'/api/config', '/api/config',
'/common/dom-ready.js', '/common/dom-ready.js',
'/common/requireconfig.js',
'/common/sframe-common-outer.js' '/common/sframe-common-outer.js'
], function (nThen, ApiConfig, DomReady, RequireConfig, SFCommonO) { ], function (nThen, ApiConfig, DomReady, SFCommonO) {
var requireConfig = RequireConfig();
// Loaded in load #2 // Loaded in load #2
nThen(function (waitFor) { nThen(function (waitFor) {
DomReady.onReady(waitFor()); DomReady.onReady(waitFor());
}).nThen(function (waitFor) { }).nThen(function (waitFor) {
var req = { SFCommonO.initIframe(waitFor);
cfg: requireConfig,
req: [ '/common/loading.js' ],
pfx: window.location.origin
};
window.rc = requireConfig;
window.apiconf = ApiConfig;
document.getElementById('sbox-iframe').setAttribute('src',
ApiConfig.httpSafeOrigin + '/settings/inner.html?' + requireConfig.urlArgs +
'#' + encodeURIComponent(JSON.stringify(req)));
// This is a cheap trick to avoid loading sframe-channel in parallel with the
// loading screen setup.
var done = waitFor();
var onMsg = function (msg) {
var data = JSON.parse(msg.data);
if (data.q !== 'READY') { return; }
window.removeEventListener('message', onMsg);
var _done = done;
done = function () { };
_done();
};
window.addEventListener('message', onMsg);
}).nThen(function (/*waitFor*/) { }).nThen(function (/*waitFor*/) {
var addRpc = function (sframeChan, Cryptpad, Utils) { var addRpc = function (sframeChan, Cryptpad, Utils) {
sframeChan.on('Q_THUMBNAIL_CLEAR', function (d, cb) { sframeChan.on('Q_THUMBNAIL_CLEAR', function (d, cb) {

@ -2,7 +2,7 @@
<html class="cp-app-noscroll"> <html class="cp-app-noscroll">
<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="/common/onlyoffice/inner.js" data-main="/common/sframe-boot.js?ver=1.6" src="/bower_components/requirejs/require.js?ver=2.3.5"></script> <script async data-bootload="/common/onlyoffice/inner.js" data-main="/common/sframe-boot.js?ver=1.7" src="/bower_components/requirejs/require.js?ver=2.3.5"></script>
<style> <style>
.loading-hidden { display: none; } .loading-hidden { display: none; }
</style> </style>

@ -2,7 +2,7 @@
<html class="cp-app-noscroll cp-app-print"> <html class="cp-app-noscroll cp-app-print">
<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="/slide/inner.js" data-main="/common/sframe-boot.js?ver=1.6" src="/bower_components/requirejs/require.js?ver=2.3.5"></script> <script async data-bootload="/slide/inner.js" data-main="/common/sframe-boot.js?ver=1.7" src="/bower_components/requirejs/require.js?ver=2.3.5"></script>
<style> <style>
.loading-hidden { display: none; } .loading-hidden { display: none; }
#editor1 { display: none; } #editor1 { display: none; }

@ -2,7 +2,7 @@
<html class="cp-app-noscroll"> <html class="cp-app-noscroll">
<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="/support/inner.js" data-main="/common/sframe-boot.js?ver=1.6" src="/bower_components/requirejs/require.js?ver=2.3.5"></script> <script async data-bootload="/support/inner.js" data-main="/common/sframe-boot.js?ver=1.7" src="/bower_components/requirejs/require.js?ver=2.3.5"></script>
<style> <style>
.loading-hidden { display: none; } .loading-hidden { display: none; }
</style> </style>

@ -3,40 +3,16 @@ define([
'/bower_components/nthen/index.js', '/bower_components/nthen/index.js',
'/api/config', '/api/config',
'/common/dom-ready.js', '/common/dom-ready.js',
'/common/requireconfig.js',
'/common/sframe-common-outer.js', '/common/sframe-common-outer.js',
'/common/outer/local-store.js', '/common/outer/local-store.js',
'/common/outer/login-block.js', '/common/outer/login-block.js',
], function (nThen, ApiConfig, DomReady, RequireConfig, SFCommonO, LocalStore, Block) { ], function (nThen, ApiConfig, DomReady, SFCommonO, LocalStore, Block) {
var requireConfig = RequireConfig();
// Loaded in load #2 // Loaded in load #2
nThen(function (waitFor) { nThen(function (waitFor) {
DomReady.onReady(waitFor()); DomReady.onReady(waitFor());
}).nThen(function (waitFor) { }).nThen(function (waitFor) {
var req = { SFCommonO.initIframe(waitFor);
cfg: requireConfig,
req: [ '/common/loading.js' ],
pfx: window.location.origin
};
window.rc = requireConfig;
window.apiconf = ApiConfig;
document.getElementById('sbox-iframe').setAttribute('src',
ApiConfig.httpSafeOrigin + '/support/inner.html?' + requireConfig.urlArgs +
'#' + encodeURIComponent(JSON.stringify(req)));
// This is a cheap trick to avoid loading sframe-channel in parallel with the
// loading screen setup.
var done = waitFor();
var onMsg = function (msg) {
var data = JSON.parse(msg.data);
if (data.q !== 'READY') { return; }
window.removeEventListener('message', onMsg);
var _done = done;
done = function () { };
_done();
};
window.addEventListener('message', onMsg);
}).nThen(function (/*waitFor*/) { }).nThen(function (/*waitFor*/) {
var category; var category;
if (window.location.hash) { if (window.location.hash) {

@ -2,7 +2,7 @@
<html class="cp-app-noscroll"> <html class="cp-app-noscroll">
<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="/teams/inner.js" data-main="/common/sframe-boot.js?ver=1.6" src="/bower_components/requirejs/require.js?ver=2.3.5"></script> <script async data-bootload="/teams/inner.js" data-main="/common/sframe-boot.js?ver=1.7" src="/bower_components/requirejs/require.js?ver=2.3.5"></script>
<style> <style>
.loading-hidden { display: none; } .loading-hidden { display: none; }
#editor1 { display: none; } #editor1 { display: none; }

@ -3,47 +3,17 @@ define([
'/bower_components/nthen/index.js', '/bower_components/nthen/index.js',
'/api/config', '/api/config',
'/common/dom-ready.js', '/common/dom-ready.js',
'/common/requireconfig.js',
'/common/sframe-common-outer.js', '/common/sframe-common-outer.js',
], function (nThen, ApiConfig, DomReady, RequireConfig, SFCommonO) { ], function (nThen, ApiConfig, DomReady, SFCommonO) {
var requireConfig = RequireConfig();
// Loaded in load #2 // Loaded in load #2
var hash, href; var hash, href;
nThen(function (waitFor) { nThen(function (waitFor) {
DomReady.onReady(waitFor()); DomReady.onReady(waitFor());
}).nThen(function (waitFor) { }).nThen(function (waitFor) {
var req = { var obj = SFCommonO.initIframe(waitFor, true);
cfg: requireConfig, href = obj.href;
req: [ '/common/loading.js' ], hash = obj.hash;
pfx: window.location.origin
};
window.rc = requireConfig;
window.apiconf = ApiConfig;
// Hidden hash
hash = window.location.hash;
href = window.location.href;
if (window.history && window.history.replaceState && hash) {
window.history.replaceState({}, window.document.title, '#');
}
document.getElementById('sbox-iframe').setAttribute('src',
ApiConfig.httpSafeOrigin + '/teams/inner.html?' + requireConfig.urlArgs +
'#' + encodeURIComponent(JSON.stringify(req)));
// This is a cheap trick to avoid loading sframe-channel in parallel with the
// loading screen setup.
var done = waitFor();
var onMsg = function (msg) {
var data = JSON.parse(msg.data);
if (data.q !== 'READY') { return; }
window.removeEventListener('message', onMsg);
var _done = done;
done = function () { };
_done();
};
window.addEventListener('message', onMsg);
}).nThen(function (/*waitFor*/) { }).nThen(function (/*waitFor*/) {
var teamId; var teamId;
var addRpc = function (sframeChan, Cryptpad, Utils) { var addRpc = function (sframeChan, Cryptpad, Utils) {
@ -127,9 +97,12 @@ define([
var secret = Hash.getSecrets('team', hash); var secret = Hash.getSecrets('team', hash);
cb(null, secret); cb(null, secret);
}; };
var addData = function (meta) { var addData = function (meta, Cryptpad, user, Utils) {
if (!hash) { return; } if (!Utils.currentPad.hash) { return; }
meta.teamInviteHash = hash.slice(1); var _hash = Utils.currentPad.hash.replace(/^#/, '');
var parsed = Utils.Hash.parseTypeHash('invite', _hash);
if (parsed.app !== 'invite') { return; }
meta.teamInviteHash = _hash;
}; };
SFCommonO.start({ SFCommonO.start({
getSecrets: getSecrets, getSecrets: getSecrets,

@ -2,7 +2,7 @@
<html class="cp-app-noscroll"> <html class="cp-app-noscroll">
<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="/todo/inner.js" data-main="/common/sframe-boot.js?ver=1.6" src="/bower_components/requirejs/require.js?ver=2.3.5"></script> <script async data-bootload="/todo/inner.js" data-main="/common/sframe-boot.js?ver=1.7" src="/bower_components/requirejs/require.js?ver=2.3.5"></script>
<style> <style>
.loading-hidden { display: none; } .loading-hidden { display: none; }
</style> </style>

@ -2,7 +2,7 @@
<html class="cp-app-noscroll"> <html class="cp-app-noscroll">
<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="/whiteboard/inner.js" data-main="/common/sframe-boot.js?ver=1.6" src="/bower_components/requirejs/require.js?ver=2.3.5"></script> <script async data-bootload="/whiteboard/inner.js" data-main="/common/sframe-boot.js?ver=1.7" src="/bower_components/requirejs/require.js?ver=2.3.5"></script>
<style> <style>
.loading-hidden { display: none; } .loading-hidden { display: none; }
#editor1 { display: none; } #editor1 { display: none; }

@ -2,7 +2,7 @@
<html class="cp-app-noscroll"> <html class="cp-app-noscroll">
<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="/worker/inner.js" data-main="/common/sframe-boot.js?ver=1.6" src="/bower_components/requirejs/require.js?ver=2.3.5"></script> <script async data-bootload="/worker/inner.js" data-main="/common/sframe-boot.js?ver=1.7" src="/bower_components/requirejs/require.js?ver=2.3.5"></script>
<style> <style>
.loading-hidden { display: none; } .loading-hidden { display: none; }
</style> </style>

@ -3,38 +3,14 @@ define([
'/bower_components/nthen/index.js', '/bower_components/nthen/index.js',
'/api/config', '/api/config',
'/common/dom-ready.js', '/common/dom-ready.js',
'/common/requireconfig.js',
'/common/sframe-common-outer.js' '/common/sframe-common-outer.js'
], function (nThen, ApiConfig, DomReady, RequireConfig, SFCommonO) { ], function (nThen, ApiConfig, DomReady, SFCommonO) {
var requireConfig = RequireConfig();
// Loaded in load #2 // Loaded in load #2
nThen(function (waitFor) { nThen(function (waitFor) {
DomReady.onReady(waitFor()); DomReady.onReady(waitFor());
}).nThen(function (waitFor) { }).nThen(function (waitFor) {
var req = { SFCommonO.initIframe(waitFor);
cfg: requireConfig,
req: [ '/common/loading.js' ],
pfx: window.location.origin
};
window.rc = requireConfig;
window.apiconf = ApiConfig;
document.getElementById('sbox-iframe').setAttribute('src',
ApiConfig.httpSafeOrigin + '/worker/inner.html?' + requireConfig.urlArgs +
'#' + encodeURIComponent(JSON.stringify(req)));
// This is a cheap trick to avoid loading sframe-channel in parallel with the
// loading screen setup.
var done = waitFor();
var onMsg = function (msg) {
var data = JSON.parse(msg.data);
if (data.q !== 'READY') { return; }
window.removeEventListener('message', onMsg);
var _done = done;
done = function () { };
_done();
};
window.addEventListener('message', onMsg);
}).nThen(function (/*waitFor*/) { }).nThen(function (/*waitFor*/) {
SFCommonO.start({ SFCommonO.start({
noRealtime: true, noRealtime: true,

Loading…
Cancel
Save