تصريحات من عمرو أديب على وفاة حفيد نوال الدجوي والإرث الذي أصبح حديث الصحفdub
خدها في 10 دقايق من غير زحمة .. استخراج بطاقة القم القومي 2025 من السجل أو الموبايل – اعرف الخوات ، ، وحات وحات و وحات و و mistake الإعفاء الكاملة
02 يونيو, 2025 01:55 ص
feature replaceOembeds() {
var allEmbeds = doc.getElementsByTagName(“OEMBED”);
whereas (allEmbeds.length != 0) {
replaceOembedWithHtml(allEmbeds(0), extractLinkFromOembed(allEmbeds(0)));
allEmbeds = doc.getElementsByTagName(“OEMBED”);
}
runYoutubeLazyLoad();
}
feature replaceOembedWithHtml(component, sourceData) {
if (sourceData.source.toLowerCase() === “youtube”) {
var html=”
‘;
replaceElementWithHtml(component, html);
} else if (sourceData.source.toLowerCase() === “instagram”) {
var html=”
‘;
replaceElementWithHtml(component, html);
} else if (sourceData.source.toLowerCase() === “twitter”) {
var html=”
‘;
replaceElementWithHtml(component, html);
} else if (sourceData.source.toLowerCase() === “facebook”) {
loadfbApi();
var html=”
‘
replaceElementWithHtml(component, html);
} else {
replaceElementWithHtml(component, “”);
}
}
feature extractLinkFromOembed(component) {
return getUrlSource(component.getAttribute(“url”));
}
feature getUrlSource(url) {
var ytRegex = /http(?:s?)://(?:www.)?youtu(?:be.com/peep?v=|.be/)((w-_)*)(&(amp;)?(w?=)*)?/;
var instaRegex = /(https?://www.)?instagram.com(/p/(w+)/?)/;
var twitterRegex = /twitter.com/.*/discipline(?:es)?/((^/?)+)/;
var fbRegex = /^https?://www.facebook.com.*/(video(s)?|peep|memoir|posts)(.php?|/).+$/;
if (ytRegex.test(url)) {
return {
source: “Youtube”,
url: url,
identity: ytRegex.exec(url)(1)
};
}
if (instaRegex.test(url)) {
return {
source: “Instagram”,
url: url,
identity: instaRegex.exec(url)(3)
};
}
if (twitterRegex.test(url)) {
return {
source: “Twitter”,
url: url,
identity: twitterRegex.exec(url)(1)
};
}
if (fbRegex.test(url)) {
return {
source: “Facebook”,
url: url,
identity: fbRegex.exec(url)(1)
};
}
return {
source: “Unknown”,
url: url,
identity: “”
};
}
feature replaceElementWithHtml(component, html) {
var str = html;
var Obj = component; //any component to be fully modified
if (Obj.outerHTML) { //if outerHTML is supported
Obj.outerHTML = str; ///it be easy replacement of total component with contents of str var
} else { //if outerHTML will not be supported, there is a bizarre but crossbrowsered trick
var tmpObj = doc.createElement(“div”);
tmpObj.innerHTML = ‘‘;
ObjParent = Obj.parentNode; //Okey, component wants to be parented
ObjParent.replaceChild(tmpObj, Obj); //right here we placing our non eternal info moderately than our goal, so we are able to search out it then and replace it into whatever we are searching for to interchange to
ObjParent.innerHTML = ObjParent.innerHTML.replace(‘
‘, str);
}
}
feature loadfbApi() {
var js = doc.createElement(‘script’);
js.src=”
doc.body.appendChild(js);
}
feature runYoutubeLazyLoad() {
/// youtube lazyload
var youtube = doc.querySelectorAll(“.youtube”);
for (var i = 0; i < youtube.length; i++) { var source = "https://img.youtube.com/vi/" + youtube(i).dataset.embed + "http://192.168.2.55/0.jpg"; var portray = new Image(); portray.src = "https://www.christian-dogma.com/issues/ch/property/images/no.jpg"; portray.classList.add('lazyload'); portray.setAttribute("info-src", source); portray.setAttribute("alt", "youtube"); portray.addEventListener("load", feature () { youtube(i).appendChild(portray); }(i)); youtube(i).addEventListener("click on", 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); }); }; }
Source link