SlideShare a Scribd company logo
Politics News and U.S. Elections Coverage 
//only pass mcdougal image if it is actually not displayed in any of the items yet 
if($.inArray(it.author.image, newsbulletin.authorCutouts) == -1) 
itemDetails.authorimage = it.author.image; 
this.nbNoteDiv = ' 
'+nbNote.noteHeadline+' 
'+this.noteAuthorBlock+' 
'+nbNote.noteOverview+' 
//text 
this.text = ''; 
this.textCapped = ''; 
this.morelink = 'More' 
if(nbItemObj.text != null) 
this.text = nbItemObj.text; 
//if product just isn't expanded display capped text if applicable 
if(nbItemObj.isExpanded != true) 
if(nbItemObj.text.length > 63) 
this.textCapped = nbItemObj.text.substring(0, 63); 
this.text = this.textCapped + '...'; 
if(this.isStatusUpdate) 
this.text = this.textCapped + '... ' + this.morelink; 
'+this.notesocial+' 
'; 
nbNoteStr += this.nbNoteDiv;
); 
this.rowTemp += nbNoteStr; 
function showMoreText(id) 
//grab previous item height 
var oldItemHeight = $('#nbItem_'+id).height(); 
//retrieve the http://subduedcap1920.jimdo.com particular content from your array 
$('#text_'+id).html(contentObject[id]) 
//store id a new 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(); 
if(it.text != '') 
itemDetails.text = it.text; 
else 
itemDetails.bgPos = 'bottom right'; 
this.notetwitter = ''; 
if(nbNote.noteAuthor.twitter != null && nbNote.noteAuthor.twitter != '') 
this.notetwitter = '' 
, 5000); 
; 
addOnload(newsbulletin.load()); 
7500) 
setInterval(
function() 
return this.rowTemp; 
lastNBObjStr = currNBObjStr; 
return isNewTemp; 
else 
this.notesocial = ''; 
lastNBObjStr = ''; 
function 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'); 
//title 
this.title = ' 
'+nbItemObj.title+' 
'; 
if(nbItemObj.link != null && nbItemObj.link != '') 
this.title = '' 
this.notesocial = '';
this.noteSocialStyle = ''; 
if(nbNote.noteAuthor.name != null && nbNote.noteAuthor.name != '') this.notetwitter != '') 
this.notesocial = this.notefb + this.notetwitter; 
this.noteSocialStyle = ' style="height:21px; padding: 2px 0px;"'; 
if (idx == nbNotes.length-1) 
nbNoteDivider = ''; 
if (it.notes) 
itemDetails.notes = it.notes; 
this.notebio = ''; 
if(nbNote.noteAuthor.bio != null && nbNote.noteAuthor.bio != '') 
this.notebio = ''+nbNote.noteAuthor.name+'' 
this.noteAuthorBlock = ' 
'+this.notebio+' 
' 
//build a name worth pair set of id/text 
contentObject[itemDetails.id] = itemDetails.text 
itemDetails.isExpanded = ($.inArray(itemDetails.id, fullTextList) > -1) ? accurate : false; 
//build markup 
$("#nbItemContainer").append(newsbulletin.displayItems(itemDetails)); 
); 
$("#nbItemContainer").append(''); 
//set your height involving container div 
$("#nbItemContainer").css('height',$("#nbItemContainer").height()); 
if (shareLink != '' && shareLink != null && !isShareLinkLoaded) 
$("#newsbulletin > .midcontainer > .nbFooter").css("height":"35px", "border-top":"1px sound 
#d5d5d5", "border-bottom":"border-bottom:1px solid #eaeaea");
$("#newsbulletin > .midcontainer > .nbFooter").append(""); 
isShareLinkLoaded = true; 
if($.browser.msie) 
if ($.browser.version .midcontainer > .nbFooter").css("display":"none"); 
var timeoutId = setTimeout(function() 
$("#newsbulletin > .midcontainer > .nbFooter").css("display":"block"); 
clearTimeout(timeoutId); 
, 3000); 
isHeaderLinkLoaded = false; // flag to test if the header hyperlink is loaded 
isShareLinkLoaded = false; // flag to test when the share link is loaded 
isDoneLoading = false; // flag to test in the big event 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 a > .twitterContent").append("" + 
twitterImg + "");
isHeaderLinkLoaded = true; 
//author image 
this.nbItemStyle = ''; 
this.nbH4Class = 'class=nbheader'; 
this.nbH4Style = ''; 
this.nbItemStyleAuthor = ''; 
if(nbItemObj.authorimage != null && nbItemObj.authorimage != '') 
this.nbH4Style = ' style=width:210px;'; 
this.nbItemStyle = 'background:url('+nbItemObj.authorimage+') no-repeat bottom right'//+ 
this.itemBgPos; 
this.nbItemStyleAuthor = ' nbItemContentsAuthor' 
//social 
this.social = ''; 
this.socialStyle = ''; 
this.authorBlock = ''; 
this.divider = ''; 
this.fb = ''; 
if(nbItemObj.authorfb != null && nbItemObj.authorfb != '') 
this.fb = '' 
window.api.getContentPane().html( 
newsbulletin.load() 
); 
, 
60000 
); 
setInterval(function()
// we could call "pane.jScrollPane(settings)" once more nevertheless it is 
// more convenient to call via the actual API as then the original 
// configurations we passed within are instantly remembered. 
// Initialization in the container ought to become able to be carried out right after all of the markup 
has been loaded 
// since there will be certainly absolutely no listener in which could possibly be passed directly into 
reinitialise() for callback 
if (isDoneLoading) 
window.api.reinitialise(); 
isDoneLoading = false; 
dynamicJS.unload('newsBulletin'+nbjsId, 
newsbulletin.baseloc+'/xmldata/newsbulletin?id=14635979&'+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); 
//add for you to ignore list 
if(it.author.image != '' &&($.inArray(it.author.image, newsbulletin.authorCutouts) == -1)) 
newsbulletin.authorCutouts.push(it.author.image); 
this.twitter = ''; 
if(nbItemObj.authortwitter != null && nbItemObj.authortwitter != '') 
this.twitter = '' 
$.each(updates, function(ind) 
var itemDetails = new Object();
it = updates[ind]; 
//populate the particular 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 merchandise 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' 
" 
newsbulletin.nbFooter = "" 
//append widget header 
$("#newsbulletin > .midcontainer").append(""); 
$("#newsbulletin > .midcontainer").append(newsbulletin.nbContainer); 
$("#newsbulletin > .midcontainer").append(newsbulletin.nbFooter); 
newsbulletin.nbDiv = document.getElementById('nbItemContainer'); 
nbjsId = 0; 
newsbulletin.load = function() 
//alert(newsbulletin.baseloc+'/xmldata/newsbulletin?id=14635979&twOverride=&lpos='+newsbulle 
tin.lpos+'&section=&'+nbjsId) 
//to attempt to handle caching inside webkit browsers 
dynamicJS.load('newsBulletin'+nbjsId, 
newsbulletin.baseloc+'/xmldata/newsbulletin?id=14635979&twOverride=&lpos='+newsbulletin.lpo 
s2+'&section=&'+nbjsId); 
//dynamicJS.load('newsBulletin','http://preview.abcnews.go.com/xmldata/newsbulletin?id=13564505' 
); 
'+this.social+' 
'; 
if (nbItemObj.notes) 
nbNotes = nbItemObj.notes; 
nbNoteStr = ''; 
nbNoteDivider = ''; 
$.each(nbNotes, function(idx) 
nbNote = nbNotes[idx]; 
this.noteAuthorBlock = '';
this.notefb = ''; 
if(nbNote.noteAuthor.facebook != null && nbNote.noteAuthor.facebook != '') 
this.notefb = '' 
if(it.author.name == '') 
itemDetails.author = 'ABC News' 
itemDetails.authorfb = 'http://www.facebook.com/abcnews' 
itemDetails.authortwitter = 'http://twitter.com/abc' 
//display items 
newsbulletin.displayItems = function(nbItemObj) 
//check if status update 
this.isStatusUpdate = (nbItemObj.label == 'Status Update')?true:false; 
//item kind class 
this.itemTypeClass = (this.isStatusUpdate)?'orange':'blue'; 
//bg position 
this.itemBgPos = '100% 55%'; 
if(nbItemObj.bgPos != null) 
this.itemBgPos = nbItemObj.bgPos; 
this.textStyle = ''; 
if(nbItemObj.authorimage != null && nbItemObj.authorimage != '') 
this.textStyle = ' style=width:208px;'; 
otherwise 
if(nbItemObj.author == null 
this.categoryTag = ''; 
this.nbTextOverride = ''; 
this.rowTemp = ''+this.authorBlock+' 
'+nbItemObj.date+'
'+this.title+' 
'+this.text+' 
if(nbItemObj.author != null && nbItemObj.author != '')else 
this.social = ''; 
//clear the writer cutouts array 
newsbulletin.authorCutouts = []; 
// check to learn if there is a height set with regard to container, if that can be the case obvious it 
// prevents cacheing 
var hasHeight = $('#nbItemContainer').attr('style'); 
if (typeof hasHeight != 'undefined') 
$('#nbItemContainer').removeAttr('style'); 
this.bio = ''; 
if(nbItemObj.authorbio != null && nbItemObj.authorbio != '') 
this.bio = ''+nbItemObj.author+'' 
this.authorBlock = ' 
'+this.bio+' 
'

More Related Content

What's hot

Technology and Science News - ABC News
Technology and Science News - ABC NewsTechnology and Science News - ABC News
Technology and Science News - ABC News
numberlesspasto93
 
Politics News and U.S. Elections Coverage
Politics News and U.S. Elections CoveragePolitics News and U.S. Elections Coverage
Politics News and U.S. Elections Coverage
exoticshame065
 
Technology and Science News - ABC News
Technology and Science News - ABC NewsTechnology and Science News - ABC News
Technology and Science News - ABC News
talloration5719
 
International News | World News
International News | World NewsInternational News | World News
International News | World News
productiveengin27
 
Politics News and U.S. Elections Coverage
Politics News and U.S. Elections CoveragePolitics News and U.S. Elections Coverage
Politics News and U.S. Elections Coverage
excitedfoyer2246
 
What Would You Do? With John Quinones
What Would You Do? With John QuinonesWhat Would You Do? With John Quinones
What Would You Do? With John Quinones
numberlesspasto93
 
U.S. News | National News
U.S. News | National NewsU.S. News | National News
U.S. News | National News
rhetoricalmosai86
 
International News | World News
International News | World NewsInternational News | World News
International News | World News
boringterminolo30
 
Technology and Science News - ABC News
Technology and Science News - ABC NewsTechnology and Science News - ABC News
Technology and Science News - ABC News
gapingtrousers365
 
U.S. News | National News
U.S. News | National NewsU.S. News | National News
U.S. News | National News
willingtablewar49
 
International News | World News
International News | World NewsInternational News | World News
International News | World News
joblessbeach6696
 
Technology and Science News - ABC News
Technology and Science News - ABC NewsTechnology and Science News - ABC News
Technology and Science News - ABC News
lethalsummary6309
 
International News | World News
International News | World NewsInternational News | World News
International News | World News
moz4
 
What Would You Do? With John Quinones
What Would You Do? With John QuinonesWhat Would You Do? With John Quinones
What Would You Do? With John Quinones
alertchair8725
 
Politics News and U.S. Elections Coverage
Politics News and U.S. Elections CoveragePolitics News and U.S. Elections Coverage
Politics News and U.S. Elections Coverage
erna8nielsen65
 
What Would You Do? With John Quinones
What Would You Do? With John QuinonesWhat Would You Do? With John Quinones
What Would You Do? With John Quinones
roastedrecluse128
 
Politics News and U.S. Elections Coverage
Politics News and U.S. Elections CoveragePolitics News and U.S. Elections Coverage
Politics News and U.S. Elections Coverage
sccolumbia7779
 
Technology and Science News - ABC News
Technology and Science News - ABC NewsTechnology and Science News - ABC News
Technology and Science News - ABC News
whisperingwhiz946
 
Technology and Science News - ABC News
Technology and Science News - ABC NewsTechnology and Science News - ABC News
Technology and Science News - ABC News
boorishvictim1493
 
Politics News and U.S. Elections Coverage
Politics News and U.S. Elections CoveragePolitics News and U.S. Elections Coverage
Politics News and U.S. Elections Coverage
greedycabin1256
 

What's hot (20)

Technology and Science News - ABC News
Technology and Science News - ABC NewsTechnology and Science News - ABC News
Technology and Science News - ABC News
 
Politics News and U.S. Elections Coverage
Politics News and U.S. Elections CoveragePolitics News and U.S. Elections Coverage
Politics News and U.S. Elections Coverage
 
Technology and Science News - ABC News
Technology and Science News - ABC NewsTechnology and Science News - ABC News
Technology and Science News - ABC News
 
International News | World News
International News | World NewsInternational News | World News
International News | World News
 
Politics News and U.S. Elections Coverage
Politics News and U.S. Elections CoveragePolitics News and U.S. Elections Coverage
Politics News and U.S. Elections Coverage
 
What Would You Do? With John Quinones
What Would You Do? With John QuinonesWhat Would You Do? With John Quinones
What Would You Do? With John Quinones
 
U.S. News | National News
U.S. News | National NewsU.S. News | National News
U.S. News | National News
 
International News | World News
International News | World NewsInternational News | World News
International News | World News
 
Technology and Science News - ABC News
Technology and Science News - ABC NewsTechnology and Science News - ABC News
Technology and Science News - ABC News
 
U.S. News | National News
U.S. News | National NewsU.S. News | National News
U.S. News | National News
 
International News | World News
International News | World NewsInternational News | World News
International News | World News
 
Technology and Science News - ABC News
Technology and Science News - ABC NewsTechnology and Science News - ABC News
Technology and Science News - ABC News
 
International News | World News
International News | World NewsInternational News | World News
International News | World News
 
What Would You Do? With John Quinones
What Would You Do? With John QuinonesWhat Would You Do? With John Quinones
What Would You Do? With John Quinones
 
Politics News and U.S. Elections Coverage
Politics News and U.S. Elections CoveragePolitics News and U.S. Elections Coverage
Politics News and U.S. Elections Coverage
 
What Would You Do? With John Quinones
What Would You Do? With John QuinonesWhat Would You Do? With John Quinones
What Would You Do? With John Quinones
 
Politics News and U.S. Elections Coverage
Politics News and U.S. Elections CoveragePolitics News and U.S. Elections Coverage
Politics News and U.S. Elections Coverage
 
Technology and Science News - ABC News
Technology and Science News - ABC NewsTechnology and Science News - ABC News
Technology and Science News - ABC News
 
Technology and Science News - ABC News
Technology and Science News - ABC NewsTechnology and Science News - ABC News
Technology and Science News - ABC News
 
Politics News and U.S. Elections Coverage
Politics News and U.S. Elections CoveragePolitics News and U.S. Elections Coverage
Politics News and U.S. Elections Coverage
 

Similar to Politics News and U.S. Elections Coverage

U.S. News | National News
U.S. News | National NewsU.S. News | National News
U.S. News | National News
woodenpersonnel36
 
Technology and Science News - ABC News
Technology and Science News - ABC NewsTechnology and Science News - ABC News
Technology and Science News - ABC News
waggishwedge3973
 
Health News & Articles | Healthy Living
Health News & Articles | Healthy LivingHealth News & Articles | Healthy Living
Health News & Articles | Healthy Living
abortivecatcall84
 
Politics News and U.S. Elections Coverage
Politics News and U.S. Elections CoveragePolitics News and U.S. Elections Coverage
Politics News and U.S. Elections Coverage
plantresidence159
 
U.S. News | National News
U.S. News | National NewsU.S. News | National News
U.S. News | National News
accidentaldeity33
 
Politics News and U.S. Elections Coverage
Politics News and U.S. Elections CoveragePolitics News and U.S. Elections Coverage
Politics News and U.S. Elections Coverage
creepypreview6376
 
Technology and Science News - ABC News
Technology and Science News - ABC NewsTechnology and Science News - ABC News
Technology and Science News - ABC News
ignorantlogic4950
 
Politics News and U.S. Elections Coverage
Politics News and U.S. Elections CoveragePolitics News and U.S. Elections Coverage
Politics News and U.S. Elections Coverage
brendacuthbert89
 
Technology and Science News - ABC News
Technology and Science News - ABC NewsTechnology and Science News - ABC News
Technology and Science News - ABC News
honorablejourna10
 
Technology and Science News - ABC News
Technology and Science News - ABC NewsTechnology and Science News - ABC News
Technology and Science News - ABC News
painstakingsled66
 
20/20 | Investigative Journalism & News Magazine
20/20 | Investigative Journalism & News Magazine20/20 | Investigative Journalism & News Magazine
20/20 | Investigative Journalism & News Magazine
alertmishap944
 
U.S. News | National News
U.S. News | National NewsU.S. News | National News
U.S. News | National News
painstakingsled66
 
20/20 | Investigative Journalism & News Magazine
20/20 | Investigative Journalism & News Magazine20/20 | Investigative Journalism & News Magazine
20/20 | Investigative Journalism & News Magazine
demonicrhythm3717
 
Technology and Science News - ABC News
Technology and Science News - ABC NewsTechnology and Science News - ABC News
Technology and Science News - ABC News
spiritualvictim28
 
Politics News and U.S. Elections Coverage
Politics News and U.S. Elections CoveragePolitics News and U.S. Elections Coverage
Politics News and U.S. Elections Coverage
coldfascism4997
 

Similar to Politics News and U.S. Elections Coverage (15)

U.S. News | National News
U.S. News | National NewsU.S. News | National News
U.S. News | National News
 
Technology and Science News - ABC News
Technology and Science News - ABC NewsTechnology and Science News - ABC News
Technology and Science News - ABC News
 
Health News & Articles | Healthy Living
Health News & Articles | Healthy LivingHealth News & Articles | Healthy Living
Health News & Articles | Healthy Living
 
Politics News and U.S. Elections Coverage
Politics News and U.S. Elections CoveragePolitics News and U.S. Elections Coverage
Politics News and U.S. Elections Coverage
 
U.S. News | National News
U.S. News | National NewsU.S. News | National News
U.S. News | National News
 
Politics News and U.S. Elections Coverage
Politics News and U.S. Elections CoveragePolitics News and U.S. Elections Coverage
Politics News and U.S. Elections Coverage
 
Technology and Science News - ABC News
Technology and Science News - ABC NewsTechnology and Science News - ABC News
Technology and Science News - ABC News
 
Politics News and U.S. Elections Coverage
Politics News and U.S. Elections CoveragePolitics News and U.S. Elections Coverage
Politics News and U.S. Elections Coverage
 
Technology and Science News - ABC News
Technology and Science News - ABC NewsTechnology and Science News - ABC News
Technology and Science News - ABC News
 
Technology and Science News - ABC News
Technology and Science News - ABC NewsTechnology and Science News - ABC News
Technology and Science News - ABC News
 
20/20 | Investigative Journalism & News Magazine
20/20 | Investigative Journalism & News Magazine20/20 | Investigative Journalism & News Magazine
20/20 | Investigative Journalism & News Magazine
 
U.S. News | National News
U.S. News | National NewsU.S. News | National News
U.S. News | National News
 
20/20 | Investigative Journalism & News Magazine
20/20 | Investigative Journalism & News Magazine20/20 | Investigative Journalism & News Magazine
20/20 | Investigative Journalism & News Magazine
 
Technology and Science News - ABC News
Technology and Science News - ABC NewsTechnology and Science News - ABC News
Technology and Science News - ABC News
 
Politics News and U.S. Elections Coverage
Politics News and U.S. Elections CoveragePolitics News and U.S. Elections Coverage
Politics News and U.S. Elections Coverage
 

Politics News and U.S. Elections Coverage

  • 1. Politics News and U.S. Elections Coverage //only pass mcdougal image if it is actually not displayed in any of the items yet if($.inArray(it.author.image, newsbulletin.authorCutouts) == -1) itemDetails.authorimage = it.author.image; this.nbNoteDiv = ' '+nbNote.noteHeadline+' '+this.noteAuthorBlock+' '+nbNote.noteOverview+' //text this.text = ''; this.textCapped = ''; this.morelink = 'More' if(nbItemObj.text != null) this.text = nbItemObj.text; //if product just isn't expanded display capped text if applicable if(nbItemObj.isExpanded != true) if(nbItemObj.text.length > 63) this.textCapped = nbItemObj.text.substring(0, 63); this.text = this.textCapped + '...'; if(this.isStatusUpdate) this.text = this.textCapped + '... ' + this.morelink; '+this.notesocial+' '; nbNoteStr += this.nbNoteDiv;
  • 2. ); this.rowTemp += nbNoteStr; function showMoreText(id) //grab previous item height var oldItemHeight = $('#nbItem_'+id).height(); //retrieve the http://subduedcap1920.jimdo.com particular content from your array $('#text_'+id).html(contentObject[id]) //store id a new 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(); if(it.text != '') itemDetails.text = it.text; else itemDetails.bgPos = 'bottom right'; this.notetwitter = ''; if(nbNote.noteAuthor.twitter != null && nbNote.noteAuthor.twitter != '') this.notetwitter = '' , 5000); ; addOnload(newsbulletin.load()); 7500) setInterval(
  • 3. function() return this.rowTemp; lastNBObjStr = currNBObjStr; return isNewTemp; else this.notesocial = ''; lastNBObjStr = ''; function 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'); //title this.title = ' '+nbItemObj.title+' '; if(nbItemObj.link != null && nbItemObj.link != '') this.title = '' this.notesocial = '';
  • 4. this.noteSocialStyle = ''; if(nbNote.noteAuthor.name != null && nbNote.noteAuthor.name != '') this.notetwitter != '') this.notesocial = this.notefb + this.notetwitter; this.noteSocialStyle = ' style="height:21px; padding: 2px 0px;"'; if (idx == nbNotes.length-1) nbNoteDivider = ''; if (it.notes) itemDetails.notes = it.notes; this.notebio = ''; if(nbNote.noteAuthor.bio != null && nbNote.noteAuthor.bio != '') this.notebio = ''+nbNote.noteAuthor.name+'' this.noteAuthorBlock = ' '+this.notebio+' ' //build a name worth pair set of id/text contentObject[itemDetails.id] = itemDetails.text itemDetails.isExpanded = ($.inArray(itemDetails.id, fullTextList) > -1) ? accurate : false; //build markup $("#nbItemContainer").append(newsbulletin.displayItems(itemDetails)); ); $("#nbItemContainer").append(''); //set your height involving container div $("#nbItemContainer").css('height',$("#nbItemContainer").height()); if (shareLink != '' && shareLink != null && !isShareLinkLoaded) $("#newsbulletin > .midcontainer > .nbFooter").css("height":"35px", "border-top":"1px sound #d5d5d5", "border-bottom":"border-bottom:1px solid #eaeaea");
  • 5. $("#newsbulletin > .midcontainer > .nbFooter").append(""); isShareLinkLoaded = true; if($.browser.msie) if ($.browser.version .midcontainer > .nbFooter").css("display":"none"); var timeoutId = setTimeout(function() $("#newsbulletin > .midcontainer > .nbFooter").css("display":"block"); clearTimeout(timeoutId); , 3000); isHeaderLinkLoaded = false; // flag to test if the header hyperlink is loaded isShareLinkLoaded = false; // flag to test when the share link is loaded isDoneLoading = false; // flag to test in the big event 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 a > .twitterContent").append("" + twitterImg + "");
  • 6. isHeaderLinkLoaded = true; //author image this.nbItemStyle = ''; this.nbH4Class = 'class=nbheader'; this.nbH4Style = ''; this.nbItemStyleAuthor = ''; if(nbItemObj.authorimage != null && nbItemObj.authorimage != '') this.nbH4Style = ' style=width:210px;'; this.nbItemStyle = 'background:url('+nbItemObj.authorimage+') no-repeat bottom right'//+ this.itemBgPos; this.nbItemStyleAuthor = ' nbItemContentsAuthor' //social this.social = ''; this.socialStyle = ''; this.authorBlock = ''; this.divider = ''; this.fb = ''; if(nbItemObj.authorfb != null && nbItemObj.authorfb != '') this.fb = '' window.api.getContentPane().html( newsbulletin.load() ); , 60000 ); setInterval(function()
  • 7. // we could call "pane.jScrollPane(settings)" once more nevertheless it is // more convenient to call via the actual API as then the original // configurations we passed within are instantly remembered. // Initialization in the container ought to become able to be carried out right after all of the markup has been loaded // since there will be certainly absolutely no listener in which could possibly be passed directly into reinitialise() for callback if (isDoneLoading) window.api.reinitialise(); isDoneLoading = false; dynamicJS.unload('newsBulletin'+nbjsId, newsbulletin.baseloc+'/xmldata/newsbulletin?id=14635979&'+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); //add for you to ignore list if(it.author.image != '' &&($.inArray(it.author.image, newsbulletin.authorCutouts) == -1)) newsbulletin.authorCutouts.push(it.author.image); this.twitter = ''; if(nbItemObj.authortwitter != null && nbItemObj.authortwitter != '') this.twitter = '' $.each(updates, function(ind) var itemDetails = new Object();
  • 8. it = updates[ind]; //populate the particular 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 merchandise is a status update if(itemDetails.label == 'Status Update')
  • 9. if(it.author.image == '') it.author.image = 'http://a.abcnews.com/assets/images/abc_news_logo_84x84.png' " newsbulletin.nbFooter = "" //append widget header $("#newsbulletin > .midcontainer").append(""); $("#newsbulletin > .midcontainer").append(newsbulletin.nbContainer); $("#newsbulletin > .midcontainer").append(newsbulletin.nbFooter); newsbulletin.nbDiv = document.getElementById('nbItemContainer'); nbjsId = 0; newsbulletin.load = function() //alert(newsbulletin.baseloc+'/xmldata/newsbulletin?id=14635979&twOverride=&lpos='+newsbulle tin.lpos+'&section=&'+nbjsId) //to attempt to handle caching inside webkit browsers dynamicJS.load('newsBulletin'+nbjsId, newsbulletin.baseloc+'/xmldata/newsbulletin?id=14635979&twOverride=&lpos='+newsbulletin.lpo s2+'&section=&'+nbjsId); //dynamicJS.load('newsBulletin','http://preview.abcnews.go.com/xmldata/newsbulletin?id=13564505' ); '+this.social+' '; if (nbItemObj.notes) nbNotes = nbItemObj.notes; nbNoteStr = ''; nbNoteDivider = ''; $.each(nbNotes, function(idx) nbNote = nbNotes[idx]; this.noteAuthorBlock = '';
  • 10. this.notefb = ''; if(nbNote.noteAuthor.facebook != null && nbNote.noteAuthor.facebook != '') this.notefb = '' if(it.author.name == '') itemDetails.author = 'ABC News' itemDetails.authorfb = 'http://www.facebook.com/abcnews' itemDetails.authortwitter = 'http://twitter.com/abc' //display items newsbulletin.displayItems = function(nbItemObj) //check if status update this.isStatusUpdate = (nbItemObj.label == 'Status Update')?true:false; //item kind class this.itemTypeClass = (this.isStatusUpdate)?'orange':'blue'; //bg position this.itemBgPos = '100% 55%'; if(nbItemObj.bgPos != null) this.itemBgPos = nbItemObj.bgPos; this.textStyle = ''; if(nbItemObj.authorimage != null && nbItemObj.authorimage != '') this.textStyle = ' style=width:208px;'; otherwise if(nbItemObj.author == null this.categoryTag = ''; this.nbTextOverride = ''; this.rowTemp = ''+this.authorBlock+' '+nbItemObj.date+'
  • 11. '+this.title+' '+this.text+' if(nbItemObj.author != null && nbItemObj.author != '')else this.social = ''; //clear the writer cutouts array newsbulletin.authorCutouts = []; // check to learn if there is a height set with regard to container, if that can be the case obvious it // prevents cacheing var hasHeight = $('#nbItemContainer').attr('style'); if (typeof hasHeight != 'undefined') $('#nbItemContainer').removeAttr('style'); this.bio = ''; if(nbItemObj.authorbio != null && nbItemObj.authorbio != '') this.bio = ''+nbItemObj.author+'' this.authorBlock = ' '+this.bio+' '