]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/js/tinymce/plugins/media/plugin.js
WordPress 4.2
[autoinstalls/wordpress.git] / wp-includes / js / tinymce / plugins / media / plugin.js
index 3739f7051568a0a81804f965ae08b0cac68d0f03..4507e6bf81c4d42a1a302fbdfe988c2607d6675f 100644 (file)
@@ -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