Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Many improvements #7

Closed
wants to merge 10 commits into from
645 changes: 425 additions & 220 deletions WP_Auth0.php
100755 → 100644

Large diffs are not rendered by default.

75 changes: 48 additions & 27 deletions assets/js/admin.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,52 @@
jQuery(document).ready(function($) {
//uploading files variable
var media_frame;
$(document).on('click', '#wpa0_choose_icon', function(event) {
event.preventDefault();
//If the frame already exists, reopen it
if (typeof(media_frame)!=="undefined")
//uploading files variable
var media_frame;
$(document).on('click', '#wpa0_choose_icon', function(event) {
event.preventDefault();
//If the frame already exists, reopen it
if (typeof(media_frame)!=="undefined")
media_frame.close();

//Create WP media frame.
media_frame = wp.media.frames.customHeader = wp.media({
title: wpa0.media_title,
library: {
type: 'image'
},
button: {
text: wpa0.media_button
},
multiple: false
});

// Set the frame callback
media_frame.on('select', function() {
var attachment = media_frame.state().get('selection').first().toJSON();
$('#wpa0_icon_url').val(attachment.url);
});

//Open modal
media_frame.open();
});
//Create WP media frame.
media_frame = wp.media.frames.customHeader = wp.media({
title: wpa0.media_title,
library: {
type: 'image'
},
button: {
text: wpa0.media_button
},
multiple: false
});

// Set the frame callback
media_frame.on('select', function() {
var attachment = media_frame.state().get('selection').first().toJSON();
$('#wpa0_icon_url').val(attachment.url);
});

//Open modal
media_frame.open();
});

function configureHideShowAutoLogin() {
// Hide/Show login method depending on auto login
var $loginMethodField = $("#wpa0_auto_login_method").closest("tr");
var $autoLoginCheckbox = $("#wpa0_auto_login");
if (!$autoLoginCheckbox.prop("checked")) {
$loginMethodField.hide();
}

$autoLoginCheckbox.change(function() {
if (!$autoLoginCheckbox.prop("checked")) {
$loginMethodField.hide();
} else {
$loginMethodField.show();
}

});
}

configureHideShowAutoLogin();

});
24 changes: 0 additions & 24 deletions assets/js/wp-login.js

This file was deleted.

Loading