Changeset 4355 for trunk/wp-admin/upload-js.php
- Timestamp:
- 10/07/2006 06:31:39 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/upload-js.php
r4349 r4355 38 38 return; 39 39 var thumbEl = $('attachment-thumb-url-' + id); 40 if ( thumbEl ) 40 this.currentImage.isImage = true; 41 if ( thumbEl ) { 41 42 this.currentImage.thumb = ( 0 == id ? '' : thumbEl.value ); 42 else 43 this.currentImage.thumbBase = ( 0 == id ? '' : $('attachment-thumb-url-base-' + id).value ); 44 } else { 43 45 this.currentImage.thumb = false; 46 var isImageEl = $('attachment-is-image-' + id); 47 if ( !isImageEl ) 48 this.currentImage.isImage = false; 49 } 44 50 this.currentImage.src = ( 0 == id ? '' : $('attachment-url-' + id).value ); 51 this.currentImage.srcBase = ( 0 == id ? '' : $('attachment-url-base-' + id).value ); 45 52 this.currentImage.page = ( 0 == id ? '' : $('attachment-page-url-' + id).value ); 46 53 this.currentImage.title = ( 0 == id ? '' : $('attachment-title-' + id).value ); … … 66 73 params.ID = ''; 67 74 params.action = ''; 68 h += "<a href='" + this.urlData[0] + '?' + params.toQueryString() + "' 75 h += "<a href='" + this.urlData[0] + '?' + params.toQueryString() + "' title='Browse your files' class='back'>« Back</a>"; 69 76 } else { 70 77 h += "<a href='#' onclick='theFileList.cancelView()' title='Browse your files' class='back'>« Back</a>"; 71 78 } 72 79 h += "<div id='file-title'>" 73 if ( !this.currentImage. thumb)74 h += "<h2><a href='" + this.currentImage.src + "' title='Direct link to file'>" + this.currentImage.title + "</a></h2>";80 if ( !this.currentImage.isImage ) 81 h += "<h2><a href='" + this.currentImage.src + "' onclick='return false;' title='Direct link to file'>" + this.currentImage.title + "</a></h2>"; 75 82 else 76 83 h += "<h2>" + this.currentImage.title + "</h2>"; … … 80 87 h += '</div>' 81 88 h += "<div id='upload-file-view' class='alignleft'>"; 82 if ( this.currentImage.thumb ) 83 h += "<a href='" + this.currentImage.src + "' title='Direct link to file'><img src='" + this.currentImage.thumb + "' alt='" + this.currentImage.title + "' width='" + this.currentImage.width + "' height='" + this.currentImage.height + "' /></a>"; 84 else 89 if ( this.currentImage.isImage ) { 90 h += "<a href='" + this.currentImage.src + "' onclick='return false;' title='Direct link to file'>"; 91 h += "<img src='" + ( this.currentImage.thumb ? this.currentImage.thumb : this.currentImage.src ) + "' alt='" + this.currentImage.title + "' width='" + this.currentImage.width + "' height='" + this.currentImage.height + "' />"; 92 h += "</a>"; 93 } else 85 94 h += ' '; 86 95 h += "</div>"; … … 120 129 if ( this.postID ) 121 130 action += '&post_id=' + this.postID; 131 122 132 h += "<form id='upload-file' method='post' action='" + action + "'>"; 123 133 if ( this.ID ) { … … 130 140 } 131 141 h += "<div id='file-title'>" 132 if ( !this.currentImage. thumb)133 h += "<h2><a href='" + this.currentImage.src + "' title='Direct link to file'>" + this.currentImage.title + "</a></h2>";142 if ( !this.currentImage.isImage ) 143 h += "<h2><a href='" + this.currentImage.src + "' onclick='return false;' title='Direct link to file'>" + this.currentImage.title + "</a></h2>"; 134 144 else 135 145 h += "<h2>" + this.currentImage.title + "</h2>"; … … 139 149 h += '</div>' 140 150 h += "<div id='upload-file-view' class='alignleft'>"; 141 if ( this.currentImage.thumb ) 142 h += "<a href='" + this.currentImage.src + "' title='Direct link to file'><img src='" + this.currentImage.thumb + "' alt='" + this.currentImage.title + "' width='" + this.currentImage.width + "' height='" + this.currentImage.height + "' /></a>"; 143 else 151 if ( this.currentImage.isImage ) { 152 h += "<a href='" + this.currentImage.src + "' onclick='return false;' title='Direct link to file'>"; 153 h += "<img src='" + ( this.currentImage.thumb ? this.currentImage.thumb : this.currentImage.src ) + "' alt='" + this.currentImage.title + "' width='" + this.currentImage.width + "' height='" + this.currentImage.height + "' />"; 154 h += "</a>"; 155 } else 144 156 h += ' '; 145 157 h += "</div>"; 146 158 147 159 148 h += "<table><tr>" 149 h += "<th scope='row'><label for='post_title'>Title:</label></th>"; 160 h += "<table><col /><col class='widefat' /><tr>" 161 h += "<th scope='row'><label for='url'>URL</label></th>"; 162 h += "<td><input type='text' id='url' class='readonly' value='" + this.currentImage.src + "' readonly='readonly' /></td>"; 163 h += "</tr><tr>"; 164 h += "<th scope='row'><label for='post_title'>Title</label></th>"; 150 165 h += "<td><input type='text' id='post_title' name='post_title' value='" + this.currentImage.title + "' /></td>"; 151 166 h += "</tr><tr>"; 152 h += "<th scope='row'><label for='post_content'>Description :</label></th>";167 h += "<th scope='row'><label for='post_content'>Description</label></th>"; 153 168 h += "<td><textarea name='post_content' id='post_content'>" + this.currentImage.description + "</textarea></td>"; 154 h += "</tr><tr id='buttons' ><th><input type='button' name='delete' class='delete button' value='Delete' onclick='theFileList.deleteFile(" + id + ");' /></th><td>";169 h += "</tr><tr id='buttons' class='submit'><td colspan='2'><input type='button' id='delete' name='delete' class='delete alignleft' value='Delete File' onclick='theFileList.deleteFile(" + id + ");' />"; 155 170 h += "<input type='hidden' name='from_tab' value='" + this.tab + "' />"; 156 171 h += "<input type='hidden' name='action' id='action-value' value='save' />"; 157 172 h += "<input type='hidden' name='ID' value='" + id + "' />"; 158 173 h += "<input type='hidden' name='_wpnonce' value='" + this.nonce + "' />"; 159 h += "<div class='submit'><input type='submit' value='Save »' /> ";160 h += "</ div></td></tr></table></form>";174 h += "<div class='submit'><input type='submit' value='Save »' /></div>"; 175 h += "</td></tr></table></form>"; 161 176 162 177 new Insertion.Top('upload-content', h); … … 203 218 if ( displayEl ) 204 219 display = displayEl.value; 220 else if ( this.currentImage.isImage ) 221 display = 'full'; 205 222 206 223 if ( 'none' != link ) 207 h += "<a href='" + ( 'file' == link ? this.currentImage.src : this.currentImage.page) + "' title='" + this.currentImage.title + "'>";224 h += "<a href='" + ( 'file' == link ? ( this.currentImage.srcBase + this.currentImage.src ) : ( this.currentImage.page + "' rel='attachment" ) ) + "' title='" + this.currentImage.title + "'>"; 208 225 if ( display ) 209 h += "<img src='" + ( 'thumb' == display ? this.currentImage.thumb : this.currentImage.src) + "' alt='" + this.currentImage.title + "' />";226 h += "<img src='" + ( 'thumb' == display ? ( this.currentImage.thumbBase + this.currentImage.thumb ) : ( this.currentImage.srcBase + this.currentImage.src ) ) + "' alt='" + this.currentImage.title + "' />"; 210 227 else 211 228 h += this.currentImage.title; … … 221 238 else 222 239 win.edInsertContent(win.edCanvas, h); 223 this.cancelView(); 240 if ( !this.ID ) 241 this.cancelView(); 224 242 return false; 225 243 },
Note: See TracChangeset
for help on using the changeset viewer.