diff --git a/customize.dist/images/avatar.png b/customize.dist/images/avatar.png new file mode 100644 index 000000000..5605809af Binary files /dev/null and b/customize.dist/images/avatar.png differ diff --git a/customize.dist/src/less/cryptpad.less b/customize.dist/src/less/cryptpad.less index 5f75301a2..2094ab624 100644 --- a/customize.dist/src/less/cryptpad.less +++ b/customize.dist/src/less/cryptpad.less @@ -577,7 +577,7 @@ noscript { line-height: 24px; vertical-align: middle; .usage { - height: 24px; + height: 100%; display: inline-block; background: blue; position: absolute; diff --git a/customize.dist/src/less/dropdown.less b/customize.dist/src/less/dropdown.less index 46c01e697..cf35f72e2 100644 --- a/customize.dist/src/less/dropdown.less +++ b/customize.dist/src/less/dropdown.less @@ -32,6 +32,9 @@ z-index: 1000; max-height: 300px; overflow-y: auto; + font-family: -apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif; + font-size: 16px; + line-height: 1em; &.left { right: 0; @@ -45,7 +48,7 @@ color: black; padding: 5px 16px; text-decoration: none; - display: block; + display: flex; cursor: pointer; -webkit-user-select: none; -moz-user-select: none; @@ -53,6 +56,16 @@ user-select: none; float: none; text-align: left; + font-family: -apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif; + font-size: 16px; + line-height: 1em; + + + .fa { + width: 20px; + text-align: center; + margin-right: 5px; + } &:hover { background-color: #f1f1f1; @@ -77,7 +90,13 @@ margin: 0; white-space: normal; text-align: left; + color: black; + font-size: 14px; + * { + font-size: 14px; + } h2 { + color: black; font-weight: bold; text-align: center; background-color: #EEEEEE; diff --git a/customize.dist/src/less/toolbar.less b/customize.dist/src/less/toolbar.less index 3a01e9a78..fca423e9a 100644 --- a/customize.dist/src/less/toolbar.less +++ b/customize.dist/src/less/toolbar.less @@ -28,16 +28,38 @@ #cke_1_contents { margin-top: -1px; display: flex; + overflow: visible; } +.padColor { color: @toolbar-pad-bg; } +.codeColor { color: @toolbar-code-bg; } +.slideColor { color: @toolbar-slide-bg; } +.pollColor { color: @toolbar-poll-bg; } +.fileColor { color: @toolbar-file-bg; } +.whiteboardColor { color: @toolbar-whiteboard-bg; } +.driveColor { color: @toolbar-drive-bg; } +.defaultColor { color: @toolbar-default-bg; } + .userlist-drawer { font: normal normal normal 14px Arial,Helvetica,Tahoma,Verdana,Sans-Serif; + min-width: 175px; width: 175px; display: block; overflow-y: auto; overflow-x: hidden; padding: 10px; box-sizing: border-box; + .close { + position: absolute; + margin-top: -11px; + margin-left: 149px; + font-size: 15px; + opacity: 0.5; + cursor: pointer; + &:hover { + opacity: 1; + } + } h2 { color: inherit; font-size: 1.2em; @@ -96,24 +118,20 @@ body { } .cryptpad-toolbar-leftside, .cryptpad-toolbar-rightside, .drawer-content { background-color: lighten(@bgcolor, 8%); - button:hover { + button:hover, button.active { background-color: @bgcolor; } } .hoverable:hover { - .editable { + .editable, .pencilIcon { cursor: text; border: 1px solid darken(@bgcolor, 15%); background: darken(@bgcolor, 10%); + transition: all 0.15s; color: @color; } - .pencilIcon { - border: 1px solid darken(@bgcolor, 15%); - background: darken(@bgcolor, 10%); - color: @color; - &:hover { - background: darken(@bgcolor, 5%); - } + .editable { + cursor: text; } } .saveIcon { @@ -129,7 +147,7 @@ body { background: darken(@bgcolor, 10%); color: @color; } - .dropdown-bar-content { + /*.dropdown-bar-content { background: darken(@bgcolor, 5%); border: 1px solid @color; color: @color; @@ -155,7 +173,7 @@ body { background-color: @bgcolor; } } - } + }*/ } } @@ -229,9 +247,6 @@ body { margin: 0; background: transparent; } - .dropdown-bar-content { - line-height: 14px; - } } .separator { @@ -248,6 +263,7 @@ body { } button { + transition: all 0.15s; .unselectable(); &#shareButton, &.buttonSuccess { // Bootstrap 4 colors @@ -297,14 +313,9 @@ body { } } .cryptpad-toolbar-rightside button, .cryptpad-toolbar-leftside button { - //background-color: #fff; - //border-color: #ccc; background: transparent; &:hover { - //color: #292b2c; background-color: rgba(50,50,50,0.3); - //background-color: #e6e6e6; - border-color: #adadad; } } @@ -603,7 +614,7 @@ body { display: inline-flex; align-items: center; line-height: @toolbar-top-height; - margin: 0 20px; + margin: 0 10px; .title, .pencilIcon, .saveIcon { font-size: 25px; vertical-align: middle; @@ -671,6 +682,8 @@ body { } order: 2; text-align: center; + font-size: 32px; + margin-left: 10px; &> button { display: flex; align-items: center; @@ -696,10 +709,6 @@ body { color: inherit; } } - .dropdown-bar-content { - font-size: 12px; - line-height: 14px; - } } .cryptpad-link { display: inline-flex; @@ -728,6 +737,7 @@ body { display: inline-block; order: 5; line-height: @toolbar-top-height; + color: white; &> * { display: inline-block; height: 100%; @@ -739,13 +749,15 @@ body { cursor: pointer; } .cryptpad-user-dropdown { - margin-left: 20px; + z-index: 10000; + //margin-left: 20px; height: 64px; width: 64px; padding: 0px; box-sizing: border-box; text-align: center; background-color: rgba(0,0,0,0.3); + transition: all 0.15s; &:hover { background-color: rgba(0,0,0,0.4); } @@ -838,6 +850,9 @@ body { display: flex; flex-flow: column; z-index:1000; + .fa { + font-size: 17px; + } &> span { box-sizing: border-box; width: 150px; diff --git a/customize.dist/translations/messages.fr.js b/customize.dist/translations/messages.fr.js index b50b83c01..e373765ac 100644 --- a/customize.dist/translations/messages.fr.js +++ b/customize.dist/translations/messages.fr.js @@ -241,7 +241,7 @@ define(function () { out.fm_templateName = "Modèles"; out.fm_searchName = "Recherche"; out.fm_searchPlaceholder = "Rechercher..."; - out.fm_newButton = "Ajouter à ce dossier"; + out.fm_newButton = "Nouveau"; out.fm_newButtonTitle = "Créer un nouveau pad ou un dossier, importer un fichier dans le dossier courant"; out.fm_newFolder = "Nouveau dossier"; out.fm_newFile = "Nouveau pad"; diff --git a/customize.dist/translations/messages.js b/customize.dist/translations/messages.js index 149d1ebff..9f7f34be7 100644 --- a/customize.dist/translations/messages.js +++ b/customize.dist/translations/messages.js @@ -244,7 +244,7 @@ define(function () { out.fm_templateName = "Templates"; out.fm_searchName = "Search"; out.fm_searchPlaceholder = "Search..."; - out.fm_newButton = "Add to this folder"; + out.fm_newButton = "New"; out.fm_newButtonTitle = "Create a new pad or folder, import a file in the current folder"; out.fm_newFolder = "New folder"; out.fm_newFile = "New pad"; diff --git a/www/common/common-interface.js b/www/common/common-interface.js index 8209149c7..755e75a8e 100644 --- a/www/common/common-interface.js +++ b/www/common/common-interface.js @@ -263,5 +263,28 @@ define([ }; }; + var $fileIcon = $('', {"class": "fa fa-file-text-o file icon"}); + var $fileAppIcon = $('', {"class": "fa fa-file-text-o file icon fileColor"}); + var $padIcon = $('', {"class": "fa fa-file-word-o file icon padColor"}); + var $codeIcon = $('', {"class": "fa fa-file-code-o file icon codeColor"}); + var $slideIcon = $('', {"class": "fa fa-file-powerpoint-o file icon slideColor"}); + var $pollIcon = $('', {"class": "fa fa-calendar file icon pollColor"}); + var $whiteboardIcon = $('', {"class": "fa fa-paint-brush whiteboardColor"}); + UI.getIcon = function (type) { + var $icon; + + switch(type) { + case 'pad': $icon = $padIcon.clone(); break; + case 'file': $icon = $fileAppIcon.clone(); break; + case 'code': $icon = $codeIcon.clone(); break; + case 'slide': $icon = $slideIcon.clone(); break; + case 'poll': $icon = $pollIcon.clone(); break; + case 'whiteboard': $icon = $whiteboardIcon.clone(); break; + default: $icon = $fileIcon.clone(); + } + + return $icon; + }; + return UI; }); diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index 66fccba1c..92254b9fa 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -12,12 +12,13 @@ define([ '/common/common-metadata.js', '/common/common-codemirror.js', '/common/common-file.js', + '/file/file-crypto.js', '/common/clipboard.js', '/common/pinpad.js', '/customize/application_config.js' ], function ($, Config, Messages, Store, Util, Hash, UI, History, UserList, Title, Metadata, - CodeMirror, Files, Clipboard, Pinpad, AppConfig) { + CodeMirror, Files, FileCrypto, Clipboard, Pinpad, AppConfig) { /* This file exposes functionality which is specific to Cryptpad, but not to any particular pad type. This includes functions for committing metadata @@ -65,6 +66,7 @@ define([ common.errorLoadingScreen = UI.errorLoadingScreen; common.notify = UI.notify; common.unnotify = UI.unnotify; + common.getIcon = UI.getIcon; // import common utilities for export common.find = Util.find; @@ -850,8 +852,9 @@ define([ common.createUsageBar = function (cb) { // getPinnedUsage updates common.account.usage, and other values // so we can just use those and only check for errors + var $container = $('', {'class':'limit-container'}); var todo = function (err) { - var $container = $('', {'class':'limit-container'}); + $container.html(''); if (err) { return void window.setTimeout(function () { common.getPinnedUsage(todo); @@ -867,8 +870,7 @@ define([ var $limit = $('', {'class': 'cryptpad-limit-bar'}).appendTo($container); var quota = usage/limit; - var width = Math.floor(Math.min(quota, 1)*$limit.width()); // the bar is 200px width - var $usage = $('', {'class': 'usage'}).css('width', width+'px'); + var $usage = $('', {'class': 'usage'}).css('width', quota*100+'%'); var makeDonateButton = function () { $('', { @@ -921,9 +923,9 @@ define([ window.setTimeout(function () { common.getPinnedUsage(todo); }, LIMIT_REFRESH_RATE); - cb(err, $container); }; common.getPinnedUsage(todo); + cb(null, $container); }; var prepareFeedback = common.prepareFeedback = function (key) { @@ -975,9 +977,14 @@ define([ var ev = { target: data.target }; + if (data.filter && !data.filter(file)) { + common.log('TODO: invalid avatar (type or size)'); + return; + } data.FM.handleFile(file, ev); if (callback) { callback(); } }); + if (data.accept) { $input.attr('accept', data.accept); } button.click(function () { $input.click(); }); break; case 'template': @@ -1099,8 +1106,7 @@ define([ } button = $('