Changeset 4670 for trunk/wp-admin/upload-js.php
- Timestamp:
- 01/02/2007 07:28:30 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/upload-js.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/upload-js.php
r4656 r4670 38 38 return; 39 39 var thumbEl = $('attachment-thumb-url-' + id); 40 this.currentImage.isImage = true;41 40 if ( thumbEl ) { 42 41 this.currentImage.thumb = ( 0 == id ? '' : thumbEl.value ); … … 44 43 } else { 45 44 this.currentImage.thumb = false; 46 var isImageEl = $('attachment-is-image-' + id);47 if ( !isImageEl )48 this.currentImage.isImage = false;49 45 } 50 46 this.currentImage.src = ( 0 == id ? '' : $('attachment-url-' + id).value ); … … 61 57 this.currentImage.height = false; 62 58 } 59 this.currentImage.isImage = ( 0 == id ? '' : $('attachment-is-image-' + id).value ); 63 60 this.currentImage.ID = id; 64 61 }, … … 97 94 h += "<form name='uploadoptions' id='uploadoptions' class='alignleft'>"; 98 95 h += "<table>"; 99 if ( this.currentImage.thumb ) { 96 var display = []; 97 var checked = 'display-title'; 98 if ( 1 == this.currentImage.isImage ) { 99 checked = 'display-full'; 100 if ( this.currentImage.thumb ) { 101 display.push("<label for='display-thumb'><input type='radio' name='display' id='display-thumb' value='thumb' /> <?php echo attribute_escape(__('Thumbnail')); ?></label><br />"); 102 checked = 'display-thumb'; 103 } 104 display.push("<label for='display-full'><input type='radio' name='display' id='display-full' value='full' /> <?php echo attribute_escape(__('Full size')); ?></label>"); 105 } else if ( this.currentImage.thumb ) { 106 display.push("<label for='display-thumb'><input type='radio' name='display' id='display-thumb' value='thumb' /> <?php echo attribute_escape(__('Icon')); ?></label>"); 107 } 108 if ( display.length ) { 109 display.push("<br /><label for='display-title'><input type='radio' name='display' id='display-title' value='title' /> <?php echo attribute_escape(__('Title')); ?></label>"); 100 110 h += "<tr><th style='padding-bottom:.5em'><?php echo attribute_escape(__('Show:')); ?></th><td style='padding-bottom:.5em'>"; 101 h += "<label for='display-thumb'><input type='radio' name='display' id='display-thumb' value='thumb' checked='checked' /> <?php echo attribute_escape(__('Thumbnail')); ?></label><br />"; 102 h += "<label for='display-full'><input type='radio' name='display' id='display-full' value='full' /> <?php echo attribute_escape(__('Full size')); ?></label>"; 111 $A(display).each( function(i) { h += i; } ); 103 112 h += "</td></tr>"; 104 113 } … … 118 127 119 128 new Insertion.Top('upload-content', h); 129 var displayEl = $(checked); 130 if ( displayEl ) 131 displayEl.checked = true; 132 120 133 if (e) Event.stop(e); 121 134 return false; … … 145 158 h += "<h2>" + this.currentImage.title + "</h2>"; 146 159 h += " — <span>"; 147 h += "<a href='#' onclick='return theFileList.imageView(" + id + ");'><?php attribute_escape(__('Insert')); ?></a>"160 h += "<a href='#' onclick='return theFileList.imageView(" + id + ");'><?php echo attribute_escape(__('Insert')); ?></a>" 148 161 h += "</span>"; 149 162 h += '</div>' … … 223 236 if ( 'none' != link ) 224 237 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 + "'>"; 225 if ( display )238 if ( display && 'title' != display ) 226 239 h += "<img src='" + ( 'thumb' == display ? ( this.currentImage.thumbBase + this.currentImage.thumb ) : ( this.currentImage.srcBase + this.currentImage.src ) ) + "' alt='" + this.currentImage.title + "' />"; 227 240 else
Note: See TracChangeset
for help on using the changeset viewer.