summernote

SummerNote insertHtml

青春壹個敷衍的年華 提交于 2019-12-22 02:32:08
问题 I have a 'template' selector, that enables people to change the 'text/html' of the current textarea. So when they change templates, I need to update the Summernote HTML. I see the method for (insertText), but it doesn't work for HTML. Is there a solution for HTML version? I thought there was a .code() solution, but doesn't seem to be working? I receive an error, "Not a function" Any help would be greatly appreciated! $('.dialogMessageArea').summernote({ height:'230px', focus:true, toolbar: [

Summernote - Image url instead of Base64

南笙酒味 提交于 2019-12-21 07:57:21
问题 Summernote wysiwyg editor encodes image files into Base64. Well, this seems handy but I expect the DB to be used quite heavily for a long term. This will cause some issues - searching slow, implementing image library, and etc... I wonder if it has a option to turn this encoding option off and use 'inserting url' method intead. I've been looking for it but no great success yet. For example, instead of storing images like... <img style="width: 640px;" src="data:image/jpeg;base64,/9j

How to use @Html.Raw() in @Html.TextAreaFor()

巧了我就是萌 提交于 2019-12-20 06:01:22
问题 I am using summernote to add Image, Video, text. Also, I save image or video as Html Code that is type string to database. When I retreive video or image from the database to display on summernote, it takes nearly 5 minutes and I don't know why. However, when I retrieve text from the database to display on summernote, there is no problem. Here is model public class Article { [AllowHtml] [Column(TypeName = "varchar(MAX)")] public string Content { get; set; } } Here is View for summernote

summernote add class in img

╄→尐↘猪︶ㄣ 提交于 2019-12-19 06:29:11
问题 I want to add a class (class="img-responsive") in the images which i add with the editor. actually i get this code after i saved my text: <img src="LINK" style="width: 628px; height: 470.7191413237925px;"> in the summernote.js i found this code: /** * create `<image>` from url string * * @param {String} sUrl * @return {Promise} - then: $image */ var createImage = function (sUrl) { return $.Deferred(function (deferred) { $('<img>').one('load', function () { deferred.resolve($(this)); }).one(

Summernote image upload

本小妞迷上赌 提交于 2019-12-17 04:42:10
问题 I have a problem with editor Summernote. I want to upload images into a catalog on the server. I have some script: <script type="text/javascript"> $(function () { $(\'.summernote\').summernote({ height: 200 }); $(\'.summernote\').summernote({ height:300, onImageUpload: function(files, editor, welEditable) { sendFile(files[0],editor,welEditable); } }); }); </script> <script type="text/javascript"> function sendFile(file, editor, welEditable) { data = new FormData(); data.append("file", file);

Summernote image upload

◇◆丶佛笑我妖孽 提交于 2019-12-17 04:40:11
问题 I have a problem with editor Summernote. I want to upload images into a catalog on the server. I have some script: <script type="text/javascript"> $(function () { $(\'.summernote\').summernote({ height: 200 }); $(\'.summernote\').summernote({ height:300, onImageUpload: function(files, editor, welEditable) { sendFile(files[0],editor,welEditable); } }); }); </script> <script type="text/javascript"> function sendFile(file, editor, welEditable) { data = new FormData(); data.append("file", file);

Summernote how to focus at end of text

左心房为你撑大大i 提交于 2019-12-14 01:31:03
问题 I'm currently using summernote 0.8.2, and I'm using a note which is preloaded with text. When the text loads, I would like it to focus but focus at the end of the line. I tried doing focusing based on the API. However, I tried focusing but it doesn't start at the end of the line. Below is an example of what I tried doing based on this question. Please help. (I would like the cursor to be after "item 2") $("#myNote").summernote({ toolbar: [ ['para', ['ul']] ], focus: true }); $('.note-editor

summernote doesn't allow to format pasted text after writing onpaste event

爷,独闯天下 提交于 2019-12-13 16:15:57
问题 my issue is that, when i paste data in summernote is clears the formatting but if i want to format the pasted text as i want it doesn't allow me to make changes in pasted text nor in the text i m writing in editor. i have used this code for binding onpaste event to summernote. I am Using summernote.js version 0.5.8 $(".summernote").summernote({ onpaste: function (e) { debugger; var bufferText = ((e.originalEvent || e).clipboardData || window.clipboardData).getData('Text'); e.preventDefault();

How to use django-summernote in templates

会有一股神秘感。 提交于 2019-12-13 03:27:38
问题 I have setup django-summernote on my project and everything is great, it works very good on admin , but i want to use it on my templates. Note : in django-summernote documentation they only explain how to use it if you have forms.py file but I dont my main urls.py : urlpatterns = [ path('games/', include('core.urls', namespace='core')), path('summernote/', include('django_summernote.urls')), ] my app(name=core) urls.py : from django.urls import path from . import views app_name = 'core'

Adding a new element into the DOM with angularjs does not initiate it

安稳与你 提交于 2019-12-12 18:22:13
问题 Explaining further, I am using angular-summernote and I am using a directive to insert new WYSIWYG editor instances inside of the DOM. However, when I insert it into the DOM, the new editor does not load maybe because the init has already been fired. Here is the directive I am using, as well as a jsFiddle that works, it does insert the editor tags but it does not generate/start another editor: JSFiddle angular.module('summernoteDemo', ['summernote']) .directive('addSummernote', function () {