diff --git a/CHANGES.md b/CHANGES.md index 459a1c3d5..2a8bf2bd4 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,8 @@ +2.3.1 / 2016-04-19 +================== + + * Fix UMD dependencies (#314) + * Fix extending editor's functions (#310, #316) 2.3.0 / 2016-04-12 ================== diff --git a/bower.json b/bower.json index d3e4cb05d..c81263034 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "medium-editor-insert-plugin", - "version": "2.3.0", + "version": "2.3.1", "description": "jQuery insert plugin for MediumEditor", "homepage": "http://linkesch.com/medium-editor-insert-plugin", "main": [ diff --git a/dist/css/medium-editor-insert-plugin-frontend.css b/dist/css/medium-editor-insert-plugin-frontend.css index 3f6e9653f..f1dd176e2 100644 --- a/dist/css/medium-editor-insert-plugin-frontend.css +++ b/dist/css/medium-editor-insert-plugin-frontend.css @@ -1,5 +1,5 @@ /*! - * medium-editor-insert-plugin v2.3.0 - jQuery insert plugin for MediumEditor + * medium-editor-insert-plugin v2.3.1 - jQuery insert plugin for MediumEditor * * http://linkesch.com/medium-editor-insert-plugin * diff --git a/dist/css/medium-editor-insert-plugin-frontend.min.css b/dist/css/medium-editor-insert-plugin-frontend.min.css index 499b7aa53..b3d5f5ea9 100644 --- a/dist/css/medium-editor-insert-plugin-frontend.min.css +++ b/dist/css/medium-editor-insert-plugin-frontend.min.css @@ -1,5 +1,5 @@ /*! - * medium-editor-insert-plugin v2.3.0 - jQuery insert plugin for MediumEditor + * medium-editor-insert-plugin v2.3.1 - jQuery insert plugin for MediumEditor * * http://linkesch.com/medium-editor-insert-plugin * diff --git a/dist/css/medium-editor-insert-plugin.css b/dist/css/medium-editor-insert-plugin.css index 1b4d8fbc7..58cffc08d 100644 --- a/dist/css/medium-editor-insert-plugin.css +++ b/dist/css/medium-editor-insert-plugin.css @@ -1,5 +1,5 @@ /*! - * medium-editor-insert-plugin v2.3.0 - jQuery insert plugin for MediumEditor + * medium-editor-insert-plugin v2.3.1 - jQuery insert plugin for MediumEditor * * http://linkesch.com/medium-editor-insert-plugin * diff --git a/dist/css/medium-editor-insert-plugin.min.css b/dist/css/medium-editor-insert-plugin.min.css index efb204245..22a54d35a 100644 --- a/dist/css/medium-editor-insert-plugin.min.css +++ b/dist/css/medium-editor-insert-plugin.min.css @@ -1,5 +1,5 @@ /*! - * medium-editor-insert-plugin v2.3.0 - jQuery insert plugin for MediumEditor + * medium-editor-insert-plugin v2.3.1 - jQuery insert plugin for MediumEditor * * http://linkesch.com/medium-editor-insert-plugin * diff --git a/dist/js/medium-editor-insert-plugin.js b/dist/js/medium-editor-insert-plugin.js index 2df8e06eb..b1f00adf3 100644 --- a/dist/js/medium-editor-insert-plugin.js +++ b/dist/js/medium-editor-insert-plugin.js @@ -1,5 +1,5 @@ /*! - * medium-editor-insert-plugin v2.3.0 - jQuery insert plugin for MediumEditor + * medium-editor-insert-plugin v2.3.1 - jQuery insert plugin for MediumEditor * * http://linkesch.com/medium-editor-insert-plugin * @@ -9,24 +9,28 @@ (function (factory) { if (typeof define === 'function' && define.amd) { - define(['jquery'], factory); + define(['jquery', 'handlebars', 'medium-editor', 'blueimp-file-upload', 'jquery-sortable'], factory); } else if (typeof module === 'object' && module.exports) { module.exports = function( root, jQuery ) { if ( jQuery === undefined ) { if ( typeof window !== 'undefined' ) { jQuery = require('jquery'); + Handlebars = require('handlebars'); + MediumEditor = require('medium-editor'); } else { jQuery = require('jquery')(root); + Handlebars = require('handlebars')(root); + MediumEditor = require('medium-editor')(root); } } - factory(jQuery); + factory(jQuery, Handlebars, MediumEditor); return jQuery; }; } else { - factory(jQuery); + factory(jQuery, Handlebars, MediumEditor); } -}(function ($) { +}(function ($, Handlebars, MediumEditor) { this["MediumInsert"] = this["MediumInsert"] || {}; this["MediumInsert"]["Templates"] = this["MediumInsert"]["Templates"] || {}; @@ -216,9 +220,15 @@ this["MediumInsert"]["Templates"]["src/js/templates/images-toolbar.hbs"] = Handl // Extend editor's functions if (this.options && this.options.editor) { - this.options.editor._serialize = this.options.editor.serialize; - this.options.editor._destroy = this.options.editor.destroy; - this.options.editor._setup = this.options.editor.setup; + if (this.options.editor._serialize === undefined) { + this.options.editor._serialize = this.options.editor.serialize; + } + if (this.options.editor._destroy === undefined) { + this.options.editor._destroy = this.options.editor.destroy; + } + if (this.options.editor._setup === undefined) { + this.options.editor._setup = this.options.editor.setup; + } this.options.editor._hideInsertButtons = this.hideButtons; this.options.editor.serialize = this.editorSerialize; @@ -317,7 +327,9 @@ this["MediumInsert"]["Templates"]["src/js/templates/images-toolbar.hbs"] = Handl Core.prototype.editorDestroy = function () { $.each(this.elements, function (key, el) { - $(el).data('plugin_' + pluginName).disable(); + if ($(el).data('plugin_' + pluginName) instanceof Core) { + $(el).data('plugin_' + pluginName).disable(); + } }); this._destroy(); @@ -333,7 +345,9 @@ this["MediumInsert"]["Templates"]["src/js/templates/images-toolbar.hbs"] = Handl this._setup(); $.each(this.elements, function (key, el) { - $(el).data('plugin_' + pluginName).enable(); + if ($(el).data('plugin_' + pluginName) instanceof Core) { + $(el).data('plugin_' + pluginName).enable(); + } }); }; diff --git a/dist/js/medium-editor-insert-plugin.min.js b/dist/js/medium-editor-insert-plugin.min.js index 2b0d1951e..ba29555e0 100644 --- a/dist/js/medium-editor-insert-plugin.min.js +++ b/dist/js/medium-editor-insert-plugin.min.js @@ -1,5 +1,5 @@ /*! - * medium-editor-insert-plugin v2.3.0 - jQuery insert plugin for MediumEditor + * medium-editor-insert-plugin v2.3.1 - jQuery insert plugin for MediumEditor * * http://linkesch.com/medium-editor-insert-plugin * @@ -7,5 +7,5 @@ * Released under the MIT license */ -!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c),c}:a(jQuery)}(function(a){this.MediumInsert=this.MediumInsert||{},this.MediumInsert.Templates=this.MediumInsert.Templates||{},this.MediumInsert.Templates["src/js/templates/core-buttons.hbs"]=Handlebars.template({1:function(a,b,c,d,e){var f,g,h=null!=b?b:{},i=c.helperMissing,j="function";return'
').replace(/^(https:\/\/www\.facebook\.com\/(.*))$/,'').replace(/^https?:\/\/instagram\.com\/p\/(.+)\/?$/,''),/<("[^"]*"|'[^']*'|[^'">])*>/.test(d)===!1?(a.proxy(this,"convertBadEmbed",b)(),!1):void(c?this.embed(d,b):this.embed(d))):(a.proxy(this,"convertBadEmbed",b)(),!1)},e.prototype.embed=function(b,c){var d,e=this.$el.find(".medium-insert-embeds-active");return b?(b.indexOf("")>-1&&(d=a("