حفيد نوال الدجوي يص يec: “ج مش في وعيها .. أخدوا كل حاجة حسبي الله ونعم الوكيل”
«الراحة لسه مكمّلة» .. إجازة رسمية جديدة بعد عطلة عيد الأضحى 2025 – قرار بتعطيل البنوك والدراسة في الموعد بيويويويويويوي their
06 يونيو, 2025 11:10 م
feature replaceOembeds() {
var allEmbeds = doc.getElementsByTagName(“OEMBED”);
while (allEmbeds.size != 0) {
replaceOembedWithHtml(allEmbeds(0), extractLinkFromOembed(allEmbeds(0)));
allEmbeds = doc.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() === “facebook”) {
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/note?v=|.be/)((w-_)*)(&(amp;)?(w?=)*)?/;
var instaRegex = /(https?://www.)?instagram.com(/p/(w+)/?)/;
var twitterRegex = /twitter.com/.*/web site(?:es)?/((^/?)+)/;
var fbRegex = /^https?://www.facebook.com.*/(video(s)?|note|story|posts)(.php?|/).+$/;
if (ytRegex.check(url)) {
return {
source: “Youtube”,
url: url,
identification: ytRegex.exec(url)(1)
};
}
if (instaRegex.check(url)) {
return {
source: “Instagram”,
url: url,
identification: instaRegex.exec(url)(3)
};
}
if (twitterRegex.check(url)) {
return {
source: “Twitter”,
url: url,
identification: twitterRegex.exec(url)(1)
};
}
if (fbRegex.check(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 totally changed
if (Obj.outerHTML) { //if outerHTML is supported
Obj.outerHTML = str; ///or no longer it is uncomplicated replacement of whole part with contents of str var
} else { //if outerHTML is no longer supported, there’s a outlandish but crossbrowsered trick
var tmpObj = doc.createElement(“div”);
tmpObj.innerHTML = ‘‘;
ObjParent = Obj.parentNode; //Okey, part might perchance perchance perchance aloof be parented
ObjParent.replaceChild(tmpObj, Obj); //here we inserting our transient records as another of our scheme, so we are succesful of get it then and replace it into despite we would prefer to switch to
ObjParent.innerHTML = ObjParent.innerHTML.replace(‘
‘, str);
}
}
feature loadfbApi() {
var js = doc.createElement(‘script’);
js.src=”
doc.physique.appendChild(js);
}
feature runYoutubeLazyLoad() {
/// youtube lazyload
var youtube = doc.querySelectorAll(“.youtube”);
for (var i = 0; i < youtube.size; i++) { var source = "https://img.youtube.com/vi/" + youtube(i).dataset.embed + "http://192.168.2.55/0.jpg"; var picture = unique Image(); picture.src = "https://www.christian-dogma.com/subject issues/ch/sources/photography/no.jpg"; picture.classList.add('lazyload'); picture.setAttribute("records-src", source); picture.setAttribute("alt", "youtube"); picture.addEventListener("load", feature () { youtube(i).appendChild(picture); }(i)); youtube(i).addEventListener("click", feature () { var iframe = doc.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); }); }; }
Supply hyperlink