- objective-c - iOS 5 : Can you override UIAppearance customisations in specific classes?
- iphone - 如何将 CGFontRef 转换为 UIFont?
- ios - 以编程方式关闭标记的信息窗口 google maps iOS
- ios - Xcode 5 - 尝试验证存档时出现 "No application records were found"
我有一个"template"选择器,可以让人们更改当前文本区域的“文本/html”。
所以当他们更改模板时,我需要更新 Summernote HTML。我看到了 (insertText) 的方法,但它不适用于 HTML。
有HTML版本的解决方案吗?
我认为有一个 .code() 解决方案,但似乎不起作用?我收到错误消息“不是函数”
如有任何帮助,我们将不胜感激!
$('.dialogMessageArea').summernote({
height:'230px',
focus:true,
toolbar: [
['style', ['bold', 'italic', 'underline', 'clear']],
['fontsize', ['fontsize']],
['para', ['ul', 'ol', 'paragraph']],
['table', ['table']],
['misc', ['fullscreen','undo','redo']]
]
});
$(document).on('change', '.messageTemplate', function() {
var templateId = $(this).selected().attr('value');
if(templateId) {
$.ajax({
type: "POST",
dataType: "json",
url: '/cont/templates/GetTemplate',
data: {'templateId': templateId},
success: function (data) {
$('.subjectMessage').val(data.results[0].subject);
if(data.results[0].template) {
$('.dialogMessageArea').code(data.results[0].template);
}
},
error: function () {
alert('We were not able to get your template');
}
});
}
});
console.log($('.dialogMessageArea'));
console.log("<b>Welcome</b><h3>hello world</h3>");
最佳答案
根据 api ( https://summernote.org/getting-started/#get--set-code ),
要更改所见即所得的值,您应该使用 summernote 函数,其中“代码”字符串作为第一个参数,您的内容作为第二个参数
像这样:
$('.dialogMessageArea').summernote('code', data.results[0].template);
关于javascript - SummerNote insertHtml,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34170950/
fontfamily 选项在 summernote 中不起作用 我试过 $("#divCalltoactiontitle").summernote({ toolbar: [
我正在尝试在 Summer-note v0.8.1 中创建一个自定义按钮(带有下拉列表)。 我以前使用过一个运行良好的旧版本,但是在新版本中我不知道如何创建下拉列表按钮。 请帮助我向自定义按钮添加属性
我正在尝试在 vueJS 中使用 summernote。在 Laravel 框架下。在 blade.php 文档中,我设置了一个 id summernot_div: 然后,在相应的 vueJS 文档
我正在尝试使用 summernote我的应用程序中的编辑器。我在我想修复编辑器的地方使用了 height/minheight, maxheigh 并且不允许它调整大小。 这是我正在处理的代码: $('
我有这个旧代码 // myenter.js, enter key is binded to insertParagraph command. $.summernote.addPlugin({
我正在尝试限制夏日笔记中允许的字数。 例如,我只想限制最多 50 个字。 你有什么想法吗? $(document).ready(function() { $('#summernote').su
我正在将用户输入加载回 summernote 进行编辑,顶部和底部都添加了额外的行。有办法解决吗? $('#summernote').summernote('editor.pasteHTML', "h
我在 angular 中使用 summernote 我想创建一个自定义按钮。 我想将 customButton 中的 listHit 作为参数传递,如下所示 'testBtn': this.custo
我在 summernote 中有一个自定义按钮,当我点击例如文本“一”时,它有一个项目“一”、“二”、“三”的下拉列表,文本被添加在开头,这很好。但是当我之后点击“两个”时,文本也会添加到产生这个结果
我在 laravel 上使用 summernote 包,但问题是 Orderlist 和 unorder list 在那里不起作用。这是我正在尝试使用的代码。请帮我解决这个问题。 Html : Ve
我在 Laravel 应用程序中使用 summernote。 @csrf
我正在使用非常好的 Summernote Editor 来开发一个小网络应用程序。我没有对图像使用默认的内联 base64 代码,而是将图像存储在一个文件夹中。 我让那部分按预期工作。我可以单击“图像
我这里有一个 jsFiddle -> http://jsfiddle.net/cm910t89/2/ 我在Summernote WYSIWYG Editor中创建了一个自定义按钮我似乎无法让我的功能在
有人可以帮我设置 Summernote 的默认 textarea 名称值吗?编辑器在页面上看起来是正确的(我可以使用界面修改文本),但根据我的理解,POST 不起作用。 我尝试了各种 POST 变量,
我在将文本返回到 Summernote 编辑器时遇到问题。 我已经尝试过(但没有成功): $("#EDITsummernote").innerHtml = 'test'; 如何做到这一点? 最佳答案
我正在尝试编写一个脚本,当我单击按钮时,该脚本会自动显示 Summernote 链接对话框。 例如,我有以下按钮: Copy 所以在我的 js 中我有: $("#linklist").on("clic
有没有办法在summernote编辑器中同时启用默认工具栏和空气模式工具栏? 例如,我需要用户首先使用默认工具栏编辑文本区域,当他只想编辑一个单词时,他可以选择它,然后弹出空中模式工具栏。 (就像 M
我正在使用django-summernote作为所见即所得的编辑器。到目前为止,我可以从 Summernote 编辑器保存帖子,也可以使用 safe 过滤器显示它。但它的一些功能在我的模板中不存在。
我最近实现了django-summernote使用我的表单,这对于文本非常有效。然而,我很难确切地了解图像上传的工作原理。有人对它是如何完成的有一些意见吗? 问题 使用 Summernote 从文件中
我想向 Summernote WYSIWYG 编辑器添加自定义按钮。 此按钮将弹出一个小窗口,其中包含特殊字符,例如:alpha - beta - 度数等。 我到处找过,但没有找到任何有关此的信息。如
我是一名优秀的程序员,十分优秀!