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

Commit

Permalink
add backwards compatibility to embeds
Browse files Browse the repository at this point in the history
  • Loading branch information
linkesch committed Feb 23, 2015
1 parent 66ba0f0 commit 3961a20
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 11 deletions.
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.1.0",
"version": "1.1.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.1.0 - jQuery insert plugin for MediumEditor
* medium-editor-insert-plugin v1.1.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.1.0 - jQuery insert plugin for MediumEditor
* medium-editor-insert-plugin v1.1.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.

15 changes: 13 additions & 2 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.1.0 - jQuery insert plugin for MediumEditor
* medium-editor-insert-plugin v1.1.1 - jQuery insert plugin for MediumEditor
*
* https://github.com/orthes/medium-editor-insert-plugin
*
Expand Down Expand Up @@ -760,15 +760,26 @@ this["MediumInsert"]["Templates"]["src/js/templates/images-toolbar.hbs"] = Handl
};

/**
* Replace v0.* class names with new ones
* Replace v0.* class names with new ones, wrap embedded content to new structure
*
* @return {void}
*/

Embeds.prototype.backwardsCompatibility = function () {
var that = this;

this.$el.find('.mediumInsert-embeds')
.removeClass('mediumInsert-embeds')
.addClass('medium-insert-embeds');

this.$el.find('.medium-insert-embeds').each(function () {
if ($(this).find('.medium-insert-embed').length === 0) {
$(this).after(that.templates['src/js/templates/embeds-wrapper.hbs']({
html: $(this).html()
}));
$(this).remove();
}
});
};

/**
Expand Down
4 changes: 2 additions & 2 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.1.0",
"version": "1.1.1",
"description": "jQuery insert plugin for MediumEditor",
"license": "MIT",
"homepage": "https://github.com/orthes/medium-editor-insert-plugin",
Expand Down
13 changes: 12 additions & 1 deletion src/js/embeds.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,26 @@
};

/**
* Replace v0.* class names with new ones
* Replace v0.* class names with new ones, wrap embedded content to new structure
*
* @return {void}
*/

Embeds.prototype.backwardsCompatibility = function () {
var that = this;

this.$el.find('.mediumInsert-embeds')
.removeClass('mediumInsert-embeds')
.addClass('medium-insert-embeds');

this.$el.find('.medium-insert-embeds').each(function () {
if ($(this).find('.medium-insert-embed').length === 0) {
$(this).after(that.templates['src/js/templates/embeds-wrapper.hbs']({
html: $(this).html()
}));
$(this).remove();
}
});
};

/**
Expand Down

0 comments on commit 3961a20

Please sign in to comment.