首页 \ 问答 \ CQ富文本字段编辑器启用粗体,斜体和下划线样式,仅加上项目符号和编号列表(CQ rich text field editor enable bold, italic and underline styles, plus bullet and numbered lists only)

CQ富文本字段编辑器启用粗体,斜体和下划线样式,仅加上项目符号和编号列表(CQ rich text field editor enable bold, italic and underline styles, plus bullet and numbered lists only)

我有一个富文本字段编辑器小部件,我需要的是激活函数(粗体,斜体和下划线样式,加上项目符号和编号列表。)

这是我的小部件的xml:

<richtextfield
     jcr:primaryType="cq:Widget"
     fieldLabel="this is rich text field"
     name="./richtextfield"
     xtype="richtext">
     <rtePlugins jcr:primaryType="nt:unstructured">
           <subsuperscript
           jcr:primaryType="nt:unstructured"
           features="*"/>
     </rtePlugins>
 </richtextfield>

你可以看到我在这里启用了所有功能,,,但这不是我需要的,因为我只需要粗体,斜体和下划线样式,只有子弹和编号列表才能启用。

有什么建议么? 谢谢


I have a rich text field editor widget, What I need is to activate functions (bold, italic and underline styles, plus bullet and numbered lists only.)

Here is the xml of my widget:

<richtextfield
     jcr:primaryType="cq:Widget"
     fieldLabel="this is rich text field"
     name="./richtextfield"
     xtype="richtext">
     <rtePlugins jcr:primaryType="nt:unstructured">
           <subsuperscript
           jcr:primaryType="nt:unstructured"
           features="*"/>
     </rtePlugins>
 </richtextfield>

as you can see i have all features enabled here,,,but this is not i need, as i just need bold, italic and underline styles, plus bullet and numbered lists enabled only.

any suggestions? Thanks


原文:https://stackoverflow.com/questions/24650723
更新时间:2021-12-13 16:12

最满意答案

带矩形的Css解决方案

这是一个不使用trinalges的示例,而是使用旋转的rectangel。

Explination:
首先创建一个旋转的矩形前后。
为前矩形提供与背景相同的颜色。
元素获得与箭头相同的颜色。 然后我们可以将边框应用于矩形,以给出具有边框的元素的完美错觉。

body {
  background-color: #555;
}
.menu {
  display: inline-block;
  margin: 0;
  padding: 0;
}
.menu .arrow {
  position: relative;
  display: inline-block;
  list-style: none;
  font-size: 2em;
  width: 150px;
  height: 70px;
  background-color: white;
  margin-right: 90px;
  border-top: 2px solid red;
  border-bottom: 2px solid red;
}
.arrow:first-of-type {
  border-left: 2px solid red;
}
.arrow::after {
  position: absolute;
  top: 9px;
  right: -25px;
  content: "";
  height: 50px;
  width: 50px;
  background-color: white;
  transform: rotate(45deg);
  border-right: 2px solid red;
  border-top: 2px solid red;
}
.arrow::before {
  content: "";
  position: absolute;
  top: 9px;
  left: -25px;
  height: 50px;
  width: 50px;
  background-color: #555; /*Needs to match body backgrond-color*/
  transform: rotate(45deg);
  border-right: 2px solid red;
  border-top: 2px solid red;
}
.arrow:first-of-type::before {
  content: none;
  
}
.arrow span {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
<ul class="menu">
  <li class="arrow"><span>Text</span>
  </li>
  <li class="arrow"><span>Text</span>
  </li>
  <li class="arrow"><span>Text</span>
  </li>
</ul>


Css solution with rectangles

Here is an example that does not use trinalges, but instead uses rotated rectangel.

Explination:
First the before and after create a rotated rectangle.
Give the before rectangle the same color as the background.
After element gets the same color as the arrow. Then we can apply borders to rectangles to give the perfect illusion of the elements having the border.

body {
  background-color: #555;
}
.menu {
  display: inline-block;
  margin: 0;
  padding: 0;
}
.menu .arrow {
  position: relative;
  display: inline-block;
  list-style: none;
  font-size: 2em;
  width: 150px;
  height: 70px;
  background-color: white;
  margin-right: 90px;
  border-top: 2px solid red;
  border-bottom: 2px solid red;
}
.arrow:first-of-type {
  border-left: 2px solid red;
}
.arrow::after {
  position: absolute;
  top: 9px;
  right: -25px;
  content: "";
  height: 50px;
  width: 50px;
  background-color: white;
  transform: rotate(45deg);
  border-right: 2px solid red;
  border-top: 2px solid red;
}
.arrow::before {
  content: "";
  position: absolute;
  top: 9px;
  left: -25px;
  height: 50px;
  width: 50px;
  background-color: #555; /*Needs to match body backgrond-color*/
  transform: rotate(45deg);
  border-right: 2px solid red;
  border-top: 2px solid red;
}
.arrow:first-of-type::before {
  content: none;
  
}
.arrow span {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
<ul class="menu">
  <li class="arrow"><span>Text</span>
  </li>
  <li class="arrow"><span>Text</span>
  </li>
  <li class="arrow"><span>Text</span>
  </li>
</ul>

相关问答

更多
  • 您可以使用drawArc和drawCircle绘制径向菜单,并使用触摸点与中心点和角度之间的距离来检测当前正在单击的切片。 我给你写了一个样本: public class RadioButtons extends View { //the number of slice private int mSlices = 6; //the angle of each slice private int degreeStep = 360 / mSlices; privat ...
  • 是的,您可以更改控件的Style以满足您的需要。