| 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 |
if ( typeof CodeMirror == 'function' && $( '#bws_newcontent_css' ).length > 0 ) { |
| 24 |
var editor = CodeMirror.fromTextArea( document.getElementById("bws_newcontent_css"), { |
| 25 |
mode: "css", |
| 26 |
theme: "default", |
| 27 |
styleActiveLine: true, |
| 28 |
matchBrackets: true, |
| 29 |
lineNumbers: true |
| 30 |
}); |
| 31 |
} |
| 32 |
}); |
| 33 |
})(jQuery); |