From b0c2dd9857e153f3ed087f2b9cf10b0df16c301b Mon Sep 17 00:00:00 2001 From: openorclose Date: Mon, 9 Mar 2020 23:40:58 +0800 Subject: [PATCH 1/2] Show pointer and use underline dashed for click trigger A regression from #1033 Let's add back the two styles of triggers: - click: show mouse pointer to signal that it is clickable and use underline dashed - not click: no special cursor, and use underline dotted --- asset/css/markbind.css | 5 +++++ src/lib/markbind/src/parsers/componentParser.js | 11 ++++++++--- test/functional/test_site/expected/bugs/index.html | 6 +++--- .../test_site/expected/markbind/css/markbind.css | 5 +++++ .../expected/markbind/css/markbind.css | 5 +++++ .../expected/markbind/css/markbind.css | 5 +++++ .../expected/markbind/css/markbind.css | 5 +++++ .../expected/markbind/css/markbind.css | 5 +++++ .../test_default/expected/index.html | 2 +- .../test_default/expected/markbind/css/markbind.css | 5 +++++ .../test_minimal/expected/markbind/css/markbind.css | 5 +++++ 11 files changed, 52 insertions(+), 7 deletions(-) diff --git a/asset/css/markbind.css b/asset/css/markbind.css index 927167704d..646618d46b 100644 --- a/asset/css/markbind.css +++ b/asset/css/markbind.css @@ -381,6 +381,11 @@ li.footnote-item:target { text-decoration: underline dotted; } +.trigger-click { + cursor: pointer; + text-decoration: underline dashed; +} + .modal.mb-zoom { -webkit-transform: scale(0.1); -moz-transform: scale(0.1); diff --git a/src/lib/markbind/src/parsers/componentParser.js b/src/lib/markbind/src/parsers/componentParser.js index c9ed5eead3..446a1e8b9d 100644 --- a/src/lib/markbind/src/parsers/componentParser.js +++ b/src/lib/markbind/src/parsers/componentParser.js @@ -188,6 +188,11 @@ function _warnDeprecatedAttributes(node, attributeNamePairs) { * For modals, we make it attempt to show the modal if it exists. */ +function addTriggerClass(node, trigger) { + const triggerClass = trigger === 'click' ? 'trigger-click' : 'trigger'; + node.attribs.class = node.attribs.class ? `${node.attribs.class} ${triggerClass}` : triggerClass; +} + function _parseTrigger(node) { node.name = 'span'; const trigger = node.attribs.trigger || 'hover'; @@ -198,7 +203,7 @@ function _parseTrigger(node) { = 'tooltipContentGetter'; const convertedTrigger = trigger === 'hover' ? 'mouseover' : trigger; node.attribs[`v-on:${convertedTrigger}`] = `$refs['${node.attribs.for}'].show()`; - node.attribs.class = node.attribs.class ? `${node.attribs.class} trigger` : 'trigger'; + addTriggerClass(node, convertedTrigger); } /* @@ -222,7 +227,7 @@ function _parsePopover(node) { node.attribs['data-mb-component-type'] = 'popover'; node.attribs[`v-b-popover.${trigger}.${placement}.html`] = 'popoverInnerGenerator'; - node.attribs.class = node.attribs.class ? `${node.attribs.class} trigger` : 'trigger'; + addTriggerClass(node, trigger); _transformSlottedComponents(node); } @@ -267,7 +272,7 @@ function _parseTooltip(node) { node.attribs['data-mb-component-type'] = 'tooltip'; node.attribs[`v-b-tooltip.${trigger}.${placement}.html`] = 'tooltipInnerContentGetter'; - node.attribs.class = node.attribs.class ? `${node.attribs.class} trigger` : 'trigger'; + addTriggerClass(node, trigger); _transformSlottedComponents(node); } diff --git a/test/functional/test_site/expected/bugs/index.html b/test/functional/test_site/expected/bugs/index.html index 1a2b64865d..641e20a918 100644 --- a/test/functional/test_site/expected/bugs/index.html +++ b/test/functional/test_site/expected/bugs/index.html @@ -39,7 +39,7 @@

Issue #49

Repro:

Establishing Requirements

- +

Requirements gathering, requirements elicitation, requirements analysis, @@ -49,7 +49,7 @@

Issue #107

Repro:

-

This is to reproduce multiple inclusions of a modal bug

+

This is to reproduce multiple inclusions of a modal bug

Requirements gathering, requirements elicitation, requirements analysis, requirements capture are some of the terms commonly and interchangeably used to represent the activity of understanding what a software product should @@ -59,7 +59,7 @@

-

This is to reproduce multiple inclusions of a modal bug

+

This is to reproduce multiple inclusions of a modal bug

