pass in websocketURL from main

pull/1/head
ansuz 9 years ago
parent d9a4f2f22c
commit 85dbd5cb6e

@ -1,6 +1,5 @@
require.config({ paths: { 'json.sortify': '/bower_components/json.sortify/dist/JSON.sortify' } }); require.config({ paths: { 'json.sortify': '/bower_components/json.sortify/dist/JSON.sortify' } });
define([ define([
'/api/config?cb=' + Math.random().toString(16).substring(2),
'/common/crypto.js', '/common/crypto.js',
'/common/realtime-input.js', '/common/realtime-input.js',
'/bower_components/chainpad-json-validator/json-ot.js', '/bower_components/chainpad-json-validator/json-ot.js',
@ -8,7 +7,7 @@ define([
'/bower_components/textpatcher/TextPatcher.amd.js', '/bower_components/textpatcher/TextPatcher.amd.js',
'/bower_components/jquery/dist/jquery.min.js', '/bower_components/jquery/dist/jquery.min.js',
'/bower_components/proxy-polyfill/proxy.min.js', // https://github.com/GoogleChrome/proxy-polyfill '/bower_components/proxy-polyfill/proxy.min.js', // https://github.com/GoogleChrome/proxy-polyfill
], function (Config, Crypto, Realtime, JsonOT, Sortify, TextPatcher) { ], function (Crypto, Realtime, JsonOT, Sortify, TextPatcher) {
var api = {}; var api = {};
// linter complains if this isn't defined // linter complains if this isn't defined
var Proxy = window.Proxy; var Proxy = window.Proxy;
@ -67,6 +66,10 @@ define([
create: [], create: [],
}; };
/* TODO implement 'off' as well.
change 'setter' to warn users when they attempt to set 'off'
*/
var on = function (evt, pattern, f) { var on = function (evt, pattern, f) {
switch (evt) { switch (evt) {
case 'change': case 'change':
@ -547,7 +550,7 @@ define([
channel: cfg.channel, channel: cfg.channel,
cryptKey: cfg.cryptKey, cryptKey: cfg.cryptKey,
crypto: Crypto, crypto: Crypto,
websocketURL: Config.websocketURL, websocketURL: cfg.websocketURL,
logLevel: 0 logLevel: 0
}; };

@ -1,14 +1,16 @@
define([ define([
'/api/config?cb=' + Math.random().toString(16).substring(2),
'/common/chainpad-listmap.js', '/common/chainpad-listmap.js',
'/common/crypto.js', '/common/crypto.js',
'/common/cryptpad-common.js', '/common/cryptpad-common.js',
//'/customize/pad.js' //'/customize/pad.js'
], function (RtListMap, Crypto, Common) { ], function (Config, RtListMap, Crypto, Common) {
var $ = window.jQuery; var $ = window.jQuery;
var secret = Common.getSecrets(); var secret = Common.getSecrets();
var config = { var config = {
websocketURL: Config.websocketURL,
channel: secret.channel, channel: secret.channel,
cryptKey: secret.key, cryptKey: secret.key,
data: {}, data: {},

Loading…
Cancel
Save