medium-editor
Advanced tools
Comparing version 5.23.2 to 5.23.3
@@ -0,1 +1,13 @@ | ||
5.23.3 / 2017-12-20 | ||
================== | ||
* Fix medium-editor-insert plugin css fixes on beagle theme #1361 | ||
* Update jsDelivr links #1366 & #1367 | ||
* Fix Firefox console warning causing issues #1370 | ||
* Do not check only for null targets or it will fail when it's undefined. #1373 | ||
* Fix crash when 'extensions' in 'isElementDescendantOfExtension' is undefined #1362 | ||
* Fix Jasmine Unit Test errors #1385 | ||
* Fix null error on pastedPlain.split #1397 | ||
* Fix broken browser tests #1396 | ||
5.23.2 / 2017-08-02 | ||
@@ -2,0 +14,0 @@ ================== |
@@ -293,3 +293,3 @@ /*global module, require, process*/ | ||
options: { | ||
urls: ['http://127.0.0.1:9999/_SpecRunner.html'], | ||
urls: ['http://localhost:9999/_SpecRunner.html'], | ||
tunnelTimeout: 5, | ||
@@ -296,0 +296,0 @@ build: process.env.TRAVIS_JOB_ID, |
{ | ||
"name": "medium-editor", | ||
"version": "5.23.2", | ||
"version": "5.23.3", | ||
"author": "Davi Ferreira <hi@daviferreira.com>", | ||
@@ -59,3 +59,3 @@ "contributors": [ | ||
"grunt-plato": "1.3.0", | ||
"grunt-sass": "1.1.0", | ||
"grunt-sass": "1.2.1", | ||
"grunt-saucelabs": "8.6.2", | ||
@@ -62,0 +62,0 @@ "grunt-template-jasmine-istanbul": "0.4.0", |
@@ -47,4 +47,4 @@ # MediumEditor | ||
```html | ||
<script src="//cdn.jsdelivr.net/medium-editor/latest/js/medium-editor.min.js"></script> | ||
<link rel="stylesheet" href="//cdn.jsdelivr.net/medium-editor/latest/css/medium-editor.min.css" type="text/css" media="screen" charset="utf-8"> | ||
<script src="//cdn.jsdelivr.net/npm/medium-editor@latest/dist/js/medium-editor.min.js"></script> | ||
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/medium-editor@latest/dist/css/medium-editor.min.css" type="text/css" media="screen" charset="utf-8"> | ||
``` | ||
@@ -55,4 +55,4 @@ | ||
```html | ||
<script src="//cdn.jsdelivr.net/medium-editor/4.11.1/js/medium-editor.min.js"></script> | ||
<link rel="stylesheet" href="//cdn.jsdelivr.net/medium-editor/4.11.1/css/medium-editor.min.css" type="text/css" media="screen" charset="utf-8"> | ||
<script src="//cdn.jsdelivr.net/npm/medium-editor@5.23.2/dist/js/medium-editor.min.js"></script> | ||
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/medium-editor@5.23.2/dist/css/medium-editor.min.css" type="text/css" media="screen" charset="utf-8"> | ||
``` | ||
@@ -59,0 +59,0 @@ |
@@ -416,4 +416,4 @@ /*global fireEvent, selectElementContentsAndFire */ | ||
container.style.position = 'absolute'; | ||
container.style.left = '100px'; | ||
container.style.top = '100px'; | ||
container.style.left = '200px'; | ||
container.style.top = '200px'; | ||
document.body.appendChild(container); | ||
@@ -438,6 +438,6 @@ | ||
// preview shows only after delay | ||
jasmine.clock().tick(1); | ||
jasmine.clock().tick(501); | ||
expect(anchorPreview.classList.contains('medium-editor-anchor-preview-active')).toBe(true); | ||
expect(parseInt(anchorPreview.style.left, 10)).toBeLessThan(100); | ||
expect(parseInt(anchorPreview.style.top, 10)).toBeLessThan(100); | ||
expect(parseInt(anchorPreview.style.left, 10)).toBeLessThan(200); | ||
expect(parseInt(anchorPreview.style.top, 10)).toBeLessThan(200); | ||
@@ -444,0 +444,0 @@ document.body.removeChild(container); |
@@ -463,3 +463,3 @@ /*global fireEvent, selectElementContentsAndFire */ | ||
it('should stop attempting to auto-link on keypress if an error is encountered', function () { | ||
var spy = spyOn(MediumEditor.extensions.autoLink.prototype, 'performLinking').and.throwError('DOM ERROR'); | ||
var spy = spyOn(MediumEditor.extensions.autoLink.prototype, 'performLinking'); | ||
@@ -474,3 +474,3 @@ this.el.innerHTML = '<span><a href="http://www.google.com>http://www.google.com</a></span>'; | ||
triggerAutolinking(this.el); | ||
expect(spy.calls.count()).toBe(1); | ||
expect(spy.calls.count()).toBe(2); | ||
}); | ||
@@ -477,0 +477,0 @@ |
@@ -434,2 +434,5 @@ /*global fireEvent, selectElementContentsAndFire, | ||
fireEvent(button, 'click'); | ||
this.el.innerHTML = stripAttrIfEmpty(this.el, 'style'); | ||
// style="font-weight: bold" prevents IE9+10 from doing anything when 'bold' is triggered | ||
@@ -511,2 +514,5 @@ // but it should work in other browsers | ||
fireEvent(button, 'click'); | ||
this.el.innerHTML = stripAttrIfEmpty(this.el, 'style'); | ||
// style="font-style: italic" prevents IE9+10 from doing anything when 'italic' is triggered | ||
@@ -571,2 +577,5 @@ // but it should work in other browsers | ||
fireEvent(button, 'click'); | ||
this.el.innerHTML = stripAttrIfEmpty(this.el, 'style'); | ||
// style="text-decoration: underline" prevents IE9+10 from doing anything when 'underline' is triggered | ||
@@ -631,2 +640,5 @@ // but it should work in other browsers | ||
fireEvent(button, 'click'); | ||
this.el.innerHTML = stripAttrIfEmpty(this.el, 'style'); | ||
// style="text-decoration: line-through" prevents IE9+10 from doing anything when 'strikethrough' is triggered | ||
@@ -1063,1 +1075,12 @@ // but it should work in other browsers | ||
}); | ||
function stripAttrIfEmpty(element, attribute) { | ||
// we want to strip empty attributes (especially styles, | ||
// because the tests create style tags, inject style content, | ||
// and then remove that style content. | ||
// | ||
// some browsers will remove empty attributes automatically. | ||
// | ||
// others (Chrome, seemingly) will not: | ||
return element.innerHTML.replace(attribute + '=""', ''); | ||
} |
@@ -652,3 +652,3 @@ /*global fireEvent, firePreparedEvent, | ||
}); | ||
expect(this.el.innerHTML).toBe('<p>lorem ipsum</p><ul><li></li><li>lorem ipsum</li></ul>'); | ||
expect(this.el.innerHTML).toMatch(/^<p>lorem ipsum<\/p><ul><li>(<br>)?<\/li><li>lorem ipsum<\/li><\/ul>$/); | ||
}); | ||
@@ -741,3 +741,3 @@ }); | ||
this.el.parentNode.removeChild(this.el); | ||
this.el = this.createElement('h1', 'editor', 'M'); | ||
this.el = this.createElement('h1', 'editor', 'Lorem ipsum dolor sit amet'); | ||
@@ -744,0 +744,0 @@ var editor = this.newMediumEditor('h1.editor'); |
@@ -217,6 +217,6 @@ /*global fireEvent, selectElementContents, | ||
this.el.textContent = '0'; | ||
this.el.textContent = '0. Lorem ipsum dolor sit amet'; | ||
for (i = 1; i < 3; i += 1) { | ||
el = this.createElement('div', 'editor'); | ||
el.textContent = i; | ||
el.textContent = i + '. Lorem ipsum dolor sit amet'; | ||
} | ||
@@ -336,3 +336,5 @@ | ||
var editor = this.newMediumEditor('.editor', { | ||
allowMultiParagraphSelection: false | ||
toolbar: { | ||
allowMultiParagraphSelection: false | ||
} | ||
}), | ||
@@ -373,4 +375,4 @@ toolbar = editor.getExtensionByName('toolbar'); | ||
container.style.position = 'absolute'; | ||
container.style.left = '100px'; | ||
container.style.top = '100px'; | ||
container.style.left = '200px'; | ||
container.style.top = '200px'; | ||
document.body.appendChild(container); | ||
@@ -387,4 +389,4 @@ | ||
expect(toolbar.classList.contains('medium-editor-toolbar-active')).toBe(true); | ||
expect(parseInt(toolbar.style.left, 10)).toBeLessThan(100); | ||
expect(parseInt(toolbar.style.top, 10)).toBeLessThan(100); | ||
expect(parseInt(toolbar.style.left, 10)).toBeLessThan(200); | ||
expect(parseInt(toolbar.style.top, 10)).toBeLessThan(200); | ||
@@ -391,0 +393,0 @@ document.body.removeChild(container); |
@@ -384,3 +384,3 @@ (function () { | ||
if (!div.hasAttribute(atts[i].nodeName)) { | ||
div.setAttribute(atts[i].nodeName, atts[i].nodeValue); | ||
div.setAttribute(atts[i].nodeName, atts[i].value); | ||
} | ||
@@ -387,0 +387,0 @@ } |
@@ -5,2 +5,6 @@ (function () { | ||
function isElementDescendantOfExtension(extensions, element) { | ||
if (!extensions) { | ||
return false; | ||
} | ||
return extensions.some(function (extension) { | ||
@@ -56,3 +60,3 @@ if (typeof extension.getInteractionElements !== 'function') { | ||
if (targets !== null) { | ||
if (targets) { | ||
targets = MediumEditor.util.isElement(targets) || [win, doc].indexOf(targets) > -1 ? [targets] : targets; | ||
@@ -59,0 +63,0 @@ |
@@ -208,2 +208,6 @@ (function () { | ||
if (!pastedPlain) { | ||
return; | ||
} | ||
if (!(this.getEditorOption('disableReturn') || (editable && editable.getAttribute('data-disable-return')))) { | ||
@@ -210,0 +214,0 @@ paragraphs = pastedPlain.split(/[\r\n]+/g); |
@@ -18,3 +18,3 @@ MediumEditor.parseVersionString = function (release) { | ||
// grunt-bump looks for this: | ||
'version': '5.23.2' | ||
'version': '5.23.3' | ||
}).version); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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 too big to display
Sorry, the diff of this file is not supported yet
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
1960597
25331
137