From 30e3bd9d2b139737027ea60677c036224c0e806a Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 16 Jan 2007 18:10:54 +0000 Subject: [PATCH] Send to Editor fixes from mdawaffe. fixes #3594 git-svn-id: http://svn.automattic.com/wordpress/trunk@4748 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/upload-js.php | 12 ++++++------ wp-includes/post-template.php | 3 ++- wp-includes/script-loader.php | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/wp-admin/upload-js.php b/wp-admin/upload-js.php index 67d7a9ea11..bdf3d1ca46 100644 --- a/wp-admin/upload-js.php +++ b/wp-admin/upload-js.php @@ -56,7 +56,7 @@ addLoadEvent( function() { this.currentImage.width = false; this.currentImage.height = false; } - this.currentImage.isImage = ( 0 == id ? '' : $('attachment-is-image-' + id).value ); + this.currentImage.isImage = ( 0 == id ? 0 : $('attachment-is-image-' + id).value ); this.currentImage.ID = id; }, @@ -74,7 +74,7 @@ addLoadEvent( function() { h += "' class='back'>"; } h += "
" - if ( !this.currentImage.isImage ) + if ( 0 == this.currentImage.isImage ) h += "

'>" + this.currentImage.title + "

"; else h += "

" + this.currentImage.title + "

"; @@ -83,7 +83,7 @@ addLoadEvent( function() { h += ""; h += '
' h += "
"; - if ( this.currentImage.isImage ) { + if ( 1 == this.currentImage.isImage ) { h += "'>"; h += "" + this.currentImage.title + ""; h += ""; @@ -152,7 +152,7 @@ addLoadEvent( function() { h += "' class='back'>"; } h += "
" - if ( !this.currentImage.isImage ) + if ( 0 == this.currentImage.isImage ) h += "

'>" + this.currentImage.title + "

"; else h += "

" + this.currentImage.title + "

"; @@ -161,7 +161,7 @@ addLoadEvent( function() { h += ""; h += '
' h += "
"; - if ( this.currentImage.isImage ) { + if ( 1 == this.currentImage.isImage ) { h += "'>"; h += "" + this.currentImage.title + ""; h += ""; @@ -230,7 +230,7 @@ addLoadEvent( function() { displayEl = $A(document.forms.uploadoptions.elements.display).detect( function(i) { return i.checked; } ) if ( displayEl ) display = displayEl.value; - else if ( this.currentImage.isImage ) + else if ( 1 == this.currentImage.isImage ) display = 'full'; if ( 'none' != link ) diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index e05408ee1a..4951baaf8c 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -368,8 +368,9 @@ function get_attachment_icon_src( $id = 0, $fullsize = false ) { $src_file = $icon_dir . '/' . basename($src); } - if ( !isset($src) ) + if ( !isset($src) || !$src ) return false; + return array($src, $src_file); } diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 62521e0b3e..bcc8bc5fc1 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -38,7 +38,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'), '4583' ); $this->add( 'xfn', '/wp-admin/xfn.js', false, '3517' ); - $this->add( 'upload', '/wp-admin/upload-js.php', array('prototype'), '20061223' ); + $this->add( 'upload', '/wp-admin/upload-js.php', array('prototype'), '20070116' ); } }