From 6def40697cf6b41a104d3de669777063d67a45e2 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Tue, 21 Nov 2006 20:10:01 +0000 Subject: [PATCH] Upload JS fixes from mdawaffe. fixes #3378 git-svn-id: https://develop.svn.wordpress.org/trunk@4510 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/upload-js.php | 9 +++++---- wp-includes/script-loader.php | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/wp-admin/upload-js.php b/wp-admin/upload-js.php index e221f57f42..ca51e3fe6c 100644 --- a/wp-admin/upload-js.php +++ b/wp-admin/upload-js.php @@ -233,9 +233,10 @@ addLoadEvent( function() { if ( !win ) win = top; tinyMCE = win.tinyMCE; - if ( typeof tinyMCE != 'undefined' && tinyMCE.getInstanceById('content') ) - win.tinyMCE.execCommand('mceInsertContent', false, h); - else + if ( typeof tinyMCE != 'undefined' && tinyMCE.getInstanceById('content') ) { + tinyMCE.selectedInstance.getWin().focus(); + tinyMCE.execCommand('mceInsertContent', false, h); + } else win.edInsertContent(win.edCanvas, h); if ( !this.ID ) this.cancelView(); @@ -243,7 +244,7 @@ addLoadEvent( function() { }, deleteFile: function(id) { - if ( confirm("") { + if ( confirm("") ) { $('action-value').value = 'delete'; $('upload-file').submit(); return true; diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index ca4f62803e..8caac47be5 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -30,7 +30,7 @@ class WP_Scripts { $this->add( 'admin-comments', '/wp-admin/edit-comments.js', array('listman'), '3847' ); $this->add( 'admin-users', '/wp-admin/users.js', array('listman'), '3684' ); $this->add( 'xfn', '/wp-admin/xfn.js', false, '3517' ); - $this->add( 'upload', '/wp-admin/upload-js.php', array('prototype'), '4466' ); + $this->add( 'upload', '/wp-admin/upload-js.php', array('prototype'), '####' ); } }