',
'
']
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 = 4;
//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 = 4;
//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:
- Scenes from Yida refugee camp in South Sudan - NBCNews.com (blog) - 17/09/2012 02:48
- Small steps mean big hurrah for South Sudan 0 - London Free Press - 16/09/2012 20:36
- South Sudan army sinks its own boat, killing 10 - CBS News - 16/09/2012 14:47
- China Says South Sudan Oil May Flow - China Digital Times - 16/09/2012 14:42
- South Sudan army sinks its own boat, killing 10 - The Seattle Times - 16/09/2012 14:37
Older news items
- South Sudan army sinks its own boat, killing 10 - The Associated Press - 16/09/2012 14:24
- Wek's South Sudan homecoming - Bayoubuzz - 16/09/2012 00:34
- South Sudan slices crude cake into three parts - PakistanToday.com.pk - 15/09/2012 23:55
- Flooding, conflict victims need aid in Jonglei, South Sudan - Examiner.com - 15/09/2012 12:43
- China's Africa envoy says South Sudan oil may flow by November - Chicago Tribune - 15/09/2012 10:22
Latest news items (all categories):
- The Emerging Endgame of the Russo-Ukrainian War - 05/08/2026 22:59
- The changing face of “Made in China” - 05/08/2026 22:41
- UK - Change of His Majesty’s Ambassador to South Sudan: Rebecca Fabrizi - 05/08/2026 22:09
- South Sudan rewriting its future with eyes on agriculture and mining boom - 05/08/2026 21:53
- Moroccan king's letter confirms naming of major highway in honour of Trump - 05/08/2026 21:52
Random articles (all categories):
- South Sudan Supreme boss freed, to compensate crash victims - 25/09/2023 06:43
- IOM - Field Assistant (Hygiene Promotion, Risk Communication and Community Engagement -WASH) - 30/01/2025 18:57
- Fighting erupts again in South Sudan - 18/02/2014 14:05
- Episcopal Relief Development Responds to Civil Unrest and the COVID-19 Pandemic in South Sudan - 28/04/2022 13:06
- Fears after Kenya deports South Sudan rebel spokesman - 05/11/2016 13:17
Popular articles:
- Who is the darkest person in the world, according to Guinness World Record? - 25/10/2022 02:34 - Read 148323 times
- School exam results in South Sudan show decline - 01/04/2012 17:58 - Read 27918 times
- Top 10 weakest currency exchange rates in Africa in 2023 - 19/07/2023 00:24 - Read 25004 times
- No oil in troubled waters - 25/03/2014 15:02 - Read 24329 times
- NDSU student from South Sudan receives scholarship - In-Forum - 29/09/2012 01:44 - Read 22283 times