夏季笔记 向工具栏添加字母间距



我想在Summernote中向工具栏添加功能。我想以微调器或 editText 的形式提供控制字母间距的功能,但我不知道在哪里添加它。即使我尝试其他插件,我也无法理解它。

// toolbar
toolbar: [
['style', ['style']],
['font', ['bold', 'underline', 'clear']],
['fontname', ['fontname']],
['color', ['color']],
			  ['fontSize', ['fontSize']],
			  ['letterSpace', ['letterSpace']],
['para', ['ul', 'ol', 'paragraph']],
['table', ['table']],
['insert', ['link', 'picture', 'video']],
['view', ['fullscreen', 'codeview', 'help']]
]

this.fontName = this.wrapCommand(function (value) {
return _this.fontStyling('font-family', "'" + value + "'");
});
this.fontSize = this.wrapCommand(function (value) {
return _this.fontStyling('font-size', value + 'px');
});
		  this.letterSpace = this.wrapCommand(function (value) {
return _this.fontStyling('letter-spacing', value + 'px');
});

在下面添加 button.fontSize

this.context.memo("button.letter", function() {
return n.ui.buttonGroup([n.button({
className: "dropdown-toggle",
contents: n.ui.dropdownButtonContents('<span class="note-current-letter"/>', n.options),
tooltip: "font letter",
data: {
toggle: "dropdown"
}
}), n.ui.dropdownCheck({
className: "dropdown-letter",
checkClassName: n.options.icons.menuCheck,
items: n.options.letters,
title: "font letter",
click: n.context.createInvokeHandlerAndUpdateState("editor.letter")
})]).render()

this.fontSize = this.wrapCommand (function (t( 在底部添加以下代码

this.letter = this.wrapCommand(function(t) {
u.fontStyling("letter-spacing", t + "px")
});

分别在工具变量和弹出框上

["信"、"[信"]]和 字母: ["8

", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19" , "20", "21", "22", "23", "24", "32", "48", "72", "112", "127", "254", "500"] 添加了解决它。

最新更新