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

Commit 288cc42

Browse files
committed
v2.3.1
1 parent e19bf31 commit 288cc42

9 files changed

+38
-19
lines changed

CHANGES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2.3.1 / 2016-04-19
2+
==================
3+
4+
* Fix UMD dependencies (#314)
5+
* Fix extending editor's functions (#310, #316)
16

27
2.3.0 / 2016-04-12
38
==================

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.3.0",
3+
"version": "2.3.1",
44
"description": "jQuery insert plugin for MediumEditor",
55
"homepage": "http://linkesch.com/medium-editor-insert-plugin",
66
"main": [

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.3.0 - jQuery insert plugin for MediumEditor
2+
* medium-editor-insert-plugin v2.3.1 - jQuery insert plugin for MediumEditor
33
*
44
* http://linkesch.com/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.3.0 - jQuery insert plugin for MediumEditor
2+
* medium-editor-insert-plugin v2.3.1 - jQuery insert plugin for MediumEditor
33
*
44
* http://linkesch.com/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: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* medium-editor-insert-plugin v2.3.0 - jQuery insert plugin for MediumEditor
2+
* medium-editor-insert-plugin v2.3.1 - jQuery insert plugin for MediumEditor
33
*
44
* http://linkesch.com/medium-editor-insert-plugin
55
*
@@ -9,24 +9,28 @@
99

1010
(function (factory) {
1111
if (typeof define === 'function' && define.amd) {
12-
define(['jquery'], factory);
12+
define(['jquery', 'handlebars', 'medium-editor', 'blueimp-file-upload', 'jquery-sortable'], factory);
1313
} else if (typeof module === 'object' && module.exports) {
1414
module.exports = function( root, jQuery ) {
1515
if ( jQuery === undefined ) {
1616
if ( typeof window !== 'undefined' ) {
1717
jQuery = require('jquery');
18+
Handlebars = require('handlebars');
19+
MediumEditor = require('medium-editor');
1820
}
1921
else {
2022
jQuery = require('jquery')(root);
23+
Handlebars = require('handlebars')(root);
24+
MediumEditor = require('medium-editor')(root);
2125
}
2226
}
23-
factory(jQuery);
27+
factory(jQuery, Handlebars, MediumEditor);
2428
return jQuery;
2529
};
2630
} else {
27-
factory(jQuery);
31+
factory(jQuery, Handlebars, MediumEditor);
2832
}
29-
}(function ($) {
33+
}(function ($, Handlebars, MediumEditor) {
3034

3135
this["MediumInsert"] = this["MediumInsert"] || {};
3236
this["MediumInsert"]["Templates"] = this["MediumInsert"]["Templates"] || {};
@@ -216,9 +220,15 @@ this["MediumInsert"]["Templates"]["src/js/templates/images-toolbar.hbs"] = Handl
216220

217221
// Extend editor's functions
218222
if (this.options && this.options.editor) {
219-
this.options.editor._serialize = this.options.editor.serialize;
220-
this.options.editor._destroy = this.options.editor.destroy;
221-
this.options.editor._setup = this.options.editor.setup;
223+
if (this.options.editor._serialize === undefined) {
224+
this.options.editor._serialize = this.options.editor.serialize;
225+
}
226+
if (this.options.editor._destroy === undefined) {
227+
this.options.editor._destroy = this.options.editor.destroy;
228+
}
229+
if (this.options.editor._setup === undefined) {
230+
this.options.editor._setup = this.options.editor.setup;
231+
}
222232
this.options.editor._hideInsertButtons = this.hideButtons;
223233

224234
this.options.editor.serialize = this.editorSerialize;
@@ -317,7 +327,9 @@ this["MediumInsert"]["Templates"]["src/js/templates/images-toolbar.hbs"] = Handl
317327

318328
Core.prototype.editorDestroy = function () {
319329
$.each(this.elements, function (key, el) {
320-
$(el).data('plugin_' + pluginName).disable();
330+
if ($(el).data('plugin_' + pluginName) instanceof Core) {
331+
$(el).data('plugin_' + pluginName).disable();
332+
}
321333
});
322334

323335
this._destroy();
@@ -333,7 +345,9 @@ this["MediumInsert"]["Templates"]["src/js/templates/images-toolbar.hbs"] = Handl
333345
this._setup();
334346

335347
$.each(this.elements, function (key, el) {
336-
$(el).data('plugin_' + pluginName).enable();
348+
if ($(el).data('plugin_' + pluginName) instanceof Core) {
349+
$(el).data('plugin_' + pluginName).enable();
350+
}
337351
});
338352
};
339353

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.3.0",
3+
"version": "2.3.1",
44
"description": "jQuery insert plugin for MediumEditor",
55
"main": "dist/js/medium-editor-insert-plugin.js",
66
"homepage": "http://linkesch.com/medium-editor-insert-plugin",

0 commit comments

Comments
 (0)