With the needs of Afghan children greater than ever before, the world “cannot abandon them now”, a senior official with the UN Children’s Fund (...
","whicProcessBuiltThisRecordSet":"ic3-library-.php __FAST function @ LINE#4268"},{"theID":11070,"theTitle":"No Ban! No Wall! No War!","thePermalink":"https://islamicity.org/11070/no-ban-no-wall-no-war/","theExcerpt":" ","theIcon":"","theReadingTime":"","theCategory":"Articles|/explore/articles","theTag":"Climate Change|/topics/climate-change","theDate":1486465200,"theAuthor":"Richard Moser|/by/richard-moser/","theAuthorName":"Richard Moser","theThumbnail":"https://media.islamicity.org/wp-content/uploads/2017/02/protesters-gather-london-fight-against-trump-immigration-order.jpg","thePostStatus":"publish","topics_SER":"a:6:{i:0;s:38:\"Climate Change|/topics/climate-change/\";i:1;s:38:\"Foreign Policy|/topics/foreign-policy/\";i:2;s:42:\"Peace & Justice|/topics/peace-justice/\";i:3;s:26:\"Refugees|/topics/refugees/\";i:4;s:32:\"Richard Moser|/by/richard-moser/\";i:5;s:36:\"Counter Punch|/source/counter-punch/\";}","theLinks":"Climate Change, Foreign Policy, Peace & Justice","blpCustomFieldEmbed":null,"whicProcessBuiltThisRecordSet":"ic3-library-.php __FAST function @ LINE#4268"},{"theID":11045,"theTitle":"Jews Rejecting Ban On Muslim Refugees","thePermalink":"https://islamicity.org/11045/jews-rejecting-ban-muslim-refugees/","theExcerpt":" ","theIcon":"","theReadingTime":"","theCategory":"Americas|/explore/americas","theTag":"American Muslims|/topics/american-muslims","theDate":1485856800,"theAuthor":"Rabbi Allen S. Maller|/by/rabbi-allen-s-maller/","theAuthorName":"Rabbi Allen S. Maller","theThumbnail":"https://media.islamicity.org/wp-content/uploads/2017/01/trump-executive-order1600.jpg","thePostStatus":"publish","topics_SER":"a:6:{i:0;s:42:\"American Muslims|/topics/american-muslims/\";i:1;s:34:\"Donald Trump|/topics/donald-trump/\";i:2;s:30:\"Muslim Ban|/topics/muslim-ban/\";i:3;s:26:\"Refugees|/topics/refugees/\";i:4;s:47:\"Rabbi Allen S. Maller|/by/rabbi-allen-s-maller/\";i:5;s:22:\"iViews|/source/iviews/\";}","theLinks":"Muslim Ban, Donald Trump, American Muslims","blpCustomFieldEmbed":null,"whicProcessBuiltThisRecordSet":"ic3-library-.php __FAST function @ LINE#4268"},{"theID":10072,"theTitle":"As Sweden Absorbs Refugees, Some Warn The Welcome Won't Last","thePermalink":"https://islamicity.org/10072/as-sweden-absorbs-refugees-some-warn-the-welcome-wont-last/","theExcerpt":" ","theIcon":"","theReadingTime":"","theCategory":"Audio|/explore/audio","theTag":"Refugees|/topics/refugees","theDate":1459962720,"theAuthor":"Npr|/source/npr/","theAuthorName":"Npr","theThumbnail":"https://media.islamicity.org/wp-content/uploads/2015/06/a12_islamic_art.jpg","thePostStatus":"publish","topics_SER":"a:3:{i:0;s:26:\"Refugees|/topics/refugees/\";i:1;s:22:\"Sweden|/topics/sweden/\";i:2;s:16:\"Npr|/source/npr/\";}","theLinks":"Sweden, Refugees","blpCustomFieldEmbed":"","whicProcessBuiltThisRecordSet":"ic3-library-.php __FAST function @ LINE#4268"}];
// console.log(posts);
let currentIndex = 0;
const postsContainer = document.getElementById('posts-container');
const loadMoreBtn = document.getElementById('load-more');
const loadAllBtn = document.getElementById('load-all');
const postsPerPage = 6;
// you do not need to worry about paintImage callsas far as theThumbnail being empty becuase we took care of this at the time getting all the posts for this page
function paintImage_JS(w = 500, h = 282, theThumbnail, className = '', theTitle = '', asIs = '', loading = 'lazy') {
// Ensure title is safe for HTML attributes
// if (MHK) alert('MHK');
// debugger;
console.log('\n\n____'+theThumbnail+'____\n\n');
theTitle = theTitle.replace(/"/g, '"');
// Truncate alt text to a max of 125 characters (ensuring full words)
if (theTitle.length > 125) {
theTitle = theTitle.substring(0, 122) + '...';
}
// Define `srcset` for responsive loading
const srcset = `
https://www.islamicity.org/wp-content/plugins/blueprint-timthumb/timthumb.php?v=TEMPVV&src=${theThumbnail}&w=300&h=${Math.round(h * 300 / w)}&q=80 300w,
https://www.islamicity.org/wp-content/plugins/blueprint-timthumb/timthumb.php?v=TEMPVV&src=${theThumbnail}&w=768&h=${Math.round(h * 768 / w)}&q=90 768w,
https://www.islamicity.org/wp-content/plugins/blueprint-timthumb/timthumb.php?v=TEMPVV&src=${theThumbnail}&w=1024&h=${Math.round(h * 1024 / w)}&q=95 1024w,
https://www.islamicity.org/wp-content/plugins/blueprint-timthumb/timthumb.php?v=TEMPVV&src=${theThumbnail}&w=${w}&h=${h}&q=100 ${w}w
`.trim();
// Define `sizes` for different screen widths
const sizes = "(max-width: 480px) 100vw, (max-width: 768px) 80vw, (max-width: 1024px) 60vw, 50vw";
// Construct the image tag as a string
return `
`.trim();
}
function createPostHTML(post,theImageTag) {
var theAuthorLink = post.theAuthor.split('|')[1];
var theAuthorCaption = post.theAuthor.split('|')[0];
if ( theAuthorLink.includes('ource/')) {
var theByOrSource = 'Source:';
} else {
var theByOrSource = 'By:';
}
return `