/** * plugin.js * * Released under LGPL License. * Copyright (c) 1999-2015 Ephox Corp. All rights reserved * * License: http://www.tinymce.com/license * Contributing: http://www.tinymce.com/contributing */ /*global tinymce:true */ tinymce.PluginManager.add('image', function(editor) { function getImageSize(url, callback) { var img = document.createElement('img'); function done(width, height) { if (img.parentNode) { img.parentNode.removeChild(img); } callback({width: width, height: height}); } img.onload = function() { done(Math.max(img.width, img.clientWidth), Math.max(img.height, img.clientHeight)); }; img.onerror = function() { done(); }; var styl