Merge branch 'd' into staging

This commit is contained in:
yflory
2017-03-15 16:01:29 +01:00
7 changed files with 79 additions and 41 deletions

View File

@@ -2,7 +2,7 @@ require.config({ paths: { 'json.sortify': '/bower_components/json.sortify/dist/J
define([
'/bower_components/chainpad-crypto/crypto.js',
'/bower_components/chainpad-netflux/chainpad-netflux.js',
'/bower_components/textpatcher/TextPatcher.amd.js',
'/bower_components/textpatcher/TextPatcher.js',
'/common/toolbar.js',
'json.sortify',
'/bower_components/chainpad-json-validator/json-ot.js',
@@ -521,12 +521,14 @@ define([
};
var onReady = config.onReady = function (info) {
var realtime = module.realtime = info.realtime;
module.users = info.userList.users;
module.patchText = TextPatcher.create({
realtime: realtime,
//logging: true
});
if (module.realtime !== info.realtime) {
var realtime = module.realtime = info.realtime;
module.patchText = TextPatcher.create({
realtime: realtime,
//logging: true
});
}
var userDoc = module.realtime.getUserDoc();

View File

@@ -407,8 +407,11 @@ define([
window.location = "/";
};
$aTagBig.click(onClick);
$aTagSmall.click(onClick);
var onContext = function (e) { e.stopPropagation(); };
$aTagBig.click(onClick).contextmenu(onContext);
$aTagSmall.click(onClick).contextmenu(onContext);
$linkContainer.append($aTagSmall).append($aTagBig);
};

View File

@@ -181,6 +181,7 @@ define([
var $tree = $iframe.find("#tree");
var $content = $iframe.find("#content");
var $appContainer = $iframe.find(".app-container");
var $driveToolbar = $iframe.find("#driveToolbar");
var $contextMenu = $iframe.find("#treeContextMenu");
var $contentContextMenu = $iframe.find("#contentContextMenu");
@@ -1737,7 +1738,8 @@ define([
// Disable middle click in the context menu to avoid opening /drive/inner.html# in new tabs
$(ifrw).click(function (e) {
if (e.which !== 3) {
if (!e.target || !$(e.target).parents('.cryptpad-dropdown').length) { return; }
if (e.which !== 1) {
e.stopPropagation();
return false;
}
@@ -1900,21 +1902,21 @@ define([
module.hideMenu();
});
$(ifrw).on('click', function (e) {
$appContainer.on('click', function (e) {
if (e.which !== 1) { return ; }
removeSelected(e);
removeInput();
module.hideMenu(e);
hideNewButton();
});
$(ifrw).on('drag drop', function (e) {
$appContainer.on('drag drop', function (e) {
removeInput();
module.hideMenu(e);
});
$(ifrw).on('mouseup drop', function (e) {
$appContainer.on('mouseup drop', function (e) {
$iframe.find('.droppable').removeClass('droppable');
});
$(ifrw).on('keydown', function (e) {
$appContainer.on('keydown', function (e) {
// "Del"
if (e.which === 46) {
if (filesOp.isPathInFilesData(currentPath)) { return; } // We can't remove elements directly from filesData
@@ -1948,7 +1950,7 @@ define([
moveElements(paths, [TRASH], false, refresh);
}
});
$(ifrw).contextmenu(function () {
$appContainer.contextmenu(function () {
module.hideMenu();
return false;
});
@@ -2005,7 +2007,7 @@ define([
updatePathSize();
}, 100);
});
$(ifrw).mouseup(function (e) {
$appContainer.mouseup(function (e) {
window.clearInterval(APP.resizeTree);
APP.resizeTree = undefined;
});

View File

@@ -8,7 +8,7 @@ define([
'/bower_components/chainpad-json-validator/json-ot.js',
'/common/TypingTests.js',
'json.sortify',
'/bower_components/textpatcher/TextPatcher.amd.js',
'/bower_components/textpatcher/TextPatcher.js',
'/common/cryptpad-common.js',
'/common/visible.js',
'/common/notify.js',
@@ -656,10 +656,12 @@ define([
}
}
module.patchText = TextPatcher.create({
realtime: info.realtime,
//logging: true,
});
if (module.realtime !== info.realtime) {
module.patchText = TextPatcher.create({
realtime: info.realtime,
//logging: true,
});
}
module.users = info.userList.users;
module.realtime = info.realtime;

View File

@@ -589,7 +589,7 @@ define([
$description.val(proxy.info.description);
}
$('#tableScroll').prepend($table);
$('#tableScroll').html('').prepend($table);
updateDisplayedTable();
$table
@@ -662,11 +662,17 @@ define([
var disconnect = function (info) {
//setEditable(false); // TODO
APP.realtime.toolbar.failed();
Cryptpad.alert(Messages.common_connectionLost, undefined, true);
};
var reconnect = function (info) {
//setEditable(true); // TODO
APP.realtime.toolbar.reconnecting(info.myId);
Cryptpad.findOKButton().click();
};
var create = function (info) {
var realtime = APP.realtime = info.realtime;
var myID = APP.myID = info.myID;
var editHash;
@@ -676,10 +682,13 @@ define([
editHash = Cryptpad.getEditHashFromKeys(info.channel, secret.keys);
}
APP.patchText = TextPatcher.create({
realtime: realtime,
logging: true,
});
if (APP.realtime !== info.realtime) {
APP.realtime = info.realtime;
APP.patchText = TextPatcher.create({
realtime: info.realtime,
logging: true,
});
}
userList = APP.userList = info.userList;
@@ -766,7 +775,8 @@ define([
});
});
})
.on('disconnect', disconnect);
.on('disconnect', disconnect)
.on('reconnect', reconnect);
Cryptpad.getAttribute(HIDE_INTRODUCTION_TEXT, function (e, value) {
if (e) { console.error(e); }

View File

@@ -2,7 +2,7 @@ require.config({ paths: { 'json.sortify': '/bower_components/json.sortify/dist/J
define([
'/bower_components/chainpad-crypto/crypto.js',
'/bower_components/chainpad-netflux/chainpad-netflux.js',
'/bower_components/textpatcher/TextPatcher.amd.js',
'/bower_components/textpatcher/TextPatcher.js',
'/common/toolbar.js',
'json.sortify',
'/bower_components/chainpad-json-validator/json-ot.js',
@@ -678,12 +678,15 @@ define([
};
var onReady = config.onReady = function (info) {
var realtime = module.realtime = info.realtime;
module.users = info.userList.users;
module.patchText = TextPatcher.create({
realtime: realtime,
//logging: true
});
if (module.realtime !== info.realtime) {
var realtime = module.realtime = info.realtime;
module.patchText = TextPatcher.create({
realtime: realtime,
//logging: true
});
}
var userDoc = module.realtime.getUserDoc();