Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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