Digitalraindrops

drfp-script.js

Dec 31st, 2010
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. jQuery(document).ready(function() {
  2.    
  3.     var formfield;
  4.    
  5.     jQuery('.upload_image_button').click(function() {
  6.         formfield = jQuery(this).attr('name');
  7.         var postid = jQuery(this).attr('title');
  8.         //tb_show('', 'media-upload.php?type=image&TB_iframe=true');
  9.         tb_show('','media-upload.php?post_id='+ postid +'&type=image&tab=library&TB_iframe=true');
  10.         return false;
  11.     });
  12.    
  13.     window.send_to_editor = function(html) {
  14.          imgurl = jQuery('img',html).attr('src');
  15.          jQuery('#' + formfield ).val(imgurl);
  16.          tb_remove();
  17.     }
  18. });
Add Comment
Please, Sign In to add comment