',
'
']
return ret.join('');
}
function setCarouselContents(){
var paramUser = getParamUser();
var recipe = "3"; //s.getCookieForRecVidABTest();
var paramABTestBucket = getParamABTestBucket(recipe);
var baseurl = "http://md1.washingtonpost.com";//"http://md1.washingtonpost.com"
//The current url
var paramCurrentUrl = "&url=" + encodeURI(TWP.Data.NN.canonicalURL);//we have confirmation this is preferred over 'href'
//test url - we need this especially for recipe 4. Other recipes may work at least partially with prodprev urls
//var paramCurrentUrl = "&url=" + encodeURI("/entertainment/tv/tbss-men-at-work-a-rerun-before-its-even-started/2012/05/23/gJQAcSedkU_story.html");
var rgUrlGetRecommendedVideos = [baseurl, "/search-recommendation/videos.jsonp?callback=?", paramUser, paramABTestBucket, paramCurrentUrl];
var urlGetRecommendedVideos = rgUrlGetRecommendedVideos.join('');
$.getJSON(urlGetRecommendedVideos, function(data) {
if(data == null || data.results == undefined || data.results == null){
return;
}
//constants - the size of images, count of items per row
var itemsPerRow = 3;
//the following five lines specify the size. Note that only those sizes automatically generated by Methode are supported.
var photoPathPrefix = "http://img.wpdigital.net/rf/image_172x114";
var maxPhotoWidth = 172;
var maxPhotoHeight = 114;
var photoWidth = maxPhotoWidth + "";
var photoHeight = maxPhotoHeight + "";
var maxPhotoHeightpx = maxPhotoHeight + "px";
var minPhotoWidthpx = maxPhotoWidth + "px";
var blankImageUrl = "http://img.wpdigital.net/wp-srv/images/spacer.gif";
var results = data.results;
//we want to only show full rows. It was decided partial rows look like an error.
var countResultsToShow = results.length = maxPhotoWidth && photo.path != undefined && photo.path != null){
photoPath = photoPathPrefix + photo.path;
}
//construct the div, by concatenating the array
var rgDiv=[''];
arrayOfHtmlDivs[i] = rgDiv.join('');
}
var rgFinal = new Array();
var iRow = 0;
for(var i=0; i'];
var rowStart = rgRowStart.join('');
rgFinal.push(rowStart);
for(var j=0; j
";
//$("#storiesConnector").html(rowOfVideos);
var jCarousel = $("#recommended-videos-module").after(htmlToSet);
//jCarousel.find('.carousel-control-prev').click(function(){alert("Clicked prev");});
//$(jCarousel).find('.carousel-control-prev').click(function(){alert("Clicked prev2");});
$('#btn-prev').click(function(){
//alert("button prev was clicked");
moveCarousel(findRowContainer(this), -1);
});
$('#btn-next').click(function(){
//alert("button next was clicked");
moveCarousel(findRowContainer(this), 1);
});
});
function findRowContainer(clicked) {
return $(clicked).parents('.panel.postMost').find('.stories-container');
}
function findCurrentRow(rowContainer) {
return rowContainer.children('.on').first();
}
function findIndexLastRow(rowContainer){
var rowCount = rowContainer.children().length;
return rowCount == 0 ? 0 : rowCount - 1;
}
function moveCarousel(rowContainer, delta) {
//moves the carousel to the next or previous row, depending on delta
//plan:
// Find current Row
// Figure out which row-to-select
// if the row-to-select != current Row
// disable all buttons
// fade out current row
// make row-to-select the current-row
// fade in row-to-select
// enable buttons based on current-row
//find current row
var curRow = findCurrentRow(rowContainer);
var indexLastRow = findIndexLastRow(rowContainer);
//figure out row to select
var indexCurRow = parseInt(curRow.attr("rel"));
var indexRowToSelect = indexCurRow + delta;
if(indexRowToSelect indexLastRow){
indexRowToSelect = indexLastRow;
}
//only proceed if there is a possible change
if(indexCurRow != indexRowToSelect) {
//disable all buttons
$('#btn-prev').addClass("deactivated");
$('#btn-next').addClass("deactivated");
//fade out current row
curRow.fadeOut(100, function(){
curRow.hide();
//make row-to-select the current row
//remove class 'on'
rowContainer.children('.on').removeClass('on')
//add class 'on'
var rowNext = $(rowContainer.children()[indexRowToSelect]);
rowNext.addClass('on');
//fade in the new row
rowNext.fadeIn(100, function() {
rowNext.show();
//alert("index row to select=" + indexRowToSelect + ", indexLastRow=" + indexLastRow);
//enable buttons based on current row
var enablePrev = indexRowToSelect != 0;
var enableNext = indexRowToSelect != indexLastRow;
if(enablePrev) {
$('#btn-prev').removeClass("deactivated");
}
if(enableNext) {
$('#btn-next').removeClass("deactivated");
}
});
});
}
}
}
...
',
'
']
return ret.join('');
}
function setCarouselContents(){
var paramUser = getParamUser();
var recipe = "3"; //s.getCookieForRecVidABTest();
var paramABTestBucket = getParamABTestBucket(recipe);
var baseurl = "http://md1.washingtonpost.com";//"http://md1.washingtonpost.com"
//The current url
var paramCurrentUrl = "&url=" + encodeURI(TWP.Data.NN.canonicalURL);//we have confirmation this is preferred over 'href'
//test url - we need this especially for recipe 4. Other recipes may work at least partially with prodprev urls
//var paramCurrentUrl = "&url=" + encodeURI("/entertainment/tv/tbss-men-at-work-a-rerun-before-its-even-started/2012/05/23/gJQAcSedkU_story.html");
var rgUrlGetRecommendedVideos = [baseurl, "/search-recommendation/videos.jsonp?callback=?", paramUser, paramABTestBucket, paramCurrentUrl];
var urlGetRecommendedVideos = rgUrlGetRecommendedVideos.join('');
$.getJSON(urlGetRecommendedVideos, function(data) {
if(data == null || data.results == undefined || data.results == null){
return;
}
//constants - the size of images, count of items per row
var itemsPerRow = 3;
//the following five lines specify the size. Note that only those sizes automatically generated by Methode are supported.
var photoPathPrefix = "http://img.wpdigital.net/rf/image_172x114";
var maxPhotoWidth = 172;
var maxPhotoHeight = 114;
var photoWidth = maxPhotoWidth + "";
var photoHeight = maxPhotoHeight + "";
var maxPhotoHeightpx = maxPhotoHeight + "px";
var minPhotoWidthpx = maxPhotoWidth + "px";
var blankImageUrl = "http://img.wpdigital.net/wp-srv/images/spacer.gif";
var results = data.results;
//we want to only show full rows. It was decided partial rows look like an error.
var countResultsToShow = results.length = maxPhotoWidth && photo.path != undefined && photo.path != null){
photoPath = photoPathPrefix + photo.path;
}
//construct the div, by concatenating the array
var rgDiv=[''];
arrayOfHtmlDivs[i] = rgDiv.join('');
}
var rgFinal = new Array();
var iRow = 0;
for(var i=0; i'];
var rowStart = rgRowStart.join('');
rgFinal.push(rowStart);
for(var j=0; j
";
//$("#storiesConnector").html(rowOfVideos);
var jCarousel = $("#recommended-videos-module").after(htmlToSet);
//jCarousel.find('.carousel-control-prev').click(function(){alert("Clicked prev");});
//$(jCarousel).find('.carousel-control-prev').click(function(){alert("Clicked prev2");});
$('#btn-prev').click(function(){
//alert("button prev was clicked");
moveCarousel(findRowContainer(this), -1);
});
$('#btn-next').click(function(){
//alert("button next was clicked");
moveCarousel(findRowContainer(this), 1);
});
});
function findRowContainer(clicked) {
return $(clicked).parents('.panel.postMost').find('.stories-container');
}
function findCurrentRow(rowContainer) {
return rowContainer.children('.on').first();
}
function findIndexLastRow(rowContainer){
var rowCount = rowContainer.children().length;
return rowCount == 0 ? 0 : rowCount - 1;
}
function moveCarousel(rowContainer, delta) {
//moves the carousel to the next or previous row, depending on delta
//plan:
// Find current Row
// Figure out which row-to-select
// if the row-to-select != current Row
// disable all buttons
// fade out current row
// make row-to-select the current-row
// fade in row-to-select
// enable buttons based on current-row
//find current row
var curRow = findCurrentRow(rowContainer);
var indexLastRow = findIndexLastRow(rowContainer);
//figure out row to select
var indexCurRow = parseInt(curRow.attr("rel"));
var indexRowToSelect = indexCurRow + delta;
if(indexRowToSelect indexLastRow){
indexRowToSelect = indexLastRow;
}
//only proceed if there is a possible change
if(indexCurRow != indexRowToSelect) {
//disable all buttons
$('#btn-prev').addClass("deactivated");
$('#btn-next').addClass("deactivated");
//fade out current row
curRow.fadeOut(100, function(){
curRow.hide();
//make row-to-select the current row
//remove class 'on'
rowContainer.children('.on').removeClass('on')
//add class 'on'
var rowNext = $(rowContainer.children()[indexRowToSelect]);
rowNext.addClass('on');
//fade in the new row
rowNext.fadeIn(100, function() {
rowNext.show();
//alert("index row to select=" + indexRowToSelect + ", indexLastRow=" + indexLastRow);
//enable buttons based on current row
var enablePrev = indexRowToSelect != 0;
var enableNext = indexRowToSelect != indexLastRow;
if(enablePrev) {
$('#btn-prev').removeClass("deactivated");
}
if(enableNext) {
$('#btn-next').removeClass("deactivated");
}
});
});
}
}
}
Newer articles:
- Syracuse area doctors lead medical team to South Sudan - Syracuse.com - 07/12/2012 18:18
- Trader murdered in South Sudan in unprovoked attackPublish Date: Dec 06, 2012 - New Vision - 07/12/2012 09:48
- Borders and boundaries draw friction in South Sudan - defenceWeb - 07/12/2012 04:15
- Uganda, South Sudan sign security pact... - New Vision - 07/12/2012 02:23
- George Clooney: Village burnings in Sudan are 'a war crime' - Christian Science Monitor - 06/12/2012 17:15
Older news items
- Elephants in South Sudan: Extinct in under 5 years? - Greener Ideal - 05/12/2012 19:33
- At least 30 killed in South Sudan cattle raid - gulfnews.com - 05/12/2012 08:56
- Helping young refugees in South Sudan find physical and emotional security - UNHCR (press release) - 05/12/2012 05:05
- At least 30 killed in South Sudan cattle raid: officials - DAWN.com - 05/12/2012 03:00
- South Sudan's elephants face extinction: experts - Phys.Org - 04/12/2012 14:50
Latest news items (all categories):
- IGAD and South Sudan Strengthen National Coordination for the Implementation of the Building Women’s Economic Resilience for Sustainable Peace Project - 03/08/2026 18:53
- South Sudan plans interoperable birth registration, digital ID systems - 03/08/2026 18:50
- South Sudan Oil & Power Returns as South Sudan’s Premier Investment Platform - 03/08/2026 18:04
- Kenya: Mudavadi meets South Sudan foreign minister as Juba gears up for landmark elections - 03/08/2026 16:52
- A Long Road Home: Jal’s Journey Through Conflict and Separation - 03/08/2026 16:41
Random articles (all categories):
- Dwyer: ‘Long Walk To Learn’ to raise awareness about South Sudan - 17/09/2013 05:33
- South Sudan sets $10,000 ceiling for travellers to curb cash outflows - 30/09/2020 08:33
- South Sudan’s Kiir relieves Unity state governor Taban Deng - 08/07/2013 06:59
- South Sudan leaders show little appetite for peace deal: U.N. - 14/08/2014 17:48
- In COVID-19 Migration Surge, Africans Take a More Dangerous Route - 02/09/2020 10:45
Popular articles:
- Who is the darkest person in the world, according to Guinness World Record? - 25/10/2022 02:34 - Read 148280 times
- School exam results in South Sudan show decline - 01/04/2012 17:58 - Read 27915 times
- Top 10 weakest currency exchange rates in Africa in 2023 - 19/07/2023 00:24 - Read 25000 times
- No oil in troubled waters - 25/03/2014 15:02 - Read 24324 times
- NDSU student from South Sudan receives scholarship - In-Forum - 29/09/2012 01:44 - Read 22280 times