-
+
Test Custom Cotton Config
@@ -439,73 +439,89 @@
}));
});
- // Store references to both modal instances
- document.addEventListener('DOMContentLoaded', function() {
- // Wait for Alpine.js to initialize and modal instances to be created
- setTimeout(() => {
- // Both modals should now be available with their respective window keys
- console.log('Auth Modal References:', {
- original: window.authModalOriginal,
- cotton: window.authModalCotton,
- custom: window.authModalCustom
- });
- }, 500);
- });
+ // Auth Modal Test Suite Component
+ Alpine.data('authModalTestSuite', () => ({
+ init() {
+ // Wait for Alpine.js to initialize and modal instances to be created
+ setTimeout(() => {
+ console.log('Auth Modal References:', {
+ original: window.authModalOriginal,
+ cotton: window.authModalCotton,
+ custom: window.authModalCustom
+ });
+ }, 500);
+ },
- // Test functions
- function openOriginalModalInMode(mode) {
- if (window.authModalOriginal) {
- window.authModalOriginal.mode = mode;
- window.authModalOriginal.open = true;
- }
- }
+ openOriginalModal() {
+ if (window.authModalOriginal) {
+ window.authModalOriginal.open = true;
+ }
+ },
- function openCottonModalInMode(mode) {
- if (window.authModalCotton) {
- window.authModalCotton.mode = mode;
- window.authModalCotton.open = true;
- }
- }
+ openCottonModal() {
+ if (window.authModalCotton) {
+ window.authModalCotton.open = true;
+ }
+ },
- function testOriginalInteractivity() {
- if (window.authModalOriginal) {
- window.authModalOriginal.open = true;
- window.authModalOriginal.mode = 'login';
- setTimeout(() => {
- window.authModalOriginal.loginError = 'Test error message';
- window.authModalOriginal.showPassword = true;
- }, 500);
- }
- }
+ openOriginalModalInMode(mode) {
+ if (window.authModalOriginal) {
+ window.authModalOriginal.mode = mode;
+ window.authModalOriginal.open = true;
+ }
+ },
- function testCottonInteractivity() {
- if (window.authModalCotton) {
- window.authModalCotton.open = true;
- window.authModalCotton.mode = 'login';
- setTimeout(() => {
- window.authModalCotton.loginError = 'Test error message';
- window.authModalCotton.showPassword = true;
- }, 500);
- }
- }
+ openCottonModalInMode(mode) {
+ if (window.authModalCotton) {
+ window.authModalCotton.mode = mode;
+ window.authModalCotton.open = true;
+ }
+ },
- function compareModalStyling() {
- if (window.authModalOriginal && window.authModalCotton) {
- window.authModalOriginal.open = true;
- setTimeout(() => {
- window.authModalCotton.open = true;
- }, 200);
- }
- }
+ testOriginalInteractivity() {
+ if (window.authModalOriginal) {
+ window.authModalOriginal.open = true;
+ window.authModalOriginal.mode = 'login';
+ setTimeout(() => {
+ window.authModalOriginal.loginError = 'Test error message';
+ window.authModalOriginal.showPassword = true;
+ }, 500);
+ }
+ },
- function testCustomConfiguration() {
- // Show the custom cotton modal
- const customModal = document.getElementById('custom-cotton-modal');
- customModal.style.display = 'block';
-
- // You would implement custom Alpine.js instance here
- alert('Custom configuration test - check the modal titles and text changes');
- }
+ testCottonInteractivity() {
+ if (window.authModalCotton) {
+ window.authModalCotton.open = true;
+ window.authModalCotton.mode = 'login';
+ setTimeout(() => {
+ window.authModalCotton.loginError = 'Test error message';
+ window.authModalCotton.showPassword = true;
+ }, 500);
+ }
+ },
+
+ compareModalStyling() {
+ if (window.authModalOriginal && window.authModalCotton) {
+ window.authModalOriginal.open = true;
+ setTimeout(() => {
+ window.authModalCotton.open = true;
+ }, 200);
+ }
+ },
+
+ testCustomConfiguration() {
+ // Show the custom cotton modal
+ const customModal = this.$el.querySelector('#custom-cotton-modal');
+ if (customModal) {
+ customModal.style.display = 'block';
+ }
+
+ // Dispatch custom event for configuration test
+ this.$dispatch('custom-config-test', {
+ message: 'Custom configuration test - check the modal titles and text changes'
+ });
+ }
+ }));
-
\ No newline at end of file
+