PHP Classes

File: engine/modules/core/user/js/user.js

Recommend this page to a friend!
  Classes of Aldo Tripiciano   Quanta CMS   engine/modules/core/user/js/user.js   Download  
File: engine/modules/core/user/js/user.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Quanta CMS
Manage content that works without a database
Author: By
Last change:
Date: 5 years ago
Size: 1,280 bytes
 

Contents

Class file image Download
/** * Request to open a login form. */ function logIn() { openShadow({ module: 'user', context: 'user_login', widget: 'single', components: ['user_login_form'] }); }; /** * Request to open a logout form. */ function logOut() { action('{"action": "logout"}'); }; /** * Request to open an user edit form. */ function user_edit(user_action) { openShadow({ module: 'user', context: user_action, widget: 'single', components: ['user_edit_form'] }); }; /** * When opening user login, put the focus on username field. */ $(document).bind('shadow_user_login', function () { $('#username').focus(); }); /** * Assign all click events. */ $(document).ready(function () { // Login. $('.login-link').click(function (e) { logIn(); e.preventDefault(); }); // Logout. $('.logout-link').click(function (e) { logOut(); e.preventDefault(); }); // User edit. $('.user-edit-link').click(function (e) { user_edit('user_edit'); e.preventDefault(); }); // User edit. $('.user-edit-own-link').click(function (e) { user_edit('user_edit_own'); e.preventDefault(); }); // Register. $('.register-link').click(function (e) { user_edit('user_register'); e.preventDefault(); }); });