diff --git a/www/common/common-inner.js b/www/common/common-inner.js deleted file mode 100644 index 921d10e88..000000000 --- a/www/common/common-inner.js +++ /dev/null @@ -1,8 +0,0 @@ -define([ - 'jquery' -], function ($) { - var common = {}; - - - return common; -}); diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index defca3a59..473fa815c 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -198,6 +198,9 @@ define([ } return ''; }; + common.getAccountName = function () { + return localStorage[common.userNameKey]; + }; var randomToken = function () { return Math.random().toString(16).replace(/0./, ''); diff --git a/www/common/metadata-manager.js b/www/common/metadata-manager.js index 752c8e1cf..b2a0cf756 100644 --- a/www/common/metadata-manager.js +++ b/www/common/metadata-manager.js @@ -5,6 +5,7 @@ define([], function () { var members = []; var metadataObj = UNINIT; var metadataLazyObj = UNINIT; + var priv = {}; var dirty = true; var changeHandlers = []; @@ -52,6 +53,9 @@ define([], function () { sframeChan.on('EV_METADATA_UPDATE', function (ev) { meta = ev; + if (ev.priv) { + priv = ev.priv; + } change(true); }); sframeChan.on('EV_RT_CONNECT', function (ev) { @@ -95,6 +99,9 @@ define([], function () { checkUpdate(false); var list = members.slice().filter(function (m) { return m.length === 32; }); return list.length - Object.keys(metadataObj.users).length; + }, + getPrivatedata : function () { + return priv; } }); }; diff --git a/www/pad2/main.js b/www/pad2/main.js index fd1f87ad5..95218a569 100644 --- a/www/pad2/main.js +++ b/www/pad2/main.js @@ -473,7 +473,7 @@ define([ var titleCfg = { getHeadingText: getHeadingText }; Title = Cryptpad.createTitle(titleCfg, realtimeOptions.onLocal, Cryptpad); var configTb = { - displayed: ['userlist'], + displayed: ['userlist', 'useradmin'], //title: Title.getTitleConfig(), userList: cpNfInner.metadataMgr, readOnly: readOnly, diff --git a/www/pad2/outer.js b/www/pad2/outer.js index 1dfdbcd5a..2e7793cfc 100644 --- a/www/pad2/outer.js +++ b/www/pad2/outer.js @@ -47,6 +47,9 @@ define([ profile: Cryptpad.getProfileUrl(), curvePublic: Cryptpad.getProxy().curvePublic, netfluxId: Cryptpad.getNetwork().webChannels[0].myID, + }, + priv: { + accountName: Cryptpad.getAccountName() } }); }); @@ -75,4 +78,4 @@ define([ } }); }); -}); \ No newline at end of file +});