Send to Editor fixes from mdawaffe. fixes #3594

git-svn-id: http://svn.automattic.com/wordpress/trunk@4748 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2007-01-16 18:10:54 +00:00
parent 132569c301
commit 30e3bd9d2b
3 changed files with 9 additions and 8 deletions

View File

@ -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 += "<a href='#' onclick='return theFileList.cancelView();' title='<?php echo attribute_escape(__('Browse your files')); ?>' class='back'><?php echo attribute_escape(__('&laquo; Back')) ?></a>";
}
h += "<div id='file-title'>"
if ( !this.currentImage.isImage )
if ( 0 == this.currentImage.isImage )
h += "<h2><a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='<?php echo attribute_escape(__('Direct link to file')); ?>'>" + this.currentImage.title + "</a></h2>";
else
h += "<h2>" + this.currentImage.title + "</h2>";
@ -83,7 +83,7 @@ addLoadEvent( function() {
h += "</span>";
h += '</div>'
h += "<div id='upload-file-view' class='alignleft'>";
if ( this.currentImage.isImage ) {
if ( 1 == this.currentImage.isImage ) {
h += "<a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='<?php echo attribute_escape(__('Direct link to file')); ?>'>";
h += "<img src='" + ( this.currentImage.thumb ? this.currentImage.thumb : this.currentImage.src ) + "' alt='" + this.currentImage.title + "' width='" + this.currentImage.width + "' height='" + this.currentImage.height + "' />";
h += "</a>";
@ -152,7 +152,7 @@ addLoadEvent( function() {
h += "<a href='#' onclick='return theFileList.cancelView();' title='<?php echo attribute_escape(__('Browse your files')); ?>' class='back'><?php echo attribute_escape(__('&laquo; Back')); ?></a>";
}
h += "<div id='file-title'>"
if ( !this.currentImage.isImage )
if ( 0 == this.currentImage.isImage )
h += "<h2><a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='<?php echo attribute_escape(__('Direct link to file')); ?>'>" + this.currentImage.title + "</a></h2>";
else
h += "<h2>" + this.currentImage.title + "</h2>";
@ -161,7 +161,7 @@ addLoadEvent( function() {
h += "</span>";
h += '</div>'
h += "<div id='upload-file-view' class='alignleft'>";
if ( this.currentImage.isImage ) {
if ( 1 == this.currentImage.isImage ) {
h += "<a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='<?php echo wp_specialchars(__('Direct link to file')); ?>'>";
h += "<img src='" + ( this.currentImage.thumb ? this.currentImage.thumb : this.currentImage.src ) + "' alt='" + this.currentImage.title + "' width='" + this.currentImage.width + "' height='" + this.currentImage.height + "' />";
h += "</a>";
@ -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 )

View File

@ -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);
}

View File

@ -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' );
}
}