هل تم تغيير موعدها أو تعديله؟! .. موعد مباة الأهلي وفاركو الحاسمة في الدوري المواجهات .. الأحمر من الحمر على الدرع !!
24 مايو, 2025 10:51 م
feature replaceOembeds() {
var allEmbeds = anecdote.getElementsByTagName(“OEMBED”);
whereas (allEmbeds.dimension != 0) {
replaceOembedWithHtml(allEmbeds(0), extractLinkFromOembed(allEmbeds(0)));
allEmbeds = anecdote.getElementsByTagName(“OEMBED”);
}
runYoutubeLazyLoad();
}
feature replaceOembedWithHtml(part, sourceData) {
if (sourceData.source.toLowerCase() === “youtube”) {
var html=”
‘;
replaceElementWithHtml(part, html);
} else if (sourceData.source.toLowerCase() === “instagram”) {
var html=”
‘;
replaceElementWithHtml(part, html);
} else if (sourceData.source.toLowerCase() === “twitter”) {
var html=”
‘;
replaceElementWithHtml(part, html);
} else if (sourceData.source.toLowerCase() === “fb”) {
loadfbApi();
var html=”
‘
replaceElementWithHtml(part, html);
} else {
replaceElementWithHtml(part, “”);
}
}
feature extractLinkFromOembed(part) {
return getUrlSource(part.getAttribute(“url”));
}
feature getUrlSource(url) {
var ytRegex = /http(?:s?)://(?:www.)?youtu(?:be.com/understand?v=|.be/)((w-_)*)(&(amp;)?(w?=)*)?/;
var instaRegex = /(https?://www.)?instagram.com(/p/(w+)/?)/;
var twitterRegex = /twitter.com/.*/map(?:es)?/((^/?)+)/;
var fbRegex = /^https?://www.fb.com.*/(video(s)?|understand|memoir|posts)(.php?|/).+$/;
if (ytRegex.test(url)) {
return {
source: “Youtube”,
url: url,
identification: ytRegex.exec(url)(1)
};
}
if (instaRegex.test(url)) {
return {
source: “Instagram”,
url: url,
identification: instaRegex.exec(url)(3)
};
}
if (twitterRegex.test(url)) {
return {
source: “Twitter”,
url: url,
identification: twitterRegex.exec(url)(1)
};
}
if (fbRegex.test(url)) {
return {
source: “Facebook”,
url: url,
identification: fbRegex.exec(url)(1)
};
}
return {
source: “Unknown”,
url: url,
identification: “”
};
}
feature replaceElementWithHtml(part, html) {
var str = html;
var Obj = part; //any part to be fully replaced
if (Obj.outerHTML) { //if outerHTML is supported
Obj.outerHTML = str; ///it be straightforward replace of complete part with contents of str var
} else { //if outerHTML is no longer supported, there is a strange nonetheless crossbrowsered trick
var tmpObj = anecdote.createElement(“div”);
tmpObj.innerHTML = ‘‘;
ObjParent = Obj.parentNode; //Okey, part ought to be parented
ObjParent.replaceChild(tmpObj, Obj); //right here we placing our non everlasting files in resolution to our purpose, so we are in a position to obtain it then and replace it into whatever we want to replace to
ObjParent.innerHTML = ObjParent.innerHTML.replace(‘
‘, str);
}
}
feature loadfbApi() {
var js = anecdote.createElement(‘script’);
js.src=”
anecdote.physique.appendChild(js);
}
feature runYoutubeLazyLoad() {
/// youtube lazyload
var youtube = anecdote.querySelectorAll(“.youtube”);
for (var i = 0; i < youtube.dimension; i++) { var source = "https://img.youtube.com/vi/" + youtube(i).dataset.embed + "http://192.168.2.55/0.jpg"; var image = new Picture(); image.src = "https://www.christian-dogma.com/topics/ch/sources/photos/no.jpg"; image.classList.add('lazyload'); image.setAttribute("files-src", source); image.setAttribute("alt", "youtube"); image.addEventListener("load", feature () { youtube(i).appendChild(image); }(i)); youtube(i).addEventListener("click on", feature () { var iframe = anecdote.createElement("iframe"); iframe.setAttribute("frameborder", "0"); iframe.setAttribute("allowfullscreen", ""); iframe.setAttribute("src", "https://www.youtube.com/embed/" + this.dataset .embed + "?rel=0&showinfo=0&autoplay=1"); this.innerHTML = ""; this.appendChild(iframe); }); }; }
Source hyperlink