X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/fa6ee2c363cdfdebcb4b76e4d9c4347a4cb19065..7f1521bf193b382565eb753043c161f4cb3fcda7:/wp-includes/js/tinymce/plugins/media/plugin.js diff --git a/wp-includes/js/tinymce/plugins/media/plugin.js b/wp-includes/js/tinymce/plugins/media/plugin.js index 3739f705..4507e6bf 100644 --- a/wp-includes/js/tinymce/plugins/media/plugin.js +++ b/wp-includes/js/tinymce/plugins/media/plugin.js @@ -24,6 +24,8 @@ tinymce.PluginManager.add('media', function(editor, url) { var embedChange = (tinymce.Env.ie && tinymce.Env.ie <= 8) ? 'onChange' : 'onInput'; function guessMime(url) { + url = url.toLowerCase(); + if (url.indexOf('.mp3') != -1) { return 'audio/mpeg'; } @@ -94,10 +96,16 @@ tinymce.PluginManager.add('media', function(editor, url) { if (win.find('#constrain')[0].checked() && width && height && newWidth && newHeight) { if (e.control == widthCtrl) { newHeight = Math.round((newWidth / width) * newHeight); - heightCtrl.value(newHeight); + + if (!isNaN(newHeight)) { + heightCtrl.value(newHeight); + } } else { newWidth = Math.round((newHeight / height) * newWidth); - widthCtrl.value(newWidth); + + if (!isNaN(newWidth)) { + widthCtrl.value(newWidth); + } } } @@ -121,9 +129,9 @@ tinymce.PluginManager.add('media', function(editor, url) { align: 'center', spacing: 5, items: [ - {name: 'width', type: 'textbox', maxLength: 3, size: 3, onchange: recalcSize}, + {name: 'width', type: 'textbox', maxLength: 5, size: 3, onchange: recalcSize, ariaLabel: 'Width'}, {type: 'label', text: 'x'}, - {name: 'height', type: 'textbox', maxLength: 3, size: 3, onchange: recalcSize}, + {name: 'height', type: 'textbox', maxLength: 5, size: 3, onchange: recalcSize, ariaLabel: 'Height'}, {name: 'constrain', type: 'checkbox', checked: true, text: 'Constrain proportions'} ] }); @@ -766,7 +774,7 @@ tinymce.PluginManager.add('media', function(editor, url) { editor.addMenuItem('media', { icon: 'media', - text: 'Insert video', + text: 'Insert/edit video', onclick: showDialog, context: 'insert', prependToContext: true