summernote

Summernote event for switch from code view to editor

◇◆丶佛笑我妖孽 提交于 2020-02-04 04:57:27
问题 I use google caja html sanitizer to prevent script executions on client side. So I need to put event on switch from code view to editor, and in that event I would clean html. Since there is no any event for that switch I wrote something like this: $('#newFeaturesView .note-editor .btn-codeview').click(function () { if (!$(element).hasClass('active')) { var html = $('#summernote').summernote('code'); var sanitizedHtml = html_sanitize(html, urlTransformer, classIdTransformer); $('#summernote')

Summernote and form submission in MVC c#

浪子不回头ぞ 提交于 2020-01-12 06:58:27
问题 I am using the summernote plugin for text box: http://summernote.org/#/getting-started#basic-api This is the form I have using summmernote: <div class="modal-body" style="max-height: 600px"> @using (Html.BeginForm()) { @Html.ValidationSummary(true) <fieldset class="form-horizontal"> <div id="textForLabelLanguage"></div> <button type="submit" class="btn btn-primary">Save changes</button> @Html.ActionLink("Cancel", "Index", null, new { @class = "btn " }) </fieldset> } </div> <script type="text

How to disable a ts rule for a specific line?

会有一股神秘感。 提交于 2019-12-30 05:32:11
问题 Summernote is a jQuery plugin, and I don't need type definitions for it. I just want to modify the object, but TS keeps throwing errors. The line bellow still gives me: "Property 'summernote' does not exist on type 'jQueryStatic'." error. (function ($) { /* tslint:disable */ delete $.summernote.options.keyMap.pc.TAB; delete $.summernote.options.keyMap.mac.TAB; /* tslint:enable */ })(jQuery) Edit: Here is my tsconfig.json { "compilerOptions": { "outDir": "./dist/", "sourceMap": true,

vue推荐一个好用的富文本框

旧街凉风 提交于 2019-12-28 02:03:51
1、安装 npm i summernote 2、创建页面显示区域 <div id="content"></div> 3、加载的时候进行初始化 js中引入 import 'summernote/dist/summernote' import 'summernote/dist/summernote.css' 使用的时候初始化方法: $('#content').summernote({ height: 150, // set editable area's height codemirror: { // codemirror options theme: 'monokai' } }) $('#content').summernote('code', item.content) 获取文本框内容: const content = $('#content').summernote('code') 效果如下: 大功告成,大家有问题可以私信我或者直接在下方回复 来源: CSDN 作者: 干掉熊猫我就是国宝++ 链接: https://blog.csdn.net/water_hope/article/details/103732852

How insert nugget in 'codeview' mode (Summernote wysiwyg)

感情迁移 提交于 2019-12-25 01:35:05
问题 Good afternoon. I have my Wysiwyg editor ' summernote ' with codeview mode enabled by default, what happens is that I want to add nuggetts in the codeview preview area, but summernote puts the content in a different area of the nugget. Internally, I made a process for codeview mode not to disable the tools and change the background color of the codeview, this I did precisely to be able to add words through the nuggets. 'Codeview' mode is activated when some content is pasted into summernote

Summernote image upload error

浪子不回头ぞ 提交于 2019-12-24 12:30:52
问题 I'm using codeigniter, twitter bootstrap and summernote as my WYSIWYG editor. Im facing some problem with the image upload. Whenever uploading an image using Summernote, it serializes the image in a base64 string. That base64 string is so long that it doesnt fit in the text data-type in phpmyadmin. What i want to do is, upload the image using PHP upload function and store its url in the database instead of the base64 string. How would i do that? With reference to this post, here's the code, $

Summernote WYSIWYG : set code view as default view

坚强是说给别人听的谎言 提交于 2019-12-24 03:16:30
问题 I can't find anything about this on the web. Is there a way to set the default view of Summernote (WYSIWYG jQuery text editor) to be the code/html view. I want to see directly the HTML code when landing on the form page. Thank you 回答1: You can simulate a click on the codeview button (after summernote initialization), it works for me : $('.summernote').summernote({ oninit: function() { $("div.note-editor button[data-event='codeview']").click(); } }); 回答2: Not very elegant and I don't know if

Jquery的bootstrap在线文本编辑器插件Summernote

寵の児 提交于 2019-12-23 00:10:04
http://www.jqcool.net/demo/201407/bootstrap-summernote/ Summernote 是一个基于 jquery 的bootstrap超级简单WYSIWYG在线 编辑器 。Summernote非常的轻量级,大小只有30KB,支持Safari,Chrome,Firefox、Opera、Internet Explorer 9 +(IE8支持即将到来)。 特点: 世界上最好的WYSIWYG 在线编辑器 极易安装 开源 自定义初化选项 支持快捷键 适用于各种后端程序言语 使用方法 使用html5文档 <!DOCTYPE html> < html > ... </ html > 引入核心文件,Summernote需要几个JS库的支持,所以得先引入其它库 <!-- include libries(jQuery, bootstrap, fontawesome) --> < script src = "//code.jquery.com/jquery-1.9.1.min.js" ></ script > < link href = "//netdna.bootstrapcdn.com/bootstrap/3.0.1/css/bootstrap.min.css" > < script src = "//netdna.bootstrapcdn.com

How to reset textarea with summernote

无人久伴 提交于 2019-12-22 07:57:57
问题 In a form after submitting all fields get cleared other than the TEXTAREA. I use summernote for textarea. (using bootstrap) <script type='text/javascript'>//<![CDATA[ $(function(){ $('#description').summernote({height: 500}); });//]]> </script> #description is the id of the textarea. reset done like below <script> $('#submit-box')[0].reset(); </script> #submit-box is the id of the form 回答1: $('#description').code(''); see http://hackerwins.github.io/summernote/features.html#api-code Updated

Adding disable/enable methods to Summernote editor

蓝咒 提交于 2019-12-22 04:32:35
问题 I have been using summernote editor for a while now and it's working for most of the things I've needed it for. However, I recently wanted it disabled ( not destroyed ) after a user action. After efforts without success, it occurred to me I could use the destroy() method to achieve what I wanted. I noticed that Summernote still turned an already disabled textarea to its editor, with the writing area disabled. Here is what I finally did: To disable summernote after creating it: I first