manual merge

This commit is contained in:
Caleb James DeLisle
2017-09-11 15:52:14 +02:00
42 changed files with 3078 additions and 1081 deletions

View File

@@ -8,14 +8,30 @@ define([
'/common/sframe-common-interface.js',
'/common/sframe-common-history.js',
'/common/sframe-common-file.js',
'/common/sframe-common-codemirror.js',
'/common/metadata-manager.js',
'/customize/application_config.js',
'/common/cryptpad-common.js',
'/common/common-realtime.js',
'/common/common-util.js'
], function ($, nThen, Messages, CpNfInner, SFrameChannel, Title, UI, History, File, MetadataMgr,
AppConfig, Cryptpad, CommonRealtime, Util) {
], function (
$,
nThen,
Messages,
CpNfInner,
SFrameChannel,
Title,
UI,
History,
File,
CodeMirror,
MetadataMgr,
AppConfig,
Cryptpad,
CommonRealtime,
Util
) {
// Chainpad Netflux Inner
var funcs = {};
@@ -40,7 +56,7 @@ define([
funcs.getSframeChannel = function () { return ctx.sframeChan; };
funcs.getAppConfig = function () { return AppConfig; };
var isLoggedIn = funcs.isLoggedIn = function () {
funcs.isLoggedIn = function () {
if (!ctx.cpNfInner) { throw new Error("cpNfInner is not ready!"); }
return ctx.cpNfInner.metadataMgr.getPrivateData().accountName;
};
@@ -73,12 +89,8 @@ define([
funcs.uploadFile = callWithCommon(File.uploadFile);
funcs.createFileManager = callWithCommon(File.create);
// Misc
funcs.setDisplayName = function (name, cb) {
cb = cb || $.noop;
ctx.sframeChan.query('Q_SETTINGS_SET_DISPLAY_NAME', name, cb);
};
// CodeMirror
funcs.initCodeMirrorApp = callWithCommon(CodeMirror.create);
// Window
funcs.logout = function (cb) {
@@ -89,12 +101,22 @@ define([
funcs.notify = function () {
ctx.sframeChan.event('EV_NOTIFY');
};
funcs.setTabTitle = function (newTitle) {
ctx.sframeChan.event('EV_SET_TAB_TITLE', newTitle);
};
funcs.setLoginRedirect = function (cb) {
cb = cb || $.noop;
ctx.sframeChan.query('Q_SET_LOGIN_REDIRECT', null, cb);
};
funcs.isPresentUrl = function (cb) {
ctx.sframeChan.query('Q_PRESENT_URL_GET_VALUE', null, cb);
};
funcs.setPresentUrl = function (value) {
ctx.sframeChan.event('EV_PRESENT_URL_SET_VALUE', value);
};
// Store
funcs.sendAnonRpcMsg = function (msg, content, cb) {
ctx.sframeChan.query('Q_ANON_RPC_MESSAGE', {
@@ -152,6 +174,11 @@ define([
return !data.readOnly || !data.availableHashes.editHash;
};
funcs.setDisplayName = function (name, cb) {
cb = cb || $.noop;
ctx.sframeChan.query('Q_SETTINGS_SET_DISPLAY_NAME', name, cb);
};
// Friends
var pendingFriends = [];
funcs.getPendingFriends = function () {
@@ -226,6 +253,7 @@ define([
Cryptpad.log(data.logText);
});
ctx.sframeChan.ready();
cb(funcs);
});
} };