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;
white-space: nowrap;
}
.pageTitle {
padding: 0 5px;
}
.pencilIcon, .saveIcon {
display: flex;
align-items: center;

@ -9,7 +9,7 @@ define(function () {
out.type.code = 'Code';
out.type.poll = 'Sondage';
out.type.slide = 'Présentation';
out.type.drive = 'Drive';
out.type.drive = 'CryptDrive';
out.type.whiteboard = "Tableau Blanc";
out.type.file = "Fichier";
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_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_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.";

@ -9,7 +9,7 @@ define(function () {
out.type.code = 'Code';
out.type.poll = 'Poll';
out.type.slide = 'Presentation';
out.type.drive = 'Drive';
out.type.drive = 'CryptDrive';
out.type.whiteboard = 'Whiteboard';
out.type.file = 'File';
out.type.media = 'Media';
@ -435,6 +435,7 @@ define(function () {
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.upload_title = "File upload";
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_success = "Your file ({0}) has been successfully uploaded and added to your drive.";

@ -600,6 +600,21 @@ define([
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 $linkContainer = $('<span>', {
'class': "cryptpad-link"
@ -1020,6 +1035,7 @@ define([
tb['share'] = createShare;
tb['fileshare'] = createFileShare;
tb['title'] = createTitle;
tb['pageTitle'] = createPageTitle;
tb['lag'] = createLag;
tb['spinner'] = createSpinner;
tb['state'] = createState;

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

@ -68,8 +68,14 @@ define([
ifrw: ifrw,
common: Cryptpad,
hideDisplayName: true,
$container: $bar
$container: $bar,
};
if (uploadMode) {
displayed.push('pageTitle');
configTb.pageTitle = Messages.upload_title;
}
var toolbar = APP.toolbar = Toolbar.create(configTb);
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); }
var title = document.title = metadata.name;
Title.updateTitle(title || Title.defaultTitle);
toolbar.addElement(['pageTitle'], {pageTitle: title});
var displayFile = function (ev, sizeMb) {
var $mt = $dlview.find('media-tag');

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

Loading…
Cancel
Save