From 75e0ccc3a64e164d036da4f71f458520ddea3b24 Mon Sep 17 00:00:00 2001 From: donncha Date: Mon, 9 Oct 2006 11:39:17 +0000 Subject: WP Merge - needs testing. git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@797 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-admin/upload-js.php | 62 ++++++++++++++++++++++++++++++++------------------ 1 file changed, 40 insertions(+), 22 deletions(-) (limited to 'wp-admin/upload-js.php') diff --git a/wp-admin/upload-js.php b/wp-admin/upload-js.php index c03746f..4d5b21f 100644 --- a/wp-admin/upload-js.php +++ b/wp-admin/upload-js.php @@ -37,11 +37,18 @@ addLoadEvent( function() { if ( id == this.currentImage.ID ) return; var thumbEl = $('attachment-thumb-url-' + id); - if ( thumbEl ) + this.currentImage.isImage = true; + if ( thumbEl ) { this.currentImage.thumb = ( 0 == id ? '' : thumbEl.value ); - else + this.currentImage.thumbBase = ( 0 == id ? '' : $('attachment-thumb-url-base-' + id).value ); + } else { this.currentImage.thumb = false; + var isImageEl = $('attachment-is-image-' + id); + if ( !isImageEl ) + this.currentImage.isImage = false; + } this.currentImage.src = ( 0 == id ? '' : $('attachment-url-' + id).value ); + this.currentImage.srcBase = ( 0 == id ? '' : $('attachment-url-base-' + id).value ); this.currentImage.page = ( 0 == id ? '' : $('attachment-page-url-' + id).value ); this.currentImage.title = ( 0 == id ? '' : $('attachment-title-' + id).value ); this.currentImage.description = ( 0 == id ? '' : $('attachment-description-' + id).value ); @@ -65,13 +72,13 @@ addLoadEvent( function() { var params = $H(this.params); params.ID = ''; params.action = ''; - h += "« Back"; + h += "« Back"; } else { h += "« Back"; } h += "
" - if ( !this.currentImage.thumb ) - h += "

" + this.currentImage.title + "

"; + if ( !this.currentImage.isImage ) + h += "

" + this.currentImage.title + "

"; else h += "

" + this.currentImage.title + "

"; h += " — "; @@ -79,9 +86,11 @@ addLoadEvent( function() { h += ""; h += '
' h += "
"; - if ( this.currentImage.thumb ) - h += "" + this.currentImage.title + ""; - else + if ( this.currentImage.isImage ) { + h += ""; + h += "" + this.currentImage.title + ""; + h += ""; + } else h += ' '; h += "
"; @@ -119,6 +128,7 @@ addLoadEvent( function() { var action = 'upload.php?style=' + this.style + '&tab=upload'; if ( this.postID ) action += '&post_id=' + this.postID; + h += "
"; if ( this.ID ) { var params = $H(this.params); @@ -129,8 +139,8 @@ addLoadEvent( function() { h += "« Back"; } h += "
" - if ( !this.currentImage.thumb ) - h += "

" + this.currentImage.title + "

"; + if ( !this.currentImage.isImage ) + h += "

" + this.currentImage.title + "

"; else h += "

" + this.currentImage.title + "

"; h += " — "; @@ -138,26 +148,31 @@ addLoadEvent( function() { h += ""; h += '
' h += "
"; - if ( this.currentImage.thumb ) - h += "" + this.currentImage.title + ""; - else + if ( this.currentImage.isImage ) { + h += ""; + h += "" + this.currentImage.title + ""; + h += ""; + } else h += ' '; h += "
"; - h += "" - h += ""; + h += "
" + h += ""; + h += ""; + h += ""; + h += ""; h += ""; h += ""; - h += ""; + h += ""; h += ""; - h += "
"; + h += "
"; h += ""; h += ""; h += ""; h += ""; - h += "
"; - h += "
"; + h += "
"; + h += ""; new Insertion.Top('upload-content', h); if (e) Event.stop(e); @@ -202,11 +217,13 @@ 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 ) + display = 'full'; if ( 'none' != link ) - h += ""; + h += ""; if ( display ) - h += "" + this.currentImage.title + ""; + h += "" + this.currentImage.title + ""; else h += this.currentImage.title; if ( 'none' != link ) @@ -220,7 +237,8 @@ addLoadEvent( function() { win.tinyMCE.execCommand('mceInsertContent', false, h); else win.edInsertContent(win.edCanvas, h); - this.cancelView(); + if ( !this.ID ) + this.cancelView(); return false; }, -- cgit