diff --git a/customize.dist/pages.js b/customize.dist/pages.js index 90c0524d7..a62c962fb 100644 --- a/customize.dist/pages.js +++ b/customize.dist/pages.js @@ -282,10 +282,6 @@ define([ return h('div#container'); }; - Pages['/profile/'] = Pages['/profile/index.html'] = function () { - return h('div#container'); - }; - Pages['/register/'] = Pages['/register/index.html'] = function () { return [h('div#main', [ h('div.mainOverlay'), @@ -513,5 +509,13 @@ define([ ]; }; + Pages['/profile/'] = Pages['/profile/index.html'] = function () { + return [ + h('div#toolbar'), + h('div#container'), + loadingScreen() + ]; + }; + return Pages; }); diff --git a/customize.dist/src/less/sidebar-layout.less b/customize.dist/src/less/sidebar-layout.less new file mode 100644 index 000000000..02126b169 --- /dev/null +++ b/customize.dist/src/less/sidebar-layout.less @@ -0,0 +1,97 @@ +@import '/customize/src/less/variables.less'; +@import '/customize/src/less/mixins.less'; + +@leftside-bg: #eee; +@leftside-color: #000; +@rightside-color: #000; +@description-color: #777; + +@button-width: 400px; +@button-bg: #3066e5; +@button-alt-bg: #fff; +@button-red-bg: #e54e4e; + + +.cp { + input[type="text"] { + padding-left: 10px; + } + #container { + font-size: 16px; + display: flex; + flex: 1; + min-height: 0; + #leftSide { + color: @leftside-color; + width: 250px; + background: @leftside-bg; + display: flex; + flex-flow: column; + .categories { + flex: 1; + .category { + .leftsideCategory(); + } + } + } + #rightSide { + flex: 1; + padding: 5px 20px; + color: @rightside-color; + overflow: auto; + .element { + label:not(.noTitle), .label { + display: block; + font-weight: bold; + margin-bottom: 0; + } + .description { + display: block; + color: @description-color; + margin-bottom: 5px; + } + margin-bottom: 20px; + } + [type="text"], button { + vertical-align: middle; + height: 40px; + box-sizing: border-box; + } + .inputBlock { + display: inline-flex; + width: @button-width; + input { + flex: 1; + border-radius: 0.25em 0 0 0.25em; + border: 1px solid #adadad; + border-right: 0px; + } + button { + border-radius: 0 0.25em 0.25em 0; + //border: 1px solid #adadad; + border-left: 0px; + } + } + button.btn { + background-color: @button-bg; + border-color: darken(@button-bg, 10%); + color: white; + &:hover { + background-color: darken(@button-bg, 10%); + } + &.btn-danger { + background-color: @button-red-bg; + border-color: darken(@button-red-bg, 10%); + color: white; + &:hover { + background-color: darken(@button-red-bg, 10%); + } + } + } + &>div { + margin: 10px 0; + } + } + } +} + diff --git a/customize.dist/src/less/toolbar.less b/customize.dist/src/less/toolbar.less index 58fece5a2..6e8b60036 100644 --- a/customize.dist/src/less/toolbar.less +++ b/customize.dist/src/less/toolbar.less @@ -25,6 +25,7 @@ .whiteboardColor { color: @toolbar-whiteboard-bg; } .driveColor { color: @toolbar-drive-bg; } .settingsColor { color: @toolbar-settings-bg; } +.profileColor { color: @toolbar-settings-bg; } .defaultColor { color: @toolbar-default-bg; } .toolbar-container { @@ -268,6 +269,11 @@ body { @color: @toolbar-settings-color; .addToolbarColors(@color, @bgcolor); } + &.app-profile { + @bgcolor: @toolbar-profile-bg; + @color: @toolbar-profile-color; + .addToolbarColors(@color, @bgcolor); + } } @@ -302,8 +308,8 @@ body .cryptpad-toolbar { z-index: 9001; .dropdown-bar { - height: 100%; - display: inline-block; + //height: 100%; + //display: inline-block; button { height: 100%; border-radius: 0; @@ -620,6 +626,32 @@ body .cryptpad-toolbar { } } +.app-slide { + @media screen and (max-width: @media-medium-screen) { + .cryptpad-toolbar-leftside { + flex-flow: row wrap; + width: 175px; + height: auto; + .cryptpad-spinner { order: 0; } + } + .cryptpad-toolbar-rightside { + height: 2*@toolbar-line-height; + } + } + @media screen and (max-width: 320px) { + .cryptpad-toolbar-leftside { + flex-flow: row wrap; + width: 175px; + height: auto; + padding-top: @toolbar-line-height; + .cryptpad-spinner { order: 0; } + } + .cryptpad-toolbar-rightside { + height: auto; + } + } +} + .cryptpad-toolbar-top { display: flex; flex-flow: row; @@ -727,7 +759,6 @@ body .cryptpad-toolbar { &:hover { background-color: rgba(0,0,0,0.3); } - order: 2; text-align: center; font-size: 32px; margin-left: 10px; @@ -785,10 +816,14 @@ body .cryptpad-toolbar { } .cryptpad-user { height: 100%; - display: inline-block; + display: inline-flex; order: 5; line-height: @toolbar-top-height; color: white; + .cryptpad-upgrade { order: 1; } + .cryptpad-new { order: 2; } + .cryptpad-user-dropdown { order: 3; } + .cryptpad-backup { order: 4; } &> * { display: inline-block; height: 100%; @@ -837,6 +872,14 @@ body .cryptpad-toolbar { } } } + p.accountData { + &> span { + font-weight: bold; + span { + font-weight: normal; + } + } + } .cryptpad-backup { margin: 0; border-radius: 0; @@ -848,12 +891,14 @@ body .cryptpad-toolbar { } } .cryptpad-toolbar-leftside { - height: @toolbar-line-height; + //height: @toolbar-line-height; &:empty { height: 0; } float: left; - margin-bottom: -1px; + display: inline-flex; + align-items: center; + //margin-bottom: -1px; .cryptpad-dropdown-users { pre { /* needed for ckeditor */ @@ -869,17 +914,22 @@ body .cryptpad-toolbar { .dropdown-bar-content { margin-top: -1px; } - .limit-container a { - height: 26px; - margin: 3px 0; - line-height: 26px; - padding: 0 5px; - box-sizing: border-box; - border: 1px solid transparent; - font-size: 14px; - &:hover { - text-decoration: none; - } + + & > span { + height: @toolbar-line-height; + } + + #userButtons { order: 1; } + .shareButton { order: 2; } + .cryptpad-spinner { order: 3; } + + #userButtons button { + width: 125px; + text-align: center; + } + .shareButton button { + width: 50px; + text-align: center; } } .cryptpad-toolbar-rightside { @@ -986,11 +1036,12 @@ body .cryptpad-toolbar { } } .cryptpad-spinner { - line-height: @toolbar-top-height; + line-height: @toolbar-line-height; + padding: 0 20px; &> span.fa { height: 20px; width: 20px; - margin: 8px; + //margin: 8px; line-height: 20px; font-size: 20px; text-align: center; @@ -1001,16 +1052,6 @@ body .cryptpad-toolbar { font-weight: bold; text-transform: uppercase; } -.cryptpad-user { - p.accountData { - &> span { - font-weight: bold; - span { - font-weight: normal; - } - } - } -} .cryptpad-dropdown-share { a { .fa { diff --git a/customize.dist/src/less/variables.less b/customize.dist/src/less/variables.less index edc46d250..c5b3f4be2 100644 --- a/customize.dist/src/less/variables.less +++ b/customize.dist/src/less/variables.less @@ -105,6 +105,8 @@ @toolbar-default-color: #000; @toolbar-settings-bg: #0087ff; @toolbar-settings-color: #fff; +@toolbar-profile-bg: #0087ff; +@toolbar-profile-color: #fff; @topbar-back: #fff; diff --git a/customize.dist/template.js b/customize.dist/template.js index fbb97071e..ca0fb7bd3 100644 --- a/customize.dist/template.js +++ b/customize.dist/template.js @@ -12,7 +12,7 @@ $(function () { var Messages = Cryptpad.Messages; var $body = $('body'); var isMainApp = function () { - return /^\/(pad|code|slide|poll|whiteboard|file|media|friends|drive|settings)\/$/.test(location.pathname); + return /^\/(pad|code|slide|poll|whiteboard|file|media|friends|drive|settings|profile)\/$/.test(location.pathname); }; var rightLink = function (ref, loc, txt) { @@ -145,7 +145,7 @@ $(function () { } else if (/drive/.test(pathname)) { $('body').append(h('body', Pages[pathname]()).innerHTML); require(['/drive/main.js'], ready); - } else if (/file/.test(pathname)) { + } else if (/\/file\//.test(pathname)) { $('body').append(h('body', Pages[pathname]()).innerHTML); require([ '/file/main.js' ], ready); } else if (/friends/.test(pathname)) { @@ -163,6 +163,9 @@ $(function () { } else if (/^\/settings\//.test(pathname)) { $('body').append(h('body', Pages[pathname]()).innerHTML); require([ '/settings/main.js', ], ready); + } else if (/^\/profile\//.test(pathname)) { + $('body').append(h('body', Pages[pathname]()).innerHTML); + require([ '/profile/main.js', ], ready); } }); @@ -176,9 +179,7 @@ $(function () { ], function () { $body.append($topbar).append($main).append($footer); - if (/^\/profile\//.test(pathname)) { - require([ '/profile/main.js'], function () {}); - } else if (/^\/user\//.test(pathname)) { + if (/^\/user\//.test(pathname)) { require([ '/user/main.js'], function () {}); } else if (/^\/register\//.test(pathname)) { require([ '/register/main.js' ], function () {}); diff --git a/customize.dist/translations/messages.fr.js b/customize.dist/translations/messages.fr.js index e4f69ec45..112a0dc0b 100644 --- a/customize.dist/translations/messages.fr.js +++ b/customize.dist/translations/messages.fr.js @@ -37,6 +37,7 @@ define(function () { out.disconnected = 'Déconnecté'; out.synchronizing = 'Synchronisation'; out.reconnecting = 'Reconnexion...'; + out.typing = "Édition"; out.lag = 'Latence'; out.readonly = 'Lecture seule'; out.anonymous = "Anonyme"; diff --git a/customize.dist/translations/messages.js b/customize.dist/translations/messages.js index 27495077f..bbb6f22e1 100644 --- a/customize.dist/translations/messages.js +++ b/customize.dist/translations/messages.js @@ -41,6 +41,7 @@ define(function () { out.disconnected = 'Disconnected'; out.synchronizing = 'Synchronizing'; out.reconnecting = 'Reconnecting...'; + out.typing = "Typing"; out.lag = 'Lag'; out.readonly = 'Read only'; out.anonymous = "Anonymous"; diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index af5ef56ce..2c11eb4a3 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -1662,7 +1662,7 @@ define([ content: Messages.user_rename }); } - if (account && parsed && (!parsed.type || parsed.type !== 'profile')) { + if (account) { options.push({ tag: 'a', attributes: {'class': 'profile'}, diff --git a/www/common/toolbar2.js b/www/common/toolbar2.js index 225f18fd2..cddc79b3e 100644 --- a/www/common/toolbar2.js +++ b/www/common/toolbar2.js @@ -29,12 +29,9 @@ define([ // Top parts var USER_CLS = Bar.constants.userAdmin = "cryptpad-user"; var SPINNER_CLS = Bar.constants.spinner = 'cryptpad-spinner'; - var STATE_CLS = Bar.constants.state = 'cryptpad-state'; - var LAG_CLS = Bar.constants.lag = 'cryptpad-lag'; var LIMIT_CLS = Bar.constants.lag = 'cryptpad-limit'; var TITLE_CLS = Bar.constants.title = "cryptpad-title"; var NEWPAD_CLS = Bar.constants.newpad = "cryptpad-new"; - var UPGRADE_CLS = Bar.constants.upgrade = "cryptpad-upgrade"; // User admin menu var USERADMIN_CLS = Bar.constants.user = 'cryptpad-user-dropdown'; @@ -66,10 +63,6 @@ define([ var $userContainer = $('', { 'class': USER_CLS }).appendTo($topContainer); - $('