resolve merge conflicts

This commit is contained in:
ansuz
2017-11-23 16:56:49 +01:00
88 changed files with 2238 additions and 8645 deletions

View File

@@ -3,15 +3,16 @@ define([
'/bower_components/hyperjson/hyperjson.js',
'/common/toolbar3.js',
'json.sortify',
'/common/cryptpad-common.js',
'/bower_components/nthen/index.js',
'/common/sframe-common.js',
'/customize/messages.js',
'/common/common-util.js',
'/common/common-interface.js',
'/common/common-thumbnail.js',
'/customize/application_config.js',
'/bower_components/chainpad/chainpad.dist.js',
'/bower_components/file-saver/FileSaver.min.js',
'css!/bower_components/bootstrap/dist/css/bootstrap.min.css',
'less!/bower_components/components-font-awesome/css/font-awesome.min.css',
'less!/customize/src/less2/main.less',
@@ -20,11 +21,11 @@ define([
Hyperjson,
Toolbar,
JSONSortify,
Cryptpad,
nThen,
SFCommon,
Messages,
Util,
UI,
Thumb,
AppConfig,
ChainPad)
@@ -45,10 +46,6 @@ define([
var badStateTimeout = typeof(AppConfig.badStateTimeout) === 'number' ?
AppConfig.badStateTimeout : 30000;
var onConnectError = function () {
Cryptpad.errorLoadingScreen(Messages.websocketError);
};
var create = function (options, cb) {
var evContentUpdate = Util.mkEvent();
var evEditableStateChange = Util.mkEvent();
@@ -148,7 +145,7 @@ define([
evContentUpdate.fire(newContent);
} catch (e) {
console.log(e.stack);
Cryptpad.errorLoadingScreen(e.message);
UI.errorLoadingScreen(e.message);
}
};
@@ -254,7 +251,7 @@ define([
newContent = normalize(newContent);
contentUpdate(newContent);
} else {
title.updateTitle(Cryptpad.initialName || title.defaultTitle);
title.updateTitle(title.defaultTitle);
evOnDefaultContentNeeded.fire();
}
stateChange(STATE.READY);
@@ -262,7 +259,7 @@ define([
if (!readOnly) { onLocal(); }
evOnReady.fire(newPad);
Cryptpad.removeLoadingScreen(emitResize);
UI.removeLoadingScreen(emitResize);
var privateDat = cpNfInner.metadataMgr.getPrivateData();
if (options.thumbnail && privateDat.thumbnails) {
@@ -285,9 +282,9 @@ define([
var onConnectionChange = function (info) {
stateChange(info.state ? STATE.INITIALIZING : STATE.DISCONNECTED);
if (info.state) {
Cryptpad.findOKButton().click();
UI.findOKButton().click();
} else {
Cryptpad.alert(Messages.common_connectionLost, undefined, true);
UI.alert(Messages.common_connectionLost, undefined, true);
}
};
@@ -295,8 +292,8 @@ define([
var $export = common.createButton('export', true, {}, function () {
var ext = (typeof(extension) === 'function') ? extension() : extension;
var suggestion = title.suggestTitle('cryptpad-document');
Cryptpad.prompt(Messages.exportPrompt,
Cryptpad.fixFileName(suggestion) + '.' + ext, function (filename)
UI.prompt(Messages.exportPrompt,
Util.fixFileName(suggestion) + '.' + ext, function (filename)
{
if (!(typeof(filename) === 'string' && filename)) { return; }
if (async) {
@@ -371,7 +368,7 @@ define([
};
nThen(function (waitFor) {
Cryptpad.addLoadingScreen();
UI.addLoadingScreen();
SFCommon.create(waitFor(function (c) { common = c; }));
}).nThen(function (waitFor) {
cpNfInner = common.startRealtime({
@@ -422,25 +419,19 @@ define([
if (infiniteSpinnerModal) { return; }
infiniteSpinnerModal = true;
stateChange(STATE.INFINITE_SPINNER);
Cryptpad.confirm(Messages.realtime_unrecoverableError, function (yes) {
UI.confirm(Messages.realtime_unrecoverableError, function (yes) {
if (!yes) { return; }
common.gotoURL();
});
cpNfInner.chainpad.onSettle(function () {
infiniteSpinnerModal = false;
Cryptpad.findCancelButton().click();
UI.findCancelButton().click();
stateChange(STATE.READY);
onRemote();
});
}, 2000);
//Cryptpad.onLogout(function () { ... });
Cryptpad.onError(function (info) {
if (info && info.type === "store") {
onConnectError();
}
});
//common.onLogout(function () { ... });
}).nThen(function (waitFor) {
if (readOnly) { $('body').addClass('cp-readonly'); }
@@ -472,7 +463,6 @@ define([
metadataMgr: cpNfInner.metadataMgr,
readOnly: readOnly,
realtime: cpNfInner.chainpad,
common: Cryptpad,
sfCommon: common,
$container: $(toolbarContainer),
$contentContainer: $(contentContainer)