...
HTML |
---|
<script type="text/javascript"> AJS.toInit(function() { // Interceptar específicamente las llamadas a cargar_region var originalAjax = AJS.$.ajax; AJS.$.ajax = function(options) { if (typeof options === 'string') { options = { url: options }; } // Corregir específicamente las URLs de ofertas_trabajo if (options.url && options.url.includes('pm.portalminero.com/ofertas_trabajo')) { if (options.url.indexOf('http://') === 0) { options.url = options.url.replace('http://', 'https://'); console.log('Mixed content corregido:', options.url); } } return originalAjax.apply(this, arguments); }; // También verificar jQuery global si existe if (window.jQuery && window.jQuery !== AJS.$) { var originalJQueryAjax = window.jQuery.ajax; window.jQuery.ajax = function(options) { if (typeof options === 'string') { options = { url: options }; } if (options.url && options.url.includes('pm.portalminero.com/ofertas_trabajo')) { if (options.url.indexOf('http://') === 0) { options.url = options.url.replace('http://', 'https://'); } } return originalJQueryAjax.apply(this, arguments); }; } }); </script> <script<style> type="text/javascript"> // Monitor para popup de signup (function() { 'use strict'; console.log('Monitor de popup iniciado'); // Función para aplicar CSS al popup function applyPopupCSS() { // Buscar iframes o popups var iframes = document.querySelectorAll('iframe'); var popupWindows = document.querySelectorAll('.popup-window, [class*="popup"]'); // Aplicar a elementos en la página actual si es popup if (window.location.href.includes('decorator=popup')) /* CSS que se hereda al popup */ @media screen and (max-width: 768px) { console.log('Popup detectado - Aplicando CSS'); var sbWrapper = document.querySelector('.sb-wrapper'); if (sbWrapper) .form_login label { width: sbWrapper.style.setProperty('top', '70px', 'important')100px !important; console.log('? CSS aplicado a .sb-wrapper en popup')font-size: 12px !important; color: #2a5f97 !important; } var rightAlignedForms = document.querySelectorAll('.right-aligned-form-fields'); rightAlignedForms.forEach(function(form) { form.style.setProperty('padding', '110px 50px', 'important')font-weight: bold !important; form.style.setProperty('margin', '-108px', 'important')left: -100px !important; position: console.log('? CSS aplicado a .right-aligned-form-fields en popup')relative !important; }); } // Monitor de nuevos popups que se abran var observer = new MutationObserver(function(mutations) { mutations.forEach(function(mutation) { mutation.addedNodes.forEach(function(node) { if (node.nodeType === 1) { // Element node if (node.classList && (node.classList.contains('popup') || node.querySelector && node.querySelector('.sb-wrapper'))) /* Forzar CSS en cualquier popup hijo */ * .form_login label { width: setTimeout(applyPopupCSS, 100)100px !important; } } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); } // Ejecutar applyPopupCSS(); window.addEventListener('load', applyPopupCSS); // Monitor de ventanas popup var originalOpen = window.open; window.open = function() { var popup = originalOpen.apply(this, arguments); if (popup) { popup.addEventListener('load', function() { // Aplicar CSS cuando el popup cargue setTimeout(function() { if (popup.document) { var style = popup.document.createElement('style'); style.textContent = ` .sb-wrapper { top: 70px !important; } .right-aligned-form-fields { padding: 110px 50px font-size: 12px !important; color: #2a5f97 !important; font-weight: bold !important; marginleft: -108px100px !important; position: } `; popup.document.head.appendChild(style); console.log('? CSS aplicado a popup window'); } }, 500); }); } return popup; }; })(); </script> relative !important; } </style> |