Files
b2b.redline.com.pl/modules/privateshoplite/views/js/authentication16.js
Jacek Pyziak 4d2561ce4e Add PrivateShop module templates and initial setup files
- Created restricted.tpl for displaying restricted access messages with customizable background options.
- Added index.php files in hook and main template directories to prevent direct access and ensure proper redirection.
- Implemented info.tpl to provide module information and support links, enhancing user experience with promotional content.
- Included necessary CSS styles for the new templates to ensure proper layout and responsiveness.
2025-07-04 01:27:12 +02:00

92 lines
2.2 KiB
JavaScript

/*
* PrivateShop
*
* Do not edit or add to this file.
* You are not authorized to modify, copy or redistribute this file.
* Permissions are reserved by FME Modules.
*
* @author FME Modules
* @copyright 2021 FME Modules All right reserved
* @license FME Modules
* @category FMM Modules
* @package PrivateShop
*/
$(document).ready(function(){
$(document).on('submit', '#create-account_form', function(e){
e.preventDefault();
submitFunction();
});
$('.is_customer_param').hide();
});
function submitFunction()
{
$('#create_account_error').html('').hide();
$.ajax({
type: 'POST',
url: baseUri + '?rand=' + new Date().getTime(),
async: true,
cache: false,
dataType : "json",
headers: { "cache-control": "no-cache" },
data:
{
controller: 'authentication',
SubmitCreate: 1,
ajax: true,
email_create: $('#email_create').val(),
back: $('input[name=back]').val(),
token: token
},
success: function(jsonData)
{
if (jsonData.hasError)
{
var errors = '';
for(error in jsonData.errors)
//IE6 bug fix
if(error != 'indexOf')
errors += '<li>' + jsonData.errors[error] + '</li>';
$('#create_account_error').html('<ol>' + errors + '</ol>').show();
}
else
{
// adding a div to display a transition
$('#wrapper').addClass('private_wrapper');
$('#center_column').html('<div id="noSlide">' + $('#center_column').html() + '</div>');
$('#noSlide').fadeOut('slow', function()
{
$('#noSlide').html(jsonData.page);
$(this).fadeIn('slow', function()
{
if (typeof bindUniform !=='undefined')
bindUniform();
if (typeof bindStateInputAndUpdate !=='undefined')
bindStateInputAndUpdate();
document.location = '#account-creation';
});
});
}
},
error: function(XMLHttpRequest, textStatus, errorThrown)
{
error = "TECHNICAL ERROR: unable to load form.\n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus;
if (!!$.prototype.fancybox)
{
$.fancybox.open([
{
type: 'inline',
autoScale: true,
minHeight: 30,
content: "<p class='fancybox-error'>" + error + '</p>'
}],
{
padding: 0
});
}
else
alert(error);
}
});
}