Version Description
- replaced deprecated JS functions due to jQuery 3.5 transition in WordPress 5.6-7
Download this release
Release Info
Developer | netweblogic |
Plugin | Login With Ajax |
Version | 3.1.11 |
Comparing to | |
See all releases |
Code changes from version 3.1.10 to 3.1.11
- login-with-ajax.php +3 -3
- readme.txt +5 -2
- widget/login-with-ajax.js +1 -1
- widget/login-with-ajax.source.js +4 -4
login-with-ajax.php
CHANGED
@@ -4,12 +4,12 @@ Plugin Name: Login With Ajax
|
|
4 |
Plugin URI: http://wordpress.org/extend/plugins/login-with-ajax/
|
5 |
Description: Ajax driven login widget. Customisable from within your template folder, and advanced settings from the admin area.
|
6 |
Author: Marcus Sykes
|
7 |
-
Version: 3.1.
|
8 |
Author URI: http://msyk.es/?utm_source=login-with-ajax&utm_medium=plugin-header&utm_campaign=plugins
|
9 |
Tags: Login, Ajax, Redirect, BuddyPress, MU, WPMU, sidebar, admin, widget
|
10 |
Text Domain: login-with-ajax
|
11 |
|
12 |
-
Copyright (C)
|
13 |
|
14 |
This program is free software; you can redistribute it and/or modify
|
15 |
it under the terms of the GNU General Public License as published by
|
@@ -24,7 +24,7 @@ GNU General Public License for more details.
|
|
24 |
You should have received a copy of the GNU General Public License
|
25 |
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
26 |
*/
|
27 |
-
define('LOGIN_WITH_AJAX_VERSION', '3.1.
|
28 |
class LoginWithAjax {
|
29 |
|
30 |
/**
|
4 |
Plugin URI: http://wordpress.org/extend/plugins/login-with-ajax/
|
5 |
Description: Ajax driven login widget. Customisable from within your template folder, and advanced settings from the admin area.
|
6 |
Author: Marcus Sykes
|
7 |
+
Version: 3.1.11
|
8 |
Author URI: http://msyk.es/?utm_source=login-with-ajax&utm_medium=plugin-header&utm_campaign=plugins
|
9 |
Tags: Login, Ajax, Redirect, BuddyPress, MU, WPMU, sidebar, admin, widget
|
10 |
Text Domain: login-with-ajax
|
11 |
|
12 |
+
Copyright (C) 2021 Pixelite SL
|
13 |
|
14 |
This program is free software; you can redistribute it and/or modify
|
15 |
it under the terms of the GNU General Public License as published by
|
24 |
You should have received a copy of the GNU General Public License
|
25 |
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
26 |
*/
|
27 |
+
define('LOGIN_WITH_AJAX_VERSION', '3.1.11');
|
28 |
class LoginWithAjax {
|
29 |
|
30 |
/**
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: netweblogic
|
|
3 |
Tags: login, ajax, ajax login, registration, redirect redirect, buddypress, multi site, sidebar, admin, widget
|
4 |
Text Domain: login-with-ajax
|
5 |
Requires at least: 4.8
|
6 |
-
Tested up to: 5.
|
7 |
-
Stable tag: 3.1.
|
8 |
Requires PHP: 5.2
|
9 |
License: GPLv2 or later
|
10 |
|
@@ -163,6 +163,9 @@ For further questions and answers (or to submit one yourself) go to our [https:/
|
|
163 |
|
164 |
|
165 |
== Changelog ==
|
|
|
|
|
|
|
166 |
= 3.1.10 =
|
167 |
* fixed bug where login via wp-admin is not possible when %LASTURL% is the default redirect action
|
168 |
|
3 |
Tags: login, ajax, ajax login, registration, redirect redirect, buddypress, multi site, sidebar, admin, widget
|
4 |
Text Domain: login-with-ajax
|
5 |
Requires at least: 4.8
|
6 |
+
Tested up to: 5.7
|
7 |
+
Stable tag: 3.1.11
|
8 |
Requires PHP: 5.2
|
9 |
License: GPLv2 or later
|
10 |
|
163 |
|
164 |
|
165 |
== Changelog ==
|
166 |
+
= 3.1.11 =
|
167 |
+
* replaced deprecated JS functions due to jQuery 3.5 transition in WordPress 5.6-7
|
168 |
+
|
169 |
= 3.1.10 =
|
170 |
* fixed bug where login via wp-admin is not possible when %LASTURL% is the default redirect action
|
171 |
|
widget/login-with-ajax.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(document).ready(function(
|
1 |
+
jQuery(document).ready(function($){if($("#LoginWithAjax").length>0){$("#LoginWithAjax").addClass("lwa");$("#LoginWithAjax_Status").addClass("lwa-status");$("#LoginWithAjax_Register").addClass("lwa-register");$("#LoginWithAjax_Remember").addClass("lwa-remember");$("#LoginWithAjax_Links_Remember").addClass("lwa-links-remember");$("#LoginWithAjax_Links_Remember_Cancel").addClass("lwa-links-remember-cancel");$("#LoginWithAjax_Form").addClass("lwa-form")}$("form.lwa-form, form.lwa-remember, div.lwa-register form").submit(function(event){event.preventDefault();var form=$(this);var statusElement=form.find(".lwa-status");if(statusElement.length==0){statusElement=$('<span class="lwa-status"></span>');form.prepend(statusElement)}var ajaxFlag=form.find(".lwa-ajax");if(ajaxFlag.length==0){ajaxFlag=$('<input class="lwa-ajax" name="lwa" type="hidden" value="1" />');form.prepend(ajaxFlag)}$('<div class="lwa-loading"></div>').prependTo(form);var form_action=form.attr("action");if(typeof LWA!=="undefined")form_action=LWA.ajaxurl;$.ajax({type:"POST",url:form_action,data:form.serialize(),success:function(data){lwaAjax(data,statusElement);$(document).trigger("lwa_"+data.action,[data,form])},error:function(){lwaAjax({},statusElement)},dataType:"jsonp"})});$(document).on("lwa_login",function(event,data,form){if(data.result===true){if(data.widget!=null){$.get(data.widget,function(widget_result){var newWidget=$(widget_result);form.parent(".lwa").replaceWith(newWidget);var lwaSub=newWidget.find(".").show();var lwaOrg=newWidget.parent().find(".lwa-title");lwaOrg.replaceWith(lwaSub)})}else{if(data.redirect==null){window.location.reload()}else{window.location=data.redirect}}}});$(".lwa-modal").each(function(i,e){var modal=$(e);modal.parents(".lwa").data("modal",modal);$("body").append($('<div class="lwa"></div>').append(modal))});$(document).on("click",".lwa-links-modal",function(e){var target=$(this).parents(".lwa").data("modal");if(typeof target!="undefined"&&target.length>0){e.preventDefault();target.reveal({modalbgclass:"lwa-modal-bg",dismissmodalclass:"lwa-modal-close"})}});$(".lwa-links-register-inline").on("click",function(event){var register_form=$(this).parents(".lwa").find(".lwa-register");if(register_form.length>0){event.preventDefault();register_form.show("slow");$(this).parents(".lwa").find(".lwa-remember").hide("slow")}});$(".lwa-links-register-inline-cancel").on("click",function(event){event.preventDefault();$(this).parents(".lwa-register").hide("slow")});$(document).on("click",".lwa-links-remember",function(event){var remember_form=$(this).parents(".lwa").find(".lwa-remember");if(remember_form.length>0){event.preventDefault();remember_form.show("slow");$(this).parents(".lwa").find(".lwa-register").hide("slow")}});$(document).on("click",".lwa-links-remember-cancel",function(event){event.preventDefault();$(this).parents(".lwa-remember").hide("slow")});function lwaAjax(data,statusElement){$(".lwa-loading").remove();statusElement=$(statusElement);if(data.result===true){statusElement.removeClass("lwa-status-invalid").addClass("lwa-status-confirm").html(data.message)}else if(data.result===false){statusElement.removeClass("lwa-status-confirm").addClass("lwa-status-invalid").html(data.error);statusElement.find("a").on("click",function(event){var remember_form=$(this).parents(".lwa").find("form.lwa-remember");if(remember_form.length>0){event.preventDefault();remember_form.show("slow")}})}else{statusElement.removeClass("lwa-status-confirm").addClass("lwa-status-invalid").html("An error has occured. Please try again.")}}});(function($){$("a[data-reveal-id]").on("click",function(e){e.preventDefault();var modalLocation=$(this).attr("data-reveal-id");$("#"+modalLocation).reveal($(this).data())});$.fn.reveal=function(options){var defaults={animation:"fadeAndPop",animationspeed:300,closeonbackgroundclick:true,dismissmodalclass:"close-reveal-modal",modalbgclass:"reveal-modal-bg"};var options=$.extend({},defaults,options);return this.each(function(){var modal=$(this),topMeasure=parseInt(modal.css("top")),topOffset=modal.height()+topMeasure,locked=false,modalBG=$("."+options.modalbgclass);if(modalBG.length==0){modalBG=$('<div class="'+options.modalbgclass+'" />').insertAfter(modal)}if(modal.find("."+options.dismissmodalclass).length==0){modal.append('<a class="'+options.dismissmodalclass+'">×</a>')}modal.bind("reveal:open",function(){modalBG.unbind("click.modalEvent");$("."+options.dismissmodalclass).unbind("click.modalEvent");if(!locked){lockModal();if(options.animation=="fadeAndPop"){modal.css({top:$(document).scrollTop()-topOffset,opacity:0,visibility:"visible",display:"block"});modalBG.fadeIn(options.animationspeed/2);modal.delay(options.animationspeed/2).animate({top:$(document).scrollTop()+topMeasure+"px",opacity:1},options.animationspeed,unlockModal())}if(options.animation=="fade"){modal.css({opacity:0,visibility:"visible",top:$(document).scrollTop()+topMeasure,display:"block"});modalBG.fadeIn(options.animationspeed/2);modal.delay(options.animationspeed/2).animate({opacity:1},options.animationspeed,unlockModal())}if(options.animation=="none"){modal.css({visibility:"visible",top:$(document).scrollTop()+topMeasure,display:"block"});modalBG.css({display:"block"});unlockModal()}}modal.unbind("reveal:open")});modal.bind("reveal:close",function(){if(!locked){lockModal();if(options.animation=="fadeAndPop"){modalBG.delay(options.animationspeed).fadeOut(options.animationspeed);modal.animate({top:$(document).scrollTop()-topOffset+"px",opacity:0},options.animationspeed/2,function(){modal.css({top:topMeasure,opacity:1,visibility:"hidden"});unlockModal()})}if(options.animation=="fade"){modalBG.delay(options.animationspeed).fadeOut(options.animationspeed);modal.animate({opacity:0},options.animationspeed,function(){modal.css({opacity:1,visibility:"hidden",top:topMeasure});unlockModal()})}if(options.animation=="none"){modal.css({visibility:"hidden",top:topMeasure});modalBG.css({display:"none"})}}modal.unbind("reveal:close")});modal.trigger("reveal:open");var closeButton=$("."+options.dismissmodalclass).bind("click.modalEvent",function(){modal.trigger("reveal:close")});if(options.closeonbackgroundclick){modalBG.css({cursor:"pointer"});modalBG.bind("click.modalEvent",function(){modal.trigger("reveal:close")})}$("body").on("keyup",function(e){if(e.which===27){modal.trigger("reveal:close")}});function unlockModal(){locked=false}function lockModal(){locked=true}})}})(jQuery);
|
widget/login-with-ajax.source.js
CHANGED
@@ -86,7 +86,7 @@ jQuery(document).ready( function($) {
|
|
86 |
}
|
87 |
});
|
88 |
//Register
|
89 |
-
$('.lwa-links-register-inline').click
|
90 |
var register_form = $(this).parents('.lwa').find('.lwa-register');
|
91 |
if( register_form.length > 0 ){
|
92 |
event.preventDefault();
|
@@ -94,7 +94,7 @@ jQuery(document).ready( function($) {
|
|
94 |
$(this).parents('.lwa').find('.lwa-remember').hide('slow');
|
95 |
}
|
96 |
});
|
97 |
-
$('.lwa-links-register-inline-cancel').click
|
98 |
event.preventDefault();
|
99 |
$(this).parents('.lwa-register').hide('slow');
|
100 |
});
|
@@ -125,7 +125,7 @@ jQuery(document).ready( function($) {
|
|
125 |
//Login Failed
|
126 |
statusElement.removeClass('lwa-status-confirm').addClass('lwa-status-invalid').html(data.error); //modify status content
|
127 |
//We assume a link in the status message is for a forgotten password
|
128 |
-
statusElement.find('a').click
|
129 |
var remember_form = $(this).parents('.lwa').find('form.lwa-remember');
|
130 |
if( remember_form.length > 0 ){
|
131 |
event.preventDefault();
|
@@ -285,7 +285,7 @@ jQuery(document).ready( function($) {
|
|
285 |
modal.trigger('reveal:close')
|
286 |
});
|
287 |
}
|
288 |
-
$('body').keyup
|
289 |
if(e.which===27){ modal.trigger('reveal:close'); } // 27 is the keycode for the Escape key
|
290 |
});
|
291 |
|
86 |
}
|
87 |
});
|
88 |
//Register
|
89 |
+
$('.lwa-links-register-inline').on('click', function(event){
|
90 |
var register_form = $(this).parents('.lwa').find('.lwa-register');
|
91 |
if( register_form.length > 0 ){
|
92 |
event.preventDefault();
|
94 |
$(this).parents('.lwa').find('.lwa-remember').hide('slow');
|
95 |
}
|
96 |
});
|
97 |
+
$('.lwa-links-register-inline-cancel').on('click', function(event){
|
98 |
event.preventDefault();
|
99 |
$(this).parents('.lwa-register').hide('slow');
|
100 |
});
|
125 |
//Login Failed
|
126 |
statusElement.removeClass('lwa-status-confirm').addClass('lwa-status-invalid').html(data.error); //modify status content
|
127 |
//We assume a link in the status message is for a forgotten password
|
128 |
+
statusElement.find('a').on('click', function(event){
|
129 |
var remember_form = $(this).parents('.lwa').find('form.lwa-remember');
|
130 |
if( remember_form.length > 0 ){
|
131 |
event.preventDefault();
|
285 |
modal.trigger('reveal:close')
|
286 |
});
|
287 |
}
|
288 |
+
$('body').on('keyup', function(e) {
|
289 |
if(e.which===27){ modal.trigger('reveal:close'); } // 27 is the keycode for the Escape key
|
290 |
});
|
291 |
|