PluginProbe
Print, PDF & Email by PrintFriendly / 3.0
Print, PDF & Email by PrintFriendly v3.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 3.0, at admin.js

69 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 // Throughout the admin I chose to use slow animations to make it clear that stuff is being hidden or shown depending on settings.
2 jQuery(document).ready(function() {
3 jQuery('.show_list').change(function() {
4 if (jQuery('.show_list:checked').val()=='manual') {
5 jQuery('#addmanual-help').show('slow');
6 jQuery('.content_placement').hide('slow');
7 jQuery('.content_placement input').attr('disabled','disabled');
8 } else {
9 jQuery('#addmanual-help').hide('slow');
10 jQuery('.content_placement').show('slow');
11 jQuery('.content_placement input').removeAttr('disabled');
12 }
13 });
14 if (jQuery('.show_list:checked').val()=='manual') {
15 jQuery('#addmanual-help').show('slow');
16 jQuery('.content_placement').hide();
17 jQuery('.content_placement input').attr('disabled','disabled');
18 }
19
20 jQuery('#colorSelector').ColorPicker({
21 color: jQuery('#text_color').val(),
22 onShow: function (colpkr) {
23 jQuery(colpkr).fadeIn(500);
24 return false;
25 },
26 onHide: function (colpkr) {
27 jQuery(colpkr).fadeOut(500);
28 return false;
29 },
30 onChange: function (hsb, hex, rgb) {
31 jQuery('#colorSelector div').css('backgroundColor', '#' + hex);
32 jQuery('#text_color').val('#' + hex);
33 jQuery('.printfriendly-text').css('color','#' + hex)
34 }
35 });
36
37 jQuery('#disable_css').change(function(){
38 if ( jQuery('#disable_css').is(':checked') ) {
39 jQuery('.css').show('slow');
40 jQuery('.css input').removeAttr('disabled');
41 } else {
42 jQuery('.css').hide('slow');
43 jQuery('.css input').attr('disabled','disabled');
44 }
45 });
46 if ( jQuery('#disable_css').not(':checked') ) {
47 jQuery('.css').hide();
48 jQuery('.css input').attr('disabled','disabled');
49 }
50
51 jQuery('#text_size').change(function(){
52 size = jQuery('#text_size').val();
53 jQuery('.printfriendly-text').css('font-size',parseInt(size));
54 }).change();
55
56 jQuery('#custom_text').change(function(){
57 pf_custom_text_change();
58 }).change();
59
60 jQuery('#custom_text').keyup(function(){
61 pf_custom_text_change();
62 });
63
64 function pf_custom_text_change(){
65 jQuery('.button_preview span:not(.printandpdf)').text( jQuery('#custom_text').val() );
66 }
67
68 jQuery('.printfriendly-text').css('color', jQuery('#text_color').val() );
69 });