هل سيبقى الفرعون المصري مع ليفربول؟ .. مفاجأة من العيار الثقيل بشأن تجديد صلا higher


مفاجآت في اجتماع رئاسة الوزراء .. توجيه عاجل من رئيس الوزراء لـ الرقابة النـ بسب الأحداث الجارين .. مصر ؟!


18 يونيو, 2025 07:10 م

characteristic replaceOembeds() {
var allEmbeds = doc.getElementsByTagName(“OEMBED”);

while (allEmbeds.length != 0) {
replaceOembedWithHtml(allEmbeds(0), extractLinkFromOembed(allEmbeds(0)));
allEmbeds = doc.getElementsByTagName(“OEMBED”);
}

runYoutubeLazyLoad();

}

characteristic 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, “”);
}

}

characteristic extractLinkFromOembed(component) {
return getUrlSource(component.getAttribute(“url”));
}

characteristic getUrlSource(url) {
var ytRegex = /http(?:s?)://(?:www.)?youtu(?:be.com/search for?v=|.be/)((w-_)*)(&(amp;)?‌​(w?‌​=)*)?/;
var instaRegex = /(https?://www.)?instagram.com(/p/(w+)/?)/;
var twitterRegex = /twitter.com/.*/assign(?:es)?/((^/?)+)/;
var fbRegex = /^https?://www.facebook.com.*/(video(s)?|search for|memoir|posts)(.php?|/).+$/;

if (ytRegex.take a look at(url)) {
return {
source: “Youtube”,
url: url,
identity: ytRegex.exec(url)(1)
};
}

if (instaRegex.take a look at(url)) {
return {
source: “Instagram”,
url: url,
identity: instaRegex.exec(url)(3)
};
}

if (twitterRegex.take a look at(url)) {
return {
source: “Twitter”,
url: url,
identity: twitterRegex.exec(url)(1)
};
}

if (fbRegex.take a look at(url)) {
return {
source: “Facebook”,
url: url,
identity: fbRegex.exec(url)(1)
};

}

return {
source: “Unknown”,
url: url,
identity: “”
};
}

characteristic replaceElementWithHtml(component, html) {
var str = html;
var Obj = component; //any component to be fully replaced
if (Obj.outerHTML) { //if outerHTML is supported
Obj.outerHTML = str; ///or no longer it is straight forward substitute of total component with contents of str var
} else { //if outerHTML is no longer supported, there’s a wierd however crossbrowsered trick
var tmpObj = doc.createElement(“div”);
tmpObj.innerHTML = ‘‘;
ObjParent = Obj.parentNode; //Okey, component must be parented
ObjParent.replaceChild(tmpObj, Obj); //right here we inserting our fast recordsdata rather than our purpose, so we’re going to have the option to procure it then and replace it into whatever we desire to replace to
ObjParent.innerHTML = ObjParent.innerHTML.replace(‘

‘, str);
}
}
characteristic loadfbApi() {
var js = doc.createElement(‘script’);
js.src=”
doc.body.appendChild(js);
}
characteristic 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 image = contemporary Image(); image.src = "https://www.christian-dogma.com/issues/ch/sources/photos/no.jpg"; image.classList.add('lazyload'); image.setAttribute("recordsdata-src", source); image.setAttribute("alt", "youtube"); image.addEventListener("load", characteristic () { youtube(i).appendChild(image); }(i)); youtube(i).addEventListener("click on", characteristic () { 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

Exit mobile version