PluginProbe
Passster – Password Protect Pages and Content / 3.5.4
Passster – Password Protect Pages and Content v3.5.4
4.3.16 4.3.15 4.3.14 4.3.12 4.3.13 4.3.11 4.3.10 4.3.9 4.3.8 4.3.7 4.3.6 4.3.5 trunk 3.5.4 3.5.5.2 3.5.5.8 3.5.5.9 4.0 4.1.4 4.2.10 4.2.11 4.2.12 4.2.13 4.2.14 4.2.15 All 48 releases
content-protector / assets / admin / passster-admin.js

passster-admin.js in Passster – Password Protect Pages and Content 3.5.4, at assets/admin/passster-admin.js

68 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
3 // page restriction conditional fields.
4 var ps_selected = $('#passster-protection-type').find('option:selected').val();
5 ps_show_selected(ps_selected);
6
7 $('#passster-protection-type').on('change', function(){
8 value = $(this).find('option:selected').val();
9 ps_show_selected(value);
10
11 });
12
13 function ps_show_selected( value ) {
14 if ('password' === value ) {
15 $('#passster-password').parent().show();
16 } else {
17 $('#passster-password').parent().hide();
18 }
19
20 if ('passwords' === value ) {
21 $('#passster-passwords').parent().show();
22 } else {
23 $('#passster-passwords').parent().hide();
24 }
25
26 if ('password_list' === value ) {
27 $('#passster-password-list').parent().show();
28 } else {
29 $('#passster-password-list').parent().hide();
30 }
31
32 if ('api' === value ) {
33 $('#passster-api').parent().show();
34 } else {
35 $('#passster-api').parent().hide();
36 }
37 }
38
39 /* premium indicator */
40 $("input.premium").attr('disabled', 'disabled');
41 let td = $("input.premium").parent();
42 $(td).append('<span class="pro">PRO</span>');
43
44 // toggle admin notice if clicked.
45 $( '.passster-notice button.notice-dismiss' ).on( 'click', function() {
46 var data = { 'action': 'passster_dismiss_notice' };
47
48 $.post( ps_admin_ajax.ajax_url, data, function( response ) {
49 });
50 });
51
52 // reset usage data.
53 $('#passster-reset-usage-data').on('click', function(e) {
54 $.ajax({
55 type: 'post',
56 dataType: 'json',
57 url: ps_admin_ajax.ajax_url,
58 data: { 'action': 'reset_usage_data', 'nonce' : ps_admin_ajax.nonce },
59 success: function(response){
60 if ( true === response.success ) {
61 $('#passster-reset-success').append( ps_admin_ajax.reset_message );
62 }
63 }
64 });
65 });
66 });
67
68