نموذج الاختبار الوزاري لمادة اللغة الانجليزية الصف السابع الفصل الثالث لعام 2018
التعديل الأخير بواسطة المشرف: 27 مايو 2024
!function() {
const config = {
siteUrl: 'https://www.jnob-jo.com',
whitelist: [
'youtube.com',
'youtu.be',
'facebook.com',
'twitter.com',
'iinkor.com',
'forum.iinkor.com',
'instagram.com',
'up.jnob-jo.com',
'drive.google.com',
'docs.google.com',
'apps.moe.gov.jo',
'nccd.gov.jo'
],
replaceText: '****',
addNoFollow: true,
addNoOpener: true
};
function isWhitelisted(url) {
try {
const urlObj = new URL(url);
return config.whitelist.some(domain =>
urlObj.hostname === domain ||
urlObj.hostname.endsWith('.' + domain) ||
urlObj.hostname.includes(domain)
);
} catch (e) {
return false;
}
}
function isExternalLink(url) {
try {
const urlObj = new URL(url);
const siteObj = new URL(config.siteUrl);
return urlObj.hostname !== siteObj.hostname &&
!urlObj.hostname.endsWith('.' + siteObj.hostname);
} catch (e) {
return false;
}
}
function convertExternal(url, replaceWithStars = false) {
if (!url) return url;
if (!isExternalLink(url) || isWhitelisted(url)) return url;
return replaceWithStars ? config.replaceText : config.siteUrl;
}
function processLink(link) {
const href = link.getAttribute('href');
if (!href) return;
const isRawUrl = link.textContent.trim() === href ||
link.textContent.trim() === decodeURIComponent(href);
const newHref = convertExternal(href, false);
if (newHref !== href) {
link.setAttribute('href', newHref);
if (isRawUrl)
link.textContent = config.replaceText;
let rel = [];
if (config.addNoFollow) rel.push('nofollow');
if (config.addNoOpener) rel.push('noopener');
if (rel.length) link.setAttribute('rel', rel.join(' '));
link.setAttribute('target', '_blank');
link.classList.add('external-redirect');
}
}
function protectLinks() {
document.querySelectorAll('a[href*="http"]').forEach(processLink);
// حماية ستايل الروابط الخارجية
if (!document.getElementById("ext-link-style")) {
const style = document.createElement("style");
style.id = "ext-link-style";
style.textContent = `
.external-redirect {
color: #e74c3c !important;
font-weight: bold;
}
.external-redirect:hover::after {
content: 'رابط خارجي محمي';
background: #333;
color: white;
padding: 3px 6px;
border-radius: 4px;
font-size: 12px;
position: absolute;
bottom: 100%;
left: 50%;
transform: translateX(-50%);
white-space: nowrap;
}
`;
document.head.appendChild(style);
}
}
// تحميل تلقائي مع XO
document.addEventListener("DOMContentLoaded", protectLinks);
document.addEventListener("XFContentLoaded", protectLinks);
}();