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

Commit

Permalink
v2.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
linkesch committed Feb 5, 2016
1 parent d964f57 commit 947bfef
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 24 deletions.
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@

2.2.1 / 2016-02-05
==================

* Fix when `uploadCompleted()` is called - wait until uploaded image replaces preview
* Fix uploading high quality images
* Fix bug when an image toolbar action effects all instances of the editor (when using multiple editors on the same page)

2.2.0 / 2016-01-11
==================

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "medium-editor-insert-plugin",
"version": "2.2.0",
"version": "2.2.1",
"description": "jQuery insert plugin for MediumEditor",
"main": [
"dist/js/medium-editor-insert-plugin.js",
Expand Down
2 changes: 1 addition & 1 deletion dist/css/medium-editor-insert-plugin-frontend.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* medium-editor-insert-plugin v2.2.0 - jQuery insert plugin for MediumEditor
* medium-editor-insert-plugin v2.2.1 - jQuery insert plugin for MediumEditor
*
* https://github.com/orthes/medium-editor-insert-plugin
*
Expand Down
2 changes: 1 addition & 1 deletion dist/css/medium-editor-insert-plugin-frontend.min.css

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

2 changes: 1 addition & 1 deletion dist/css/medium-editor-insert-plugin.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* medium-editor-insert-plugin v2.2.0 - jQuery insert plugin for MediumEditor
* medium-editor-insert-plugin v2.2.1 - jQuery insert plugin for MediumEditor
*
* https://github.com/orthes/medium-editor-insert-plugin
*
Expand Down
2 changes: 1 addition & 1 deletion dist/css/medium-editor-insert-plugin.min.css

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

34 changes: 19 additions & 15 deletions dist/js/medium-editor-insert-plugin.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* medium-editor-insert-plugin v2.2.0 - jQuery insert plugin for MediumEditor
* medium-editor-insert-plugin v2.2.1 - jQuery insert plugin for MediumEditor
*
* https://github.com/orthes/medium-editor-insert-plugin
*
Expand Down Expand Up @@ -315,15 +315,10 @@ this["MediumInsert"]["Templates"]["src/js/templates/images-toolbar.hbs"] = Handl
*/

Core.prototype.editorUpdatePlaceholder = function (el) {
var $clone = $(el).clone(),
cloneHtml;
var contents = $(el).children()
.not('.medium-insert-buttons').contents();

$clone.find('.medium-insert-buttons').remove();
cloneHtml = $clone.html()
.replace(/^\s+|\s+$/g, '')
.replace(/^<p( class="medium-insert-active")?><br><\/p>$/, '');

if (!(el.querySelector('img, blockquote')) && cloneHtml === '') {
if (contents.length === 1 && contents[0].nodeName.toLowerCase() === 'br') {
this.showPlaceholder(el);
this.base._hideInsertButtons($(el));
} else {
Expand Down Expand Up @@ -1484,6 +1479,7 @@ this["MediumInsert"]["Templates"]["src/js/templates/images-toolbar.hbs"] = Handl
function Images (el, options) {
this.el = el;
this.$el = $(el);
this.$currentImage = null;
this.templates = window.MediumInsert.Templates;
this.core = this.$el.data('plugin_'+ pluginName);

Expand Down Expand Up @@ -1735,14 +1731,10 @@ this["MediumInsert"]["Templates"]["src/js/templates/images-toolbar.hbs"] = Handl
*/

Images.prototype.uploadDone = function (e, data) {
var $el = $.proxy(this, 'showImage', data.result.files[0].url, data)();
$.proxy(this, 'showImage', data.result.files[0].url, data)();

this.core.clean();
this.sorting();

if (this.options.uploadCompleted) {
this.options.uploadCompleted($el, data);
}
};

/**
Expand All @@ -1767,8 +1759,13 @@ this["MediumInsert"]["Templates"]["src/js/templates/images-toolbar.hbs"] = Handl
domImage = this.getDOMImage();
domImage.onload = function () {
data.context.find('img').attr('src', domImage.src);

if (this.options.uploadCompleted) {
this.options.uploadCompleted(data.context, data);
}

that.core.triggerInput();
};
}.bind(this);
domImage.src = img;
} else {
data.context = $(this.templates['src/js/templates/images-image.hbs']({
Expand Down Expand Up @@ -1798,6 +1795,8 @@ this["MediumInsert"]["Templates"]["src/js/templates/images-toolbar.hbs"] = Handl

if (this.options.preview) {
data.submit();
} else if (this.options.uploadCompleted) {
this.options.uploadCompleted(data.context, data);
}
}

Expand All @@ -1822,6 +1821,8 @@ this["MediumInsert"]["Templates"]["src/js/templates/images-toolbar.hbs"] = Handl
var $image = $(e.target),
that = this;

this.$currentImage = $image;

// Hide keyboard on mobile devices
this.$el.blur();

Expand Down Expand Up @@ -1864,6 +1865,7 @@ this["MediumInsert"]["Templates"]["src/js/templates/images-toolbar.hbs"] = Handl
} else if ($el.is('figcaption') === false) {
this.core.removeCaptions();
}
this.$currentImage = null;
};

/**
Expand Down Expand Up @@ -1990,6 +1992,7 @@ this["MediumInsert"]["Templates"]["src/js/templates/images-toolbar.hbs"] = Handl
*/

Images.prototype.toolbarAction = function (e) {
if (this.$currentImage === null) return;
var $button = $(e.target).is('button') ? $(e.target) : $(e.target).closest('button'),
$li = $button.closest('li'),
$ul = $li.closest('ul'),
Expand Down Expand Up @@ -2031,6 +2034,7 @@ this["MediumInsert"]["Templates"]["src/js/templates/images-toolbar.hbs"] = Handl
*/

Images.prototype.toolbar2Action = function (e) {
if (this.$currentImage === null) return;
var $button = $(e.target).is('button') ? $(e.target) : $(e.target).closest('button'),
callback = this.options.actions[$button.data('action')].clicked;

Expand Down
6 changes: 3 additions & 3 deletions dist/js/medium-editor-insert-plugin.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "medium-editor-insert-plugin",
"version": "2.2.0",
"version": "2.2.1",
"description": "jQuery insert plugin for MediumEditor",
"license": "MIT",
"homepage": "https://github.com/orthes/medium-editor-insert-plugin",
Expand Down

0 comments on commit 947bfef

Please sign in to comment.