Remove the langauge selector from toolbar and add it in settings

pull/1/head
yflory 8 years ago
parent 13d7b3cadc
commit 15e9af77bb

@ -56,6 +56,22 @@
margin-left: 5px; margin-left: 5px;
} }
} }
&#newdoc {
// Bootstrap 4 colors
color: #fff;
background: #0275d8;
border-color: #0275d8;
&:hover {
background: #025aa5;
border: 1px solid #01549b;
}
span {
color: #fff;
}
.large {
margin-left: 5px;
}
}
&.hidden { &.hidden {
display: none; display: none;
} }
@ -141,7 +157,6 @@
} }
} }
.big { .big {
@media screen and (max-width: @media-not-big) { @media screen and (max-width: @media-not-big) {
display: none; display: none;

@ -132,6 +132,21 @@
.cryptpad-toolbar button#shareButton .large { .cryptpad-toolbar button#shareButton .large {
margin-left: 5px; margin-left: 5px;
} }
.cryptpad-toolbar button#newdoc {
color: #fff;
background: #0275d8;
border-color: #0275d8;
}
.cryptpad-toolbar button#newdoc:hover {
background: #025aa5;
border: 1px solid #01549b;
}
.cryptpad-toolbar button#newdoc span {
color: #fff;
}
.cryptpad-toolbar button#newdoc .large {
margin-left: 5px;
}
.cryptpad-toolbar button.hidden { .cryptpad-toolbar button.hidden {
display: none; display: none;
} }

@ -372,7 +372,7 @@ define([
userList = info.userList; userList = info.userList;
var config = { var config = {
displayed: ['useradmin', 'language', 'spinner', 'lag', 'state', 'share', 'userlist', 'newpad'], displayed: ['useradmin', 'spinner', 'lag', 'state', 'share', 'userlist', 'newpad'],
userData: userData, userData: userData,
readOnly: readOnly, readOnly: readOnly,
ifrw: ifrw, ifrw: ifrw,

@ -1308,6 +1308,8 @@ define([
} }
Messages._initSelector($block); Messages._initSelector($block);
return $block;
}; };
var createUserAdminMenu = common.createUserAdminMenu = function (config) { var createUserAdminMenu = common.createUserAdminMenu = function (config) {

@ -432,11 +432,6 @@ define([
$userContainer.append($lag); $userContainer.append($lag);
} }
if (config.displayed.indexOf('language') !== -1) {
// Dropdown language selector
Cryptpad.createLanguageSelector($userContainer);
}
if (config.displayed.indexOf('newpad') !== -1) { if (config.displayed.indexOf('newpad') !== -1) {
var pads_options = []; var pads_options = [];
Config.availablePadTypes.forEach(function (p) { Config.availablePadTypes.forEach(function (p) {
@ -460,6 +455,7 @@ define([
}; };
var $newPadBlock = Cryptpad.createDropdown(dropdownConfig); var $newPadBlock = Cryptpad.createDropdown(dropdownConfig);
$newPadBlock.find('button').attr('title', Messages.newButtonTitle); $newPadBlock.find('button').attr('title', Messages.newButtonTitle);
$newPadBlock.find('button').attr('id', 'newdoc');
$newPadBlock.appendTo($userContainer); $newPadBlock.appendTo($userContainer);
} }

@ -379,7 +379,7 @@ span.fa-folder-open {
box-shadow: 0px 0px 2px #000; box-shadow: 0px 0px 2px #000;
} }
#driveToolbar button.new { #driveToolbar button.new {
padding: 0 20px; padding: 0 5px;
} }
#driveToolbar .dropdown-bar { #driveToolbar .dropdown-bar {
margin: 5px 5px; margin: 5px 5px;

@ -434,7 +434,7 @@ span {
} }
} }
&.new { &.new {
padding: 0 20px; padding: 0 5px;
} }
} }
/* The container <div> - needed to position the dropdown content */ /* The container <div> - needed to position the dropdown content */

@ -1061,8 +1061,11 @@ define([
content: Messages.type[type] content: Messages.type[type]
}); });
}); });
var $plusIcon = $('<div>').append($('<span>', {'class': 'fa fa-plus'}));
var dropdownConfig = { var dropdownConfig = {
text: Messages.fm_newButton, text: $plusIcon.html() + Messages.fm_newButton,
options: options options: options
}; };
var $block = Cryptpad.createDropdown(dropdownConfig); var $block = Cryptpad.createDropdown(dropdownConfig);
@ -2122,7 +2125,7 @@ define([
var userList = APP.userList = info.userList; var userList = APP.userList = info.userList;
var config = { var config = {
displayed: ['useradmin', 'language', 'spinner', 'lag', 'state'], displayed: ['useradmin', 'spinner', 'lag', 'state'],
readOnly: readOnly, readOnly: readOnly,
ifrw: window, ifrw: window,
common: Cryptpad, common: Cryptpad,

@ -567,7 +567,7 @@ define([
userList = info.userList; userList = info.userList;
var config = { var config = {
displayed: ['useradmin', 'language', 'spinner', 'lag', 'state', 'share', 'userlist', 'newpad'], displayed: ['useradmin', 'spinner', 'lag', 'state', 'share', 'userlist', 'newpad'],
userData: userData, userData: userData,
readOnly: readOnly, readOnly: readOnly,
ifrw: ifrw, ifrw: ifrw,

@ -693,7 +693,7 @@ define([
userList = APP.userList = info.userList; userList = APP.userList = info.userList;
var config = { var config = {
displayed: ['useradmin', 'language', 'spinner', 'lag', 'state', 'share', 'userlist', 'newpad'], displayed: ['useradmin', 'spinner', 'lag', 'state', 'share', 'userlist', 'newpad'],
userData: userData, userData: userData,
readOnly: readOnly, readOnly: readOnly,
share: { share: {

@ -240,10 +240,20 @@ define([
return $div; return $div;
}; };
var createLanguageSelector = function () {
var $div = $('<div>', {'class': 'importLocalPads'});
var $label = $('<label>').text(Messages.language).appendTo($div);
$('<br>').appendTo($div);
var $b = Cryptpad.createLanguageSelector().appendTo($div);
$b.find('button').addClass('btn btn-secondary');
return $div;
};
var andThen = function (obj) { var andThen = function (obj) {
APP.$container.append(createTitle()); APP.$container.append(createTitle());
APP.$container.append(createInfoBlock(obj)); APP.$container.append(createInfoBlock(obj));
APP.$container.append(createDisplayNameInput(obj)); APP.$container.append(createDisplayNameInput(obj));
APP.$container.append(createLanguageSelector());
APP.$container.append(createResetTips()); APP.$container.append(createResetTips());
APP.$container.append(createBackupDrive(obj)); APP.$container.append(createBackupDrive(obj));
APP.$container.append(createImportLocalPads(obj)); APP.$container.append(createImportLocalPads(obj));

@ -489,7 +489,7 @@ define([
userList = info.userList; userList = info.userList;
var config = { var config = {
displayed: ['useradmin', 'language', 'spinner', 'lag', 'state', 'share', 'userlist', 'newpad'], displayed: ['useradmin', 'spinner', 'lag', 'state', 'share', 'userlist', 'newpad'],
userData: userData, userData: userData,
readOnly: readOnly, readOnly: readOnly,
ifrw: ifrw, ifrw: ifrw,

Loading…
Cancel
Save