Big manual merge
This commit is contained in:
commit
0d1f19f5d4
71 files changed
+3489
-1004
No files matched your search
@@ -254,6 +254,7 @@ define([
|
||||
var createAreaHandlers = File.createDropArea = function ($area, $hoverArea) {
|
||||
var counter = 0;
|
||||
if (!$hoverArea) { $hoverArea = $area; }
|
||||
if (!$area) { return; }
|
||||
$hoverArea
|
||||
.on('dragenter', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
@@ -276,6 +276,7 @@ define([
|
||||
var $slideIcon = $('<span>', {"class": "fa fa-file-powerpoint-o file icon slideColor"});
|
||||
var $pollIcon = $('<span>', {"class": "fa fa-calendar file icon pollColor"});
|
||||
var $whiteboardIcon = $('<span>', {"class": "fa fa-paint-brush whiteboardColor"});
|
||||
var $todoIcon = $('<span>', {"class": "fa fa-tasks todoColor"});
|
||||
var $contactsIcon = $('<span>', {"class": "fa fa-users friendsColor"});
|
||||
UI.getIcon = function (type) {
|
||||
var $icon;
|
||||
@@ -287,6 +288,7 @@ define([
|
||||
case 'slide': $icon = $slideIcon.clone(); break;
|
||||
case 'poll': $icon = $pollIcon.clone(); break;
|
||||
case 'whiteboard': $icon = $whiteboardIcon.clone(); break;
|
||||
case 'todo': $icon = $todoIcon.clone(); break;
|
||||
case 'contacts': $icon = $contactsIcon.clone(); break;
|
||||
default: $icon = $fileIcon.clone();
|
||||
}
|
||||
@@ -295,16 +297,21 @@ define([
|
||||
};
|
||||
|
||||
// Tooltips
|
||||
|
||||
UI.clearTooltips = function () {
|
||||
$('.tippy-popper').remove();
|
||||
};
|
||||
|
||||
UI.addTooltips = function () {
|
||||
var MutationObserver = window.MutationObserver;
|
||||
var addTippy = function (el) {
|
||||
if (el.nodeName === 'IFRAME') { return; }
|
||||
console.log(el);
|
||||
var delay = typeof(AppConfig.tooltipDelay) === "number" ? AppConfig.tooltipDelay : 500;
|
||||
Tippy(el, {
|
||||
position: 'bottom',
|
||||
distance: 0,
|
||||
performance: true,
|
||||
delay: [500, 0]
|
||||
delay: [delay, 0]
|
||||
});
|
||||
};
|
||||
var $body = $('body');
|
||||
|
||||
+113
-30
@@ -4,7 +4,27 @@ define([
|
||||
'/common/curve.js',
|
||||
'/bower_components/marked/marked.min.js',
|
||||
], function ($, Crypto, Curve, Marked) {
|
||||
var Msg = {};
|
||||
var Msg = {
|
||||
inputs: [],
|
||||
};
|
||||
|
||||
var Messages;
|
||||
Msg.setEditable = function (bool) {
|
||||
bool = !bool;
|
||||
Msg.inputs.forEach(function (input) {
|
||||
if (bool) {
|
||||
input.setAttribute('disabled', bool);
|
||||
} else {
|
||||
input.removeAttribute('disabled');
|
||||
}
|
||||
|
||||
if (Messages) {
|
||||
// set placeholder
|
||||
var placeholder = bool? Messages.disconnected: Messages.contacts_typeHere;
|
||||
input.setAttribute('placeholder', placeholder);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var Types = {
|
||||
message: 'MSG',
|
||||
@@ -227,7 +247,6 @@ define([
|
||||
if (!isId) { return; }
|
||||
|
||||
var decryptedMsg = channel.encryptor.decrypt(msg);
|
||||
console.log(decryptedMsg);
|
||||
var parsed = JSON.parse(decryptedMsg);
|
||||
if (parsed[0] !== Types.mapId && parsed[0] !== Types.mapIdAck) { return; }
|
||||
if (parsed[2] !== sender || !parsed[1]) { return; }
|
||||
@@ -267,6 +286,7 @@ define([
|
||||
var chan = parsed[3];
|
||||
if (!chan || !channels[chan]) { return; }
|
||||
pushMsg(common, channels[chan], parsed[4]);
|
||||
channels[chan].refresh();
|
||||
};
|
||||
var onMessage = function (common, msg, sender, chan) {
|
||||
if (!channels[chan.id]) { return; }
|
||||
@@ -284,32 +304,50 @@ define([
|
||||
var data = getFriend(common, curvePublic);
|
||||
var proxy = common.getProxy();
|
||||
|
||||
var $header = $('<div>', {'class': 'header avatar'}).appendTo($container);
|
||||
/*
|
||||
var $removeHistory = $('<button>', {
|
||||
'class': 'remove-history'
|
||||
}).text('remove chat history').click(function () {
|
||||
Cryptpad.confirm('are you sure?', function (yes) {
|
||||
// Input
|
||||
var channel = channels[data.channel];
|
||||
|
||||
var $header = $('<div>', {
|
||||
'class': 'header',
|
||||
}).appendTo($container);
|
||||
|
||||
var $avatar = $('<div>', {'class': 'avatar'}).appendTo($header);
|
||||
|
||||
// more history...
|
||||
$('<span>', {
|
||||
'class': 'more-history',
|
||||
})
|
||||
.text('get more history')
|
||||
.click(function () {
|
||||
console.log("GETTING HISTORY");
|
||||
channel.getPreviousMessages();
|
||||
})
|
||||
.appendTo($header);
|
||||
|
||||
var $removeHistory = $('<span>', {
|
||||
'class': 'remove-history fa fa-eraser',
|
||||
title: common.Messages.contacts_removeHistoryTitle
|
||||
})
|
||||
.click(function () {
|
||||
common.confirm(common.Messages.contacts_confirmRemoveHistory, function (yes) {
|
||||
if (!yes) { return; }
|
||||
Cryptpad.clearOwnedChannel(data.channel, function (e) {
|
||||
common.clearOwnedChannel(data.channel, function (e) {
|
||||
if (e) {
|
||||
console.error(e);
|
||||
Cryptpad.alert("Something went wrong");
|
||||
common.alert(common.Messages.contacts_removeHistoryServerError);
|
||||
return;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
$removeHistory.appendTo($header); //rightCol);
|
||||
*/
|
||||
$removeHistory.appendTo($header);
|
||||
|
||||
$('<div>', {'class': 'messages'}).appendTo($container);
|
||||
var $inputBlock = $('<div>', {'class': 'input'}).appendTo($container);
|
||||
|
||||
// Input
|
||||
var channel = channels[data.channel];
|
||||
var $input = $('<textarea>').appendTo($inputBlock);
|
||||
$input.attr('placeholder', common.Messages.contacts_typeHere);
|
||||
Msg.inputs.push($input[0]);
|
||||
|
||||
var sending = false;
|
||||
var send = function () {
|
||||
@@ -338,7 +376,7 @@ define([
|
||||
});*/
|
||||
var onKeyDown = function (e) {
|
||||
if (e.keyCode === 13) {
|
||||
if (e.ctrlKey) {
|
||||
if (e.ctrlKey || e.shiftKey) {
|
||||
var val = this.value;
|
||||
if (typeof this.selectionStart === "number" && typeof this.selectionEnd === "number") {
|
||||
var start = this.selectionStart;
|
||||
@@ -363,24 +401,35 @@ define([
|
||||
var $rightCol = $('<span>', {'class': 'right-col'});
|
||||
$('<span>', {'class': 'name'}).text(data.displayName).appendTo($rightCol);
|
||||
if (data.avatar && avatars[data.avatar]) {
|
||||
$header.append(avatars[data.avatar]);
|
||||
$header.append($rightCol);
|
||||
$avatar.append(avatars[data.avatar]);
|
||||
$avatar.append($rightCol);
|
||||
} else {
|
||||
common.displayAvatar($header, data.avatar, data.displayName, function ($img) {
|
||||
common.displayAvatar($avatar, data.avatar, data.displayName, function ($img) {
|
||||
if (data.avatar && $img) {
|
||||
avatars[data.avatar] = $img[0].outerHTML;
|
||||
}
|
||||
$header.append($rightCol);
|
||||
$avatar.append($rightCol);
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Msg.getLatestMessages = function () {
|
||||
Object.keys(channels).forEach(function (id) {
|
||||
if (id === 'me') { return; }
|
||||
var friend = channels[id];
|
||||
friend.getMessagesSinceDisconnect();
|
||||
friend.refresh();
|
||||
});
|
||||
};
|
||||
|
||||
Msg.init = function (common, $listContainer, $msgContainer) {
|
||||
var network = common.getNetwork();
|
||||
var proxy = common.getProxy();
|
||||
Msg.hk = network.historyKeeper;
|
||||
var friends = getFriendList(common);
|
||||
Messages = Messages || common.Messages;
|
||||
|
||||
network.on('message', function(msg, sender) {
|
||||
onDirectMessage(common, msg, sender);
|
||||
});
|
||||
@@ -450,6 +499,7 @@ define([
|
||||
$chat.show();
|
||||
|
||||
Msg.active = curvePublic;
|
||||
// TODO don't mark messages as read unless you have displayed them
|
||||
|
||||
refresh(curvePublic);
|
||||
};
|
||||
@@ -539,6 +589,37 @@ define([
|
||||
var statusText = status ? 'online' : 'offline';
|
||||
$friend.find('.status').attr('class', 'status '+statusText);
|
||||
};
|
||||
var getMoreHistory = function (network, chan, hash, count) {
|
||||
var msg = [
|
||||
'GET_HISTORY_RANGE',
|
||||
chan.id,
|
||||
{
|
||||
from: hash,
|
||||
count: count,
|
||||
}
|
||||
];
|
||||
|
||||
console.log(msg);
|
||||
|
||||
network.sendto(network.historyKeeper, JSON.stringify(msg)).then(function (a, b, c) {
|
||||
console.log(a, b, c);
|
||||
}, function (err) {
|
||||
throw new Error(err);
|
||||
});
|
||||
};
|
||||
|
||||
var getChannelMessagesSince = function (network, chan, data, keys) {
|
||||
var cfg = {
|
||||
validateKey: keys.validateKey,
|
||||
owners: [proxy.edPublic, data.edPublic],
|
||||
lastKnownHash: data.lastKnownHash
|
||||
};
|
||||
var msg = ['GET_HISTORY', chan.id, cfg];
|
||||
network.sendto(network.historyKeeper, JSON.stringify(msg))
|
||||
.then($.noop, function (err) {
|
||||
throw new Error(err);
|
||||
});
|
||||
};
|
||||
|
||||
// Open the channels
|
||||
var openFriendChannel = function (f) {
|
||||
@@ -558,9 +639,18 @@ define([
|
||||
removeUI: function () { removeUI(data.curvePublic); },
|
||||
updateUI: function (types) { updateUI(data.curvePublic, types); },
|
||||
updateStatus: function () { updateStatus(data.curvePublic); },
|
||||
getMessagesSinceDisconnect: function () {
|
||||
getChannelMessagesSince(network, chan, data, keys);
|
||||
},
|
||||
wc: chan,
|
||||
userList: [],
|
||||
mapId: {}
|
||||
mapId: {},
|
||||
getPreviousMessages: function () {
|
||||
var oldestMessages = channel.messages[0];
|
||||
var oldestHash = oldestMessages[0];
|
||||
|
||||
getMoreHistory(network, chan, oldestHash, 10);
|
||||
},
|
||||
};
|
||||
chan.on('message', function (msg, sender) {
|
||||
onMessage(common, msg, sender, chan);
|
||||
@@ -589,20 +679,13 @@ define([
|
||||
}
|
||||
channel.updateStatus();
|
||||
});
|
||||
var cfg = {
|
||||
validateKey: keys.validateKey,
|
||||
owners: [proxy.edPublic, data.edPublic],
|
||||
lastKnownHash: data.lastKnownHash
|
||||
};
|
||||
var msg = ['GET_HISTORY', chan.id, cfg];
|
||||
network.sendto(network.historyKeeper, JSON.stringify(msg))
|
||||
.then($.noop, function (err) {
|
||||
throw new Error(err);
|
||||
});
|
||||
|
||||
getChannelMessagesSince(network, chan, data, keys);
|
||||
}, function (err) {
|
||||
console.error(err);
|
||||
});
|
||||
};
|
||||
|
||||
Object.keys(friends).forEach(openFriendChannel);
|
||||
|
||||
var checkNewFriends = function () {
|
||||
|
||||
@@ -51,7 +51,7 @@ define([
|
||||
common.displayNameKey = 'cryptpad.username';
|
||||
var newPadNameKey = common.newPadNameKey = "newPadName";
|
||||
var newPadPathKey = common.newPadPathKey = "newPadPath";
|
||||
var oldStorageKey = common.oldStorageKey = 'CryptPad_RECENTPADS';
|
||||
common.oldStorageKey = 'CryptPad_RECENTPADS';
|
||||
common.storageKey = 'filesData';
|
||||
var PINNING_ENABLED = AppConfig.enablePinning;
|
||||
|
||||
@@ -77,6 +77,7 @@ define([
|
||||
common.unnotify = UI.unnotify;
|
||||
common.getIcon = UI.getIcon;
|
||||
common.addTooltips = UI.addTooltips;
|
||||
common.clearTooltips = UI.clearTooltips;
|
||||
|
||||
// import common utilities for export
|
||||
common.find = Util.find;
|
||||
@@ -127,6 +128,8 @@ define([
|
||||
common.getFriendListUI = Messaging.getFriendListUI;
|
||||
common.createData = Messaging.createData;
|
||||
common.getPendingInvites = Messaging.getPending;
|
||||
common.enableMessaging = Messaging.setEditable;
|
||||
common.getLatestMessages = Messaging.getLatestMessages;
|
||||
|
||||
// Userlist
|
||||
common.createUserList = UserList.create;
|
||||
@@ -244,6 +247,8 @@ define([
|
||||
};
|
||||
|
||||
common.infiniteSpinnerDetected = false;
|
||||
var BAD_STATE_TIMEOUT = typeof(AppConfig.badStateTimeout) === 'number'?
|
||||
AppConfig.badStateTimeout: 30000;
|
||||
var whenRealtimeSyncs = common.whenRealtimeSyncs = function (realtime, cb) {
|
||||
realtime.sync();
|
||||
|
||||
@@ -263,7 +268,7 @@ define([
|
||||
window.location.reload();
|
||||
});
|
||||
common.infiniteSpinnerDetected = true;
|
||||
}, 30000);
|
||||
}, BAD_STATE_TIMEOUT);
|
||||
realtime.onSettle(function () {
|
||||
clearTimeout(to);
|
||||
cb();
|
||||
@@ -409,7 +414,7 @@ define([
|
||||
return parsed.hashData;
|
||||
};
|
||||
// Migrate from legacy store (localStorage)
|
||||
var migrateRecentPads = common.migrateRecentPads = function (pads) {
|
||||
common.migrateRecentPads = function (pads) {
|
||||
return pads.map(function (pad) {
|
||||
var parsedHash;
|
||||
if (Array.isArray(pad)) { // TODO DEPRECATE_F
|
||||
@@ -448,24 +453,6 @@ define([
|
||||
});
|
||||
};
|
||||
|
||||
// Get the pads from localStorage to migrate them to the object store
|
||||
common.getLegacyPads = function (cb) {
|
||||
require(['/customize/store.js'], function(Legacy) { // TODO DEPRECATE_F
|
||||
Legacy.ready(function (err, legacy) {
|
||||
if (err) { cb(err, null); return; }
|
||||
legacy.get(oldStorageKey, function (err2, recentPads) {
|
||||
if (err2) { cb(err2, null); return; }
|
||||
if (Array.isArray(recentPads)) {
|
||||
feedback('MIGRATE_LEGACY_STORE');
|
||||
cb(void 0, migrateRecentPads(recentPads));
|
||||
return;
|
||||
}
|
||||
cb(void 0, []);
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
// Create untitled documents when no name is given
|
||||
var getLocaleDate = common.getLocaleDate = function () {
|
||||
if (window.Intl && window.Intl.DateTimeFormat) {
|
||||
@@ -1098,6 +1085,7 @@ define([
|
||||
}
|
||||
break;
|
||||
case 'upload':
|
||||
console.log('UPLOAD');
|
||||
button = $('<button>', {
|
||||
'class': 'btn btn-primary new',
|
||||
title: Messages.uploadButtonTitle,
|
||||
@@ -1257,6 +1245,13 @@ define([
|
||||
style: 'font:'+size+' FontAwesome'
|
||||
});
|
||||
break;
|
||||
case 'savetodrive':
|
||||
button = $('<button>', {
|
||||
'class': 'fa fa-cloud-upload',
|
||||
title: Messages.canvas_saveToDrive,
|
||||
})
|
||||
.click(prepareFeedback(type));
|
||||
break;
|
||||
default:
|
||||
button = $('<button>', {
|
||||
'class': "fa fa-question",
|
||||
@@ -1403,6 +1398,67 @@ define([
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
common.createFileDialog = function (cfg) {
|
||||
var $body = cfg.$body || $('body');
|
||||
var $block = $body.find('#fileDialog');
|
||||
if (!$block.length) {
|
||||
$block = $('<div>', {id: "fileDialog"}).appendTo($body);
|
||||
}
|
||||
$block.html('');
|
||||
$('<span>', {
|
||||
'class': 'close fa fa-times',
|
||||
'title': Messages.filePicker_close
|
||||
}).click(function () {
|
||||
$block.hide();
|
||||
}).appendTo($block);
|
||||
var $description = $('<p>').text(Messages.filePicker_description);
|
||||
$block.append($description);
|
||||
var $filter = $('<p>').appendTo($block);
|
||||
var $container = $('<span>', {'class': 'fileContainer'}).appendTo($block);
|
||||
var updateContainer = function () {
|
||||
$container.html('');
|
||||
var filter = $filter.find('.filter').val().trim();
|
||||
var list = common.getUserFilesList();
|
||||
var fo = common.getFO();
|
||||
list.forEach(function (id) {
|
||||
var data = fo.getFileData(id);
|
||||
var name = fo.getTitle(id);
|
||||
if (filter && name.toLowerCase().indexOf(filter.toLowerCase()) === -1) {
|
||||
return;
|
||||
}
|
||||
var $span = $('<span>', {'class': 'element'}).appendTo($container);
|
||||
var $inner = $('<span>').text(name);
|
||||
$span.append($inner).click(function () {
|
||||
if (typeof cfg.onSelect === "function") { cfg.onSelect(data.href); }
|
||||
$block.hide();
|
||||
});
|
||||
});
|
||||
};
|
||||
var to;
|
||||
$('<input>', {
|
||||
type: 'text',
|
||||
'class': 'filter',
|
||||
'placeholder': Messages.filePicker_filter
|
||||
}).appendTo($filter).on('keypress', function () {
|
||||
if (to) { window.clearTimeout(to); }
|
||||
to = window.setTimeout(updateContainer, 300);
|
||||
});
|
||||
//$filter.append(' '+Messages.or+' ');
|
||||
var data = {FM: cfg.data.FM};
|
||||
$filter.append(common.createButton('upload', false, data, function () {
|
||||
$block.hide();
|
||||
}));
|
||||
updateContainer();
|
||||
$body.keydown(function (e) {
|
||||
if (e.which === 27) { $block.hide(); }
|
||||
});
|
||||
$block.show();
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
// Create a button with a dropdown menu
|
||||
// input is a config object with parameters:
|
||||
// - container (optional): the dropdown container (span)
|
||||
@@ -1779,6 +1835,7 @@ define([
|
||||
initialized = true;
|
||||
|
||||
updateLocalVersion();
|
||||
common.addTooltips();
|
||||
f(void 0, env);
|
||||
if (typeof(window.onhashchange) === 'function') { window.onhashchange(); }
|
||||
}
|
||||
@@ -1797,7 +1854,6 @@ define([
|
||||
store = common.store = env.store = storeObj;
|
||||
|
||||
common.addDirectMessageHandler(common);
|
||||
common.addTooltips();
|
||||
|
||||
var proxy = getProxy();
|
||||
var network = getNetwork();
|
||||
|
||||
@@ -164,7 +164,6 @@ define([
|
||||
var $mts = $content.find('media-tag:not(:has(*))');
|
||||
$mts.each(function (i, el) {
|
||||
MediaTag(el);
|
||||
console.log(el.outerHTML);
|
||||
var observer = new MutationObserver(function(mutations) {
|
||||
mutations.forEach(function(mutation) {
|
||||
if (mutation.type === 'childList') {
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
#fileDialog {
|
||||
position: absolute;
|
||||
background-color: rgba(200, 200, 200, 0.8);
|
||||
top: 15vh; bottom: 15vh;
|
||||
left: 10vw; right: 10vw;
|
||||
border: 1px solid black;
|
||||
z-index: 100000;
|
||||
overflow: auto;
|
||||
display: none;
|
||||
font-family: -apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
.close {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
padding: 5px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.element {
|
||||
cursor: pointer;
|
||||
display: inline-flex;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
border: 1px solid #ccc;
|
||||
margin: 5px;
|
||||
overflow: hidden;
|
||||
word-wrap: break-word;
|
||||
background-color: white;
|
||||
padding: 5px;
|
||||
align-items: center;
|
||||
span {
|
||||
width: 100px;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -294,10 +294,8 @@ define([
|
||||
// Creating a new anon drive: import anon pads from localStorage
|
||||
if ((!drive[Cryptpad.oldStorageKey] || !Cryptpad.isArray(drive[Cryptpad.oldStorageKey]))
|
||||
&& !drive['filesData']) {
|
||||
Cryptpad.getLegacyPads(function (err, data) {
|
||||
drive[Cryptpad.oldStorageKey] = data;
|
||||
onReady(f, rt.proxy, Cryptpad, exp);
|
||||
});
|
||||
drive[Cryptpad.oldStorageKey] = [];
|
||||
onReady(f, rt.proxy, Cryptpad, exp);
|
||||
return;
|
||||
}
|
||||
// Drive already exist: return the existing drive, don't load data from legacy store
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
.markdown_preformatted-code (@color: #333) {
|
||||
pre > code {
|
||||
display: block;
|
||||
position: relative;
|
||||
border: 1px solid @color;
|
||||
width: 90%;
|
||||
margin: auto;
|
||||
padding-left: .25vw;
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
.markdown_gfm-table (@color: black) {
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
tr {
|
||||
th {
|
||||
border: 3px solid @color;
|
||||
padding: 15px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// todo ul, ol
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 403 B After Width: | Height: | Size: 402 B |
Binary file not shown.
|
Before Width: | Height: | Size: 461 B After Width: | Height: | Size: 337 B |
Binary file not shown.
|
Before Width: | Height: | Size: 143 B After Width: | Height: | Size: 135 B |
@@ -142,7 +142,11 @@ define([
|
||||
}
|
||||
rpc.send('CLEAR_OWNED_CHANNEL', channel, function (e, response) {
|
||||
if (e) { return cb(e); }
|
||||
cb(response);
|
||||
if (response && response.length) {
|
||||
cb(void 0, response[0]);
|
||||
} else {
|
||||
cb();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
+1
-1
@@ -63,7 +63,7 @@ types of messages:
|
||||
// RPC responses are arrays. this message isn't meant for us.
|
||||
return;
|
||||
}
|
||||
if (/FULL_HISTORY/.test(parsed[0])) { return; }
|
||||
if (/(FULL_HISTORY|HISTORY_RANGE)/.test(parsed[0])) { return; }
|
||||
|
||||
var response = parsed.slice(2);
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
(function(e,t){'object'==typeof exports&&'undefined'!=typeof module?module.exports=t():'function'==typeof define&&define.amd?define(t):e.tippy=t()})(this,function(){'use strict';function e(e){Pe.forEach(function(t){var o=t.popper,i=t.tippyInstance,n=t.settings,r=n.appendTo,s=n.hideOnClick,a=n.trigger;if(r.contains(o)){var p=!0===s||-1!==a.indexOf('focus'),l=!e||o!==e.popper;p&&l&&i.hide(o)}})}function t(e,t){var o=Element.prototype.closest||function(e){for(var t=this;t;){if(Ie.call(t,e))return t;t=t.parentElement}};return o.call(e,t)}function o(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function n(){var i=function(){xe.touch=!0,xe.iOS()&&document.body.classList.add('tippy-touch'),xe.dynamicInputDetection&&document.addEventListener('mousemove',n)},n=function(){var e;return function(){var t=performance&&performance.now();t&&10>t-e&&(xe.touch=!1,document.removeEventListener('mousemove',n),!xe.iOS()&&document.body.classList.contains('tippy-touch')&&document.body.classList.remove('tippy-touch')),e=t}}();document.addEventListener('click',function(i){if(!(i.target instanceof Element))return e();var n=t(i.target,Ce.TOOLTIPPED_EL),r=t(i.target,Ce.POPPER);if(r){var s=o(Pe,function(e){return e.popper===r}),a=s.settings.interactive;if(a)return}if(n){var p=o(Pe,function(e){return e.el===n}),l=p.settings,d=l.hideOnClick,c=l.multiple,f=l.trigger;if(!c&&xe.touch||!c&&-1!==f.indexOf('click'))return e(p);if(!0!==d||-1!==f.indexOf('click'))return}t(i.target,Ce.CONTROLLER)||!document.querySelector(Ce.POPPER)||e()}),document.addEventListener('touchstart',i),window.addEventListener('blur',function(){var e=document,t=e.activeElement;t&&t.blur&&Ie.call(t,Ce.TOOLTIPPED_EL)&&t.blur()}),!xe.SUPPORTS_TOUCH&&(0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints)&&document.addEventListener('pointerdown',i)}function r(){return!r.done&&(r.done=!0,Ae.appendTo=document.body,n(),!0)}function s(e){window.requestAnimationFrame(function(){setTimeout(e,0)})}function a(e){for(var t=[!1,'webkit'],o=e.charAt(0).toUpperCase()+e.slice(1),n=0;n<t.length;n++){var i=t[n],r=i?''+i+o:e;if('undefined'!=typeof window.document.body.style[r])return r}return null}function p(e,t){return Array.prototype.findIndex?e.findIndex(t):e.indexOf(o(e,t))}function l(e){var t=e.getAttribute('title');e.setAttribute('data-original-title',t||'html'),e.removeAttribute('title')}function d(e){var t=e.getBoundingClientRect();return 0<=t.top&&0<=t.left&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}function c(e,t){t?window.getComputedStyle(t)[a('transform')]:window.getComputedStyle(e).opacity}function f(e,t){e.forEach(function(e){e&&t(e.classList)})}function m(e,t){e.forEach(function(e){if(e){var o=Ie.call(e,Ce.CONTENT),i=o?Se(t/1.3):t;e.style[a('transitionDuration')]=i+'ms'}})}function h(e){return'visible'===e.style.visibility}function u(){}function g(e){return e.replace(/-.+/,'')}function b(t){var e,i,n=this,r=o(Pe,function(e){return e.el===n}),s=r.popper,p=r.settings.offset,l=g(s.getAttribute('x-placement')),d=Se(s.offsetWidth/2),c=Se(s.offsetHeight/2),f=5,m=document.documentElement.offsetWidth||document.body.offsetWidth,h=t.pageX,u=t.pageY;'top'===l?(e=h-d+p,i=u-2.25*c):'left'===l?(e=h-2*d-10,i=u-c+p):'right'===l?(e=h+c,i=u-c+p):'bottom'===l?(e=h-d+p,i=u+c/1.5):void 0;('top'===l||'bottom'===l)&&(h+f+d+p>m&&(e=m-f-2*d),0>h-f-d+p&&(e=f)),s.style[a('transform')]='translate3d('+e+'px, '+i+'px, 0)'}function y(e){return e instanceof Element?[e]:[].slice.call(document.querySelectorAll(e))}function v(e,t,o){if(!t)return o();var i=e.popper.querySelector(Ce.TOOLTIP),n=!1,r=function t(r){r.target!==i||(n=!0,i.removeEventListener('webkitTransitionEnd',t),i.removeEventListener('transitionend',t),o())};i.addEventListener('webkitTransitionEnd',r),i.addEventListener('transitionend',r),clearTimeout(e._transitionendTimeout),e._transitionendTimeout=setTimeout(function(){n||o()},t)}function E(e){return e&&'[object Function]'==={}.toString.call(e)}function O(e,t){if(1!==e.nodeType)return[];var o=window.getComputedStyle(e,null);return t?o[t]:o}function w(e){return'HTML'===e.nodeName?e:e.parentNode||e.host}function L(e){if(!e||-1!==['HTML','BODY','#document'].indexOf(e.nodeName))return window.document.body;var t=O(e),o=t.overflow,i=t.overflowX,n=t.overflowY;return /(auto|scroll)/.test(o+n+i)?e:L(w(e))}function T(e){var t=e.nodeName;return'BODY'!==t&&('HTML'===t||e.firstElementChild.offsetParent===e)}function S(e){return null===e.parentNode?e:S(e.parentNode)}function P(e){var t=e&&e.offsetParent,o=t&&t.nodeName;return o&&'BODY'!==o&&'HTML'!==o?t:window.document.documentElement}function x(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return window.document.documentElement;var o=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,i=o?e:t,n=o?t:e,r=document.createRange();r.setStart(i,0),r.setEnd(n,0);var s=r.commonAncestorContainer;if(e!==s&&t!==s||i.contains(n))return T(s)?s:P(s);var a=SLine truncated
|
||||
(function(e,t){'object'==typeof exports&&'undefined'!=typeof module?module.exports=t():'function'==typeof define&&define.amd?define(t):e.tippy=t()})(this,function(){'use strict';function e(e){Pe.forEach(function(t){var o=t.popper,i=t.tippyInstance,n=t.settings,r=n.appendTo,s=n.hideOnClick,a=n.trigger;if(r.contains(o)){var p=!0===s||-1!==a.indexOf('focus'),l=!e||o!==e.popper;p&&l&&i.hide(o)}})}function t(e,t){var o=Element.prototype.closest||function(e){for(var t=this;t;){if(Ie.call(t,e))return t;t=t.parentElement}};return o.call(e,t)}function o(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function n(){var i=function(){xe.touch=!0,xe.iOS()&&document.body.classList.add('tippy-touch'),xe.dynamicInputDetection&&document.addEventListener('mousemove',n)},n=function(){var e;return function(){var t=performance&&performance.now();t&&10>t-e&&(xe.touch=!1,document.removeEventListener('mousemove',n),!xe.iOS()&&document.body.classList.contains('tippy-touch')&&document.body.classList.remove('tippy-touch')),e=t}}();document.addEventListener('click',function(i){if(!(i.target instanceof Element))return e();var n=t(i.target,Ce.TOOLTIPPED_EL),r=t(i.target,Ce.POPPER);if(r){var s=o(Pe,function(e){return e.popper===r}),a=s.settings.interactive;if(a)return}if(n){var p=o(Pe,function(e){return e.el===n}),l=p.settings,d=l.hideOnClick,c=l.multiple,f=l.trigger;if(!c&&xe.touch||!c&&-1!==f.indexOf('click'))return e(p);if(!0!==d||-1!==f.indexOf('click'))return}t(i.target,Ce.CONTROLLER)||!document.querySelector(Ce.POPPER)||e()}),document.addEventListener('touchstart',i),window.addEventListener('blur',function(){var e=document,t=e.activeElement;t&&t.blur&&Ie.call(t,Ce.TOOLTIPPED_EL)&&t.blur()}),!xe.SUPPORTS_TOUCH&&(0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints)&&document.addEventListener('pointerdown',i)}function r(){return!r.done&&(r.done=!0,Ae.appendTo=document.body,n(),!0)}function s(e){window.requestAnimationFrame(function(){setTimeout(e,0)})}function a(e){for(var t=[!1,'webkit'],o=e.charAt(0).toUpperCase()+e.slice(1),n=0;n<t.length;n++){var i=t[n],r=i?''+i+o:e;if('undefined'!=typeof window.document.body.style[r])return r}return null}function p(e,t){return Array.prototype.findIndex?e.findIndex(t):e.indexOf(o(e,t))}function l(e){var t=e.getAttribute('title');e.setAttribute('data-original-title',t||'html'),e.removeAttribute('title')}function d(e){var t=e.getBoundingClientRect();return 0<=t.top&&0<=t.left&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}function c(e,t){t?window.getComputedStyle(t)[a('transform')]:window.getComputedStyle(e).opacity}function f(e,t){e.forEach(function(e){e&&t(e.classList)})}function m(e,t){e.forEach(function(e){if(e){var o=Ie.call(e,Ce.CONTENT),i=o?Se(t/1.3):t;e.style[a('transitionDuration')]=i+'ms'}})}function h(e){return'visible'===e.style.visibility}function u(){}function g(e){return e.replace(/-.+/,'')}function b(t){var e,i,n=this,r=o(Pe,function(e){return e.el===n}),s=r.popper,p=r.settings.offset,l=g(s.getAttribute('x-placement')),d=Se(s.offsetWidth/2),c=Se(s.offsetHeight/2),f=5,m=document.documentElement.offsetWidth||document.body.offsetWidth,h=t.pageX,u=t.pageY;'top'===l?(e=h-d+p,i=u-2.25*c):'left'===l?(e=h-2*d-10,i=u-c+p):'right'===l?(e=h+c,i=u-c+p):'bottom'===l?(e=h-d+p,i=u+c/1.5):void 0;('top'===l||'bottom'===l)&&(h+f+d+p>m&&(e=m-f-2*d),0>h-f-d+p&&(e=f)),s.style[a('transform')]='translate3d('+e+'px, '+i+'px, 0)'}function y(e){return e instanceof Element||/Element/.test(Object.prototype.toString.call(e))?[e]:[].slice.call(document.querySelectorAll(e))}function v(e,t,o){if(!t)return o();var i=e.popper.querySelector(Ce.TOOLTIP),n=!1,r=function t(r){r.target!==i||(n=!0,i.removeEventListener('webkitTransitionEnd',t),i.removeEventListener('transitionend',t),o())};i.addEventListener('webkitTransitionEnd',r),i.addEventListener('transitionend',r),clearTimeout(e._transitionendTimeout),e._transitionendTimeout=setTimeout(function(){n||o()},t)}function E(e){return e&&'[object Function]'==={}.toString.call(e)}function O(e,t){if(1!==e.nodeType)return[];var o=window.getComputedStyle(e,null);return t?o[t]:o}function w(e){return'HTML'===e.nodeName?e:e.parentNode||e.host}function L(e){if(!e||-1!==['HTML','BODY','#document'].indexOf(e.nodeName))return window.document.body;var t=O(e),o=t.overflow,i=t.overflowX,n=t.overflowY;return /(auto|scroll)/.test(o+n+i)?e:L(w(e))}function T(e){var t=e.nodeName;return'BODY'!==t&&('HTML'===t||e.firstElementChild.offsetParent===e)}function S(e){return null===e.parentNode?e:S(e.parentNode)}function P(e){var t=e&&e.offsetParent,o=t&&t.nodeName;return o&&'BODY'!==o&&'HTML'!==o?t:window.document.documentElement}function x(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return window.document.documentElement;var o=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,i=o?e:t,n=o?t:e,r=document.createRange();r.setStart(i,0),r.setEnd(n,0);var s=r.commonAncestorContainer;if(e!=Line truncated
|
||||
+16
-2
@@ -199,6 +199,7 @@ define([
|
||||
|
||||
// Update the userlist
|
||||
var $editUsers = $userlistContent.find('.' + USERLIST_CLS).html('');
|
||||
Cryptpad.clearTooltips();
|
||||
|
||||
var $editUsersList = $('<div>', {'class': 'userlist-others'});
|
||||
|
||||
@@ -689,6 +690,14 @@ define([
|
||||
config.realtime.onPatch(ks(toolbar, config));
|
||||
config.realtime.onMessage(ks(toolbar, config, true));
|
||||
}
|
||||
// without this, users in read-only mode say 'synchronizing' until they
|
||||
// receive a patch.
|
||||
if (Cryptpad) {
|
||||
typing = 0;
|
||||
Cryptpad.whenRealtimeSyncs(config.realtime, function () {
|
||||
kickSpinner(toolbar, config);
|
||||
});
|
||||
}
|
||||
return $spin;
|
||||
};
|
||||
|
||||
@@ -990,13 +999,18 @@ define([
|
||||
|
||||
var failed = toolbar.failed = function () {
|
||||
toolbar.connected = false;
|
||||
toolbar.spinner.text(Messages.disconnected);
|
||||
|
||||
if (toolbar.spinner) {
|
||||
toolbar.spinner.text(Messages.disconnected);
|
||||
}
|
||||
//checkLag(toolbar, config);
|
||||
};
|
||||
toolbar.reconnecting = function (userId) {
|
||||
if (config.userList) { config.userList.userNetfluxId = userId; }
|
||||
toolbar.connected = false;
|
||||
toolbar.spinner.text(Messages.reconnecting);
|
||||
if (toolbar.spinner) {
|
||||
toolbar.spinner.text(Messages.reconnecting);
|
||||
}
|
||||
//checkLag(toolbar, config);
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user