@syncfusion/ej2-richtexteditor
Advanced tools
Comparing version 16.4.42 to 16.4.44
@@ -5,2 +5,10 @@ # Changelog | ||
### RichTextEditor | ||
#### Bug Fixes | ||
- Pasted URL is not converted to links automatically, that issue has been fixed. | ||
- Image paste as twice in Firefox browser, that issue has been fixed. | ||
## 16.4.40-beta (2018-12-10) | ||
@@ -7,0 +15,0 @@ |
/*! | ||
* filename: index.d.ts | ||
* version : 16.4.42 | ||
* version : 16.4.44 | ||
* Copyright Syncfusion Inc. 2001 - 2018. All rights reserved. | ||
@@ -5,0 +5,0 @@ * Use of this code is subject to the terms of our license. |
{ | ||
"name": "@syncfusion/ej2-richtexteditor", | ||
"version": "16.4.42", | ||
"version": "16.4.44", | ||
"description": "Essential JS 2 RichTextEditor component", | ||
@@ -12,4 +12,4 @@ "author": "Syncfusion Inc.", | ||
"@syncfusion/ej2-base": "~16.4.42", | ||
"@syncfusion/ej2-navigations": "~16.4.42", | ||
"@syncfusion/ej2-popups": "~16.4.42", | ||
"@syncfusion/ej2-navigations": "~16.4.44", | ||
"@syncfusion/ej2-popups": "~16.4.44", | ||
"@syncfusion/ej2-splitbuttons": "~16.4.42" | ||
@@ -16,0 +16,0 @@ }, |
@@ -91,2 +91,3 @@ import { NodeSelection } from './../../selection/index'; | ||
captionClass?: string; | ||
action?: string; | ||
} | ||
@@ -93,0 +94,0 @@ export interface IHtmlUndoRedoData { |
@@ -62,3 +62,4 @@ import { createElement, isNullOrUndefined } from '@syncfusion/ej2-base'; | ||
else { | ||
e.item.selection.setSelectionText(this.parent.currentDocument, anchor.childNodes[0], anchor.childNodes[0], 0, anchor.childNodes[0].textContent.length); | ||
var startIndex = e.item.action === 'Paste' ? anchor.childNodes[0].textContent.length : 0; | ||
e.item.selection.setSelectionText(this.parent.currentDocument, anchor.childNodes[0], anchor.childNodes[0], startIndex, anchor.childNodes[0].textContent.length); | ||
} | ||
@@ -65,0 +66,0 @@ } |
@@ -28,2 +28,3 @@ import { IRichTextEditor, NotifyArgs } from '../base/interface'; | ||
private onKeyDown; | ||
private onPaste; | ||
private spaceLink; | ||
@@ -30,0 +31,0 @@ private onToolbarClick; |
@@ -50,2 +50,3 @@ import * as events from '../base/constant'; | ||
this.parent.on(events.readOnlyMode, this.updateReadOnly, this); | ||
this.parent.on(events.paste, this.onPaste, this); | ||
}; | ||
@@ -99,2 +100,12 @@ HtmlEditor.prototype.updateReadOnly = function () { | ||
}; | ||
HtmlEditor.prototype.onPaste = function (e) { | ||
var regex = new RegExp(/([^\S]|^)(((https?\:\/\/)|(www\.))(\S+))/gi); | ||
if (e.text.match(regex)) { | ||
e.args.preventDefault(); | ||
var range = this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument()); | ||
var saveSelection = this.parent.formatter.editorManager.nodeSelection.save(range, this.parent.contentModule.getDocument()); | ||
var args = { url: e.text, text: '', selection: saveSelection, action: 'Paste' }; | ||
this.parent.formatter.editorManager.execCommand('Links', 'CreateLink', null, null, args, args); | ||
} | ||
}; | ||
HtmlEditor.prototype.spaceLink = function (e) { | ||
@@ -235,2 +246,3 @@ var range = this.nodeSelectionObj.getRange(this.contentRenderer.getDocument()); | ||
this.parent.off(events.readOnlyMode, this.updateReadOnly); | ||
this.parent.off(events.paste, this.onPaste); | ||
}; | ||
@@ -237,0 +249,0 @@ HtmlEditor.prototype.render = function () { |
@@ -157,3 +157,3 @@ /** @hidden */ | ||
/** @hidden */ | ||
export var paste = 'pasteImage'; | ||
export var paste = 'paste-content'; | ||
/** @hidden */ | ||
@@ -160,0 +160,0 @@ export var imgModule = 'imageModule'; |
@@ -349,3 +349,2 @@ var __extends = (this && this.__extends) || (function () { | ||
var args = { requestType: 'Paste', editorMode: this.editorMode, event: e }; | ||
var proxy = this; | ||
var value = null; | ||
@@ -355,9 +354,12 @@ if (e && !isNOU(e.clipboardData)) { | ||
} | ||
setTimeout(function () { _this.formatter.saveData(); }, 0); | ||
this.formatter.onSuccess(this, args); | ||
if (value !== null && value.length === 0) { | ||
var file = e && e.clipboardData && e.clipboardData.items.length > 0 ? | ||
e.clipboardData.items[0].getAsFile() : null; | ||
if (value !== null) { | ||
this.notify(events.paste, { | ||
module: events.imgModule, file: e.clipboardData.items[0].getAsFile(), args: e | ||
file: file, | ||
args: e, | ||
text: value | ||
}); | ||
} | ||
setTimeout(function () { _this.formatter.onSuccess(_this, args); }, 0); | ||
}; | ||
@@ -364,0 +366,0 @@ /** |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9411902
81287