Made pad2 server more generic and easy to implement

This commit is contained in:
Caleb James DeLisle
2017-08-17 15:41:04 +02:00
parent e04c0b89a1
commit ad9f2ff223
6 changed files with 46 additions and 25 deletions

View File

@@ -1,17 +1,20 @@
define([
'/api/config',
'/common/sframe-channel.js',
'jquery',
'/common/sframe-chainpad-netflux-outer.js',
'/bower_components/nthen/index.js',
'/common/cryptpad-common.js',
'/bower_components/chainpad-crypto/crypto.js'
], function (SFrameChannel, $, CpNfOuter, nThen, Cryptpad, Crypto) {
], function (ApiConfig, SFrameChannel, $, CpNfOuter, nThen, Cryptpad, Crypto) {
console.log('xxx');
var sframeChan;
nThen(function (waitFor) {
$(waitFor());
}).nThen(function (waitFor) {
$('#sbox-iframe').attr('src',
ApiConfig.httpSafeOrigin + '/pad2/inner.html?' + ApiConfig.requireConf.urlArgs);
SFrameChannel.create($('#sbox-iframe')[0].contentWindow, waitFor(function (sfc) {
sframeChan = sfc;
console.log('sframe initialized');