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

This commit is contained in:
ansuz 2018-03-07 17:49:57 +01:00
commit 71f519f982
10 changed files with 23 additions and 13 deletions

View File

@ -47,7 +47,7 @@ define(function () {
out.disconnected = 'Déconnecté'; out.disconnected = 'Déconnecté';
out.synchronizing = 'Synchronisation'; out.synchronizing = 'Synchronisation';
out.reconnecting = 'Reconnexion...'; out.reconnecting = 'Reconnexion';
out.typing = "Édition"; out.typing = "Édition";
out.initializing = "Initialisation..."; out.initializing = "Initialisation...";
out.forgotten = 'Déplacé vers la corbeille'; out.forgotten = 'Déplacé vers la corbeille';
@ -361,7 +361,7 @@ define(function () {
out.fm_templateName = "Modèles"; out.fm_templateName = "Modèles";
out.fm_searchName = "Recherche"; out.fm_searchName = "Recherche";
out.fm_recentPadsName = "Pads récents"; out.fm_recentPadsName = "Pads récents";
out.fm_ownedPadsName = "Possédés"; out.fm_ownedPadsName = "Pads possédés";
out.fm_searchPlaceholder = "Rechercher..."; out.fm_searchPlaceholder = "Rechercher...";
out.fm_newButton = "Nouveau"; out.fm_newButton = "Nouveau";
out.fm_newButtonTitle = "Créer un nouveau pad ou un dossier, importer un fichier dans le dossier courant"; out.fm_newButtonTitle = "Créer un nouveau pad ou un dossier, importer un fichier dans le dossier courant";

View File

@ -48,7 +48,7 @@ define(function () {
out.disconnected = 'Disconnected'; out.disconnected = 'Disconnected';
out.synchronizing = 'Synchronizing'; out.synchronizing = 'Synchronizing';
out.reconnecting = 'Reconnecting...'; out.reconnecting = 'Reconnecting';
out.typing = "Editing"; out.typing = "Editing";
out.initializing = "Initializing..."; out.initializing = "Initializing...";
out.forgotten = 'Moved to the trash'; out.forgotten = 'Moved to the trash';

View File

@ -852,6 +852,7 @@ define([
var tbState = true; var tbState = true;
common.getAttribute(['general', 'markdown-help'], function (e, data) { common.getAttribute(['general', 'markdown-help'], function (e, data) {
if (e) { return void console.error(e); } if (e) { return void console.error(e); }
if ($(window).height() < 800) { return; }
if (data === true && $toolbarButton.length && tbState) { if (data === true && $toolbarButton.length && tbState) {
$toolbarButton.click(); $toolbarButton.click();
} }
@ -868,6 +869,7 @@ define([
} }
common.getAttribute(['general', 'markdown-help'], function (e, data) { common.getAttribute(['general', 'markdown-help'], function (e, data) {
if (e) { return void console.error(e); } if (e) { return void console.error(e); }
if ($(window).height() < 800) { return; }
if (data === true && $toolbarButton) { if (data === true && $toolbarButton) {
// Show the toolbar using the button to make sure the icon in the button is // Show the toolbar using the button to make sure the icon in the button is
// correct (caret-down / caret-up) // correct (caret-down / caret-up)
@ -923,6 +925,7 @@ define([
}); });
common.getAttribute(['hideHelp', type], function (err, val) { common.getAttribute(['hideHelp', type], function (err, val) {
if ($(window).height() < 800) { return void toggleHelp(true); }
if (val === true) { toggleHelp(true); } if (val === true) { toggleHelp(true); }
}); });

View File

@ -116,7 +116,7 @@ define([
} else { } else {
var errText = "[cursor.fixSelection] At least one of the " + var errText = "[cursor.fixSelection] At least one of the " +
"cursor nodes did not exist, could not fix selection"; "cursor nodes did not exist, could not fix selection";
console.error(errText); //console.error(errText);
return errText; return errText;
} }
} catch (e) { console.error(e); } } catch (e) { console.error(e); }

View File

@ -325,11 +325,11 @@ define([
var onConnectionChange = function (info) { var onConnectionChange = function (info) {
if (state === STATE.DELETED) { return; } if (state === STATE.DELETED) { return; }
stateChange(info.state ? STATE.INITIALIZING : STATE.DISCONNECTED); stateChange(info.state ? STATE.INITIALIZING : STATE.DISCONNECTED);
if (info.state) { /*if (info.state) {
UI.findOKButton().click(); UI.findOKButton().click();
} else { } else {
UI.alert(Messages.common_connectionLost, undefined, true); UI.alert(Messages.common_connectionLost, undefined, true);
} }*/
}; };
var onError = function (err) { var onError = function (err) {

View File

@ -400,7 +400,7 @@ define([
}); });
show(); show();
Common.getAttribute(['toolbar', 'userlist-drawer'], function (err, val) { Common.getAttribute(['toolbar', 'userlist-drawer'], function (err, val) {
if (val === false) { return void hide(); } if (val === false || $(window).height() < 800) { return void hide(); }
show(); show();
}); });
@ -1048,6 +1048,13 @@ define([
toolbar.reconnecting = function (/*userId*/) { toolbar.reconnecting = function (/*userId*/) {
toolbar.connected = false; toolbar.connected = false;
if (toolbar.spinner) { if (toolbar.spinner) {
var state = -1;
var interval = window.setInterval(function () {
if (toolbar.connected) { clearInterval(interval); }
var dots = Array(state+1).join('.');
toolbar.spinner.text(Messages.reconnecting + dots);
if (++state > 3) { state = 0; }
}, 500);
toolbar.spinner.text(Messages.reconnecting); toolbar.spinner.text(Messages.reconnecting);
} }
}; };

View File

@ -237,7 +237,7 @@ define([
'tabindex': '-1', 'tabindex': '-1',
'data-icon': faFolder, 'data-icon': faFolder,
}, Messages.fc_newfolder)), }, Messages.fc_newfolder)),
h('li', h('a.cp-app-drive-context-hashtag.dropdown-item', { h('li', h('a.cp-app-drive-context-hashtag.dropdown-item.cp-app-drive-context-editable', {
'tabindex': '-1', 'tabindex': '-1',
'data-icon': faTags, 'data-icon': faTags,
}, Messages.fc_hashtag)), }, Messages.fc_hashtag)),

View File

@ -282,7 +282,7 @@ define([
framework._.sfCommon.setAttribute(['pad', 'showToolbar'], visible); framework._.sfCommon.setAttribute(['pad', 'showToolbar'], visible);
}; };
framework._.sfCommon.getAttribute(['pad', 'showToolbar'], function (err, data) { framework._.sfCommon.getAttribute(['pad', 'showToolbar'], function (err, data) {
if (typeof(data) === "undefined" || data) { $('.cke_toolbox_main').show(); } if ($(window).height() >= 800 && (typeof(data) === "undefined" || data)) { $('.cke_toolbox_main').show(); }
else { $('.cke_toolbox_main').hide(); } else { $('.cke_toolbox_main').hide(); }
var $collapse = framework._.sfCommon.createButton('toggle', true, cfg, onClick); var $collapse = framework._.sfCommon.createButton('toggle', true, cfg, onClick);
framework._.toolbar.$rightside.append($collapse); framework._.toolbar.$rightside.append($collapse);

View File

@ -1117,13 +1117,13 @@ define([
}); });
} }
setEditable(false); setEditable(false);
UI.alert(Messages.common_connectionLost, undefined, true); //UI.alert(Messages.common_connectionLost, undefined, true);
}; };
var onReconnect = function () { var onReconnect = function () {
if (APP.unrecoverable) { return; } if (APP.unrecoverable) { return; }
setEditable(true); setEditable(true);
UI.findOKButton().click(); //UI.findOKButton().click();
}; };
var getHeadingText = function () { var getHeadingText = function () {

View File

@ -616,9 +616,9 @@ define([
setEditable(info.state); setEditable(info.state);
if (info.state) { if (info.state) {
initializing = true; initializing = true;
UI.findOKButton().click(); //UI.findOKButton().click();
} else { } else {
UI.alert(Messages.common_connectionLost, undefined, true); //UI.alert(Messages.common_connectionLost, undefined, true);
} }
}; };