Diyanet’ten dijital atılım

const shareableModelId = 1571;
const shareableModelClass=”TEVideoModelsVideo”;
function shareCount(id, model, platform, url) {
fetch(“https://www.diyanethaber.com.tr/sharecount”, {
method: ‘POST’,
headers: {
‘Content-Type’: ‘application/json’,
‘X-CSRF-TOKEN’: document.querySelector(‘meta[name=”csrf-token”]’)?.getAttribute(‘content’)
},
body: JSON.stringify({ id, model, platform, url })
}).catch(err => console.error(‘Share count fetch error:’, err));
}
function goSharePopup(url, title, width = 600, height = 400) {
const left = (screen.width – width) / 2;
const top = (screen.height – height) / 2;
window.open(
url,
title,
`width=${width},height=${height},left=${left},top=${top},resizable=yes,scrollbars=yes`
);
}
async function handleMobileShare(event, title, url) {
event.preventDefault();
if (shareableModelId && shareableModelClass) {
shareCount(shareableModelId, shareableModelClass, ‘native_mobile_share’, url);
}
const isAndroidWebView = navigator.userAgent.includes(‘Android’) && !navigator.share;
if (isAndroidWebView) {
window.location.href=”https://www.diyanethaber.com.tr/video/androidshare://paylas?title=” + encodeURIComponent(title) + ‘&url=” + encodeURIComponent(url);
return;
}
if (navigator.share) {
try {
await navigator.share({ title: title, url: url });
} catch (error) {
if (error.name !== “AbortError’) {
console.error(‘Web Share API failed:’, error);
}
}
} else {
alert(“Bu cihaz paylaşımı desteklemiyor.”);
}
}
function initiateDesktopShare(event, platformOverride = null) {
event.preventDefault();
const anchor = event.currentTarget;
const platform = platformOverride || anchor.dataset.platform;
const webShareUrl = anchor.href;
const contentUrl = anchor.dataset.shareUrl || webShareUrl;
if (shareableModelId && shareableModelClass && platform) {
shareCount(shareableModelId, shareableModelClass, platform, contentUrl);
}
goSharePopup(webShareUrl, platform ? platform.charAt(0).toUpperCase() + platform.slice(1) : “Share”);
}
function copyURL(event, urlToCopy) {
event.preventDefault();
navigator.clipboard.writeText(urlToCopy).then(() => {
alert(‘Bağlantı panoya kopyalandı!’);
}).catch(err => {
console.error(‘Could not copy text: ‘, err);
try {
const textArea = document.createElement(“textarea”);
textArea.value = urlToCopy;
textArea.style.position = “fixed”;
document.body.appendChild(textArea);
textArea.focus();
textArea.select();
document.execCommand(‘copy’);
document.body.removeChild(textArea);
alert(‘Bağlantı panoya kopyalandı!’);
} catch (fallbackErr) {
console.error(‘Fallback copy failed:’, fallbackErr);
}
});
}
const dropdownButton = document.querySelector(‘.dropdownButton’);
if (dropdownButton) {
const icon = dropdownButton.querySelector(‘#icon’);
const parentDropdown = dropdownButton.closest(‘.dropdown’);
if (parentDropdown && icon) {
parentDropdown.addEventListener(‘show.bs.dropdown’, function () {
icon.classList.remove(‘fa-plus’);
icon.classList.add(‘fa-minus’);
});
parentDropdown.addEventListener(‘hide.bs.dropdown’, function () {
icon.classList.remove(‘fa-minus’);
icon.classList.add(‘fa-plus’);
});
}
}
Başkan Erbaş, Sanayi ve Teknoloji Bakanı Mehmet Fatih Kacır’ın katılımıyla başkanlıktaki 15 Temmuz Milli İrade Şehit Ali Alıtkan Konferans Salonu’nda düzenlenen “Dijital Hizmetler Tanıtım Toplantısı”nda konuştu.
kabul etmiş bulunuyor ve tüm sorumluluğu üstleniyorsunuz. Yazılan yorumlardan DiyanetHaber hiçbir şekilde sorumlu tutulamaz.