diff options
| author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-01-04 13:20:38 +0000 |
|---|---|---|
| committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-01-04 13:20:38 +0000 |
| commit | 861bd9122e6d9ee710df2b6fc0a1222a8a8965cf (patch) | |
| tree | da5020f0e73f0f0ee5f8466250ce041fe22a53d0 /wp-admin/upload-js.php | |
| parent | d71327104baa1c83106f008a3ed11aee70edc50d (diff) | |
| download | wordpress-mu-861bd9122e6d9ee710df2b6fc0a1222a8a8965cf.tar.gz wordpress-mu-861bd9122e6d9ee710df2b6fc0a1222a8a8965cf.tar.xz wordpress-mu-861bd9122e6d9ee710df2b6fc0a1222a8a8965cf.zip | |
WP Merge to 4674
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@830 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-admin/upload-js.php')
| -rw-r--r-- | wp-admin/upload-js.php | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/wp-admin/upload-js.php b/wp-admin/upload-js.php index e5a65f2..67d7a9e 100644 --- a/wp-admin/upload-js.php +++ b/wp-admin/upload-js.php @@ -37,15 +37,11 @@ addLoadEvent( function() { if ( id == this.currentImage.ID ) return; var thumbEl = $('attachment-thumb-url-' + id); - this.currentImage.isImage = true; if ( thumbEl ) { this.currentImage.thumb = ( 0 == id ? '' : thumbEl.value ); 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 ); @@ -60,6 +56,7 @@ addLoadEvent( function() { this.currentImage.width = false; this.currentImage.height = false; } + this.currentImage.isImage = ( 0 == id ? '' : $('attachment-is-image-' + id).value ); this.currentImage.ID = id; }, @@ -96,10 +93,22 @@ addLoadEvent( function() { h += "<form name='uploadoptions' id='uploadoptions' class='alignleft'>"; h += "<table>"; - if ( this.currentImage.thumb ) { + var display = []; + var checked = 'display-title'; + if ( 1 == this.currentImage.isImage ) { + checked = 'display-full'; + if ( this.currentImage.thumb ) { + display.push("<label for='display-thumb'><input type='radio' name='display' id='display-thumb' value='thumb' /> <?php echo attribute_escape(__('Thumbnail')); ?></label><br />"); + checked = 'display-thumb'; + } + display.push("<label for='display-full'><input type='radio' name='display' id='display-full' value='full' /> <?php echo attribute_escape(__('Full size')); ?></label>"); + } else if ( this.currentImage.thumb ) { + display.push("<label for='display-thumb'><input type='radio' name='display' id='display-thumb' value='thumb' /> <?php echo attribute_escape(__('Icon')); ?></label>"); + } + if ( display.length ) { + display.push("<br /><label for='display-title'><input type='radio' name='display' id='display-title' value='title' /> <?php echo attribute_escape(__('Title')); ?></label>"); h += "<tr><th style='padding-bottom:.5em'><?php echo attribute_escape(__('Show:')); ?></th><td style='padding-bottom:.5em'>"; - h += "<label for='display-thumb'><input type='radio' name='display' id='display-thumb' value='thumb' checked='checked' /> <?php echo attribute_escape(__('Thumbnail')); ?></label><br />"; - h += "<label for='display-full'><input type='radio' name='display' id='display-full' value='full' /> <?php echo attribute_escape(__('Full size')); ?></label>"; + $A(display).each( function(i) { h += i; } ); h += "</td></tr>"; } @@ -117,6 +126,10 @@ addLoadEvent( function() { h += "</div>"; new Insertion.Top('upload-content', h); + var displayEl = $(checked); + if ( displayEl ) + displayEl.checked = true; + if (e) Event.stop(e); return false; }, @@ -144,7 +157,7 @@ addLoadEvent( function() { else h += "<h2>" + this.currentImage.title + "</h2>"; h += " — <span>"; - h += "<a href='#' onclick='return theFileList.imageView(" + id + ");'><?php attribute_escape(__('Insert')); ?></a>" + h += "<a href='#' onclick='return theFileList.imageView(" + id + ");'><?php echo attribute_escape(__('Insert')); ?></a>" h += "</span>"; h += '</div>' h += "<div id='upload-file-view' class='alignleft'>"; @@ -222,7 +235,7 @@ addLoadEvent( function() { if ( 'none' != link ) h += "<a href='" + ( 'file' == link ? ( this.currentImage.srcBase + this.currentImage.src ) : ( this.currentImage.page + "' rel='attachment wp-att-" + this.currentImage.ID ) ) + "' title='" + this.currentImage.title + "'>"; - if ( display ) + if ( display && 'title' != display ) h += "<img src='" + ( 'thumb' == display ? ( this.currentImage.thumbBase + this.currentImage.thumb ) : ( this.currentImage.srcBase + this.currentImage.src ) ) + "' alt='" + this.currentImage.title + "' />"; else h += this.currentImage.title; |
