Userlist in polls

pull/1/head
yflory 8 years ago
parent a11befaa0f
commit 684269fdda

@ -39,6 +39,7 @@
padding: 10px;
box-sizing: border-box;
h2 {
color: inherit;
font-size: 1.2em;
font-weight: bold;
text-align: center;

@ -108,6 +108,7 @@
text-align: baseline;
}
.userlist-drawer h2 {
color: inherit;
font-size: 1.2em;
font-weight: bold;
text-align: center;

@ -413,7 +413,7 @@ define([
};
common.setAttribute = function (attr, value, cb) {
getStore().set(["cryptpad", attr].join('.'), value, function (err, data) {
cb(err, data);
if (cb) { cb(err, data); }
});
};
common.setLSAttribute = function (attr, value) {

@ -70,7 +70,6 @@ define([
var parsed = Cryptpad.parsePadUrl(window.location.href);
if (typeof parsed.type === "string") {
var b = config.$container.parents('body')[0];
config.$container.parents('body').addClass('app-' + parsed.type);
}
@ -136,18 +135,15 @@ define([
var getOtherUsers = function(config) {
var userList = config.userList.list.users;
var userData = config.userList.data;
var userNetfluxId = config.userList.userNetfluxId;
var i = 0; // duplicates counter
var list = [];
// Display only one time each user (if he is connected in multiple tabs)
var myUid = userData[userNetfluxId] ? userData[userNetfluxId].uid : undefined;
var uids = [];
userList.forEach(function(user) {
//if (user !== userNetfluxId) {
var data = userData[user] || {};
var userName = data.name;
var userId = data.uid;
if (!data.uid) { return; }
if (uids.indexOf(userId) === -1) {// && (!myUid || userId !== myUid)) {
@ -268,13 +264,6 @@ define([
!config.userList.data || !config.userList.userNetfluxId) {
throw new Error("You must provide a `userList` object to display the userlist");
}
var dropdownConfig = {
options: [{
tag: 'p',
attributes: {'class': USERLIST_CLS},
}]
};
var $content = $('<div>', {'class': 'userlist-drawer'});
$('<p>', {'class': USERLIST_CLS}).appendTo($content);
toolbar.userlistContent = $content;
@ -291,7 +280,7 @@ define([
config.$contentContainer.prepend($content);
}
$button.click(function (e) {
$button.click(function () {
$content.toggle();
Cryptpad.setAttribute('userlist-drawer', $content.is(':visible'));
});

@ -17,22 +17,23 @@
<body>
<div id="toolbar" class="toolbar-container"></div>
<div id="howItWorks">
<div id="content">
<div id="poll">
<div id="howItWorks">
<h1 id="mainTitle">CryptPoll</h1>
<h2 data-localization="poll_subtitle"></h2>
<p data-localization="poll_p_save"></p>
<p data-localization="poll_p_encryption"></p>
</div>
</div>
<div class="upper">
<div class="upper">
<button id="publish" data-localization-title="poll_publish_button" data-localization="poll_publish_button" style="display: none;">publish poll</button>
<button id="admin" data-localization-title="poll_admin_button" data-localization="poll_admin_button" style="display: none;">admin</button>
<button id="help" data-localization-title="poll_show_help_button" data-localization="poll_show_help_button">help</button>
</div>
</div>
<div class="realtime">
<div class="realtime">
<br />
<center>
<textarea rows=5 cols=50 disabled="disabled" id="description"></textarea><br />
@ -43,6 +44,8 @@
<button data-localization-title="poll_create_option" id="create-option"><span class="fa fa-plus"></span></button>
<button data-localization-title="poll_commit" id="commit"><span class="fa fa-check"></span></button>
</div>
</div>
</div>
</div>
<div id="loading">

@ -692,7 +692,8 @@ var create = function (info) {
ifrw: window,
realtime: info.realtime,
network: info.network,
$container: APP.$bar
$container: APP.$bar,
$contentContainer: $('#content')
};
APP.toolbar = Toolbar.create(configTb);

@ -6,6 +6,17 @@ body {
padding: 0px;
border: 0px;
}
body {
display: flex;
flex-flow: column;
}
#content {
display: flex;
flex: 1;
}
#content #poll {
flex: 1;
}
.cryptpad-toolbar h2 {
font: normal normal normal 12px Arial, Helvetica, Tahoma, Verdana, Sans-Serif;
color: #000;

@ -19,6 +19,17 @@ html, body {
padding: 0px;
border: 0px;
}
body {
display: flex;
flex-flow: column;
}
#content {
display: flex;
flex: 1;
#poll {
flex: 1;
}
}
.cryptpad-toolbar h2 {
font: normal normal normal 12px Arial, Helvetica, Tahoma, Verdana, Sans-Serif;

Loading…
Cancel
Save