Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Commit 8a102bd

Browse files
committed
v2.2.3
1 parent 1572950 commit 8a102bd

10 files changed

+28
-23
lines changed

CHANGES.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11

2+
2.2.3 / 2016-04-04
3+
==================
4+
5+
* Fix performance when uploading images
6+
* Update editor's `updatePlaceholder` function
7+
* Fix initializing plugin when editor's placeholder is turned off
8+
29
2.2.2 / 2016-02-27
310
==================
411

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "medium-editor-insert-plugin",
3-
"version": "2.2.2",
3+
"version": "2.2.3",
44
"description": "jQuery insert plugin for MediumEditor",
55
"main": [
66
"dist/js/medium-editor-insert-plugin.js",

dist/css/medium-editor-insert-plugin-frontend.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* medium-editor-insert-plugin v2.2.2 - jQuery insert plugin for MediumEditor
2+
* medium-editor-insert-plugin v2.2.3 - jQuery insert plugin for MediumEditor
33
*
44
* https://github.com/orthes/medium-editor-insert-plugin
55
*

dist/css/medium-editor-insert-plugin-frontend.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/css/medium-editor-insert-plugin.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* medium-editor-insert-plugin v2.2.2 - jQuery insert plugin for MediumEditor
2+
* medium-editor-insert-plugin v2.2.3 - jQuery insert plugin for MediumEditor
33
*
44
* https://github.com/orthes/medium-editor-insert-plugin
55
*

dist/css/medium-editor-insert-plugin.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/js/medium-editor-insert-plugin.js

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* medium-editor-insert-plugin v2.2.2 - jQuery insert plugin for MediumEditor
2+
* medium-editor-insert-plugin v2.2.3 - jQuery insert plugin for MediumEditor
33
*
44
* https://github.com/orthes/medium-editor-insert-plugin
55
*
@@ -89,9 +89,9 @@ this["MediumInsert"]["Templates"]["src/js/templates/images-image.hbs"] = Handleb
8989

9090
return "<figure contenteditable=\"false\">\n <img src=\""
9191
+ container.escapeExpression(((helper = (helper = helpers.img || (depth0 != null ? depth0.img : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(alias1,{"name":"img","hash":{},"data":data}) : helper)))
92-
+ "\" alt=\"\">\n"
92+
+ "\" alt=\"\" />\n"
9393
+ ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.progress : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
94-
+ "</figure>";
94+
+ "</figure>\n";
9595
},"useData":true});
9696

9797
this["MediumInsert"]["Templates"]["src/js/templates/images-progressbar.hbs"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
@@ -204,7 +204,9 @@ this["MediumInsert"]["Templates"]["src/js/templates/images-toolbar.hbs"] = Handl
204204
this.options.editor.destroy = this.editorDestroy;
205205
this.options.editor.setup = this.editorSetup;
206206

207-
this.options.editor.getExtensionByName('placeholder').updatePlaceholder = this.editorUpdatePlaceholder;
207+
if (this.options.editor.getExtensionByName('placeholder') !== undefined) {
208+
this.options.editor.getExtensionByName('placeholder').updatePlaceholder = this.editorUpdatePlaceholder;
209+
}
208210
}
209211
}
210212

@@ -320,11 +322,11 @@ this["MediumInsert"]["Templates"]["src/js/templates/images-toolbar.hbs"] = Handl
320322
* @return {void}
321323
*/
322324

323-
Core.prototype.editorUpdatePlaceholder = function (el) {
325+
Core.prototype.editorUpdatePlaceholder = function (el, dontShow) {
324326
var contents = $(el).children()
325327
.not('.medium-insert-buttons').contents();
326328

327-
if (contents.length === 1 && contents[0].nodeName.toLowerCase() === 'br') {
329+
if (!dontShow && contents.length === 1 && contents[0].nodeName.toLowerCase() === 'br') {
328330
this.showPlaceholder(el);
329331
this.base._hideInsertButtons($(el));
330332
} else {
@@ -432,11 +434,7 @@ this["MediumInsert"]["Templates"]["src/js/templates/images-toolbar.hbs"] = Handl
432434
return;
433435
}
434436

435-
// Fix #39
436-
// After deleting all content (ctrl+A and delete) in Firefox, all content is deleted and only <br> appears
437-
// To force placeholder to appear, set <p><br></p> as content of the $el
438-
439-
if (this.$el.html().trim() === '' || this.$el.html().trim() === '<br>') {
437+
if (this.$el.children().length === 0) {
440438
this.$el.html(this.templates['src/js/templates/core-empty-line.hbs']().trim());
441439
}
442440

@@ -445,7 +443,7 @@ this["MediumInsert"]["Templates"]["src/js/templates/images-toolbar.hbs"] = Handl
445443
$text = this.$el
446444
.contents()
447445
.filter(function () {
448-
return this.nodeName === '#text' && $.trim($(this).text()) !== '';
446+
return (this.nodeName === '#text' && $.trim($(this).text()) !== '') || this.nodeName.toLowerCase() === 'br';
449447
});
450448

451449
$text.each(function () {

dist/js/medium-editor-insert-plugin.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "medium-editor-insert-plugin",
3-
"version": "2.2.2",
3+
"version": "2.2.3",
44
"description": "jQuery insert plugin for MediumEditor",
55
"license": "MIT",
66
"homepage": "https://github.com/orthes/medium-editor-insert-plugin",

src/js/templates.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ this["MediumInsert"]["Templates"]["src/js/templates/images-image.hbs"] = Handleb
8080

8181
return "<figure contenteditable=\"false\">\n <img src=\""
8282
+ container.escapeExpression(((helper = (helper = helpers.img || (depth0 != null ? depth0.img : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(alias1,{"name":"img","hash":{},"data":data}) : helper)))
83-
+ "\" alt=\"\">\n"
83+
+ "\" alt=\"\" />\n"
8484
+ ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.progress : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
85-
+ "</figure>";
85+
+ "</figure>\n";
8686
},"useData":true});
8787

8888
this["MediumInsert"]["Templates"]["src/js/templates/images-progressbar.hbs"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {

0 commit comments

Comments
 (0)