Add indent settings to code2

This commit is contained in:
yflory
2017-08-30 17:57:10 +02:00
parent f54dc7505c
commit 0d008aaa2e
9 changed files with 38 additions and 52 deletions

View File

@@ -18,7 +18,7 @@ define([], function () {
var key = parsed.hash + '.' + attr;
var key2 = parsed.hash.slice(0,-1) + '.' + attr;// old pads not ending with /
if (typeof(files[key]) !== "undefined" || typeof(files[key2]) !== "undefined") {
debug("Migrating pad attribute", attr, "for pad", id);
console.log("Migrating pad attribute", attr, "for pad", id);
el[attr] = files[key] || files[key2];
delete files[key];
delete files[key2];
@@ -28,7 +28,7 @@ define([], function () {
var filesData = files.filesData;
if (!filesData) { return; }
var el, id, parsed;
var el, parsed;
for (var id in filesData) {
id = Number(id);
el = filesData[id];

View File

@@ -46,6 +46,7 @@ define([
var parsed = Cryptpad.parsePadUrl(window.location.href);
if (!parsed.type) { throw new Error(); }
var defaultTitle = Cryptpad.getDefaultName(parsed);
var proxy = Cryptpad.getProxy();
var updateMeta = function () {
//console.log('EV_METADATA_UPDATE');
var name;
@@ -65,7 +66,7 @@ define([
uid: Cryptpad.getUid(),
avatar: Cryptpad.getAvatarUrl(),
profile: Cryptpad.getProfileUrl(),
curvePublic: Cryptpad.getProxy().curvePublic,
curvePublic: proxy.curvePublic,
netfluxId: Cryptpad.getNetwork().webChannels[0].myID,
},
priv: {
@@ -76,13 +77,15 @@ define([
availableHashes: hashes,
isTemplate: Cryptpad.isTemplate(window.location.href),
feedbackAllowed: Cryptpad.isFeedbackAllowed(),
friends: Cryptpad.getProxy().friends || {}
friends: proxy.friends || {},
settings: proxy.settings || {}
}
});
});
};
Cryptpad.onDisplayNameChanged(updateMeta);
sframeChan.onReg('EV_METADATA_UPDATE', updateMeta);
proxy.on('change', 'settings', updateMeta);
Cryptpad.onError(function (info) {
console.log('error');

View File

@@ -286,15 +286,15 @@ define([
button.addClass('rightside-button');
}
return button;
};
/* funcs.storeLinkToClipboard = function (readOnly, cb) {
ctx.sframeChan.query('Q_STORE_LINK_TO_CLIPBOARD', readOnly, function (err) {
if (cb) { cb(err); }
});
};
*/
Object.freeze(funcs);
return { create: function (cb) {
nThen(function (waitFor) {

View File

@@ -82,4 +82,6 @@ define({
// Set the tab notification when the content of the pad changes
'EV_NOTIFY': true,
// Send the new settings to the inner iframe when they are changed in the proxy
'EV_SETTINGS_UPDATE': true,
});