Add a page title in drive, settings and file

pull/1/head
yflory 7 years ago
parent 5d5f936682
commit 16d0527e92

@ -647,6 +647,9 @@ body .cryptpad-toolbar {
line-height: 25px; line-height: 25px;
white-space: nowrap; white-space: nowrap;
} }
.pageTitle {
padding: 0 5px;
}
.pencilIcon, .saveIcon { .pencilIcon, .saveIcon {
display: flex; display: flex;
align-items: center; align-items: center;

@ -9,7 +9,7 @@ define(function () {
out.type.code = 'Code'; out.type.code = 'Code';
out.type.poll = 'Sondage'; out.type.poll = 'Sondage';
out.type.slide = 'Présentation'; out.type.slide = 'Présentation';
out.type.drive = 'Drive'; out.type.drive = 'CryptDrive';
out.type.whiteboard = "Tableau Blanc"; out.type.whiteboard = "Tableau Blanc";
out.type.file = "Fichier"; out.type.file = "Fichier";
out.type.media = "Média"; out.type.media = "Média";
@ -423,6 +423,7 @@ define(function () {
out.settings_logoutEverywhere = "Se déconnecter de force de toutes les autres sessions."; out.settings_logoutEverywhere = "Se déconnecter de force de toutes les autres sessions.";
out.settings_logoutEverywhereConfirm = "Êtes-vous sûr ? Vous devrez vous reconnecter sur tous vos autres appareils."; out.settings_logoutEverywhereConfirm = "Êtes-vous sûr ? Vous devrez vous reconnecter sur tous vos autres appareils.";
out.upload_title = "Hébergement de fichiers";
out.upload_serverError = "Erreur interne: impossible d'importer le fichier pour l'instant."; out.upload_serverError = "Erreur interne: impossible d'importer le fichier pour l'instant.";
out.upload_uploadPending = "Vous avez déjà un fichier en cours d'importation. Souhaitez-vous l'annuler et importer ce nouveau fichier ?"; out.upload_uploadPending = "Vous avez déjà un fichier en cours d'importation. Souhaitez-vous l'annuler et importer ce nouveau fichier ?";
out.upload_success = "Votre fichier ({0}) a été importé avec succès et ajouté à votre CryptDrive."; out.upload_success = "Votre fichier ({0}) a été importé avec succès et ajouté à votre CryptDrive.";

@ -9,7 +9,7 @@ define(function () {
out.type.code = 'Code'; out.type.code = 'Code';
out.type.poll = 'Poll'; out.type.poll = 'Poll';
out.type.slide = 'Presentation'; out.type.slide = 'Presentation';
out.type.drive = 'Drive'; out.type.drive = 'CryptDrive';
out.type.whiteboard = 'Whiteboard'; out.type.whiteboard = 'Whiteboard';
out.type.file = 'File'; out.type.file = 'File';
out.type.media = 'Media'; out.type.media = 'Media';
@ -435,6 +435,7 @@ define(function () {
out.settings_logoutEverywhere = "Force log out of all other web sessions"; out.settings_logoutEverywhere = "Force log out of all other web sessions";
out.settings_logoutEverywhereConfirm = "Are you sure? You will need to log in with all your devices."; out.settings_logoutEverywhereConfirm = "Are you sure? You will need to log in with all your devices.";
out.upload_title = "File upload";
out.upload_serverError = "Server Error: unable to upload your file at this time."; out.upload_serverError = "Server Error: unable to upload your file at this time.";
out.upload_uploadPending = "You already have an upload in progress. Cancel it and upload your new file?"; out.upload_uploadPending = "You already have an upload in progress. Cancel it and upload your new file?";
out.upload_success = "Your file ({0}) has been successfully uploaded and added to your drive."; out.upload_success = "Your file ({0}) has been successfully uploaded and added to your drive.";

@ -600,6 +600,21 @@ define([
return $titleContainer; return $titleContainer;
}; };
var createPageTitle = function (toolbar, config) {
if (config.title || !config.pageTitle) { return; }
var $titleContainer = $('<span>', {
id: 'toolbarTitle',
'class': TITLE_CLS
}).appendTo(toolbar.$top);
var $hoverable = $('<span>', {'class': 'hoverable'}).appendTo($titleContainer);
// Buttons
var $text = $('<span>', {
'class': 'title pageTitle'
}).appendTo($hoverable).text(config.pageTitle);
};
var createLinkToMain = function (toolbar) { var createLinkToMain = function (toolbar) {
var $linkContainer = $('<span>', { var $linkContainer = $('<span>', {
'class': "cryptpad-link" 'class': "cryptpad-link"
@ -1020,6 +1035,7 @@ define([
tb['share'] = createShare; tb['share'] = createShare;
tb['fileshare'] = createFileShare; tb['fileshare'] = createFileShare;
tb['title'] = createTitle; tb['title'] = createTitle;
tb['pageTitle'] = createPageTitle;
tb['lag'] = createLag; tb['lag'] = createLag;
tb['spinner'] = createSpinner; tb['spinner'] = createSpinner;
tb['state'] = createState; tb['state'] = createState;

@ -2721,7 +2721,7 @@ define([
var userList = APP.userList = info.userList; var userList = APP.userList = info.userList;
var config = { var config = {
displayed: ['useradmin', 'spinner', 'lag', 'state', 'limit', 'newpad'], displayed: ['useradmin', 'spinner', 'lag', 'state', 'limit', 'newpad', 'pageTitle'],
userList: { userList: {
list: userList, list: userList,
userNetfluxId: info.myID userNetfluxId: info.myID
@ -2731,7 +2731,8 @@ define([
ifrw: window, ifrw: window,
realtime: info.realtime, realtime: info.realtime,
network: info.network, network: info.network,
$container: APP.$bar $container: APP.$bar,
pageTitle: Messages.type.drive
}; };
var toolbar = APP.toolbar = Toolbar.create(config); var toolbar = APP.toolbar = Toolbar.create(config);

@ -68,8 +68,14 @@ define([
ifrw: ifrw, ifrw: ifrw,
common: Cryptpad, common: Cryptpad,
hideDisplayName: true, hideDisplayName: true,
$container: $bar $container: $bar,
}; };
if (uploadMode) {
displayed.push('pageTitle');
configTb.pageTitle = Messages.upload_title;
}
var toolbar = APP.toolbar = Toolbar.create(configTb); var toolbar = APP.toolbar = Toolbar.create(configTb);
toolbar.$rightside.html(''); // Remove the drawer if we don't use it to hide the toolbar toolbar.$rightside.html(''); // Remove the drawer if we don't use it to hide the toolbar
@ -83,6 +89,7 @@ define([
if (e) { return void console.error(e); } if (e) { return void console.error(e); }
var title = document.title = metadata.name; var title = document.title = metadata.name;
Title.updateTitle(title || Title.defaultTitle); Title.updateTitle(title || Title.defaultTitle);
toolbar.addElement(['pageTitle'], {pageTitle: title});
var displayFile = function (ev, sizeMb) { var displayFile = function (ev, sizeMb) {
var $mt = $dlview.find('media-tag'); var $mt = $dlview.find('media-tag');

@ -5,7 +5,6 @@ define([
'/common/mergeDrive.js', '/common/mergeDrive.js',
'/common/toolbar2.js', '/common/toolbar2.js',
'/bower_components/file-saver/FileSaver.min.js', '/bower_components/file-saver/FileSaver.min.js',
// '/customize/header.js',
'less!/customize/src/less/cryptpad.less', 'less!/customize/src/less/cryptpad.less',
'css!/bower_components/components-font-awesome/css/font-awesome.min.css', 'css!/bower_components/components-font-awesome/css/font-awesome.min.css',
@ -361,13 +360,14 @@ define([
}; };
var createToolbar = function () { var createToolbar = function () {
var displayed = ['useradmin', 'newpad', 'limit', 'upgrade']; var displayed = ['useradmin', 'newpad', 'limit', 'upgrade', 'pageTitle'];
var configTb = { var configTb = {
displayed: displayed, displayed: displayed,
ifrw: window, ifrw: window,
common: Cryptpad, common: Cryptpad,
hideDisplayName: true, hideDisplayName: true,
$container: APP.$toolbar $container: APP.$toolbar,
pageTitle: Messages.settings_title
}; };
var toolbar = APP.toolbar = Toolbar.create(configTb); var toolbar = APP.toolbar = Toolbar.create(configTb);
toolbar.$rightside.html(''); // Remove the drawer if we don't use it to hide the toolbar toolbar.$rightside.html(''); // Remove the drawer if we don't use it to hide the toolbar

Loading…
Cancel
Save