| 1 |
jQuery(document).ready(function() { |
| 2 |
jQuery('#upload_image_button').click(function() { |
| 3 |
formfield = jQuery('#upload_image').attr('name'); |
| 4 |
tb_show('', 'media-upload.php?type=image&TB_iframe=true'); |
| 5 |
return false; |
| 6 |
}); |
| 7 |
|
| 8 |
window.send_to_editor = function(html) { |
| 9 |
imgurl = jQuery('img',html).attr('src'); |
| 10 |
jQuery('#upload_image').val(imgurl); |
| 11 |
tb_remove(); |
| 12 |
} |
| 13 |
|
| 14 |
jQuery('.pf_show_list').change(function(){ |
| 15 |
if(jQuery(this).val()=='manual'){ |
| 16 |
jQuery('.pf_content_placement').attr('disabled','disabled'); |
| 17 |
}else{ |
| 18 |
jQuery('.pf_content_placement').removeAttr('disabled'); |
| 19 |
} |
| 20 |
}); |
| 21 |
|
| 22 |
jQuery('#colorSelector').ColorPicker({ |
| 23 |
color: jQuery('#pf_text_color').val(), |
| 24 |
onShow: function (colpkr) { |
| 25 |
jQuery(colpkr).fadeIn(500); |
| 26 |
return false; |
| 27 |
}, |
| 28 |
onHide: function (colpkr) { |
| 29 |
jQuery(colpkr).fadeOut(500); |
| 30 |
return false; |
| 31 |
}, |
| 32 |
onChange: function (hsb, hex, rgb) { |
| 33 |
jQuery('#colorSelector div').css('backgroundColor', '#' + hex); |
| 34 |
jQuery('#pf_text_color').val('#' + hex); |
| 35 |
jQuery('.preview_button span:not(.pf_tip)').css('color','#' + hex) |
| 36 |
} |
| 37 |
}); |
| 38 |
jQuery('#pf_text_size').change(function(){ |
| 39 |
pf_size_preview(); |
| 40 |
}); |
| 41 |
|
| 42 |
jQuery('#pf_text_size').keyup(function(){ |
| 43 |
pf_size_preview(); |
| 44 |
}); |
| 45 |
|
| 46 |
function pf_size_preview(){ |
| 47 |
size = jQuery('#pf_text_size').val(); |
| 48 |
jQuery('.preview_button span:not(.pf_tip)').css('font-size',parseInt(size)); |
| 49 |
} |
| 50 |
|
| 51 |
jQuery('#pf_custom_text').change(function(){ |
| 52 |
pf_custom_text_change(); |
| 53 |
}); |
| 54 |
|
| 55 |
jQuery('#pf_custom_text').keyup(function(){ |
| 56 |
pf_custom_text_change(); |
| 57 |
}); |
| 58 |
|
| 59 |
function pf_custom_text_change(){ |
| 60 |
if(text==''){ |
| 61 |
text ='Print Friendly'; |
| 62 |
}else{ |
| 63 |
if(jQuery('#pf_custom_image_label').find('span:not(.pf_tip)').length == 0){ |
| 64 |
color = jQuery('#pf_text_color').val(); |
| 65 |
size = jQuery('#pf_text_size').val(); |
| 66 |
jQuery('#pf_custom_image_label').find('img').after('<span style="marigin-left:3px; color: '+color+'; font-size:'+size+';"></span>'); |
| 67 |
} |
| 68 |
} |
| 69 |
text = jQuery('#pf_custom_text').val(); |
| 70 |
jQuery('.preview_button span:not(.pf_tip):not(.printandpdf)').text(text); |
| 71 |
} |
| 72 |
}); |