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

Commit

Permalink
version 1.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
linkesch committed Apr 13, 2015
1 parent c4bb170 commit f8b7305
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 28 deletions.
9 changes: 9 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@

1.5.1 / 2015-04-13
==================

* Don't add empty paragraph on image deletion, when empty paragraph already exists
* Fix clicking on placeholder in FF
* Hide editor's placeholder on image upload
* Use https for instagram and vimeo
* Ensure core is ```enabled``` when ```selectEmbed``` or ```selectImage``` are called

1.5.0 / 2015-04-02
==================

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": "1.5.0",
"version": "1.5.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 v1.5.0 - jQuery insert plugin for MediumEditor
* medium-editor-insert-plugin v1.5.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 v1.5.0 - jQuery insert plugin for MediumEditor
* medium-editor-insert-plugin v1.5.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.

47 changes: 28 additions & 19 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 v1.5.0 - jQuery insert plugin for MediumEditor
* medium-editor-insert-plugin v1.5.1 - jQuery insert plugin for MediumEditor
*
* https://github.com/orthes/medium-editor-insert-plugin
*
Expand Down Expand Up @@ -546,6 +546,11 @@ this["MediumInsert"]["Templates"]["src/js/templates/images-toolbar.hbs"] = Handl
$current = $(range.commonAncestorContainer);
}

// When user clicks on editor's placeholder in FF, $current el is editor itself, not the first paragraph as it should
if ($current.hasClass('medium-editor-insert-plugin')) {
$current = $current.find('p:first');
}

$p = $current.is('p') ? $current : $current.closest('p');

this.clean();
Expand All @@ -558,7 +563,7 @@ this["MediumInsert"]["Templates"]["src/js/templates/images-toolbar.hbs"] = Handl
if ($el.closest('.medium-insert-'+ addon).length) {
$current = $el;
}

if ($current.closest('.medium-insert-'+ addon).length) {
$p = $current.closest('.medium-insert-'+ addon);
activeAddon = addon;
Expand Down Expand Up @@ -595,7 +600,7 @@ this["MediumInsert"]["Templates"]["src/js/templates/images-toolbar.hbs"] = Handl

if (activeAddon) {
$buttons.find('li').hide();
$buttons.find('a[data-addon="'+ activeAddon +'"]').parent().show();
$buttons.find('a[data-addon="'+ activeAddon +'"]').parent().show();
}
};

Expand Down Expand Up @@ -1188,9 +1193,9 @@ this["MediumInsert"]["Templates"]["src/js/templates/images-toolbar.hbs"] = Handl
if(this.getCore().options.enabled) {
var $embed = $(e.target).hasClass('medium-insert-embeds') ? $(e.target) : $(e.target).closest('.medium-insert-embeds'),
that = this;

$embed.addClass('medium-insert-embeds-selected');

setTimeout(function () {
that.addToolbar();
that.getCore().addCaption($embed.find('figure'), that.options.captionPlaceholder);
Expand Down Expand Up @@ -1427,9 +1432,9 @@ this["MediumInsert"]["Templates"]["src/js/templates/images-toolbar.hbs"] = Handl
label: '<span class="fa fa-times"></span>',
clicked: function () {
var $event = $.Event('keydown');

$event.which = 8;
$(document).trigger($event);
$(document).trigger($event);
}
}
},
Expand Down Expand Up @@ -1688,7 +1693,6 @@ this["MediumInsert"]["Templates"]["src/js/templates/images-toolbar.hbs"] = Handl
var $el = $.proxy(this, 'showImage', data.result.files[0].url, data)();

this.getCore().clean();

this.sorting();

if (this.options.uploadCompleted) {
Expand All @@ -1704,7 +1708,11 @@ this["MediumInsert"]["Templates"]["src/js/templates/images-toolbar.hbs"] = Handl
*/

Images.prototype.showImage = function (img, data) {
var $place, domImage;
var $place = this.$el.find('.medium-insert-active'),
domImage;

// Hide editor's placeholder
$place.click();

// If preview is allowed and preview image already exists,
// replace it with uploaded image
Expand All @@ -1715,8 +1723,6 @@ this["MediumInsert"]["Templates"]["src/js/templates/images-toolbar.hbs"] = Handl
};
domImage.src = img;
} else {
$place = this.$el.find('.medium-insert-active');

data.context = $(this.templates['src/js/templates/images-image.hbs']({
img: img,
progress: this.options.preview
Expand All @@ -1727,9 +1733,9 @@ this["MediumInsert"]["Templates"]["src/js/templates/images-toolbar.hbs"] = Handl
if (this.options.autoGrid && $place.find('figure').length >= this.options.autoGrid) {
$.each(this.options.styles, function (style, options) {
var className = 'medium-insert-images-'+ style;

$place.removeClass(className);

if (options.removed) {
options.removed($place);
}
Expand Down Expand Up @@ -1767,13 +1773,13 @@ this["MediumInsert"]["Templates"]["src/js/templates/images-toolbar.hbs"] = Handl
if(this.getCore().options.enabled) {
var $image = $(e.target),
that = this;

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

$image.addClass('medium-insert-image-active');
$image.closest('.medium-insert-images').addClass('medium-insert-active');

setTimeout(function () {
that.addToolbar();
that.getCore().addCaption($image.closest('figure'), that.options.captionPlaceholder);
Expand Down Expand Up @@ -1833,8 +1839,11 @@ this["MediumInsert"]["Templates"]["src/js/templates/images-toolbar.hbs"] = Handl
$('.medium-insert-images-toolbar, .medium-insert-images-toolbar2').remove();

if ($parent.find('figure').length === 0) {
$empty = $(this.templates['src/js/templates/core-empty-line.hbs']().trim());
$parent.before($empty);
$empty = $parent.next();
if ($empty.is('p') === false || $empty.text() !== '') {
$empty = $(this.templates['src/js/templates/core-empty-line.hbs']().trim());
$parent.before($empty);
}
$parent.remove();

// Hide addons
Expand Down Expand Up @@ -1969,7 +1978,7 @@ this["MediumInsert"]["Templates"]["src/js/templates/images-toolbar.hbs"] = Handl
}

this.getCore().hideButtons();

this.$el.trigger('input');
};

Expand Down
7 changes: 4 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": "1.5.0",
"version": "1.5.1",
"description": "jQuery insert plugin for MediumEditor",
"license": "MIT",
"homepage": "https://github.com/orthes/medium-editor-insert-plugin",
Expand Down

0 comments on commit f8b7305

Please sign in to comment.