From f248477f82da6af6ec3c0f6f18ca03c497e2946e Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 11 May 2017 17:46:08 +0100 Subject: [PATCH 01/59] stage 0.5 rebrand (rename dist release) Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- scripts/jenkins.sh | 2 +- scripts/package.sh | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/jenkins.sh b/scripts/jenkins.sh index 0d441cdd..312eea45 100755 --- a/scripts/jenkins.sh +++ b/scripts/jenkins.sh @@ -34,7 +34,7 @@ npm run test # run eslint npm run lintall -- -f checkstyle -o eslint.xml || true -rm dist/vector-*.tar.gz || true # rm previous artifacts without failing if it doesn't exist +rm dist/riot-*.tar.gz || true # rm previous artifacts without failing if it doesn't exist # node_modules deps from 'npm install' don't have a .git dir so can't # rev-parse; but they do set the commit in package.json under 'gitHead' which diff --git a/scripts/package.sh b/scripts/package.sh index b3bc00bf..cffb6d28 100755 --- a/scripts/package.sh +++ b/scripts/package.sh @@ -25,13 +25,13 @@ cp -r webapp vector-$version # if $version looks like semver with leading v, strip it before writing to file if [[ ${version} =~ ^v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+(-.+)?$ ]]; then - echo ${version:1} > vector-$version/version + echo ${version:1} > riot-$version/version else - echo ${version} > vector-$version/version + echo ${version} > riot-$version/version fi -tar chvzf dist/vector-$version.tar.gz vector-$version -rm -r vector-$version +tar chvzf dist/riot-$version.tar.gz riot-$version +rm -r riot-$version echo -echo "Packaged dist/vector-$version.tar.gz" +echo "Packaged dist/riot-$version.tar.gz" From ea0b166da7f3bb6b5591dbee0f1aa5eeab388210 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 11 May 2017 17:49:31 +0100 Subject: [PATCH 02/59] change wording to not confuse users building repo change default repos to match their current naming Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- scripts/electron-package.sh | 2 +- scripts/issues-burndown.pl | 2 +- scripts/issues-no-state.pl | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/electron-package.sh b/scripts/electron-package.sh index a5718df8..973ea45e 100755 --- a/scripts/electron-package.sh +++ b/scripts/electron-package.sh @@ -63,7 +63,7 @@ fi if [ ! -f package.json ]; then echo "No package.json found. This script must be run from" - echo "the vector-web directory." + echo "the riot-web directory." exit fi diff --git a/scripts/issues-burndown.pl b/scripts/issues-burndown.pl index 67c05673..03af5ed7 100755 --- a/scripts/issues-burndown.pl +++ b/scripts/issues-burndown.pl @@ -18,7 +18,7 @@ my $gh = Net::GitHub->new( login => 'ara4n', pass => read_password("github password: "), ); -$gh->set_default_user_repo('vector-im', 'vector-web'); +$gh->set_default_user_repo('vector-im', 'riot-web'); #my @issues = $gh->issue->repos_issues({ state => 'all', milestone => 3 }); my @issues = $gh->issue->repos_issues({ state => 'all' }); diff --git a/scripts/issues-no-state.pl b/scripts/issues-no-state.pl index 9b07ed27..748809c5 100755 --- a/scripts/issues-no-state.pl +++ b/scripts/issues-no-state.pl @@ -18,7 +18,7 @@ my $gh = Net::GitHub->new( login => 'ara4n', pass => read_password("github password: "), ); -$gh->set_default_user_repo('vector-im', 'vector-web'); +$gh->set_default_user_repo('vector-im', 'riot-web'); #my @issues = $gh->issue->repos_issues({ state => 'all', milestone => 3 }); my @issues = $gh->issue->repos_issues({ state => 'all' }); @@ -42,7 +42,7 @@ my $now = DateTime->now(); foreach my $issue (@issues) { next if ($issue->{pull_request}); - + use Data::Dumper; print STDERR Dumper($issue); From bbda658b7f7e0dd4b173b2b4ed02484ff9eba170 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Sat, 13 May 2017 12:37:13 +0100 Subject: [PATCH 03/59] make Electron tray icon mimic the Favico.js one DRY: moved Favicon stuff into the base platform Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- electron_app/src/tray.js | 16 ++++---- src/vector/platform/VectorBasePlatform.js | 47 ++++++++++++++++++++++- src/vector/platform/WebPlatform.js | 44 --------------------- 3 files changed, 55 insertions(+), 52 deletions(-) diff --git a/electron_app/src/tray.js b/electron_app/src/tray.js index 2ccdf40c..ab3a8e1c 100644 --- a/electron_app/src/tray.js +++ b/electron_app/src/tray.js @@ -15,12 +15,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -const path = require('path'); -const electron = require('electron'); - -const app = electron.app; -const Tray = electron.Tray; -const MenuItem = electron.MenuItem; +const {app, Tray, Menu, nativeImage} = require('electron'); let trayIcon = null; @@ -44,7 +39,7 @@ exports.create = function (win, config) { } }; - const contextMenu = electron.Menu.buildFromTemplate([ + const contextMenu = Menu.buildFromTemplate([ { label: 'Show/Hide ' + config.brand, click: toggleWin @@ -64,4 +59,11 @@ exports.create = function (win, config) { trayIcon.setToolTip(config.brand); trayIcon.setContextMenu(contextMenu); trayIcon.on('click', toggleWin); + + win.webContents.on('page-favicon-updated', function(ev, favicons) { + try { + const img = nativeImage.createFromDataURL(favicons[0]); + trayIcon.setImage(img); + } catch (e) {console.error(e);} + }); }; diff --git a/src/vector/platform/VectorBasePlatform.js b/src/vector/platform/VectorBasePlatform.js index 1466b76a..00c9c47c 100644 --- a/src/vector/platform/VectorBasePlatform.js +++ b/src/vector/platform/VectorBasePlatform.js @@ -17,12 +17,57 @@ See the License for the specific language governing permissions and limitations under the License. */ -import BasePlatform from 'matrix-react-sdk/lib/BasePlatform' +import BasePlatform from 'matrix-react-sdk/lib/BasePlatform'; +import Favico from 'favico.js'; /** * Vector-specific extensions to the BasePlatform template */ export default class VectorBasePlatform extends BasePlatform { + constructor() { + super(); + + // The 'animations' are really low framerate and look terrible. + // Also it re-starts the animationb every time you set the badge, + // and we set the state each time, even if the value hasn't changed, + // so we'd need to fix that if enabling the animation. + this.favicon = new Favico({animation: 'none'}); + this._updateFavicon(); + } + + _updateFavicon() { + try { + // This needs to be in in a try block as it will throw + // if there are more than 100 badge count changes in + // its internal queue + let bgColor = "#d00", + notif = this.notificationCount; + + if (this.errorDidOccur) { + notif = notif || "×"; + bgColor = "#f00"; + } + + this.favicon.badge(notif, { + bgColor: bgColor, + }); + } catch (e) { + console.warn(`Failed to set badge count: ${e.message}`); + } + } + + setNotificationCount(count: number) { + if (this.notificationCount === count) return; + super.setNotificationCount(count); + this._updateFavicon(); + } + + setErrorStatus(errorDidOccur: boolean) { + if (this.errorDidOccur === errorDidOccur) return; + super.setErrorStatus(errorDidOccur); + this._updateFavicon(); + } + /** * Check for the availability of an update to the version of the * app that's currently running. diff --git a/src/vector/platform/WebPlatform.js b/src/vector/platform/WebPlatform.js index 72ca19f0..204317ba 100644 --- a/src/vector/platform/WebPlatform.js +++ b/src/vector/platform/WebPlatform.js @@ -18,7 +18,6 @@ limitations under the License. */ import VectorBasePlatform from './VectorBasePlatform'; -import Favico from 'favico.js'; import request from 'browser-request'; import dis from 'matrix-react-sdk/lib/dispatcher.js'; import q from 'q'; @@ -27,49 +26,6 @@ import url from 'url'; import UAParser from 'ua-parser-js'; export default class WebPlatform extends VectorBasePlatform { - constructor() { - super(); - this.runningVersion = null; - // The 'animations' are really low framerate and look terrible. - // Also it re-starts the animationb every time you set the badge, - // and we set the state each time, even if the value hasn't changed, - // so we'd need to fix that if enabling the animation. - this.favicon = new Favico({animation: 'none'}); - this._updateFavicon(); - } - - _updateFavicon() { - try { - // This needs to be in in a try block as it will throw - // if there are more than 100 badge count changes in - // its internal queue - let bgColor = "#d00", - notif = this.notificationCount; - - if (this.errorDidOccur) { - notif = notif || "×"; - bgColor = "#f00"; - } - - this.favicon.badge(notif, { - bgColor: bgColor, - }); - } catch (e) { - console.warn(`Failed to set badge count: ${e.message}`); - } - } - - setNotificationCount(count: number) { - if (this.notificationCount === count) return; - super.setNotificationCount(count); - this._updateFavicon(); - } - - setErrorStatus(errorDidOccur: boolean) { - if (this.errorDidOccur === errorDidOccur) return; - super.setErrorStatus(errorDidOccur); - this._updateFavicon(); - } /** * Returns true if the platform supports displaying From 8927afca036cda1f0cc2b1c0cac23f4510fa351d Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Sat, 13 May 2017 12:37:27 +0100 Subject: [PATCH 04/59] re-add electron node modules to gitignore Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 6dd2b988..6072f0ff 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,7 @@ /key.pem /lib /node_modules -/electron/node_modules +/electron_app/node_modules /packages/ /webapp /.npmrc From 6aae97b81204e20ef463ecbfa903af7658dbd6de Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Sat, 13 May 2017 12:39:55 +0100 Subject: [PATCH 05/59] Update tray tooltip based on document.title Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- electron_app/src/tray.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/electron_app/src/tray.js b/electron_app/src/tray.js index ab3a8e1c..b0a657a0 100644 --- a/electron_app/src/tray.js +++ b/electron_app/src/tray.js @@ -66,4 +66,8 @@ exports.create = function (win, config) { trayIcon.setImage(img); } catch (e) {console.error(e);} }); + + win.webContents.on('page-title-updated', function(ev, title) { + trayIcon.setToolTip(title); + }); }; From 808240eef9bfef0a4e685933bd986b8347bead1e Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Sat, 13 May 2017 12:40:17 +0100 Subject: [PATCH 06/59] shouldn't need this try-catch Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- electron_app/src/tray.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/electron_app/src/tray.js b/electron_app/src/tray.js index b0a657a0..75104042 100644 --- a/electron_app/src/tray.js +++ b/electron_app/src/tray.js @@ -61,10 +61,7 @@ exports.create = function (win, config) { trayIcon.on('click', toggleWin); win.webContents.on('page-favicon-updated', function(ev, favicons) { - try { - const img = nativeImage.createFromDataURL(favicons[0]); - trayIcon.setImage(img); - } catch (e) {console.error(e);} + trayIcon.setImage(nativeImage.createFromDataURL(favicons[0])); }); win.webContents.on('page-title-updated', function(ev, title) { From aa7728cad39f388f607cea1eb810eec5ea33a4f2 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Sat, 13 May 2017 12:41:13 +0100 Subject: [PATCH 07/59] tidy up tray.js - it made my eyes hurt Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- electron_app/src/tray.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/electron_app/src/tray.js b/electron_app/src/tray.js index 75104042..7198356c 100644 --- a/electron_app/src/tray.js +++ b/electron_app/src/tray.js @@ -21,15 +21,15 @@ let trayIcon = null; exports.hasTray = function hasTray() { return (trayIcon !== null); -} +}; -exports.create = function (win, config) { +exports.create = function(win, config) { // no trays on darwin if (process.platform === 'darwin' || trayIcon) { return; } - const toggleWin = function () { + const toggleWin = function() { if (win.isVisible() && !win.isMinimized()) { win.hide(); } else { @@ -42,17 +42,17 @@ exports.create = function (win, config) { const contextMenu = Menu.buildFromTemplate([ { label: 'Show/Hide ' + config.brand, - click: toggleWin + click: toggleWin, }, { - type: 'separator' + type: 'separator', }, { label: 'Quit', - click: function () { + click: function() { app.quit(); - } - } + }, + }, ]); trayIcon = new Tray(config.icon_path); From 25a727b8d8bb7b658da0ff1628d431b615fd346d Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Mon, 15 May 2017 00:26:02 +0100 Subject: [PATCH 08/59] use full date formats on timestamps - fixes https://github.com/vector-im/riot-web/issues/3874 --- src/components/views/messages/MessageTimestamp.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/messages/MessageTimestamp.js b/src/components/views/messages/MessageTimestamp.js index ab910b05..a97f54b1 100644 --- a/src/components/views/messages/MessageTimestamp.js +++ b/src/components/views/messages/MessageTimestamp.js @@ -25,7 +25,7 @@ module.exports = React.createClass({ render: function() { var date = new Date(this.props.ts); return ( - + { DateUtils.formatTime(date) } ); From 8e2e6cee35845f256cfe2f9981a1efa7978d2f0a Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Mon, 15 May 2017 01:07:25 +0100 Subject: [PATCH 09/59] require indexeddb & webworkers in modernizr --- src/vector/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vector/index.js b/src/vector/index.js index 0d704d99..02713afc 100644 --- a/src/vector/index.js +++ b/src/vector/index.js @@ -103,7 +103,7 @@ function checkBrowserFeatures(featureList) { var validBrowser = checkBrowserFeatures([ "displaytable", "flexbox", "es5object", "es5function", "localstorage", - "objectfit" + "objectfit", "indexeddb", "webworkers", ]); // Parse the given window.location and return parameters that can be used when calling From c3477a30a7de80ade690dca05db1f7c1176a5d06 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Mon, 15 May 2017 01:22:32 +0100 Subject: [PATCH 10/59] oops, rebuild modernizr to pull in new tests --- .modernizr.json | 6 ++++-- src/vector/modernizr.js | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.modernizr.json b/.modernizr.json index 29e620a5..06be8b4f 100644 --- a/.modernizr.json +++ b/.modernizr.json @@ -9,6 +9,8 @@ "test/css/flexbox", "test/es5/specification", "test/css/objectfit", - "test/storage/localstorage" + "test/storage/localstorage", + "test/workers/webworkers", + "test/indexeddb" ] -} \ No newline at end of file +} diff --git a/src/vector/modernizr.js b/src/vector/modernizr.js index 5ef7778a..07bd2fd3 100644 --- a/src/vector/modernizr.js +++ b/src/vector/modernizr.js @@ -1,3 +1,3 @@ -/*! modernizr 3.1.0 (Custom Build) | MIT * - * http://modernizr.com/download/?-displaytable-es5-flexbox-localstorage-objectfit-cssclassprefix:modernizr_ !*/ -!function(window,document,undefined){function is(e,t){return typeof e===t}function testRunner(){var e,t,r,n,o,s,i;for(var d in tests){if(e=[],t=tests[d],t.name&&(e.push(t.name.toLowerCase()),t.options&&t.options.aliases&&t.options.aliases.length))for(r=0;rd;d++)if(l=e[d],c=mStyle.style[l],contains(l,"-")&&(l=cssToDOM(l)),mStyle.style[l]!==undefined){if(n||is(r,"undefined"))return o(),"pfx"==t?l:!0;try{mStyle.style[l]=r}catch(u){}if(mStyle.style[l]!=c)return o(),"pfx"==t?l:!0}return o(),!1}function fnBind(e,t){return function(){return e.apply(t,arguments)}}function testDOMProps(e,t,r){var n;for(var o in e)if(e[o]in t)return r===!1?e[o]:(n=t[e[o]],is(n,"function")?fnBind(n,r||t):n);return!1}function testPropsAll(e,t,r,n,o){var s=e.charAt(0).toUpperCase()+e.slice(1),i=(e+" "+cssomPrefixes.join(s+" ")+s).split(" ");return is(t,"string")||is(t,"undefined")?testProps(i,t,n,o):(i=(e+" "+domPrefixes.join(s+" ")+s).split(" "),testDOMProps(i,t,r))}function testAllProps(e,t,r){return testPropsAll(e,undefined,undefined,t,r)}var tests=[],ModernizrProto={_version:"3.1.0",_config:{classPrefix:"modernizr_",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(e,t){var r=this;setTimeout(function(){t(r[e])},0)},addTest:function(e,t,r){tests.push({name:e,fn:t,options:r})},addAsyncTest:function(e){tests.push({name:null,fn:e})}},Modernizr=function(){};Modernizr.prototype=ModernizrProto,Modernizr=new Modernizr;var classes=[],docElement=document.documentElement,isSVG="svg"===docElement.nodeName.toLowerCase(),testStyles=ModernizrProto.testStyles=injectElementWithStyles;testStyles("#modernizr{display: table; direction: ltr}#modernizr div{display: table-cell; padding: 10px}",function(e){var t,r=e.childNodes;t=r[0].offsetLefto;o++){var s=prefixes[o],i=s.toUpperCase()+"_"+t;if(i in n)return"@-"+s.toLowerCase()+"-"+e}return!1};ModernizrProto.atRule=atRule;var prefixed=ModernizrProto.prefixed=function(e,t,r){return 0===e.indexOf("@")?atRule(e):(-1!=e.indexOf("-")&&(e=cssToDOM(e)),t?testPropsAll(e,t,r):testPropsAll(e,"pfx"))};Modernizr.addTest("objectfit",!!prefixed("objectFit"),{aliases:["object-fit"]}),Modernizr.addTest("localstorage",function(){var e="modernizr";try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(t){return!1}}),testRunner(),setClasses(classes),delete ModernizrProto.addTest,delete ModernizrProto.addAsyncTest;for(var i=0;id;d++)if(l=e[d],c=mStyle.style[l],contains(l,"-")&&(l=cssToDOM(l)),mStyle.style[l]!==undefined){if(n||is(r,"undefined"))return o(),"pfx"==t?l:!0;try{mStyle.style[l]=r}catch(u){}if(mStyle.style[l]!=c)return o(),"pfx"==t?l:!0}return o(),!1}function fnBind(e,t){return function(){return e.apply(t,arguments)}}function testDOMProps(e,t,r){var n;for(var o in e)if(e[o]in t)return r===!1?e[o]:(n=t[e[o]],is(n,"function")?fnBind(n,r||t):n);return!1}function testPropsAll(e,t,r,n,o){var i=e.charAt(0).toUpperCase()+e.slice(1),s=(e+" "+cssomPrefixes.join(i+" ")+i).split(" ");return is(t,"string")||is(t,"undefined")?testProps(s,t,n,o):(s=(e+" "+domPrefixes.join(i+" ")+i).split(" "),testDOMProps(s,t,r))}function testAllProps(e,t,r){return testPropsAll(e,undefined,undefined,t,r)}var tests=[],ModernizrProto={_version:"3.3.1",_config:{classPrefix:"modernizr_",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(e,t){var r=this;setTimeout(function(){t(r[e])},0)},addTest:function(e,t,r){tests.push({name:e,fn:t,options:r})},addAsyncTest:function(e){tests.push({name:null,fn:e})}},Modernizr=function(){};Modernizr.prototype=ModernizrProto,Modernizr=new Modernizr;var classes=[],docElement=document.documentElement,isSVG="svg"===docElement.nodeName.toLowerCase(),testStyles=ModernizrProto.testStyles=injectElementWithStyles;testStyles("#modernizr{display: table; direction: ltr}#modernizr div{display: table-cell; padding: 10px}",function(e){var t,r=e.childNodes;t=r[0].offsetLefto;o++){var i=prefixes[o],s=i.toUpperCase()+"_"+t;if(s in n)return"@-"+i.toLowerCase()+"-"+e}return!1};ModernizrProto.atRule=atRule;var prefixed=ModernizrProto.prefixed=function(e,t,r){return 0===e.indexOf("@")?atRule(e):(-1!=e.indexOf("-")&&(e=cssToDOM(e)),t?testPropsAll(e,t,r):testPropsAll(e,"pfx"))};Modernizr.addTest("objectfit",!!prefixed("objectFit"),{aliases:["object-fit"]}),Modernizr.addTest("localstorage",function(){var e="modernizr";try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(t){return!1}}),Modernizr.addTest("webworkers","Worker"in window);var indexeddb;try{indexeddb=prefixed("indexedDB",window)}catch(e){}Modernizr.addTest("indexeddb",!!indexeddb),indexeddb&&Modernizr.addTest("indexeddb.deletedatabase","deleteDatabase"in indexeddb),testRunner(),setClasses(classes),delete ModernizrProto.addTest,delete ModernizrProto.addAsyncTest;for(var i=0;i Date: Mon, 15 May 2017 02:24:34 +0100 Subject: [PATCH 11/59] cursor pointer for avatar upload in user settings --- .../vector/css/matrix-react-sdk/structures/_UserSettings.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/skins/vector/css/matrix-react-sdk/structures/_UserSettings.scss b/src/skins/vector/css/matrix-react-sdk/structures/_UserSettings.scss index 739ac88a..fe60aacb 100644 --- a/src/skins/vector/css/matrix-react-sdk/structures/_UserSettings.scss +++ b/src/skins/vector/css/matrix-react-sdk/structures/_UserSettings.scss @@ -219,6 +219,10 @@ input.mx_UserSettings_phoneNumberField { margin-top: 10px; } +.mx_UserSettings_avatarPicker_edit img { + cursor: pointer; +} + .mx_UserSettings_avatarPicker_edit > input { display: none; } From fe61a7eefd83af9bc4d33a25235dfe0fe4b45d5b Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Mon, 15 May 2017 02:32:25 +0100 Subject: [PATCH 12/59] fix off-by-one pixel errors in login field heights - fixes https://github.com/vector-im/riot-web/issues/3738 --- .../css/matrix-react-sdk/structures/login/_Login.scss | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/skins/vector/css/matrix-react-sdk/structures/login/_Login.scss b/src/skins/vector/css/matrix-react-sdk/structures/login/_Login.scss index 93173ed3..35370464 100644 --- a/src/skins/vector/css/matrix-react-sdk/structures/login/_Login.scss +++ b/src/skins/vector/css/matrix-react-sdk/structures/login/_Login.scss @@ -184,7 +184,7 @@ limitations under the License. } .mx_Login_field_prefix { - height: 33px; + height: 34px; padding: 0px 5px; line-height: 33px; @@ -197,7 +197,7 @@ limitations under the License. } .mx_Login_field_suffix { - height: 33px; + height: 34px; padding: 0px 5px; line-height: 33px; @@ -211,11 +211,16 @@ limitations under the License. } .mx_Login_username { + height: 16px; flex-shrink: 1; min-width: 0px; border-radius: 3px; } +.mx_Login_phoneNumberField { + height: 16px; +} + .mx_Login_field_has_prefix { border-top-left-radius: 0px; border-bottom-left-radius: 0px; From cef26a5b20601904ae104cf1688f9721edfb83c8 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@googlemail.com> Date: Mon, 15 May 2017 21:14:01 +0100 Subject: [PATCH 13/59] fix #3894 --- scripts/package.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/package.sh b/scripts/package.sh index cffb6d28..23d0925b 100755 --- a/scripts/package.sh +++ b/scripts/package.sh @@ -21,7 +21,7 @@ npm run build$dev cp config.sample.json webapp/ mkdir -p dist -cp -r webapp vector-$version +cp -r webapp riot-$version # if $version looks like semver with leading v, strip it before writing to file if [[ ${version} =~ ^v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+(-.+)?$ ]]; then From 3cead032c2fe1a0b0034c2a3b2c06248ebc2c564 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 16 May 2017 16:27:58 +0100 Subject: [PATCH 14/59] Revert "Merge pull request #3804 from vector-im/dbkr/left_panel_for_newbies_2" This reverts commit e6133820a2f70f94e693f6352da71c03ef5a079a, reversing changes made to d1db602b3a3e735430016af2fc837841feafdb43. --- src/components/structures/BottomLeftMenu.js | 127 +++++++++++++++--- src/components/structures/RoomSubList.js | 19 ++- .../structures/RoomSubListHeader.js | 44 +++--- src/skins/vector/css/_components.scss | 1 - .../views/elements/_RoleButton.scss | 33 ----- .../views/rooms/_RoomList.scss | 23 ---- .../css/vector-web/structures/_LeftPanel.scss | 34 +++-- 7 files changed, 170 insertions(+), 111 deletions(-) delete mode 100644 src/skins/vector/css/matrix-react-sdk/views/elements/_RoleButton.scss diff --git a/src/components/structures/BottomLeftMenu.js b/src/components/structures/BottomLeftMenu.js index 63dfac60..f378cac6 100644 --- a/src/components/structures/BottomLeftMenu.js +++ b/src/components/structures/BottomLeftMenu.js @@ -1,6 +1,5 @@ /* Copyright 2015, 2016 OpenMarket Ltd -Copyright 2017 Vector Creations Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -15,8 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -import React from 'react'; -import sdk from 'matrix-react-sdk'; +'use strict'; + +var React = require('react'); +var ReactDOM = require('react-dom'); +var sdk = require('matrix-react-sdk') +var dis = require('matrix-react-sdk/lib/dispatcher'); +var AccessibleButton = require('matrix-react-sdk/lib/components/views/elements/AccessibleButton'); module.exports = React.createClass({ displayName: 'BottomLeftMenu', @@ -26,28 +30,121 @@ module.exports = React.createClass({ teamToken: React.PropTypes.string, }, + getInitialState: function() { + return({ + directoryHover : false, + roomsHover : false, + homeHover: false, + peopleHover : false, + settingsHover : false, + }); + }, + + // Room events + onDirectoryClick: function() { + dis.dispatch({ action: 'view_room_directory' }); + }, + + onDirectoryMouseEnter: function() { + this.setState({ directoryHover: true }); + }, + + onDirectoryMouseLeave: function() { + this.setState({ directoryHover: false }); + }, + + onRoomsClick: function() { + dis.dispatch({ action: 'view_create_room' }); + }, + + onRoomsMouseEnter: function() { + this.setState({ roomsHover: true }); + }, + + onRoomsMouseLeave: function() { + this.setState({ roomsHover: false }); + }, + + // Home button events + onHomeClick: function() { + dis.dispatch({ action: 'view_home_page' }); + }, + + onHomeMouseEnter: function() { + this.setState({ homeHover: true }); + }, + + onHomeMouseLeave: function() { + this.setState({ homeHover: false }); + }, + + // People events + onPeopleClick: function() { + dis.dispatch({ action: 'view_create_chat' }); + }, + + onPeopleMouseEnter: function() { + this.setState({ peopleHover: true }); + }, + + onPeopleMouseLeave: function() { + this.setState({ peopleHover: false }); + }, + + // Settings events + onSettingsClick: function() { + dis.dispatch({ action: 'view_user_settings' }); + }, + + onSettingsMouseEnter: function() { + this.setState({ settingsHover: true }); + }, + + onSettingsMouseLeave: function() { + this.setState({ settingsHover: false }); + }, + + // Get the label/tooltip to show + getLabel: function(label, show) { + if (show) { + var RoomTooltip = sdk.getComponent("rooms.RoomTooltip"); + return ; + } + }, + render: function() { - const HomeButton = sdk.getComponent('elements.HomeButton'); - const StartChatButton = sdk.getComponent('elements.StartChatButton'); - const RoomDirectoryButton = sdk.getComponent('elements.RoomDirectoryButton'); - const CreateRoomButton = sdk.getComponent('elements.CreateRoomButton'); - const SettingsButton = sdk.getComponent('elements.SettingsButton'); + var TintableSvg = sdk.getComponent('elements.TintableSvg'); var homeButton; if (this.props.teamToken) { - homeButton = ; + homeButton = ( + + + { this.getLabel("Welcome page", this.state.homeHover) } + + ); } return (
{ homeButton } - - - - - - + + + { this.getLabel("Start chat", this.state.peopleHover) } + + + + { this.getLabel("Room directory", this.state.directoryHover) } + + + + { this.getLabel("Create new room", this.state.roomsHover) } + + + + { this.getLabel("Settings", this.state.settingsHover) } +
); diff --git a/src/components/structures/RoomSubList.js b/src/components/structures/RoomSubList.js index ab6c4422..c315ae46 100644 --- a/src/components/structures/RoomSubList.js +++ b/src/components/structures/RoomSubList.js @@ -1,5 +1,4 @@ /* -Copyright 2017 Vector Creations Ltd Copyright 2015, 2016 OpenMarket Ltd Licensed under the Apache License, Version 2.0 (the "License"); @@ -84,8 +83,6 @@ var RoomSubList = React.createClass({ incomingCall: React.PropTypes.object, onShowMoreRooms: React.PropTypes.func, searchFilter: React.PropTypes.string, - emptyContent: React.PropTypes.node, // content shown if the list is empty - headerItems: React.PropTypes.node, // content shown in the sublist header }, getInitialState: function() { @@ -472,15 +469,16 @@ var RoomSubList = React.createClass({ render: function() { var connectDropTarget = this.props.connectDropTarget; + var RoomDropTarget = sdk.getComponent('rooms.RoomDropTarget'); var TruncatedList = sdk.getComponent('elements.TruncatedList'); var label = this.props.collapsed ? null : this.props.label; - let content; - if (this.state.sortedList.length == 0) { - content = this.props.emptyContent; - } else { - content = this.makeRoomTiles(); + //console.log("render: " + JSON.stringify(this.state.sortedList)); + + var target; + if (this.state.sortedList.length == 0 && this.props.editable) { + target = ; } var roomCount = this.props.list.length > 0 ? this.props.list.length : ''; @@ -500,7 +498,8 @@ var RoomSubList = React.createClass({ if (!this.state.hidden) { subList = - { content } + { target } + { this.makeRoomTiles() } ; } else { @@ -522,7 +521,6 @@ var RoomSubList = React.createClass({ roomNotificationCount={ this.roomNotificationCount() } onClick={ this.onClick } onHeaderClick={ this.props.onHeaderClick } - headerItems={this.props.headerItems} /> { subList } @@ -544,7 +542,6 @@ var RoomSubList = React.createClass({ roomNotificationCount={ this.roomNotificationCount() } onClick={ this.onClick } onHeaderClick={ this.props.onHeaderClick } - headerItems={this.props.headerItems} /> : undefined } { (this.props.showSpinner && !this.state.hidden) ? : undefined } diff --git a/src/components/structures/RoomSubListHeader.js b/src/components/structures/RoomSubListHeader.js index 74094ae0..ad9aff5f 100644 --- a/src/components/structures/RoomSubListHeader.js +++ b/src/components/structures/RoomSubListHeader.js @@ -14,11 +14,16 @@ See the License for the specific language governing permissions and limitations under the License. */ -import React from 'react'; -import classNames from 'classnames'; -import sdk from 'matrix-react-sdk'; -import { formatCount } from 'matrix-react-sdk/lib/utils/FormattingUtils'; -import AccessibleButton from 'matrix-react-sdk/lib/components/views/elements/AccessibleButton'; +'use strict'; + +var React = require('react'); +var ReactDOM = require('react-dom'); +var classNames = require('classnames'); +var sdk = require('matrix-react-sdk') +var FormattingUtils = require('matrix-react-sdk/lib/utils/FormattingUtils'); +var RoomNotifs = require('matrix-react-sdk/lib/RoomNotifs'); +var AccessibleButton = require('matrix-react-sdk/lib/components/views/elements/AccessibleButton'); +var ConstantTimeDispatcher = require('matrix-react-sdk/lib/ConstantTimeDispatcher'); module.exports = React.createClass({ displayName: 'RoomSubListHeader', @@ -37,7 +42,6 @@ module.exports = React.createClass({ hidden: React.PropTypes.bool, onClick: React.PropTypes.func, onHeaderClick: React.PropTypes.func, - headerItems: React.PropTypes.node, // content shown in the sublist header }, getDefaultProps: function() { @@ -59,34 +63,35 @@ module.exports = React.createClass({ // }, render: function() { - const TintableSvg = sdk.getComponent("elements.TintableSvg"); + var TintableSvg = sdk.getComponent("elements.TintableSvg"); - const subListNotifications = this.props.roomNotificationCount; - const subListNotifCount = subListNotifications[0]; - const subListNotifHighlight = subListNotifications[1]; + var subListNotifications = this.props.roomNotificationCount; + var subListNotifCount = subListNotifications[0]; + var subListNotifHighlight = subListNotifications[1]; - const chevronClasses = classNames({ + var chevronClasses = classNames({ 'mx_RoomSubList_chevron': true, 'mx_RoomSubList_chevronRight': this.props.hidden, 'mx_RoomSubList_chevronDown': !this.props.hidden, }); - const badgeClasses = classNames({ + var badgeClasses = classNames({ 'mx_RoomSubList_badge': true, 'mx_RoomSubList_badgeHighlight': subListNotifHighlight, }); - let badge; + var badge; if (subListNotifCount > 0) { - badge =
{ formatCount(subListNotifCount) }
; - } else if (subListNotifHighlight) { + badge =
{ FormattingUtils.formatCount(subListNotifCount) }
; + } + else if (subListNotifHighlight) { badge =
!
; } // When collapsed, allow a long hover on the header to show user // the full tag name and room count - let title; - const roomCount = this.props.roomCount; + var title; + var roomCount = this.props.roomCount; if (this.props.collapsed) { title = this.props.label; if (roomCount !== '') { @@ -94,9 +99,9 @@ module.exports = React.createClass({ } } - let incomingCall; + var incomingCall; if (this.props.isIncomingCallRoom) { - const IncomingCallBox = sdk.getComponent("voip.IncomingCallBox"); + var IncomingCallBox = sdk.getComponent("voip.IncomingCallBox"); incomingCall = ; } @@ -104,7 +109,6 @@ module.exports = React.createClass({
{ this.props.collapsed ? '' : this.props.label } - {this.props.headerItems}
{ roomCount }
{ badge } diff --git a/src/skins/vector/css/_components.scss b/src/skins/vector/css/_components.scss index 5b23bb82..df3c4600 100644 --- a/src/skins/vector/css/_components.scss +++ b/src/skins/vector/css/_components.scss @@ -27,7 +27,6 @@ @import "./matrix-react-sdk/views/elements/_MemberEventListSummary.scss"; @import "./matrix-react-sdk/views/elements/_ProgressBar.scss"; @import "./matrix-react-sdk/views/elements/_RichText.scss"; -@import "./matrix-react-sdk/views/elements/_RoleButton.scss"; @import "./matrix-react-sdk/views/login/_InteractiveAuthEntryComponents.scss"; @import "./matrix-react-sdk/views/login/_ServerConfig.scss"; @import "./matrix-react-sdk/views/messages/_MEmoteBody.scss"; diff --git a/src/skins/vector/css/matrix-react-sdk/views/elements/_RoleButton.scss b/src/skins/vector/css/matrix-react-sdk/views/elements/_RoleButton.scss deleted file mode 100644 index 094e0b9b..00000000 --- a/src/skins/vector/css/matrix-react-sdk/views/elements/_RoleButton.scss +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright 2107 Vector Creations 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_RoleButton { - margin-left: 4px; - margin-right: 4px; - cursor: pointer; - display: inline-block; -} - -.mx_RoleButton object { - pointer-events: none; -} - -.mx_RoleButton_tooltip { - display: inline-block; - position: relative; - top: -25px; - left: 6px; -} diff --git a/src/skins/vector/css/matrix-react-sdk/views/rooms/_RoomList.scss b/src/skins/vector/css/matrix-react-sdk/views/rooms/_RoomList.scss index 35787ca0..110dcd5b 100644 --- a/src/skins/vector/css/matrix-react-sdk/views/rooms/_RoomList.scss +++ b/src/skins/vector/css/matrix-react-sdk/views/rooms/_RoomList.scss @@ -1,6 +1,5 @@ /* Copyright 2015, 2016 OpenMarket Ltd -Copyright 2107 Vector Creations Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -38,25 +37,3 @@ limitations under the License. .mx_RoomList_scrollbar .gm-scrollbar.-vertical { z-index: 6; } - -.mx_RoomList_emptySubListTip { - font-size: 13px; - margin-left: 18px; - margin-right: 18px; - margin-top: 8px; - margin-bottom: 7px; - padding: 5px; - border: 1px dashed $accent-color; - color: $primary-fg-color; - background-color: $droptarget-bg-color; - border-radius: 4px; -} - -.mx_RoomList_emptySubListTip .mx_RoleButton { - vertical-align: -3px; -} - -.mx_RoomList_headerButtons { - position: absolute; - right: 60px; -} diff --git a/src/skins/vector/css/vector-web/structures/_LeftPanel.scss b/src/skins/vector/css/vector-web/structures/_LeftPanel.scss index f171591c..d3bbce1b 100644 --- a/src/skins/vector/css/vector-web/structures/_LeftPanel.scss +++ b/src/skins/vector/css/vector-web/structures/_LeftPanel.scss @@ -64,25 +64,43 @@ limitations under the License. pointer-events: none; } -.collapsed .mx_RoleButton { +.mx_LeftPanel .mx_BottomLeftMenu_homePage, +.mx_LeftPanel .mx_BottomLeftMenu_directory, +.mx_LeftPanel .mx_BottomLeftMenu_createRoom, +.mx_LeftPanel .mx_BottomLeftMenu_people, +.mx_LeftPanel .mx_BottomLeftMenu_settings { + display: inline-block; + cursor: pointer; +} + +.collapsed .mx_BottomLeftMenu_homePage, +.collapsed .mx_BottomLeftMenu_directory, +.collapsed .mx_BottomLeftMenu_createRoom, +.collapsed .mx_BottomLeftMenu_people, +.collapsed .mx_BottomLeftMenu_settings { margin-right: 0px ! important; padding-top: 3px ! important; padding-bottom: 3px ! important; } -.mx_BottomLeftMenu_options .mx_RoleButton { - margin-left: 0px; +.mx_LeftPanel .mx_BottomLeftMenu_homePage, +.mx_LeftPanel .mx_BottomLeftMenu_directory, +.mx_LeftPanel .mx_BottomLeftMenu_createRoom, +.mx_LeftPanel .mx_BottomLeftMenu_people { margin-right: 10px; } -.mx_BottomLeftMenu_options .mx_BottomLeftMenu_settings { +.mx_LeftPanel .mx_BottomLeftMenu_settings { float: right; } -.mx_BottomLeftMenu_options .mx_BottomLeftMenu_settings .mx_RoleButton { - margin-right: 0px; -} - .mx_LeftPanel.collapsed .mx_BottomLeftMenu_settings { float: none; } + +.mx_LeftPanel .mx_BottomLeftMenu_tooltip { + display: inline-block; + position: relative; + top: -25px; + left: 6px; +} From 03476705b1cccf03070bdc55af5139450dd1c1cc Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 16 May 2017 16:35:06 +0100 Subject: [PATCH 15/59] Revert "better solution to incomingcallbox weirdness" This reverts commit be527874730d959fa980e81c897a658a03952aad. --- src/components/structures/RoomSubListHeader.js | 2 +- .../css/matrix-react-sdk/views/voip/_IncomingCallbox.scss | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/structures/RoomSubListHeader.js b/src/components/structures/RoomSubListHeader.js index ad9aff5f..eb73f721 100644 --- a/src/components/structures/RoomSubListHeader.js +++ b/src/components/structures/RoomSubListHeader.js @@ -112,8 +112,8 @@ module.exports = React.createClass({
{ roomCount }
{ badge } + { incomingCall }
- { incomingCall }
); }, diff --git a/src/skins/vector/css/matrix-react-sdk/views/voip/_IncomingCallbox.scss b/src/skins/vector/css/matrix-react-sdk/views/voip/_IncomingCallbox.scss index 64eac25d..e63814f5 100644 --- a/src/skins/vector/css/matrix-react-sdk/views/voip/_IncomingCallbox.scss +++ b/src/skins/vector/css/matrix-react-sdk/views/voip/_IncomingCallbox.scss @@ -25,6 +25,8 @@ limitations under the License. margin-top: -3px; margin-left: -20px; width: 200px; + font-weight: initial; + text-transform: initial; } .mx_IncomingCallBox_chevron { From 9399b7ddf0cf7b272e527b9086fc6fe68db2e66d Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 16 May 2017 16:35:17 +0100 Subject: [PATCH 16/59] Revert "fix incoming call box" This reverts commit b3431bb75008b068a2a1805803b91d0ff2616571. --- src/components/structures/RoomSubList.js | 1 - src/components/structures/RoomSubListHeader.js | 1 - .../vector/css/matrix-react-sdk/structures/_RoomView.scss | 4 ++-- .../css/matrix-react-sdk/views/voip/_IncomingCallbox.scss | 2 -- 4 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/components/structures/RoomSubList.js b/src/components/structures/RoomSubList.js index c315ae46..f741a30f 100644 --- a/src/components/structures/RoomSubList.js +++ b/src/components/structures/RoomSubList.js @@ -516,7 +516,6 @@ var RoomSubList = React.createClass({ roomCount={ roomCount } collapsed={ this.props.collapsed } hidden={ this.state.hidden } - incomingCall={ this.props.incomingCall } isIncomingCallRoom={ isIncomingCallRoom } roomNotificationCount={ this.roomNotificationCount() } onClick={ this.onClick } diff --git a/src/components/structures/RoomSubListHeader.js b/src/components/structures/RoomSubListHeader.js index eb73f721..5618b39b 100644 --- a/src/components/structures/RoomSubListHeader.js +++ b/src/components/structures/RoomSubListHeader.js @@ -36,7 +36,6 @@ module.exports = React.createClass({ React.PropTypes.number ]), collapsed: React.PropTypes.bool.isRequired, // is LeftPanel collapsed? - incomingCall: React.PropTypes.object, isIncomingCallRoom: React.PropTypes.bool, roomNotificationCount: React.PropTypes.array, hidden: React.PropTypes.bool, diff --git a/src/skins/vector/css/matrix-react-sdk/structures/_RoomView.scss b/src/skins/vector/css/matrix-react-sdk/structures/_RoomView.scss index e251ecd1..3d5fe029 100644 --- a/src/skins/vector/css/matrix-react-sdk/structures/_RoomView.scss +++ b/src/skins/vector/css/matrix-react-sdk/structures/_RoomView.scss @@ -172,7 +172,7 @@ hr.mx_RoomView_myReadMarker { max-height: 0px; background-color: $primary-bg-color; - z-index: 5; + z-index: 1000; overflow: hidden; -webkit-transition: all .2s ease-out; @@ -260,4 +260,4 @@ hr.mx_RoomView_myReadMarker { .mx_RoomView_ongoingConfCallNotification a { color: $accent-fg-color ! important; -} +} \ No newline at end of file diff --git a/src/skins/vector/css/matrix-react-sdk/views/voip/_IncomingCallbox.scss b/src/skins/vector/css/matrix-react-sdk/views/voip/_IncomingCallbox.scss index e63814f5..64eac25d 100644 --- a/src/skins/vector/css/matrix-react-sdk/views/voip/_IncomingCallbox.scss +++ b/src/skins/vector/css/matrix-react-sdk/views/voip/_IncomingCallbox.scss @@ -25,8 +25,6 @@ limitations under the License. margin-top: -3px; margin-left: -20px; width: 200px; - font-weight: initial; - text-transform: initial; } .mx_IncomingCallBox_chevron { From fdf326c9f0651c9766d55bc5aeddd60d5e0372d1 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 16 May 2017 17:13:39 +0100 Subject: [PATCH 17/59] Revert "Cancel quick-search on Escape, clearing it and returning focus to composer." This reverts commit 52a119244b2ff221c32c082166e77f9913833573. --- src/components/structures/SearchBox.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/components/structures/SearchBox.js b/src/components/structures/SearchBox.js index d0868b69..d79617c0 100644 --- a/src/components/structures/SearchBox.js +++ b/src/components/structures/SearchBox.js @@ -100,10 +100,6 @@ module.exports = React.createClass({ } switch (ev.keyCode) { - case KeyCode.ESCAPE: - this._clearSearch(); - dis.dispatch({action: 'focus_composer'}); - break; case KeyCode.KEY_K: if (ctrlCmdOnly) { if (this.refs.search) { From 844ea390c87eab83c9f287313d32e727c958a6fb Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 16 May 2017 17:13:55 +0100 Subject: [PATCH 18/59] Revert "clear the searchbox after quick-search" This reverts commit ddd12edc064bdd81fffbad941e199eaa065e3ae0. --- src/components/structures/RoomSubList.js | 3 +-- src/components/structures/SearchBox.js | 6 +++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/structures/RoomSubList.js b/src/components/structures/RoomSubList.js index f741a30f..a1291eeb 100644 --- a/src/components/structures/RoomSubList.js +++ b/src/components/structures/RoomSubList.js @@ -165,11 +165,10 @@ var RoomSubList = React.createClass({ } }, - onRoomTileClick(roomId, ev) { + onRoomTileClick(roomId) { dis.dispatch({ action: 'view_room', room_id: roomId, - clear_search: (ev && (ev.keyCode == 13 || ev.keyCode == 32)), }); }, diff --git a/src/components/structures/SearchBox.js b/src/components/structures/SearchBox.js index d79617c0..a3848dcc 100644 --- a/src/components/structures/SearchBox.js +++ b/src/components/structures/SearchBox.js @@ -48,14 +48,18 @@ module.exports = React.createClass({ }, onAction: function(payload) { + // Disabling this as I find it really really annoying, and was used to the + // previous behaviour - see https://github.com/vector-im/riot-web/issues/3348 +/* switch (payload.action) { // Clear up the text field when a room is selected. case 'view_room': - if (payload.clear_search && this.refs.search) { + if (this.refs.search) { this._clearSearch(); } break; } +*/ }, onChange: function() { From 9fc9de3af53e6457a6f83e1305c1f2247ab95421 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 16 May 2017 17:21:49 +0100 Subject: [PATCH 19/59] Revert "Merge pull request #3654 from vector-im/matthew/quick-search" This reverts commit 8f20fcfa6b6828421d1278b169df663e80d2a743, reversing changes made to 751f715e77a73fa704298dd1dbad0035eb7a75e8. --- package.json | 3 +- src/components/structures/LeftPanel.js | 94 +---------- src/components/structures/RoomSubList.js | 147 ++++++++++-------- .../structures/RoomSubListHeader.js | 120 -------------- src/components/structures/SearchBox.js | 31 ---- 5 files changed, 86 insertions(+), 309 deletions(-) delete mode 100644 src/components/structures/RoomSubListHeader.js diff --git a/package.json b/package.json index a1f06b00..644e9309 100644 --- a/package.json +++ b/package.json @@ -61,6 +61,7 @@ "favico.js": "^0.3.10", "filesize": "3.5.6", "flux": "~2.0.3", + "gemini-scrollbar": "matrix-org/gemini-scrollbar#b302279", "gfm.css": "^1.1.1", "highlight.js": "^9.0.0", "linkifyjs": "^2.1.3", @@ -73,7 +74,7 @@ "react-dnd": "^2.1.4", "react-dnd-html5-backend": "^2.1.2", "react-dom": "^15.4.0", - "react-gemini-scrollbar": "matrix-org/react-gemini-scrollbar#39d858c", + "react-gemini-scrollbar": "matrix-org/react-gemini-scrollbar#5e97aef", "sanitize-html": "^1.11.1", "ua-parser-js": "^0.7.10", "url": "^0.11.0" diff --git a/src/components/structures/LeftPanel.js b/src/components/structures/LeftPanel.js index 2d97313a..a9df37a8 100644 --- a/src/components/structures/LeftPanel.js +++ b/src/components/structures/LeftPanel.js @@ -19,11 +19,9 @@ limitations under the License. var React = require('react'); var DragDropContext = require('react-dnd').DragDropContext; var HTML5Backend = require('react-dnd-html5-backend'); -var KeyCode = require('matrix-react-sdk/lib/KeyCode'); var sdk = require('matrix-react-sdk') var dis = require('matrix-react-sdk/lib/dispatcher'); - var VectorConferenceHandler = require('../../VectorConferenceHandler'); var CallHandler = require("matrix-react-sdk/lib/CallHandler"); @@ -42,10 +40,6 @@ var LeftPanel = React.createClass({ }; }, - componentWillMount: function() { - this.focusedElement = null; - }, - componentDidMount: function() { this.dispatcherRef = dis.register(this.onAction); }, @@ -68,91 +62,6 @@ var LeftPanel = React.createClass({ } }, - _onFocus: function(ev) { - this.focusedElement = ev.target; - }, - - _onBlur: function(ev) { - this.focusedElement = null; - }, - - _onKeyDown: function(ev) { - if (!this.focusedElement) return; - let handled = false; - - switch (ev.keyCode) { - case KeyCode.UP: - this._onMoveFocus(true); - handled = true; - break; - case KeyCode.DOWN: - this._onMoveFocus(false); - handled = true; - break; - } - - if (handled) { - ev.stopPropagation(); - ev.preventDefault(); - } - }, - - _onMoveFocus: function(up) { - var element = this.focusedElement; - - // unclear why this isn't needed - // var descending = (up == this.focusDirection) ? this.focusDescending : !this.focusDescending; - // this.focusDirection = up; - - var descending = false; // are we currently descending or ascending through the DOM tree? - var classes; - - do { - var child = up ? element.lastElementChild : element.firstElementChild; - var sibling = up ? element.previousElementSibling : element.nextElementSibling; - - if (descending) { - if (child) { - element = child; - } - else if (sibling) { - element = sibling; - } - else { - descending = false; - element = element.parentElement; - } - } - else { - if (sibling) { - element = sibling; - descending = true; - } - else { - element = element.parentElement; - } - } - - if (element) { - classes = element.classList; - if (classes.contains("mx_LeftPanel")) { // we hit the top - element = up ? element.lastElementChild : element.firstElementChild; - descending = true; - } - } - - } while(element && !( - classes.contains("mx_RoomTile") || - classes.contains("mx_SearchBox_search") || - classes.contains("mx_RoomSubList_ellipsis"))); - - if (element) { - element.focus(); - this.focusedElement = element; - this.focusedDescending = descending; - } - }, - _recheckCallElement: function(selectedRoomId) { // if we aren't viewing a room with an ongoing call, but there is an // active call, show the call element - we need to do this to make @@ -211,8 +120,7 @@ var LeftPanel = React.createClass({ } return ( -