let mainColors = localStorage.getItem("color_option");
if (mainColors !== null) {
document.documentElement.style.setProperty('--cl', localStorage.getItem("color_option"));
document.querySelectorAll(".colors-list li").forEach(element => {
element.classList.remove("active");
if (element.dataset.color === mainColors) {
element.classList.add("active");
}
});
}
const colorsLi = document.querySelectorAll(".colors-list li");
colorsLi.forEach(li => {
li.addEventListener("click", (e) => {
document.documentElement.style.setProperty('--cl', e.target.dataset.color);
localStorage.setItem("color_option", e.target.dataset.color);
e.target.parentElement.querySelectorAll(".active").forEach(element => {
element.classList.remove("active");
});
e.target.classList.add("active");
});
});
let mainColor = localStorage.getItem("color");
null !== mainColor && (document.documentElement.style.setProperty("--cl2", localStorage.getItem("color")));
const colorLi = document.querySelectorAll(".colors-list li");
colorLi.forEach(e => {
e.addEventListener("click", e => {
document.documentElement.style.setProperty("--cl2", e.target.dataset.colors), localStorage.setItem("color", e.target.dataset.colors)
})
});
document.querySelector(".settings-box .toggle-settings .fa-gear").onclick = function () {
this.classList.toggle("fa-spin");
document.querySelector(".settings-box").classList.toggle("open")
};
if ($(".card-header").length > 0) {
$(".card-header").click(function () {
if ($(this).next(".card-body").hasClass("active")) {
$(this).next(".card-body").removeClass("active").slideUp();
$(this).children("span").removeClass("fa-minus").addClass("fa-plus");
} else {
$(".card .card-body").removeClass("active").slideUp();
$(".card .card-header span").removeClass("fa-minus").addClass("fa-plus");
$(this).next(".card-body").addClass("active").slideDown();
$(this).children("span").removeClass("fa-plus").addClass("fa-minus");
}
});
}
function loadCSS(e, t, n) {
"use strict";
var i = window.document.createElement("link");
var o = t || window.document.getElementsByTagName("script")[0];
i.rel = "stylesheet";
i.href = e;
i.media = "only x";
o.parentNode.insertBefore(i, o);
setTimeout(function () {
i.media = n || "all"
})
}
loadCSS("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.css");
var didScroll = false;
window.onscroll = () => didScroll = true;
setTimeout(() => {
if (!didScroll) {
window.scrollTo({
top: 1,
behavior: 'smooth'
})
}
}, 5000);
$(document).ready(function () {
(function ($) {
$.fn.theiaStickySidebar = function (options) {
var defaults = {
'containerSelector': '',
'additionalMarginTop': 0,
'additionalMarginBottom': 0,
'updateSidebarHeight': true,
'minWidth': 0,
'disableOnResponsiveLayouts': true,
'sidebarBehavior': 'modern',
'defaultPosition': 'relative',
'namespace': 'TSS'
};
options = $.extend(defaults, options);
options.additionalMarginTop = parseInt(options.additionalMarginTop) || 0;
options.additionalMarginBottom = parseInt(options.additionalMarginBottom) || 0;
tryInitOrHookIntoEvents(options, this);
function tryInitOrHookIntoEvents(options, $that) {
var success = tryInit(options, $that);
if (!success) {
console.log('TSS: Body width smaller than options.minWidth. Init is delayed.');
$(document).on('scroll.' + options.namespace, function (options, $that) {
return function (evt) {
var success = tryInit(options, $that);
if (success) {
$(this).unbind(evt)
}
}
}(options, $that));
$(window).on('resize.' + options.namespace, function (options, $that) {
return function (evt) {
var success = tryInit(options, $that);
if (success) {
$(this).unbind(evt)
}
}
}(options, $that))
}
}
function tryInit(options, $that) {
if (options.initialized === true) {
return true
}
if ($('body').width() < options.minWidth) {
return false
}
init(options, $that);
return true
}
function init(options, $that) {
options.initialized = true;
var existingStylesheet = $('#theia-sticky-sidebar-stylesheet-' + options.namespace);
if (existingStylesheet.length === 0) {
$('head').append($(''))
}
$that.each(function () {
var o = {};
o.sidebar = $(this);
o.options = options || {};
o.container = $(o.options.containerSelector);
if (o.container.length == 0) {
o.container = o.sidebar.parent()
}
o.sidebar.parents().css('-webkit-transform', 'none');
o.sidebar.css({
'position': o.options.defaultPosition,
'overflow': 'visible',
'-webkit-box-sizing': 'border-box',
'-moz-box-sizing': 'border-box',
'box-sizing': 'border-box'
});
o.stickySidebar = o.sidebar.find('.theiaStickySidebar');
if (o.stickySidebar.length == 0) {
var javaScriptMIMETypes = /(?:text|application)\/(?:x-)?(?:javascript|ecmascript)/i;
o.sidebar.find('script').filter(function (index, script) {
return script.type.length === 0 || script.type.match(javaScriptMIMETypes)
}).remove();
o.stickySidebar = $('
').addClass('theiaStickySidebar').append(o.sidebar.children());
o.sidebar.append(o.stickySidebar)
}
o.marginBottom = parseInt(o.sidebar.css('margin-bottom'));
o.paddingTop = parseInt(o.sidebar.css('padding-top'));
o.paddingBottom = parseInt(o.sidebar.css('padding-bottom'));
var collapsedTopHeight = o.stickySidebar.offset().top;
var collapsedBottomHeight = o.stickySidebar.outerHeight();
o.stickySidebar.css('padding-top', 1);
o.stickySidebar.css('padding-bottom', 1);
collapsedTopHeight -= o.stickySidebar.offset().top;
collapsedBottomHeight = o.stickySidebar.outerHeight() - collapsedBottomHeight - collapsedTopHeight;
if (collapsedTopHeight == 0) {
o.stickySidebar.css('padding-top', 0);
o.stickySidebarPaddingTop = 0
} else {
o.stickySidebarPaddingTop = 1
}
if (collapsedBottomHeight == 0) {
o.stickySidebar.css('padding-bottom', 0);
o.stickySidebarPaddingBottom = 0
} else {
o.stickySidebarPaddingBottom = 1
}
o.previousScrollTop = null;
o.fixedScrollTop = 0;
resetSidebar();
o.onScroll = function (o) {
if (!o.stickySidebar.is(":visible")) {
return
}
if ($('body').width() < o.options.minWidth) {
resetSidebar();
return
}
if (o.options.disableOnResponsiveLayouts) {
var sidebarWidth = o.sidebar.outerWidth(o.sidebar.css('float') == 'none');
if (sidebarWidth + 50 > o.container.width()) {
resetSidebar();
return
}
}
var scrollTop = $(document).scrollTop();
var position = 'static';
if (scrollTop >= o.sidebar.offset().top + (o.paddingTop - o.options.additionalMarginTop)) {
var offsetTop = o.paddingTop + options.additionalMarginTop;
var offsetBottom = o.paddingBottom + o.marginBottom + options.additionalMarginBottom;
var containerTop = o.sidebar.offset().top;
var containerBottom = o.sidebar.offset().top + getClearedHeight(o.container);
var windowOffsetTop = 0 + options.additionalMarginTop;
var windowOffsetBottom;
var sidebarSmallerThanWindow = (o.stickySidebar.outerHeight() + offsetTop + offsetBottom) < $(window).height();
if (sidebarSmallerThanWindow) {
windowOffsetBottom = windowOffsetTop + o.stickySidebar.outerHeight()
} else {
windowOffsetBottom = $(window).height() - o.marginBottom - o.paddingBottom - options.additionalMarginBottom
}
var staticLimitTop = containerTop - scrollTop + o.paddingTop;
var staticLimitBottom = containerBottom - scrollTop - o.paddingBottom - o.marginBottom;
var top = o.stickySidebar.offset().top - scrollTop;
var scrollTopDiff = o.previousScrollTop - scrollTop;
if (o.stickySidebar.css('position') == 'fixed') {
if (o.options.sidebarBehavior == 'modern') {
top += scrollTopDiff
}
}
if (o.options.sidebarBehavior == 'stick-to-top') {
top = options.additionalMarginTop
}
if (o.options.sidebarBehavior == 'stick-to-bottom') {
top = windowOffsetBottom - o.stickySidebar.outerHeight()
}
if (scrollTopDiff > 0) {
top = Math.min(top, windowOffsetTop)
} else {
top = Math.max(top, windowOffsetBottom - o.stickySidebar.outerHeight())
}
top = Math.max(top, staticLimitTop);
top = Math.min(top, staticLimitBottom - o.stickySidebar.outerHeight());
var sidebarSameHeightAsContainer = o.container.height() == o.stickySidebar.outerHeight();
if (!sidebarSameHeightAsContainer && top == windowOffsetTop) {
position = 'fixed'
} else if (!sidebarSameHeightAsContainer && top == windowOffsetBottom - o.stickySidebar.outerHeight()) {
position = 'fixed'
} else if (scrollTop + top - o.sidebar.offset().top - o.paddingTop <= options.additionalMarginTop) {
position = 'static'
} else {
position = 'absolute'
}
}
if (position == 'fixed') {
var scrollLeft = $(document).scrollLeft();
o.stickySidebar.css({
'position': 'fixed',
'width': getWidthForObject(o.stickySidebar) + 'px',
'transform': 'translateY(' + top + 'px)',
'left': (o.sidebar.offset().left + parseInt(o.sidebar.css('padding-left')) - scrollLeft) + 'px',
'top': '0px'
})
} else if (position == 'absolute') {
var css = {};
if (o.stickySidebar.css('position') != 'absolute') {
css.position = 'absolute';
css.transform = 'translateY(' + (scrollTop + top - o.sidebar.offset().top - o.stickySidebarPaddingTop - o.stickySidebarPaddingBottom) + 'px)';
css.top = '0px'
}
css.width = getWidthForObject(o.stickySidebar) + 'px';
css.left = '';
o.stickySidebar.css(css)
} else if (position == 'static') {
resetSidebar()
}
if (position != 'static') {
if (o.options.updateSidebarHeight == true) {
o.sidebar.css({
'min-height': o.stickySidebar.outerHeight() + o.stickySidebar.offset().top - o.sidebar.offset().top + o.paddingBottom
})
}
}
o.previousScrollTop = scrollTop
};
o.onScroll(o);
$(document).on('scroll.' + o.options.namespace, function (o) {
return function () {
o.onScroll(o)
}
}(o));
$(window).on('resize.' + o.options.namespace, function (o) {
return function () {
o.stickySidebar.css({
'position': 'static'
});
o.onScroll(o)
}
}(o));
if (typeof ResizeSensor !== 'undefined') {
new ResizeSensor(o.stickySidebar[0], function (o) {
return function () {
o.onScroll(o)
}
}(o))
}
function resetSidebar() {
o.fixedScrollTop = 0;
o.sidebar.css({
'min-height': '1px'
});
o.stickySidebar.css({
'position': 'static',
'width': '',
'transform': 'none'
})
}
function getClearedHeight(e) {
var height = e.height();
e.children().each(function () {
height = Math.max(height, $(this).height())
});
return height
}
})
}
function getWidthForObject(object) {
var width;
try {
width = object[0].getBoundingClientRect().width
} catch (err) {}
if (typeof width === "undefined") {
width = object.width()
}
return width
}
return this
}
})(jQuery);
});
! function (a) {
a.fn.menuBouaici = function () {
return this.each(function () {
var $t = a(this),
b = $t.find('.LinkList ul > li').children('a'),
c = b.length;
for (var i = 0; i < c; i++) {
var d = b.eq(i),
h = d.text();
if (h.charAt(0) !== '_') {
var e = b.eq(i + 1),
j = e.text();
if (j.charAt(0) === '_') {
var m = d.parent();
m.append('');
}
}
if (h.charAt(0) === '_') {
d.text(h.replace('_', ''));
d.parent().appendTo(m.children('.sub-menu'));
}
}
for (var i = 0; i < c; i++) {
var f = b.eq(i),
k = f.text();
if (k.charAt(0) !== '_') {
var g = b.eq(i + 1),
l = g.text();
if (l.charAt(0) === '_') {
var n = f.parent();
n.append('');
}
}
if (k.charAt(0) === '_') {
f.text(k.replace('_', ''));
f.parent().appendTo(n.children('.sub-menu2'));
}
}
$t.find('.LinkList ul li ul').parent('li').addClass('has-sub');
});
}
}(jQuery);
! function (a) {
a.fn.tabBouaici = function (b) {
b = jQuery.extend({
onHover: false,
animated: true,
transition: 'fadeInUp'
}, b);
return this.each(function () {
var e = a(this),
c = e.children('[tab-Bouaici]'),
d = 0,
n = 'tab-animated',
k = 'tab-active';
if (b.onHover == true) {
var event = 'mouseenter'
} else {
var event = 'click'
}
e.prepend('' + a(this).attr('tab-Bouaici') + ' ')
}).eq(d).addClass(k).addClass('tab-' + b.transition);
e.find('.select-tab a').on(event, function () {
var f = a(this).parent().index();
a(this).closest('.select-tab').find('.active').removeClass('active');
a(this).parent().addClass('active');
c.removeClass(k).removeClass('tab-' + b.transition).eq(f).addClass(k).addClass('tab-' + b.transition);
return false
}).eq(d).parent().addClass('active')
})
}
}(jQuery);
! function (a) {
a.fn.lazyBouaici = function () {
return this.each(function () {
var t = a(this),
dImg = t.attr('data-image'),
iWid = Math.round(t.width()),
iHei = Math.round(t.height()),
iSiz = '/w' + iWid + '-h' + iHei + '-p-k-no-nu',
img = '';
if (dImg.match('s72-c')) {
img = dImg.replace('/s72-c', iSiz);
} else if (dImg.match('w72-h')) {
img = dImg.replace('/w72-h72-p-k-no-nu', iSiz);
} else {
img = dImg;
}
a(window).on('load resize scroll', lazyOnScroll);
function lazyOnScroll() {
var wHeight = a(window).height(),
scrTop = a(window).scrollTop(),
offTop = t.offset().top;
if (scrTop + wHeight > offTop) {
var n = new Image();
n.onload = function () {
t.attr('style', 'background-image:url(' + this.src + ')').addClass('lazyBouaici');
}, n.src = img;
}
}
lazyOnScroll();
});
}
}(jQuery);
(function ($) {
$.fn.replaceText = function (b, a, c) {
return this.each(function () {
var f = this.firstChild,
g, e, d = [];
if (f) {
do {
if (f.nodeType === 3) {
g = f.nodeValue;
e = g.replace(b, a);
if (e !== g) {
if (!c && /')
}
if ($mtc == '$Ads={2}') {
$t.replaceWith('')
}
});
$('#Bouaici-new-before-Ads').each(function () {
var $t = $(this);
if ($t.length) {
$('#before-Ads').appendTo($t)
}
});
$('#Bouaici-new-after-Ads').each(function () {
var $t = $(this);
if ($t.length) {
$('#after-Ads').appendTo($t)
}
});
$('#HTML200').each(function () {
var $t = $(this);
if ($t.length) {
$t.appendTo($('#before-Ads'))
}
});
$('#HTML300').each(function () {
var $t = $(this);
if ($t.length) {
$t.appendTo($('#after-Ads'))
}
});
$('.avatar-image-container img').attr('src', function ($this, i) {
i = i.replace('//resources.blogblog.com/img/blank.gif', 'https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVwoTLRokeoRegsYDALPNKURgKP8GuzexCuuBlq8jY_1WEJu7ZwVZDyaqlGjWbqfF3XuoMGOWnL0hpaJxedbkC6-Uf6098FZlTEFYGayE5UK9_ehpfTTy7GdWjnusnDlQD5EoKOyCSYoM/s35-r/avatar.jpg');
i = i.replace('//img1.blogblog.com/img/blank.gif', 'https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVwoTLRokeoRegsYDALPNKURgKP8GuzexCuuBlq8jY_1WEJu7ZwVZDyaqlGjWbqfF3XuoMGOWnL0hpaJxedbkC6-Uf6098FZlTEFYGayE5UK9_ehpfTTy7GdWjnusnDlQD5EoKOyCSYoM/s35-r/avatar.jpg');
return i
});
$('.post-body a').each(function () {
var $this = $(this),
type = $this.text().trim(),
sp = type.split('/'),
txt = sp[0],
ico = sp[1],
color = sp.pop();
if (type.match('button')) {
$this.addClass('button').text(txt);
if (ico != 'button') {
$this.addClass(ico)
}
if (color != 'button') {
$this.addClass('colored-button').css({
'background-color': color
})
}
}
});
$('.post-body strike').each(function () {
var $this = $(this),
type = $this.text().trim(),
html = $this.html();
if (type.match('contact-form')) {
$this.replaceWith('');
$('.contact-form').append($('#ContactForm1'))
}
if (type.match('alert-success')) {
$this.replaceWith('')
}
if (type.match('alert-info')) {
$this.replaceWith('')
}
if (type.match('alert-warning')) {
$this.replaceWith('')
}
if (type.match('alert-error')) {
$this.replaceWith('')
}
if (type.match('left-sidebar')) {
$this.replaceWith('')
}
if (type.match('right-sidebar')) {
$this.replaceWith('')
}
if (type.match('full-width')) {
$this.replaceWith('')
}
if (type.match('code-box')) {
$this.replaceWith(' ');
$('.description-links').append($('.author-description span li'));
$('.description-links').addClass('show')
});
function msgError() {
return '' + no_post + ''
}
function beforeLoader() {
return ''
}
function getFeedUrl(type, num, label) {
var furl = '';
switch (label) {
case 'recent':
furl = '/feeds/posts/summary?alt=json&max-results=' + num;
break;
case 'comments':
if (type == 'list') {
furl = '/feeds/comments/summary?alt=json&max-results=' + num
} else {
furl = '/feeds/posts/summary/-/' + label + '?alt=json&max-results=' + num
}
break;
default:
furl = '/feeds/posts/summary/-/' + label + '?alt=json&max-results=' + num;
break
}
return furl
}
function getPostLink(feed, i) {
for (var x = 0; x < feed[i].link.length; x++)
if (feed[i].link[x].rel == 'alternate') {
var link = feed[i].link[x].href;
break
} return link
}
function getPostTitle(feed, i) {
var n = feed[i].title.$t;
return n
}
function getPostImage(feed, i) {
if ('media$thumbnail' in feed[i]) {
var src = feed[i].media$thumbnail.url.replace(/s72|w640-h408/gi, "w366-h280-c").replace("default", "hqdefault");
if (src.match('img.youtube.com')) {
src = src.replace('/default.', '/0.')
}
var img = src
} else {
img = '' + DefaultPostImage + ''
}
return img
}
function getPostAuthor(feed, i) {
var n = feed[i].author[0].name.$t,
b = messages.postAuthorLabel,
e = '';
if (b != '') {
e = '' + b + ''
} else {
e = ''
}
if (messages.postAuthor == 'true') {
var code = ''
} else {
var code = ''
}
return code
}
function getPostDate(feed, i) {
var c = feed[i].published.$t,
d = c.substring(0, 4),
f = c.substring(5, 7),
m = c.substring(8, 10),
h = monthFormat[parseInt(f, 10) - 1] + ' ' + m + ', ' + d;
if (messages.postDate == 'true') {
var code = ''
} else {
code = ''
}
return code
}
function getPostMeta(author, date) {
if (messages.postAuthor == 'true' && messages.postDate == 'true') {
var long = ''
} else if (messages.postAuthor == 'true') {
long = ''
} else if (messages.postDate == 'true') {
long = ''
} else {
long = ''
}
if (messages.postDate == 'true') {
var small = ''
} else {
small = ''
}
var code = [long, small];
return code
}
function getPostLabel(feed, i) {
if (feed[i].category != undefined) {
var tag = feed[i].category[0].term,
code = '' + tag + ''
} else {
code = ''
}
return code
}
function getPostComments(feed, i, link) {
var n = feed[i].author[0].name.$t,
e = feed[i].author[0].gd$image.src.replace('/s113', '/w55-h55-p-k-no-nu'),
h = feed[i].title.$t;
if (e.match('//img1.blogblog.com/img/blank.gif') || e.match('//img1.blogblog.com/img/b16-rounded.gif')) {
var img = 'https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVwoTLRokeoRegsYDALPNKURgKP8GuzexCuuBlq8jY_1WEJu7ZwVZDyaqlGjWbqfF3XuoMGOWnL0hpaJxedbkC6-Uf6098FZlTEFYGayE5UK9_ehpfTTy7GdWjnusnDlQD5EoKOyCSYoM/w55-h55-p-k-no-nu/avatar.jpg'
} else {
var img = e
}
var code = ' ';
return code
}
function getCustomStyle(type, label, color, lClass) {
lClass = label.replace(' ', '-');
if (color != false) {
if (type == 'featured') {
var code = '.id-' + type + '-' + lClass + ' .entry-category{background-color:' + color + ';color:#fff}.id-' + type + '-' + lClass + ' .loader:after{border-color:' + color + ';border-right-color:rgba(155,155,155,0.2)}'
} else {
code = '.id-' + type + '-' + lClass + ' .entry-category{background-color:' + color + ';color:#fff}.id-' + type + '-' + lClass + ' .title-wrap > h3,.id-' + type + '-' + lClass + ' .title-wrap > a.more:hover,.id-' + type + '-' + lClass + ' .entry-header:not(.entry-info) .entry-title a:hover,.id-' + type + '-' + lClass + ' .entry-header:not(.entry-info) .entry-meta span.author{color:' + color + '}.id-' + type + '-' + lClass + ' .loader:after{border-color:' + color + ';border-right-color:rgba(155,155,155,0.2)}'
}
} else {
code = ''
}
return code
}
function getAjax($this, type, num, label, color) {
switch (type) {
case 'msimple':
case 'megatabs':
case 'featured1':
case 'featured2':
case 'featured3':
case 'block1':
case 'col-left':
case 'col-right':
case 'grid1':
case 'grid2':
case 'videos':
case 'gallery':
case 'list':
case 'related':
if (label == false) {
label = 'geterror404'
}
var furl = getFeedUrl(type, num, label);
$.ajax({
url: furl,
type: 'GET',
dataType: 'json',
cache: true,
beforeSend: function (data) {
var style = getCustomStyle(type, label, color),
lClass = label.replace(' ', '-');
switch (type) {
case 'featured1':
case 'featured2':
case 'featured3':
$('#page-skin-2').prepend(style);
$this.html(beforeLoader()).parent().addClass('type-' + type + ' id-' + type + '-' + lClass + ' show-Bouaici lazyBouaici');
break;
case 'block1':
case 'grid1':
case 'grid2':
case 'videos':
case 'gallery':
$('#page-skin-2').prepend(style);
$this.html(beforeLoader()).parent().addClass('type-' + type + ' id-' + type + '-' + lClass + ' show-Bouaici lazyBouaici');
break;
case 'col-left':
case 'col-right':
$('#page-skin-2').prepend(style);
$this.html(beforeLoader()).parent().addClass('type-' + type + ' block-column id-' + type + '-' + lClass + ' show-Bouaici lazyBouaici');
break;
case 'list':
$this.html(beforeLoader());
break;
case 'related':
$this.html(beforeLoader()).parent().addClass('show-Bouaici lazyBouaici');
break
}
},
success: function (data) {
var html = '';
switch (type) {
case 'msimple':
case 'megatabs':
html = '
' + html + '') } var $sb = $('.post-body .short-b').find('b'); $sb.each(function () { var $b = $(this), $t = $b.text().trim(); if ($t.match('alert-success') || $t.match('alert-info') || $t.match('alert-warning') || $t.match('alert-error') || $t.match('code-box')) { $b.replaceWith("") } }) }); $('.Bouaici-share-links .window-Bouaici,.entry-share .window-Bouaici').on('click', function () { var $this = $(this), url = $this.data('url'), wid = $this.data('width'), hei = $this.data('height'), wsw = window.screen.width, wsh = window.screen.height, mrl = Math.round(wsw / 2 - wid / 2), mrt = Math.round(wsh / 2 - hei / 2), win = window.open(url, '_blank', 'scrollbars=yes,resizable=yes,toolbar=no,location=yes,width=' + wid + ',height=' + hei + ',left=' + mrl + ',top=' + mrt); win.focus() }); $('.Bouaici-share-links').each(function () { var $t = $(this), $b = $t.find('.show-hid a'); $b.on('click', function () { $t.toggleClass('show-hidden') }) }); $('.about-author .author-description span a').each(function () { var $this = $(this), cls = $this.text().trim(), url = $this.attr('href'); $this.replaceWith('
' + n + '
' + h + '
إرسال تعليق