`); doc.close(); iframe.onload = () => { if (iframe.dataset.printed) return; iframe.dataset.printed = "1"; iframe.contentWindow.focus(); iframe.contentWindow.print(); // Cleanup (print OR cancel) setTimeout(() => { iframe.remove(); $noPrint.removeClass('d-none'); hidePrintLoading(); window.isPrinting = false; }, 800); }; }) .catch(err => { console.error(err); hidePrintLoading(); $noPrint.removeClass('d-none'); window.isPrinting = false; }); }); }); $(document).ready(function () { let baseSize = 100; const defaultSize = 100; const maxSize = 150; const minSize = 100; $(document).on("click", ".increase-text", function (e) { $(".share-social-media").removeClass("show"); e.stopPropagation(); const rootFontSize = parseFloat($('html').css('font-size')); const $container = $(this).parents(".container"); const $maxSize = 1.5; let $items = $container.find(".control-size-content"); let cmsContents = []; if ($items.length) { $items.each(function () { cmsContents.push($(this)); }); } else { $container.find("#print-area").each(function () { cmsContents.push($(this)); }); } cmsContents.forEach(function ($cmsContent) { $cmsContent.find("*").each(function () { const $el = $(this); const currentPx = parseFloat($el.css("font-size")); const currentLineHeightPx = parseFloat($el.css("--line-height")); if (!isNaN(currentPx)) { const currentRem = currentPx / rootFontSize; const newRem = currentRem + 0.1; if (newRem <= $maxSize) { $el.css("font-size", newRem + "rem"); $el.css("--line-height", 3+currentLineHeightPx + "px"); } } }); }); }); $(document).on("click", ".decrease-text", function (e) { $(".share-social-media").removeClass("show"); e.stopPropagation(); const rootFontSize = parseFloat($('html').css('font-size')); const $container = $(this).parents(".container"); const $minSize = .6; let cmsContents = []; let $items = $container.find(".control-size-content"); if ($items.length) { $container.find(".control-size-content").each(function () { cmsContents.push($(this)); }); } else { $container.find("#print-area").each(function () { cmsContents.push($(this)); }); } cmsContents.forEach(function (cmsContent) { cmsContent.find("*").each(function () { const $el = $(this); const currentPx = parseFloat($el.css("font-size")); if (!isNaN(currentPx)) { const currentRem = currentPx / rootFontSize; const newRem = currentRem - 0.1; if(newRem >= $minSize) { $el.css("font-size", newRem + "rem"); } } }); }); }); // $(".no-resize").each(function(){ // let currentSize = $(this).css("font-size"); // $(this).attr("style", "font-size:" + currentSize + " !important"); // }); (function ($) { $(document).on('click', '.whatsapp-share', function (e) { e.preventDefault(); var $el = $(this); var url = $el.data('url') || window.location.href; var text = $el.data('text') || document.title; var isMobile = /Android|iPhone|iPad|iPod|Windows Phone/i.test(navigator.userAgent); var encText = encodeURIComponent(text + ' ' + url); if (isMobile) { // Mobile → open in WhatsApp app window.location.href="https://petra.gov.jo/ar/news/whatsapp://send?text=" + encText; } else { // Desktop → always open WhatsApp Web in a new tab window.open('https://web.whatsapp.com/send?text=' + encText, '_blank', 'noopener,noreferrer'); } }); })(jQuery); });

التعليقات 0
كن أول من يعلق على هذا الخبر