-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1824051
commit 7408662
Showing
2 changed files
with
68 additions
and
6 deletions.
There are no files selected for viewing
42 changes: 37 additions & 5 deletions
42
auth_signup_upgraded/static/src/js/extended_signup_view.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,52 @@ | ||
/** @odoo-module **/ | ||
|
||
import publicWidget from "@web/legacy/js/public/public_widget"; | ||
import publicWidget from '@web/legacy/js/public/public_widget'; | ||
import { _t } from '@web/core'; | ||
|
||
console.log('Button ssdsd'); | ||
console.log('Module Loaded: Extended Signup View with Autosave and Toggle Password'); | ||
|
||
// Autosave functionality (Extended Signup View) | ||
publicWidget.registry.ExtendedSignup = publicWidget.Widget.extend({ | ||
selector: '.o_extended_signup', | ||
|
||
events: { | ||
'change input': '_onFieldChange', // Detect field changes | ||
}, | ||
|
||
_onFieldChange: function (event) { | ||
// Llamada al autosave cuando los campos cambian | ||
this._autosave(); | ||
}, | ||
|
||
_autosave: function () { | ||
// Lógica para cambiar el estado del autosave en el frontend | ||
var saveButton = $('#autosave_button'); | ||
var statusText = $('#autosave_status'); | ||
saveButton.addClass('autosaving'); | ||
statusText.text(_t('Saving...')); // Text in the appropriate language | ||
|
||
// Simulación de autosave (cambiar a "Saved" después de un tiempo) | ||
setTimeout(function () { | ||
saveButton.removeClass('autosaving').addClass('saved'); | ||
statusText.text(_t('Saved')); | ||
}, 2000); // Cambia a "Saved" después de 2 segundos | ||
} | ||
}); | ||
|
||
// Toggle Password functionality | ||
publicWidget.registry.SignUpForm = publicWidget.Widget.extend({ | ||
selector: '#togglePassword', | ||
selector: '#togglePassword', // Selector for the toggle button | ||
events: { | ||
'click': '_onClick', | ||
'click': '_onClick', // Detect click event to toggle password visibility | ||
}, | ||
|
||
_onClick: function (ev) { | ||
var passwordField = document.getElementById('password'); | ||
// Toggle password visibility | ||
if (passwordField.type === 'password') { | ||
passwordField.type = 'text'; | ||
} else { | ||
passwordField.type = 'password'; | ||
} | ||
} | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters