Skip to content

Commit

Permalink
CHG: edge support paste image
Browse files Browse the repository at this point in the history
  • Loading branch information
farthinker committed Aug 15, 2019
1 parent 9e992fb commit 4eb1259
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 14 deletions.
1 change: 1 addition & 0 deletions Gruntfile.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ module.exports = (grunt) ->
options:
server: 'server.js'
bases: '_site'
port: 3001

uglify:
simditor:
Expand Down
5 changes: 1 addition & 4 deletions lib/simditor.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* Simditor v2.3.27
* http://simditor.tower.im/
* 2019-07-30
* 2019-08-15
*/
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
Expand Down Expand Up @@ -2316,9 +2316,6 @@ Clipboard = (function(superClass) {

Clipboard.prototype._processPasteByClipboardApi = function(e) {
var imageFile, pasteItem, ref, uploadOpt;
if (this.editor.util.browser.edge) {
return;
}
if (e.originalEvent.clipboardData && e.originalEvent.clipboardData.items && e.originalEvent.clipboardData.items.length > 0) {
pasteItem = e.originalEvent.clipboardData.items[0];
if (/^image\//.test(pasteItem.type)) {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simditor",
"version": "2.3.27",
"version": "2.3.28",
"description": "A simple online editor",
"repository": {
"type": "git",
Expand Down
3 changes: 0 additions & 3 deletions site/assets/scripts/simditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -2311,9 +2311,6 @@ Clipboard = (function(superClass) {

Clipboard.prototype._processPasteByClipboardApi = function(e) {
var imageFile, pasteItem, ref, uploadOpt;
if (this.editor.util.browser.edge) {
return;
}
if (e.originalEvent.clipboardData && e.originalEvent.clipboardData.items && e.originalEvent.clipboardData.items.length > 0) {
pasteItem = e.originalEvent.clipboardData.items[0];
if (/^image\//.test(pasteItem.type)) {
Expand Down
3 changes: 0 additions & 3 deletions src/clipboard.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ class Clipboard extends SimpleModule
@pasting = false

_processPasteByClipboardApi: (e) ->
# clipboard api is buggy in MS Edge
return if @editor.util.browser.edge

# paste file in chrome
if e.originalEvent.clipboardData && e.originalEvent.clipboardData.items &&
e.originalEvent.clipboardData.items.length > 0
Expand Down
2 changes: 1 addition & 1 deletion styles/simditor.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* Simditor v2.3.27
* http://simditor.tower.im/
* 2019-07-30
* 2019-08-15
*/
@font-face {
font-family: 'Simditor';
Expand Down

0 comments on commit 4eb1259

Please sign in to comment.