Requirements gathering, requirements elicitation, requirements analysis, requirements capture are some of the terms commonly and interchangeably used to represent the activity of understanding what a software product should diff --git a/test/functional/test_site/expected/markbind/css/markbind.css b/test/functional/test_site/expected/markbind/css/markbind.css index 927167704d..646618d46b 100644 --- a/test/functional/test_site/expected/markbind/css/markbind.css +++ b/test/functional/test_site/expected/markbind/css/markbind.css @@ -381,6 +381,11 @@ li.footnote-item:target { text-decoration: underline dotted; } +.trigger-click { + cursor: pointer; + text-decoration: underline dashed; +} + .modal.mb-zoom { -webkit-transform: scale(0.1); -moz-transform: scale(0.1); diff --git a/test/functional/test_site_algolia_plugin/expected/markbind/css/markbind.css b/test/functional/test_site_algolia_plugin/expected/markbind/css/markbind.css index 927167704d..646618d46b 100644 --- a/test/functional/test_site_algolia_plugin/expected/markbind/css/markbind.css +++ b/test/functional/test_site_algolia_plugin/expected/markbind/css/markbind.css @@ -381,6 +381,11 @@ li.footnote-item:target { text-decoration: underline dotted; } +.trigger-click { + cursor: pointer; + text-decoration: underline dashed; +} + .modal.mb-zoom { -webkit-transform: scale(0.1); -moz-transform: scale(0.1); diff --git a/test/functional/test_site_convert/expected/markbind/css/markbind.css b/test/functional/test_site_convert/expected/markbind/css/markbind.css index 927167704d..646618d46b 100644 --- a/test/functional/test_site_convert/expected/markbind/css/markbind.css +++ b/test/functional/test_site_convert/expected/markbind/css/markbind.css @@ -381,6 +381,11 @@ li.footnote-item:target { text-decoration: underline dotted; } +.trigger-click { + cursor: pointer; + text-decoration: underline dashed; +} + .modal.mb-zoom { -webkit-transform: scale(0.1); -moz-transform: scale(0.1); diff --git a/test/functional/test_site_expressive_layout/expected/markbind/css/markbind.css b/test/functional/test_site_expressive_layout/expected/markbind/css/markbind.css index 927167704d..646618d46b 100644 --- a/test/functional/test_site_expressive_layout/expected/markbind/css/markbind.css +++ b/test/functional/test_site_expressive_layout/expected/markbind/css/markbind.css @@ -381,6 +381,11 @@ li.footnote-item:target { text-decoration: underline dotted; } +.trigger-click { + cursor: pointer; + text-decoration: underline dashed; +} + .modal.mb-zoom { -webkit-transform: scale(0.1); -moz-transform: scale(0.1); diff --git a/test/functional/test_site_special_tags/expected/markbind/css/markbind.css b/test/functional/test_site_special_tags/expected/markbind/css/markbind.css index 927167704d..646618d46b 100644 --- a/test/functional/test_site_special_tags/expected/markbind/css/markbind.css +++ b/test/functional/test_site_special_tags/expected/markbind/css/markbind.css @@ -381,6 +381,11 @@ li.footnote-item:target { text-decoration: underline dotted; } +.trigger-click { + cursor: pointer; + text-decoration: underline dashed; +} + .modal.mb-zoom { -webkit-transform: scale(0.1); -moz-transform: scale(0.1); diff --git a/test/functional/test_site_templates/test_default/expected/index.html b/test/functional/test_site_templates/test_default/expected/index.html index 62ebed790e..3c48be3a9e 100644 --- a/test/functional/test_site_templates/test_default/expected/index.html +++ b/test/functional/test_site_templates/test_default/expected/index.html @@ -90,7 +90,7 @@

Heading 1

<foo>  <bar type="name">goo</bar></foo>

Sub Heading 1.1

A ❗️ some important explanationtooltip, - a modal, a link, + a modal, a link, a badge, another badge.

Some text some text some text some text some text some text some text. Some text some text some text some text some text some text some text. Some text some text some text some text some text some text some text some text some text some text some text some text some text some text. Some text some text some text some text some text some text. Some text some text some text some text some text some text some text. diff --git a/test/functional/test_site_templates/test_default/expected/markbind/css/markbind.css b/test/functional/test_site_templates/test_default/expected/markbind/css/markbind.css index 927167704d..646618d46b 100644 --- a/test/functional/test_site_templates/test_default/expected/markbind/css/markbind.css +++ b/test/functional/test_site_templates/test_default/expected/markbind/css/markbind.css @@ -381,6 +381,11 @@ li.footnote-item:target { text-decoration: underline dotted; } +.trigger-click { + cursor: pointer; + text-decoration: underline dashed; +} + .modal.mb-zoom { -webkit-transform: scale(0.1); -moz-transform: scale(0.1); diff --git a/test/functional/test_site_templates/test_minimal/expected/markbind/css/markbind.css b/test/functional/test_site_templates/test_minimal/expected/markbind/css/markbind.css index 927167704d..646618d46b 100644 --- a/test/functional/test_site_templates/test_minimal/expected/markbind/css/markbind.css +++ b/test/functional/test_site_templates/test_minimal/expected/markbind/css/markbind.css @@ -381,6 +381,11 @@ li.footnote-item:target { text-decoration: underline dotted; } +.trigger-click { + cursor: pointer; + text-decoration: underline dashed; +} + .modal.mb-zoom { -webkit-transform: scale(0.1); -moz-transform: scale(0.1); From 8a9225a3525a677182bd4929c6a6614631f2efcb Mon Sep 17 00:00:00 2001 From: Open Close Date: Sat, 21 Mar 2020 23:55:26 +0800 Subject: [PATCH 2/2] Remove contextmenu triggers --- docs/userGuide/syntax/popovers.mbdf | 4 ++-- docs/userGuide/syntax/tooltips.mbdf | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/docs/userGuide/syntax/popovers.mbdf b/docs/userGuide/syntax/popovers.mbdf index 143e8949f2..00a815bec4 100644 --- a/docs/userGuide/syntax/popovers.mbdf +++ b/docs/userGuide/syntax/popovers.mbdf @@ -36,8 +36,8 @@ - - + +

Markdown

diff --git a/docs/userGuide/syntax/tooltips.mbdf b/docs/userGuide/syntax/tooltips.mbdf index ea05efaa24..67d15124ad 100644 --- a/docs/userGuide/syntax/tooltips.mbdf +++ b/docs/userGuide/syntax/tooltips.mbdf @@ -22,9 +22,6 @@ Trigger - - -