Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jQuery(document).ready(function() {
- (function(){ var tb_show_temp = window.tb_show; window.tb_show = function(){ tb_show_temp.apply(null, arguments);
- var iframe = jQuery('#TB_iframeContent');
- iframe.load(function(){
- var iframeDoc = iframe[0].contentWindow.document;
- var iframeJQuery = iframe[0].contentWindow.jQuery;
- var buttonContainer = iframeJQuery('tr.submit td:first-child');
- // Only do stuff if we find a sensible button container
- if (buttonContainer){
- var button = iframeDoc.createElement('button');
- button.type = 'button';
- button.appendChild(iframeDoc.createTextNode('Insert'));
- // Click event of some description
- iframeJQuery(button).click(function(){
- var imgurl = iframeJQuery('.thumbnail').attr('src');
- jQuery('#upload_image').val(imgurl);
- tb_remove();
- })
- buttonContainer.append(button);
- }
- });
- }})()
- jQuery('#upload_image_button').click(function() {
- formfield = jQuery('#upload_image').attr('name');
- //tb_show('Test', 'media-upload.php?type=image&tab=library&TB_iframe=true');
- tb_show('Test', 'media-upload.php?type=image&TB_iframe=1');
- return false;
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement