From 08e0ae424d8681b93886462147d84945b883a0b2 Mon Sep 17 00:00:00 2001 From: ansuz Date: Thu, 14 Sep 2017 18:13:03 +0200 Subject: [PATCH 01/12] log errors in less compilation --- www/common/LessLoader.js | 1 + 1 file changed, 1 insertion(+) diff --git a/www/common/LessLoader.js b/www/common/LessLoader.js index a4c01c0bf..d09413aa7 100644 --- a/www/common/LessLoader.js +++ b/www/common/LessLoader.js @@ -118,6 +118,7 @@ define([ } console.log('CACHE MISS ' + url); ((/\.less([\?\#].*)?$/.test(url)) ? loadLess : loadCSS)(url, function (err, css) { + if (err) { console.log(err); } var output = fixAllURLs(css, url); cachePut(url, output); inject(output, url); From f9d27d2783db72147b0b3916ee5b166e10ccbbda Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 18 Sep 2017 15:09:01 +0200 Subject: [PATCH 02/12] WIP secure contacts --- customize.dist/src/less2/main.less | 1 + www/contacts/app-contacts.less | 256 +++++++++++++++++++++++++++++ www/contacts/index.html | 18 +- www/contacts/inner.html | 18 +- www/contacts/inner.js | 122 +++++++++++++- www/contacts/main.js | 99 ++++++----- www/contacts/main.less | 248 ---------------------------- 7 files changed, 436 insertions(+), 326 deletions(-) create mode 100644 www/contacts/app-contacts.less delete mode 100644 www/contacts/main.less diff --git a/customize.dist/src/less2/main.less b/customize.dist/src/less2/main.less index 1fcd30815..d2020c97b 100644 --- a/customize.dist/src/less2/main.less +++ b/customize.dist/src/less2/main.less @@ -27,4 +27,5 @@ body.cp-app-code { @import "../../../code/app-code.less"; } body.cp-app-slide { @import "../../../slide/app-slide.less"; } body.cp-app-file { @import "../../../file/app-file.less"; } body.cp-app-filepicker { @import "../../../filepicker/app-filepicker.less"; } +body.cp-app-contacts { @import "../../../contacts/app-contacts.less"; } diff --git a/www/contacts/app-contacts.less b/www/contacts/app-contacts.less new file mode 100644 index 000000000..791b2fa66 --- /dev/null +++ b/www/contacts/app-contacts.less @@ -0,0 +1,256 @@ +@import (once) "../../customize/src/less2/include/browser.less"; +@import (once) "../../customize/src/less2/include/toolbar.less"; +@import (once) "../../customize/src/less2/include/markdown.less"; +@import (once) '../../customize/src/less2/include/fileupload.less'; +@import (once) '../../customize/src/less2/include/alertify.less'; +//@import (once) '../../customize/src/less/mixins.less'; +//@import (once) '../../customize/src/less/variables.less"; + +@import (once) '../../customize/src/less2/include/avatar.less'; + + +.toolbar_main(); +.fileupload_main(); +.alertify_main(); + +// body +&.cp-app-contacts { + @keyframes example { + 0% { + background: rgba(0,0,0,0.1); + } + 50% { + background: rgba(0,0,0,0.3); + } + 100% { + background: rgba(0,0,0,0.1); + } + } + + display: flex; + flex-flow: column; + + background-color: red !important; + @button-border: 2px; + @bg-color: @colortheme_friends-bg; + @color: @colortheme_friends-color; + #app { + flex: 1; + display: flex; + justify-content: center; + align-items: center; + min-height: 0; + &.ready { + background-size: cover; + background-position: center; + } + } + + #toolbar { + display: flex; // We need this to remove a 3px border at the bottom of the toolbar + } + + .cryptpad-toolbar { + padding: 0px; + display: inline-block; + } + + #friendList { + width: 350px; + height: 100%; + background-color: lighten(@bg-color, 10%); + overflow-y: auto; + .friend { + background: rgba(0,0,0,0.1); + padding: 5px; + margin: 10px; + cursor: pointer; + &:hover { + background-color: rgba(0,0,0,0.3); + } + &.notify { + animation: example 2s ease-in-out infinite; + } + } + } + + #friendList .friend, #messaging .avatar { + .avatar_main(30px); + &.avatar { + display: flex; + } + cursor: pointer; + color: @color; + media-tag { + img { + color: #000; + } + } + media-tag, .default { + margin-right: 5px; + } + .status { + width: 5px; + display: inline-block; + position: absolute; + right: 0; + top: 0; + bottom: 0; + opacity: 0.7; + background-color: #777; + &.online { + background-color: green; + } + &.offline { + background-color: red; + } + } + } + + #friendList { + .friend { + position: relative; + } + .remove { + cursor: pointer; + width: 20px; + &:hover { + color: darken(@color, 20%); + } + } + } + + .placeholder (@color: #bbb) { + &::-webkit-input-placeholder { /* WebKit, Blink, Edge */ + color: @color; + } + &:-moz-placeholder { /* Mozilla Firefox 4 to 18 */ + color: @color; + opacity: 1; + } + &::-moz-placeholder { /* Mozilla Firefox 19+ */ + color: @color; + opacity: 1; + } + &:-ms-input-placeholder { /* Internet Explorer 10-11 */ + color: @color; + } + &::-ms-input-placeholder { /* Microsoft Edge */ + color: @color; + } + } + + #messaging { + flex: 1; + height: 100%; + background-color: lighten(@bg-color, 20%); + min-width: 0; + + .info { + padding: 20px; + } + .header { + background-color: lighten(@bg-color, 15%); + padding: 0; + display: flex; + justify-content: space-between; + align-items: center; + height: 50px; + + .hover () { + height: 100%; + line-height: 30px; + padding: 10px; + &:hover { + background-color: rgba(50,50,50,0.3); + } + } + + .avatar, + .right-col { + flex:1 1 auto; + } + .remove-history { + .hover; + } + .avatar { + margin: 10px; + } + .more-history { + //display: none; + .hover; + &.faded { + color: darken(@bg-color, 5%); + } + } + } + .chat { + height: 100%; + display: flex; + flex-flow: column; + .messages { + padding: 0 20px; + margin: 10px 0; + flex: 1; + overflow-x: auto; + .message { + & > div { + padding: 0 10px; + } + .content { + overflow: hidden; + word-wrap: break-word; + &> * { + margin: 0; + } + } + .date { + display: none; + font-style: italic; + } + .sender { + margin-top: 10px; + font-weight: bold; + background-color: rgba(0,0,0,0.1); + } + } + } + } + .input { + background-color: lighten(@bg-color, 15%); + height: auto; + min-height: 50px; + display: flex; + align-items: center; + justify-content: center; + padding: 0 75px; + textarea { + margin: 5px 0; + padding: 0 10px; + border: none; + height: 50px; + flex: 1; + background-color: darken(@bg-color, 10%); + color: @color; + resize: none; + line-height: 50px; + overflow-y: auto; + .placeholder(#bbb); + &[disabled=true] { + .placeholder(#999); + } + &:placeholder-shown { line-height: 50px; } + } + button { + height: 50px; + border-radius: 0; + border: none; + background-color: darken(@bg-color, 15%); + &:hover { + background-color: darken(@bg-color, 20%); + } + } + } + } +} + diff --git a/www/contacts/index.html b/www/contacts/index.html index a72a3c60b..e3f7eacc4 100644 --- a/www/contacts/index.html +++ b/www/contacts/index.html @@ -1,16 +1,17 @@ - + CryptPad - + + - - +