6. //grab previous product height
var oldItemHeight = $('#nbItem_'+id).height();
//retrieve the content material from the array
$('#text_'+id).html(contentObject[id])
//store id any list of opened objects
fullTextList.push(id.toString());
var newContainerHeight = $("#nbItemContainer").height() + ($('#nbItem_'+id).height()-
oldItemHeight);
$("#nbItemContainer").css('height', newContainerHeight);
//reinitialize scroll
window.api.reinitialise();
lastNBObjStr = '';
perform isNewData(data)
isNewTemp = false;
currNBObjStr = '';
$.each(data.updates, function(ind)
currNBObjStr = currNBObjStr + data.updates[ind].objId + data.updates[ind].date;
);
//console.log('x'+currNBObjStr);
//console.log('y'+lastNBObjStr);
if(currNBObjStr != lastNBObjStr)
isNewTemp = true;
else
//console.log('no refresh');
lastNBObjStr = currNBObjStr;
return isNewTemp;
7. isHeaderLinkLoaded = false; // flag to check if the header link can be loaded
isShareLinkLoaded = false; // flag to check on when the discuss hyperlink is loaded
isDoneLoading = false; // flag to check on when the html is completed loading within the jScrollPane
function newsBulletin(data)
if(data)
isNewDataFlag = isNewData(data);
if(isNewDataFlag)
//clear contents first
newsbulletin.nbDiv.innerHTML = '';
//console.log('refresh');
updates = data.updates;
headerLink = data.widgetLink;
shareLink = data.shareLink;
if (headerLink != '' && headerLink != null && !isHeaderLinkLoaded)
var twitterImg = " "
$("#newsbulletin > .midcontainer > .widget_head").append("");
$("#newsbulletin > .midcontainer > .widget_head > .twitterLink any > .twitterContent").append(""
+ twitterImg + "");
isHeaderLinkLoaded = true;
//clear the author cutouts array
newsbulletin.authorCutouts = [];
// examine to discover if there will be a height set regarding container, if that's the case clear it
// prevents cacheing
var hasHeight = $('#nbItemContainer').attr('style');
if (typeof hasHeight != 'undefined')
$('#nbItemContainer').removeAttr('style');
8. $.each(updates, function(ind)
var itemDetails = new Object();
it = updates[ind];
//populate the actual itemDetails object
itemDetails.id = it.objId;
itemDetails.title = it.title;
itemDetails.objType = it.objType;
itemDetails.link = it.link;
itemDetails.date = it.date;
itemDetails.label = it.label;
itemDetails.author = it.author.name;
itemDetails.authorbio = it.author.bio;
itemDetails.authorfb = it.author.facebook;
itemDetails.authortwitter = it.author.twitter;
itemDetails.feed = it.feed;
itemDetails.category = it.category;
//set defaults if product is a status update
if(itemDetails.label == 'Status Update')
if(it.author.image == '')
it.author.image = 'http://a.abcnews.com/assets/images/abc_news_logo_84x84.png'
if(it.author.name == '')
itemDetails.author = 'ABC News'
itemDetails.authorfb = 'http://www.facebook.com/abcnews'
itemDetails.authortwitter = 'http://twitter.com/abc'
//only pass the author image if it will be not displayed within some of those items yet
if($.inArray(it.author.image, newsbulletin.authorCutouts) == -1)
9. itemDetails.authorimage = it.author.image;
//add for you to ignore list
if(it.author.image != '' &&($.inArray(it.author.image, newsbulletin.authorCutouts) == -1))
newsbulletin.authorCutouts.push(it.author.image);
if(it.text != '')
itemDetails.text = it.text;
else
itemDetails.bgPos = 'bottom right';
if (it.notes)
itemDetails.notes = it.notes;
//build a reputation worth pair listing of id/text
contentObject[itemDetails.id] = itemDetails.text
itemDetails.isExpanded =
($.inArray(itemDetails.id, fullTextList) > -1) ?
correct : false;
//build markup
$("#nbItemContainer").append(newsbulletin.displayItems(itemDetails));
);
$("#nbItemContainer").append('');
//set your height associated with container div
$("#nbItemContainer").css('height',$("#nbItemContainer").height());
if (shareLink != '' && shareLink != null && !isShareLinkLoaded)
$("#newsbulletin > .midcontainer > .nbFooter").css("height":"35px", "border-top":"1px solid
#d5d5d5", "border-bottom":"border-bottom:1px sound #eaeaea");
$("#newsbulletin > .midcontainer > .nbFooter").append("");
isShareLinkLoaded = true;
10. if($.browser.msie)
if ($.browser.version .midcontainer > .nbFooter").css("display":"none");
var timeoutId = setTimeout(function()
$("#newsbulletin > .midcontainer > .nbFooter").css("display":"block");
clearTimeout(timeoutId);
, 3000);
dynamicJS.unload('newsBulletin'+nbjsId,
newsbulletin.baseloc+'/xmldata/newsbulletin?id=14640490&'+nbjsId);
isDoneLoading = true;
if ($.browser.webkit)
if(nbjsId .midcontainer > .nbFooter").css("display":"none");
var timeoutId = setTimeout(function()
$("#newsbulletin > .midcontainer > .nbFooter").css("display":"block");
clearTimeout(timeoutId);
, 3000);
7500)
setInterval(
function()
window.api.getContentPane().html(
newsbulletin.load()
);
,
120000
);
setInterval(function()
// we're able to call "pane.jScrollPane(settings)" once more however it is
11. // a lot more convenient to be able to call via the API as then your original
// options we passed throughout are article to video robot usually routinely remembered.
// Initialization with the container should be carried out after all the markup continues to always be
able to be loaded
// since there is actually certainly no listener in which could be passed in to reinitialise() regarding
callback
if (isDoneLoading)
window.api.reinitialise();
isDoneLoading = false;
, 5000);
;
addOnload(newsbulletin.load());