PluginProbe
PDF & Print by BestWebSoft – WordPress Posts and Pages PDF Generator Plugin / 1.9.1
PDF & Print by BestWebSoft – WordPress Posts and Pages PDF Generator Plugin v1.9.1
trunk 1.5 1.6 1.7 1.7.1 1.7.2 1.7.3 1.7.4 1.7.5 1.7.6 1.7.7 1.7.8 1.7.9 1.8.0 1.8.1 1.8.2 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 1.8.9 1.9.0 1.9.1 All 71 releases
pdf-print / bws_menu / js / general_script.js

general_script.js in PDF & Print by BestWebSoft – WordPress Posts and Pages PDF Generator Plugin 1.9.1, at bws_menu/js/general_script.js

60 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 function bws_show_settings_notice() {
2 (function($) {
3 $( '.updated.fade, .error' ).css( 'display', 'none' );
4 $( '#bws_save_settings_notice' ).css( 'display', 'block' );
5 })(jQuery);
6 }
7
8 (function($) {
9 $( document ).ready( function() {
10 /**
11 * add notice about changing on the settings page
12 */
13 $( '.bws_form input, .bws_form textarea, .bws_form select' ).bind( "change paste select", function() {
14 if ( $( this ).attr( 'type' ) != 'submit' && ! $( this ).hasClass( 'bws_no_bind_notice' ) ) {
15 bws_show_settings_notice();
16 };
17 });
18 $( '.bws_save_anchor' ).on( "click", function( event ) {
19 event.preventDefault();
20 $( '.bws_form #bws-submit-button' ).click();
21 });
22
23 /* custom code */
24 if ( typeof CodeMirror == 'function' ) {
25 if ( $( '#bws_newcontent_css' ).length > 0 ) {
26 var editor = CodeMirror.fromTextArea( document.getElementById( 'bws_newcontent_css' ), {
27 mode: "css",
28 theme: "default",
29 styleActiveLine: true,
30 matchBrackets: true,
31 lineNumbers: true,
32 });
33 }
34
35 if ( $( '#bws_newcontent_php' ).length > 0 ) {
36 var editor = CodeMirror.fromTextArea( document.getElementById( "bws_newcontent_php" ), {
37 mode: 'text/x-php',
38 styleActiveLine: true,
39 matchBrackets: true,
40 lineNumbers: true,
41 });
42 /* disable lines */
43 editor.markText( {ch:0,line:0}, {ch:0,line:5}, { readOnly: true, className: 'bws-readonly' } );
44 }
45 }
46
47 /* banner to settings */
48 $( '.bws_banner_to_settings_joint .bws-details' ).addClass( 'hidden' ).removeClass( 'hide-if-js' );
49 $( '.bws_banner_to_settings_joint .bws-more-links' ).on( "click", function( event ) {
50 event.preventDefault();
51 if ( $( '.bws_banner_to_settings_joint .bws-less' ).hasClass( 'hidden' ) ) {
52 $( '.bws_banner_to_settings_joint .bws-less, .bws_banner_to_settings_joint .bws-details' ).removeClass( 'hidden' );
53 $( '.bws_banner_to_settings_joint .bws-more' ).addClass( 'hidden' );
54 } else {
55 $( '.bws_banner_to_settings_joint .bws-less, .bws_banner_to_settings_joint .bws-details' ).addClass( 'hidden' );
56 $( '.bws_banner_to_settings_joint .bws-more' ).removeClass( 'hidden' );
57 }
58 });
59 });
60 })(jQuery);