image-widget
Last commit date
image-widget.js
16 years ago
image-widget.php
16 years ago
readme.txt
16 years ago
screenshot-1.png
16 years ago
image-widget.js
22 lines
| 1 | function set_active_widget(imageId,widthId,heightId) { |
| 2 | // establish which widget is being updated |
| 3 | currentImageId = imageId; |
| 4 | currentWidthId = widthId; |
| 5 | currentHeightId = heightId; |
| 6 | } |
| 7 | function send_to_editor(h) { |
| 8 | vars = eval(h); |
| 9 | |
| 10 | // store attachment id in hidden field |
| 11 | jQuery( '#'+currentImageId ).val( vars[0] ); |
| 12 | |
| 13 | // display attachment preview |
| 14 | jQuery( '#display-'+currentImageId ).html( vars[1] ); |
| 15 | jQuery( '#display-'+currentImageId+' > img' ).css({ |
| 16 | 'max-width':jQuery( '#'+currentWidthId ).val()+'px', |
| 17 | 'max-height':jQuery( '#'+currentHeightId ).val()+'px' |
| 18 | }); |
| 19 | |
| 20 | // close thickbox |
| 21 | tb_remove(); |
| 22 | } |