PluginProbe
Print, PDF & Email by PrintFriendly / 2.0
Print, PDF & Email by PrintFriendly v2.0
5.5.12 5.5.11 trunk 0.2 0.9 1.0 2.0 2.1.8 3.0 3.0.9 3.1.6 3.10.0 3.11.0 3.11.1 3.11.2 3.12.0 3.12.1 3.12.2 3.12.3 3.12.4 3.12.5 3.13.0 3.14.0 3.14.1 3.14.2 All 94 releases
printfriendly / admin.js

admin.js in Print, PDF & Email by PrintFriendly 2.0, at admin.js

72 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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 });