Merge branch 'staging' of github.com:xwiki-labs/cryptpad into staging

pull/1/head
ansuz 8 years ago
commit 1fd0ba488a

@ -108,6 +108,7 @@ h6 {
padding-top: .65001rem;
}
p {
a:not(.btn) {
cursor: pointer;
color: @cp-link;
@ -121,6 +122,7 @@ a:not(.btn) {
color: @cp-link-visited;
}
}
}
a.btn {
font-family: sans-serif;
}

@ -138,7 +138,15 @@ body .userlist-drawer {
color: black;
font-size: 40px;
}
.name {
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
media-tag {
min-height: 50px;
min-width: 50px;
max-height: 50px;
max-width: 50px;
img {

@ -72,7 +72,7 @@
}
}
}
a {
&.link a {
font-weight: 500;
font-size: 0.75em;
color: @cp-link;

@ -1194,6 +1194,27 @@ define([
return button;
};
var emoji_patt = /([\uD800-\uDBFF][\uDC00-\uDFFF])/;
var isEmoji = function (str) {
return emoji_patt.test(str);
};
var emojiStringToArray = function (str) {
var split = str.split(emoji_patt);
var arr = [];
for (var i=0; i<split.length; i++) {
var char = split[i];
if (char !== "") {
arr.push(char);
}
}
return arr;
};
var getFirstEmojiOrCharacter = function (str) {
if (!str || !str.trim()) { return '?'; }
var emojis = emojiStringToArray(str);
return isEmoji(emojis[0])? emojis[0]: str[0];
};
$(window.document).on('decryption', function (e) {
var decrypted = e.originalEvent;
if (decrypted.callback) {
@ -1242,7 +1263,7 @@ define([
common.displayAvatar = function ($container, href, name, cb) {
var MutationObserver = window.MutationObserver;
var displayDefault = function () {
var text = name.trim().length ? name.trim().slice(0,1) : '?';
var text = getFirstEmojiOrCharacter(name);
var $avatar = $('<span>', {'class': 'default'}).text(text);
$container.append($avatar);
if (cb) { cb(); }

@ -206,6 +206,7 @@ define([
// Editors
editUsersNames.forEach(function (data) {
var name = data.name || Messages.anonymous;
var $name = $('<span>', {'class': 'name'}).text(name);
var $span = $('<span>', {'title': name});
if (data.profile) {
$span.addClass('clickable');
@ -215,13 +216,13 @@ define([
}
if (data.avatar && avatars[data.avatar]) {
$span.append(avatars[data.avatar]);
$span.append(name);
$span.append($name);
} else {
Cryptpad.displayAvatar($span, data.avatar, name, function ($img) {
if (data.avatar && $img) {
avatars[data.avatar] = $img[0].outerHTML;
}
$span.append(name);
$span.append($name);
});
}
$span.data('uid', data.uid);

@ -1170,7 +1170,7 @@ define([
var element = filesOp.find(newPath);
var $icon = !isFolder ? getFileIcon(element) : undefined;
var ro = filesOp.isReadOnlyFile(element);
// ro undefined mens it's an old hash which doesn't support read-only
// ro undefined means it's an old hash which doesn't support read-only
var roClass = typeof(ro) === 'undefined' ? ' noreadonly' : ro ? ' readonly' : '';
var liClass = 'file-item file-element element' + roClass;
if (isFolder) {
@ -2140,6 +2140,7 @@ define([
$trashContextMenu.hide();
$contentContextMenu.hide();
$defaultContextMenu.hide();
$iframe.find('.cryptpad-dropdown').hide();
};
var stringifyPath = function (path) {

Loading…
Cancel
Save