From 2bd4d4419046d2acb74ef1f311c7211776096535 Mon Sep 17 00:00:00 2001 From: Ulysse ARNAUD Date: Mon, 10 Oct 2022 09:42:16 +0200 Subject: [PATCH 1/5] Inert attribute for content outside of modal --- src/js/views/index.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/js/views/index.js b/src/js/views/index.js index eef086fb..011988b1 100644 --- a/src/js/views/index.js +++ b/src/js/views/index.js @@ -251,6 +251,11 @@ var ModalView = Backbone.View.extend({ }, show: function() { + Array.from(document.body.children).forEach(function(child) { + if (child.className === 'modalView') return; + child.setAttribute('inert', ''); + }); + this.toggleZ(true); // on reflow, change our class to animate. for whatever // reason if this is done immediately, chrome might combine @@ -268,6 +273,12 @@ var ModalView = Backbone.View.extend({ this.toggleZ(false); } }.bind(this), this.getAnimationTime()); + + + Array.from(document.body.children).forEach(function(child) { + if (child.className === 'modalView') return; + child.removeAttribute('inert'); + }); }, getInsideElement: function() { From 7d559281c9e544314e493c30a595e328432afde5 Mon Sep 17 00:00:00 2001 From: Ulysse ARNAUD Date: Mon, 10 Oct 2022 09:51:46 +0200 Subject: [PATCH 2/5] Changed className to classList --- src/js/views/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/views/index.js b/src/js/views/index.js index 011988b1..bf52fcc4 100644 --- a/src/js/views/index.js +++ b/src/js/views/index.js @@ -252,7 +252,7 @@ var ModalView = Backbone.View.extend({ show: function() { Array.from(document.body.children).forEach(function(child) { - if (child.className === 'modalView') return; + if (child.classList.contains('modalView')) return; child.setAttribute('inert', ''); }); @@ -276,7 +276,7 @@ var ModalView = Backbone.View.extend({ Array.from(document.body.children).forEach(function(child) { - if (child.className === 'modalView') return; + if (child.classList.contains('modalView')) return; child.removeAttribute('inert'); }); }, From 01b11e1ac2774fc61c66dc6145f9404584f24363 Mon Sep 17 00:00:00 2001 From: Ulysse ARNAUD Date: Mon, 10 Oct 2022 10:17:45 +0200 Subject: [PATCH 3/5] Changed elements tag to output --- src/js/react_views/CommandView.jsx | 8 ++++---- src/style/main.css | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/js/react_views/CommandView.jsx b/src/js/react_views/CommandView.jsx index 7fbf6e2b..12a44106 100644 --- a/src/js/react_views/CommandView.jsx +++ b/src/js/react_views/CommandView.jsx @@ -50,7 +50,7 @@ class CommandView extends React.Component{ ]); return ( -
+

{'$'} {' '} @@ -69,7 +69,7 @@ class CommandView extends React.Component{

{this.renderFormattedWarnings()}
-
+ ); } @@ -104,9 +104,9 @@ class CommandView extends React.Component{ } } return ( -
+ {result} -
+ ); } diff --git a/src/style/main.css b/src/style/main.css index a5f5cf5f..e1d3b317 100644 --- a/src/style/main.css +++ b/src/style/main.css @@ -493,28 +493,28 @@ div.controls div.box.flex1 div.plus { } /* Command Line */ -div.reactCommandView p.commandLine i { +output.reactCommandView p.commandLine i { margin: 0 5px; } p.commandLine, -div.commandLineResult { +output.commandLineResult { opacity: 1; font-size: 1em; margin: 0px; } div.commandLineWarnings p, -div.commandLineResult p { +output.commandLineResult p { margin: 0px; } -div.commandLineResult p:first-child, +output.commandLineResult p:first-child, div.commandLineWarnings p:first-child { padding-top: 8px; } -div.commandLineResult p:last-child, +output.commandLineResult p:last-child, div.commandLineWarnings p:last-child { padding-bottom: 8px; } @@ -536,7 +536,7 @@ p.commandLine span.icons i:first-child { margin-left: 5px; } -div.reactCommandView p.commandLine span.icons i:first-child { +output.reactCommandView p.commandLine span.icons i:first-child { margin-left: 4px; position: relative; left: 1px; From 6026040add76edad8ba4b7e060fd07963f9da72b Mon Sep 17 00:00:00 2001 From: Ulysse ARNAUD Date: Mon, 10 Oct 2022 10:40:57 +0200 Subject: [PATCH 4/5] Links in helper bar now have title attribute --- src/js/react_views/HelperBarView.jsx | 6 ++++-- src/js/react_views/MainHelperBarView.jsx | 9 ++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/js/react_views/HelperBarView.jsx b/src/js/react_views/HelperBarView.jsx index 1e63df73..2d621496 100644 --- a/src/js/react_views/HelperBarView.jsx +++ b/src/js/react_views/HelperBarView.jsx @@ -39,7 +39,8 @@ class HelperBarView extends React.Component { key={'helper_bar_' + index} onClick={item.onClick} target="_blank" - href={item.href}> + href={item.href} + title={item.title}> {' '} @@ -49,7 +50,8 @@ class HelperBarView extends React.Component { + onClick={item.onClick} + title={item.title}> {item.text ? item.text : } diff --git a/src/js/react_views/MainHelperBarView.jsx b/src/js/react_views/MainHelperBarView.jsx index 43a6d860..a3cb1c0c 100644 --- a/src/js/react_views/MainHelperBarView.jsx +++ b/src/js/react_views/MainHelperBarView.jsx @@ -56,18 +56,21 @@ class MainHelperBarView extends React.Component { this.setState({ shownBar: BARS.COMMANDS }); - }.bind(this) + }.bind(this), + title: 'Show help' }, { icon: 'globe', onClick: function() { this.setState({ shownBar: BARS.INTL }); - }.bind(this) + }.bind(this), + title: 'Show available languages' }, { newPageLink: true, icon: 'twitter', - href: 'https://twitter.com/petermcottle' + href: 'https://twitter.com/petermcottle', + title: 'Follow me on Twitter' }]; } From dffad833e11778745b05f79d0fcf36a918a5055e Mon Sep 17 00:00:00 2001 From: Ulysse ARNAUD Date: Mon, 10 Oct 2022 10:43:43 +0200 Subject: [PATCH 5/5] Changed 'show help' to 'show commands' which is more adequate --- src/js/react_views/MainHelperBarView.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/react_views/MainHelperBarView.jsx b/src/js/react_views/MainHelperBarView.jsx index a3cb1c0c..41be1edc 100644 --- a/src/js/react_views/MainHelperBarView.jsx +++ b/src/js/react_views/MainHelperBarView.jsx @@ -57,7 +57,7 @@ class MainHelperBarView extends React.Component { shownBar: BARS.COMMANDS }); }.bind(this), - title: 'Show help' + title: 'Show commands' }, { icon: 'globe', onClick: function() {