summernote

Summernote image upload

匿名 (未验证) 提交于 2019-12-03 02:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have problem with editor Summernote. I want to upload images into a catalog on 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); url = "http://localhost/spichlerz/uploads"; $.ajax({

summernote 添加emoji表情包

匿名 (未验证) 提交于 2019-12-03 00:22:01
引入: <link href="~/Content/summernote-master/tam-emoji/css/emoji.css" rel="stylesheet" /> <script src="~/Content/summernote-master/tam-emoji/js/config.js"></script> <script src="~/Content/summernote-master/tam-emoji/js/tam-emoji.js"></script> 使用: $(document).ready(function () { //emoji图片路径 document.emojiSource = '../../content/summernote-master/tam-emoji/img'; $('#Content').summernote({ height: 400, minHeight: 400, maxHeight: 400, placeholder: "请输入内容", lang: 'zh-CN', dialogsFade: true, //模态框淡入淡出 toolbar: [ ['history', ['undo', 'redo']], ['insert', ['emoji']], //emoji ['style', ['style']], [

Image Upload for Summernote v0.8.1

匿名 (未验证) 提交于 2019-12-03 00:19:01
Image Upload for Summernote v0.8.1 $ ( '#summernote' ). summernote ({ height : ( $ ( window ). height () - 300 ), callbacks : { onImageUpload : function ( image ) { uploadImage ( image [ 0 ]); } } }); function uploadImage ( image ) { var data = new FormData (); data . append ( "image" , image ); $ . ajax ({ url : 'Your url to deal with your image' , cache : false , contentType : false , processData : false , data : data , type : "post" , success : function ( url ) { var image = $ ( '<img>' ). attr ( 'src' , 'http://' + url ); $ ( '#summernote' ). summernote ( "insertNode" , image [ 0 ]); },

summernote富文本编辑器的使用

匿名 (未验证) 提交于 2019-12-02 21:53:52
最近在开发一个微信公众号的后台,微信公众号编辑的文章一直没有得到很好地适应,大多数人也是在其他的编辑软件中编辑好之后直接去复制到微信公众平台中,考虑到复制后会排版出现问题,所以给大家推荐一款很不错的Web富文本编辑器 (summernote) 首先看一下编辑器的样子: 接下来就简单的实现这个编辑器。 1.首先需要从官网下载summernote的包(js和css两部分)然后新建一个页面,因为这个是建立在jquery和bootstarp两个基础上的,所以我们也需要引用他们,以下为我们引入的五个文件,代码如下: <script src="../../js/jquery-3.1.1.min.js"></script> <link href="../../css/bootstrap.css" rel="stylesheet" /> <script src="../../js/bootstrap.min.js"></script> <link href="dist/summernote.css" rel="stylesheet" /> <script src="dist/summernote.js"></script> 2.创建一个summernote的容器。 <div id="summernote">Hello Summernote</div> 3.创建summernote

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

 ̄綄美尐妖づ 提交于 2019-12-02 09:49:39
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 editor @Html.TextAreaFor(x => Model.Content, new { @class = "", placeholder = @Blog.Helper.Resources.Content

summernote的简单使用。

为君一笑 提交于 2019-12-02 05:28:54
导入相关css和js。 <link href="http://netdna.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.css" rel="stylesheet"> <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.js"></script> <script src="http://netdna.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.js"></script> <link href="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.12/summernote.css" rel="stylesheet"> <script src="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.12/summernote.js"></script> 如果不是使用form表单,建议使用div。 <div id="summernote">Summernote的基本使用</div> 如果使用form表单,与上面几乎相同,建议使用一个textarea元素,该元素应包含name属性

How to set text into Summernote textarea with Capybara + Poltergeist

半世苍凉 提交于 2019-12-01 18:41:04
I have a textarea which is using Summernote and I set onChange event to it. I want to write test with RSpec + Capybara + Poltergeist to confirm the onChange event is working. As far as I checked, the textarea displayed in browser is actually div tag with 'note-editable' css class. How can I set text to it and fire onChange event? I wrote a code like this, but got an error Capybara::ElementNotFound: Unable to find field "Some label" : visit edit_foo_path fill_in 'Some label', with: 'Foo bar' EDIT I created a sample app for this issue: https://github.com/JunichiIto/summernote-rspec-sandbox Raw

How to set font-size in summernote?

故事扮演 提交于 2019-12-01 18:00:40
I have been using summernote as my default text editor but I haven't been able to set a particular font-size by default when i initialize it. so far I have tried $('.active-textcontainer').summernote({ toolbar: [ ['style', ['bold', 'italic', 'underline']], ['fontsize', ['fontsize']], ['color', ['color']], ['para', ['ul', 'ol', 'paragraph']] ], height:150, fontsize:'18px' }); and $('.active-textcontainer').summernote({ toolbar: [ ['style', ['bold', 'italic', 'underline']], ['fontsize', ['fontsize']], ['color', ['color']], ['para', ['ul', 'ol', 'paragraph']] ], height:150, fontsize:'18' }); Ant

How to write Definition File for React JSX

浪子不回头ぞ 提交于 2019-12-01 12:04:35
I want to write a custom definition file for Summernote.jsx so that i dont get react-summernote module not found i have written declare var ReactSummernote: JSX.ElementClass; declare module "react-summernote" { export default ReactSummernote; } and imported this as import ReactSummernote from 'react-summernote'; but got an error saying "JSX element type 'ReactSummernote' does not have any construct or call signatures" on <ReactSummernote /> following is the link Summernote.JSX You can just declare the module as: declare module "react-summernote"; Or more specifically: declare module "react

Summernote Show Images that have been uploaded to a folder

两盒软妹~` 提交于 2019-12-01 11:09:00
I am using the really nice Summernote Editor for a little webapp. Instead of using the default inline base64 code for images I am storing the images in a folder. I have that part working as intended. I am able to click the "image" icon and select an image and it will upload it to a folder on my server in its original type (jpg, png, gif). The problem is that even though the image gets uploaded properly, Summernote does not add it to the editor ... so it doesn't show. Here is the relevant code I am using: $(function() { $('.summernote').summernote({ lang: 'en-EN', height: 500, onImageUpload: