All Projects → dwqdaiwenqi → editor-ovo

dwqdaiwenqi / editor-ovo

Licence: other
A rich text editor for mobile web. Mixed editing of photos and Emoji 一个适用于移动web的富文本编辑器。照片加emoji的混合编辑

Programming Languages

javascript
184084 projects - #8 most used programming language
Less
1899 projects
HTML
75241 projects

Projects that are alternatives of or similar to editor-ovo

Sodieremojikeyboardplus
支持自定义emoji表情,icon font , FontAwesome,斜体,超链接,粗体,下划线,字体,颜色,镂空字体等富文本
Stars: ✭ 14 (-51.72%)
Mutual labels:  emoji, rich-text-editor
drawing-board
canvas-drawing-board
Stars: ✭ 23 (-20.69%)
Mutual labels:  mobile-web, h5
emoji-db
A database of Apple-supported emojis in JSON format. Used by my Alfred emoji workflow.
Stars: ✭ 32 (+10.34%)
Mutual labels:  emoji
winmoji
Emoji lookup for Windows 😉 https://www.winmoji.com https://twitter.com/winmoji
Stars: ✭ 79 (+172.41%)
Mutual labels:  emoji
KeyboardKitPro
KeyboardKit Pro extends KeyboardKit with pro features.
Stars: ✭ 42 (+44.83%)
Mutual labels:  emoji
fastgallery
Super fast static photo and video gallery generator (written in Go and HTML/CSS/native JS)
Stars: ✭ 26 (-10.34%)
Mutual labels:  photo
mr-emoji
Lightweight emoji picker like SLACK
Stars: ✭ 23 (-20.69%)
Mutual labels:  emoji
FacebookChatStatistics
Statistics of any Facebook Messenger conversation
Stars: ✭ 49 (+68.97%)
Mutual labels:  emoji
emoji-slider
A slider control with emojis
Stars: ✭ 40 (+37.93%)
Mutual labels:  emoji
slack-emoji-upload
Slack emoji uploader, CLI. single binary, no dependencies. linux, osx, windows.
Stars: ✭ 28 (-3.45%)
Mutual labels:  emoji
dslrbrowser-ios
DSLR Browser iOS app to discover and connect to your Wi-Fi and DLNA enabled (Canon) camera
Stars: ✭ 17 (-41.38%)
Mutual labels:  photo
photomosaics
Python program that makes a photo mosaic out of a given image
Stars: ✭ 25 (-13.79%)
Mutual labels:  photo
react-rich-diff
React component to render rich diff between two documents (Markdown, HTML)
Stars: ✭ 51 (+75.86%)
Mutual labels:  rich-text-editor
npy2bdv
Fast writing of numpy 3d-arrays into HDF5 Fiji/BigDataViewer files.
Stars: ✭ 25 (-13.79%)
Mutual labels:  h5
EmojiPicker
This library to show a popover to select emoji for iOS
Stars: ✭ 58 (+100%)
Mutual labels:  emoji
country-flag-emoji-json
Country flag emojis in JSON format.
Stars: ✭ 92 (+217.24%)
Mutual labels:  emoji
emoji-helper-php
去除过滤emoji表情、判断是否包含emoji表情,输出emoji表情的16进制字符串,对于没有使用utf8mb4编码数据库的项目,这个必不可少
Stars: ✭ 29 (+0%)
Mutual labels:  emoji
Spotify-Telegram-Bio-Updater
Spotify Telegram Bio Updater Heroku Integration
Stars: ✭ 26 (-10.34%)
Mutual labels:  emoji
RichEditorView
Android 基于WebView的富文本编辑器 - 仿简书编辑器
Stars: ✭ 77 (+165.52%)
Mutual labels:  rich-text-editor
Perspec
Scriptable desktop app to correct the perspective of images
Stars: ✭ 523 (+1703.45%)
Mutual labels:  photo

editor-ovo

一个适用于移动web的富文本编辑器,实现了照片、表情、文字混排编辑。 xxxx

A rich text editor for mobile web. Mixed editing of photos and Emoji

当前有很多提供emoji表情的编辑器:一类编辑器提供的功能很简单,仅能输入文字和emoji标记(如:$apple$);还有一种编辑器功能很强大,大多用在pc端,可以控制输入字体样式、字号、图片插入、emoji插入、超链、等等。不过呢,没有搜索到比较好用的,能满足工作需求的。所以决定打造一个能提供文字输入、自定义emoji图片、输入emoji字符、相册选取图片的混排编辑器。

这个编辑器的样式设计很通用,希望它也能运用到你的项目中,并帮你解决问题🍭🍭🍭

Screenshot

pic1

pic1

Install

npm install editor-ovo --save

or

cnpm install editor-ovo --save

CDN

Usage

HTML

  <script src="//static.xyimg.net/common/js/jquery-1.8.3.min.js"></script>
  <script src="node_modules/editor-ovo/dist/scripts/main1.js"></script>
  <!--或者-->
  <!-- <script src="https://unpkg.com/[email protected]/dist/scripts/main1.js"></script> -->
  <!-- ... -->
  <button id="btn1"></button>
  <!-- ... -->
  <button id="btn2"></button>
  <!-- ... -->

JS

new EditorOvO.Reply({
  $el_active:'#btn1'
  ,config : { }
  ,convert_into_entities : false
  ,onComplete(props){
    console.log(props);
    //this.clear();
    //this.hide();

  }
})

////
new EditorOvO.Editor({
  $el_active:'#btn2'
  ,config : { }
  ,convert_into_entities : false
  ,onComplete(props){
    console.log(props);
    //this.clear();
    //this.hide();
    
  }
})

Work with module bundler

import {Reply,Editor} from 'editor-ovo';

new Reply({
    // ...
});

new Editor({
    // ...
});

Api

Options

{
  //激活编辑器的元素
  $el_active:'#element'

  //不必须,默认是false
  //如果数据库不支持切换到utf8mb4的存储方式,那么可以将参数设置为true
  //将'😁'转换为实体'&#128513;' 进行存储
  ,convert_into_entities : true
  //////

  //不必须,编辑器的层级,默认是100
  ,z_index : 1234
  //不必须,默认的提示信息如下
  ,config : {
    //都不是必须
    TITLE_EMPTY:'标题不能为空'
    ,TITLE_TOO_LONG:'标题太长...'
    ,CONTENT_EMPTY:'编辑内容不能为空'
    ,PHOTO_TOO_MANY:'你传的照片太多了吧...'
    ,SMILE_TOO_MANY:'你发的表情太多了吧...'
    ,WORD_TOO_MANY:'你写的字数太多了吧...'
    ,PHOTO_TOO_BIG:'图片太大了'
    ,SUCCESS:'发表成功'
    ,MAX_CONTENT_WORDS:800
    ,MAX_TITLE_WORDS:50
    ,MAX_SIZE_PHOTO : 1024*1024*4
    ,MAX_SMILES :20
    ,MAX_PHOTOES:6
  }
  //不必须,完成编辑后的回调
  ,onComplete:function(props){
    
    //this.hide()
    //this.clear();

    //如需对各个base64生成url
    this.generateUrl('/upload',props).then(res=>{
      //..
    });
  }
}

Nodejs Api

//nodejs 生成图片url 
app.post('/upload', function(req, res){
	res.header('Access-Control-Allow-Origin', '*');

	var base64_ = req.body.base64;

	var suff = req.body.suff;

	var buffer_ = new Buffer(base64_.replace(/^data:image\/\w+;base64,/, ''), 'base64');
	var img_name = `image-${Date.now()}.${suff}`;

  //请更改自己图片路径位置!
	fs.writeFile(`./example/upload/${img_name}`, buffer_, (err)=>{
    var resx = {attr:{url:`../example/upload/${img_name}`	}	}
    err?res.send('fail!'):res.end( `(${JSON.stringify(resx)})` );
	});
 
});

Methods

方法 类型 描述 必需
clear function 清除当前编辑器内容
show function 显示它
hide function 隐藏它
destory function 销毁它
unbind function 解绑它
generateUrl function 对各个base64生成url

Storge in Mysql

如果把用户自己输入的emoji字符也存到mysql数据库中,那么需要对mysql存储方式进行改变。存储单个emoji需要4字节,为了支持4字节的存储,在mysql中需要从'utf8'切换到'utf8mb4'。

如果不方便更改存储编码,也可将options配置中convert_into_entities设置为true,以便存储。

Run the example

npm install 
npm install webpack -g
npm run example
npm run start

open http://localhost:82/example

License

This content is released under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].