]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/js/tinymce/plugins/media/plugin.js
WordPress 4.3-scripts
[autoinstalls/wordpress.git] / wp-includes / js / tinymce / plugins / media / plugin.js
index 3739f7051568a0a81804f965ae08b0cac68d0f03..10d4b0b85422366ad7693cb415b54b3178e576f7 100644 (file)
@@ -1,8 +1,8 @@
 /**
  * plugin.js
  *
- * Copyright, Moxiecode Systems AB
  * 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
@@ -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'}
                                ]
                        });
@@ -167,7 +175,7 @@ tinymce.PluginManager.add('media', function(editor, url) {
 
                                {
                                        title: 'Embed',
-                                       type: "panel",
+                                       type: "container",
                                        layout: 'flex',
                                        direction: 'column',
                                        align: 'stretch',
@@ -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