From 9526deb024cf32bada1a6f56c857f4eb764e4054 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sun, 8 Nov 2015 16:19:53 +0000 Subject: [PATCH 1/6] add error dialogs and order search results by recents --- src/controllers/organisms/RoomView.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/controllers/organisms/RoomView.js b/src/controllers/organisms/RoomView.js index f5a8d28f..b60941c2 100644 --- a/src/controllers/organisms/RoomView.js +++ b/src/controllers/organisms/RoomView.js @@ -350,8 +350,12 @@ module.exports = { self.setState({ upload: undefined }); - }).done(undefined, function() { - // display error message + }).done(undefined, function(error) { + var ErrorDialog = sdk.getComponent("organisms.ErrorDialog"); + Modal.createDialog(ErrorDialog, { + title: "Failed to upload file", + description: error.toString() + }); }); }, @@ -377,6 +381,7 @@ module.exports = { room_events: { search_term: term, filter: filter, + order_by: "recent", event_context: { before_limit: 1, after_limit: 1, @@ -390,7 +395,11 @@ module.exports = { searchResults: data, }); }, function(error) { - // TODO: show dialog or something + var ErrorDialog = sdk.getComponent("organisms.ErrorDialog"); + Modal.createDialog(ErrorDialog, { + title: "Search failed", + description: error.toString() + }); }); }, @@ -408,7 +417,7 @@ module.exports = { var eventIds = Object.keys(results); // XXX: todo: merge overlapping results somehow? // XXX: why doesn't searching on name work? - var resultList = eventIds.map(function(key) { return results[key]; }).sort(function(a, b) { b.rank - a.rank }); + var resultList = eventIds.map(function(key) { return results[key]; }); // .sort(function(a, b) { b.rank - a.rank }); for (var i = 0; i < resultList.length; i++) { var ts1 = resultList[i].result.origin_server_ts; ret.push(
  • ); // Rank: {resultList[i].rank} From 05d921256fbe5de4f1aa3476d190ff89b2d888a0 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sun, 8 Nov 2015 23:37:14 +0000 Subject: [PATCH 2/6] re-skin the notification bar --- .../vector/css/molecules/MatrixToolbar.css | 40 +++++++++++++----- src/skins/vector/css/pages/MatrixChat.css | 2 +- src/skins/vector/img/cancel-black2.png | Bin 0 -> 1182 bytes src/skins/vector/img/warning.png | Bin 0 -> 1478 bytes .../vector/views/molecules/MatrixToolbar.js | 12 +++++- 5 files changed, 41 insertions(+), 13 deletions(-) create mode 100644 src/skins/vector/img/cancel-black2.png create mode 100644 src/skins/vector/img/warning.png diff --git a/src/skins/vector/css/molecules/MatrixToolbar.css b/src/skins/vector/css/molecules/MatrixToolbar.css index 99c28240..b545b1ad 100644 --- a/src/skins/vector/css/molecules/MatrixToolbar.css +++ b/src/skins/vector/css/molecules/MatrixToolbar.css @@ -15,20 +15,40 @@ limitations under the License. */ .mx_MatrixToolbar { - text-align: center; - background-color: #ff0064; + background-color: #76cfa6; color: #fff; - font-weight: bold; - padding: 6px; + + display: -webkit-box; + display: -moz-box; + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + -webkit-align-items: center; + align-items: center; } -.mx_MatrixToolbar button { - margin-left: 12px; +.mx_MatrixToolbar_warning { + margin-left: 16px; + margin-right: 8px; + margin-top: -2px; +} + +.mx_MatrixToolbar_link +{ + color: #fff ! important; + text-decoration: underline ! important; + cursor: pointer; } .mx_MatrixToolbar_close { - float: right; - margin-top: 3px; - margin-right: 12px; + -webkit-flex: 1; + flex: 1; cursor: pointer; -} \ No newline at end of file + text-align: right; +} + +.mx_MatrixToolbar_close img { + display: block; + float: right; + margin-right: 10px; +} diff --git a/src/skins/vector/css/pages/MatrixChat.css b/src/skins/vector/css/pages/MatrixChat.css index f649aa24..e74eb6c8 100644 --- a/src/skins/vector/css/pages/MatrixChat.css +++ b/src/skins/vector/css/pages/MatrixChat.css @@ -35,7 +35,7 @@ limitations under the License. -webkit-order: 1; order: 1; - height: 21px; + height: 40px; } .mx_MatrixChat_toolbarShowing { diff --git a/src/skins/vector/img/cancel-black2.png b/src/skins/vector/img/cancel-black2.png new file mode 100644 index 0000000000000000000000000000000000000000..a928c61b0967e83932676228efd004bc9cbf1705 GIT binary patch literal 1182 zcmeAS@N?(olHy`uVBq!ia0vp^;vmey1SIo4oWBDp$r9IylHmNblJdl&R0hYC{G?O` z&)mfH)S%SFl*+=BsWuD@%o>>?5hW46K32*3xq68pHF_1f1wh>l3^w)^1&PVosU-?Y zsp*+{wo31J?^jaDOtDo8H}y5}EpSfF$n>ZxN)4{^3rViZPPR-@vbR&PsjvbXkegbP zs8ErclUHn2VXFi-*9yo63F|8hm3bwJ6}oxF$}kgLQj3#|G7CyF^YauyCMG83 zmzLNn0bL65LT&-v*t}wBFaZNhzap_f-%!s0*lEl2^R8JRMC7?NanVBh8E{;a7Mow;K<}NNShK8=Dj*f=rPR`~= zW^NYF=7tvLFugAM$)&lec_lEtDG0shIQ4=OL~a4lW|!2W%(B!Jx1#)91+d4hGI6`b z1gCjWy(zfeVv19*KF~4xpy)-4ZkP}-4S|^O#0%uWlYeR+FwGYM6ZZwf-~lw}umRpQau|!VqtW)M#68q?qLf&=-_UHTO@8?{mEcVCE!D)IzQ;On@EfO<1m*pxQ@e)c2-BOAlr`8PUuEETZ_l^C9`elF{r5}E*JrIHB% literal 0 HcmV?d00001 diff --git a/src/skins/vector/img/warning.png b/src/skins/vector/img/warning.png new file mode 100644 index 0000000000000000000000000000000000000000..c5553530a8478d549139c265bec0492be4252d7e GIT binary patch literal 1478 zcmeAS@N?(olHy`uVBq!ia0vp^G9b*s1SJ3FdmIK*k|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*9U+m^Cs(B1$5BeXNr6bM+EIYV;~{3xK*A7;Nk-3KEmEQ%e+* zQqwc@Y?a>c-mj#PnPRIHZt82`Ti~3Uk?B!Ylp0*+7m{3+ootz+WN)WnQ(*-(AUCxn zQK2F?C$HG5!d3}vt`(3C64qBz04piUwpD^SD#ABF!8yMuRl!uxOgGuU%v{0TQqR!T z+}y-mN5ROz&{W^RSl`${*T~q)#K6kLNC66zfVLH-q*(>IxIyg#@@$ndN=gc>^!3Zj z%k|2Q_413-^$jg8E%gnI^o@*kfhu&1EAvVcD|GXUm0>2hq!uR^WfqiV=I1GZOiWD5 zFD$Tv3bSNU;+l1ennz|zM-B0$V)JVzP|XC=H|jx7ncO3BHWAB;NpiyW)Z+ZoqGVvir744~DzI`cN=+=uFAB-e&w+(vKt_H^esM;Afr7I$IMft0d=ry1 z^FV@{U|qhxR-SpqC5d^-sh%#jNH{644~kx-=!OXa(-4RWPrN`5Jo%^Q0n>aD zFma1kbOSRMlZmH`V@SoVBpvJhJ&m^-Ivd#<)Y>))EcW>FFMR$zYo-4Eu|Z^M_G=T(ulw@9=XP`oBy9V)^U}-jB9dCgUnk#t z7oO2{Pxzg|pa1^*7S0oXZ*<7AkBO&hj>7D9wa2z}MmS&X+Z)>WE2QD!%aXR*yF7n? z321&_`F+N}KgxG6{QqyOcCWS2LZaeeVAWH`7X42zcHg{}t|Fba;qTHfYxQ3&dh@1W z+37dGbMF72l%VnXeZ2#}kVjU2{cXKEm!^ectLJgq{&qCjdQ-pV$lrJ3fo+>=|2{VP z&baCZKU+@NhWg*HO`bCbwlTeR_j{Z0q4D88^*41et`Tb_yALW%kOv{8%&YoW=rS<2-?3-3HEBi%f%=l*@Q`w=(e5Pog@VkdP zOKq0jOa9lb9Q=B!k%f`Lo8x*b>mIHBw6eVXY|DjME*SxyFHyD1#^)Emwebp@P3Jh+g7)u-(A(AhdCzZNo%t5_|I$>B zu9+`$rhn_tKDX2F&V{-8FQ4yvGkjYH@4aIz4h@V9Yt2rEe*eW<3@TYYUHx3vIVCg! E0HiWF6951J literal 0 HcmV?d00001 diff --git a/src/skins/vector/views/molecules/MatrixToolbar.js b/src/skins/vector/views/molecules/MatrixToolbar.js index 4a299f14..361e39d6 100644 --- a/src/skins/vector/views/molecules/MatrixToolbar.js +++ b/src/skins/vector/views/molecules/MatrixToolbar.js @@ -28,12 +28,20 @@ module.exports = React.createClass({ Notifier.setToolbarHidden(true); }, + onClick: function() { + var Notifier = sdk.getComponent('organisms.Notifier'); + Notifier.setEnabled(true); + }, + render: function() { var EnableNotificationsButton = sdk.getComponent("atoms.EnableNotificationsButton"); return (
    - You are not receiving desktop notifications. -
    + /!\ +
    + You are not receiving desktop notifications. Enable them now +
    +
    ); } From a3082753ef39afa42be4f3b7d963a3e9cd8c7731 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Mon, 9 Nov 2015 02:12:26 +0000 Subject: [PATCH 3/6] shove initials onto default room & member avatars as per the design --- src/skins/vector/css/atoms/MemberAvatar.css | 5 +++ src/skins/vector/css/atoms/RoomAvatar.css | 24 ++++++++++++++ src/skins/vector/views/atoms/MemberAvatar.js | 19 +++++++++++ src/skins/vector/views/atoms/RoomAvatar.js | 34 ++++++++++++++++---- 4 files changed, 75 insertions(+), 7 deletions(-) create mode 100644 src/skins/vector/css/atoms/RoomAvatar.css diff --git a/src/skins/vector/css/atoms/MemberAvatar.css b/src/skins/vector/css/atoms/MemberAvatar.css index fc5fd60d..616882fd 100644 --- a/src/skins/vector/css/atoms/MemberAvatar.css +++ b/src/skins/vector/css/atoms/MemberAvatar.css @@ -19,3 +19,8 @@ limitations under the License. border-radius: 20px; } +.mx_MemberAvatar_initial { + position: absolute; + color: #fff; + text-align: center; +} \ No newline at end of file diff --git a/src/skins/vector/css/atoms/RoomAvatar.css b/src/skins/vector/css/atoms/RoomAvatar.css new file mode 100644 index 00000000..40d9064b --- /dev/null +++ b/src/skins/vector/css/atoms/RoomAvatar.css @@ -0,0 +1,24 @@ +/* +Copyright 2015 OpenMarket Ltd + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +.mx_RoomAvatar { +} + +.mx_RoomAvatar_initial { + position: absolute; + color: #fff; + text-align: center; +} \ No newline at end of file diff --git a/src/skins/vector/views/atoms/MemberAvatar.js b/src/skins/vector/views/atoms/MemberAvatar.js index 69652e1a..088e7de2 100644 --- a/src/skins/vector/views/atoms/MemberAvatar.js +++ b/src/skins/vector/views/atoms/MemberAvatar.js @@ -40,6 +40,25 @@ module.exports = React.createClass({ }, render: function() { + // XXX: recalculates default avatar url constantly + if (this.state.imageUrl === this.defaultAvatarUrl(this.props.member)) { + var initial; + if (this.props.member.name[0]) + initial = this.props.member.name[0].toUpperCase(); + if (initial === '@' && this.props.member.name[1]) + initial = this.props.member.name[1].toUpperCase(); + + return ( + + { initial } + + + ); + } return ( - ); + + // XXX: recalculates fallback avatar constantly + if (this.state.imageUrl === this.getFallbackAvatar()) { + var initial; + if (this.props.room.name[0]) + initial = this.props.room.name[0].toUpperCase(); + if (initial === '@' && this.props.room.name[1]) + initial = this.props.room.name[1].toUpperCase(); + + return ( + + { initial } + + + ); + } + else { + return + } + } }); From 66add5673b2a5a32f2663a03f431932fabcfc013 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Mon, 9 Nov 2015 11:53:50 +0000 Subject: [PATCH 4/6] de-hash rooms --- src/skins/vector/views/atoms/RoomAvatar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/skins/vector/views/atoms/RoomAvatar.js b/src/skins/vector/views/atoms/RoomAvatar.js index 1cad4c21..f61b6cec 100644 --- a/src/skins/vector/views/atoms/RoomAvatar.js +++ b/src/skins/vector/views/atoms/RoomAvatar.js @@ -52,7 +52,7 @@ module.exports = React.createClass({ var initial; if (this.props.room.name[0]) initial = this.props.room.name[0].toUpperCase(); - if (initial === '@' && this.props.room.name[1]) + if ((initial === '@' || initial === '#') && this.props.room.name[1]) initial = this.props.room.name[1].toUpperCase(); return ( From 1f697601738faa6edbb435d2c9779ea337f37095 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Mon, 9 Nov 2015 12:41:23 +0000 Subject: [PATCH 5/6] fix comedy scrolling parallax avatar initial bug --- src/skins/vector/css/atoms/MemberAvatar.css | 4 ++++ src/skins/vector/views/atoms/MemberAvatar.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/skins/vector/css/atoms/MemberAvatar.css b/src/skins/vector/css/atoms/MemberAvatar.css index 616882fd..97dae35f 100644 --- a/src/skins/vector/css/atoms/MemberAvatar.css +++ b/src/skins/vector/css/atoms/MemberAvatar.css @@ -23,4 +23,8 @@ limitations under the License. position: absolute; color: #fff; text-align: center; +} + +.mx_MemberAvatar_wrapper { + position: relative; } \ No newline at end of file diff --git a/src/skins/vector/views/atoms/MemberAvatar.js b/src/skins/vector/views/atoms/MemberAvatar.js index 088e7de2..c4153b85 100644 --- a/src/skins/vector/views/atoms/MemberAvatar.js +++ b/src/skins/vector/views/atoms/MemberAvatar.js @@ -49,7 +49,7 @@ module.exports = React.createClass({ initial = this.props.member.name[1].toUpperCase(); return ( - + Date: Mon, 9 Nov 2015 14:04:43 +0000 Subject: [PATCH 6/6] remove random bold initials --- src/skins/vector/css/atoms/RoomAvatar.css | 1 + 1 file changed, 1 insertion(+) diff --git a/src/skins/vector/css/atoms/RoomAvatar.css b/src/skins/vector/css/atoms/RoomAvatar.css index 40d9064b..f54a93ee 100644 --- a/src/skins/vector/css/atoms/RoomAvatar.css +++ b/src/skins/vector/css/atoms/RoomAvatar.css @@ -21,4 +21,5 @@ limitations under the License. position: absolute; color: #fff; text-align: center; + font-weight: normal ! important; } \ No newline at end of file