SlideShare a Scribd company logo
1 of 11
Download to read offline
Politics News and U.S. Elections Coverage
"
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 try and handle caching throughout webkit browsers
dynamicJS.load('newsBulletin'+nbjsId,
newsbulletin.baseloc+'/xmldata/newsbulletin?id=14635979&twOverride=&lpos='+newsbulletin.lpo
s2+'&section=&'+nbjsId);
//dynamicJS.load('newsBulletin','http://newspreview.corp.dig.com/xmldata/newsbulletin?id=1356450
5');
//display items
newsbulletin.displayItems = function(nbItemObj)
//check if status update
this.isStatusUpdate = (nbItemObj.label == 'Status Update')?true:false;
//item type class
this.itemTypeClass = (this.isStatusUpdate)?'orange':'blue';
//bg position
this.itemBgPos = '100% 55%';
if(nbItemObj.bgPos != null)
this.itemBgPos = nbItemObj.bgPos;
//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'
//title
this.title = '
'+nbItemObj.title+'
';
if(nbItemObj.link != null && nbItemObj.link != '')
this.title = ''
//text
this.text = '';
this.textCapped = '';
this.morelink = 'More'
if(nbItemObj.text != null)
this.text = nbItemObj.text;
//if item 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;
//social
this.social = '';
this.socialStyle = '';
this.authorBlock = '';
this.divider = '';
this.fb = '';
if(nbItemObj.authorfb != null && nbItemObj.authorfb != '')
this.fb = ''
this.twitter = '';
if(nbItemObj.authortwitter != null && nbItemObj.authortwitter != '')
this.twitter = ''
this.bio = '';
if(nbItemObj.authorbio != null && nbItemObj.authorbio != '')
this.bio = ''+nbItemObj.author+''
this.authorBlock = '
'+this.bio+'
'
if(nbItemObj.author != null && nbItemObj.author != '') this.twitter != '')
this.socialCustomStyle = '';
this.social = this.fb + this.twitter;
this.socialStyle = ' style="height:21px; padding: 2px 0px;' + this.socialCustomStyle + '"';
else
this.social = '';
this.textStyle = '';
if(nbItemObj.authorimage != null && nbItemObj.authorimage != '')
this.textStyle = ' style=width:208px;';
otherwise
this.categoryTag = '';
this.nbTextOverride = '';
this.rowTemp = ''+this.authorBlock+'
'+nbItemObj.date+'
'+this.title+'
'+this.text+'
'+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 = ''
this.notetwitter = '';
if(nbNote.noteAuthor.twitter != null && nbNote.noteAuthor.twitter != '')
this.notetwitter = ''
this.notebio = '';
if(nbNote.noteAuthor.bio != null && nbNote.noteAuthor.bio != '')
this.notebio = ''+nbNote.noteAuthor.name+''
this.noteAuthorBlock = '
'+this.notebio+'
'
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;"';
else
this.notesocial = '';
if (idx == nbNotes.length-1)
nbNoteDivider = '';
this.nbNoteDiv = '
'+nbNote.noteHeadline+'
'+this.noteAuthorBlock+'
'+nbNote.noteOverview+'
'+this.notesocial+'
';
nbNoteStr += this.nbNoteDiv;
);
this.rowTemp += nbNoteStr;
return this.rowTemp;
function showMoreText(id)
//grab outdated item height
var oldItemHeight = $('#nbItem_'+id).height();
//retrieve your content material from the array
$('#text_'+id).html(contentObject[id])
//store id the listing 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 = '';
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');
lastNBObjStr = currNBObjStr;
return isNewTemp;
isHeaderLinkLoaded = false; // flag to examine on when the header hyperlink will be loaded
isShareLinkLoaded = false; // flag to test when the share link can be loaded
isDoneLoading = false; // flag to examine on if the html is performed loading in 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 mcdougal cutouts array
newsbulletin.authorCutouts = [];
// examine to discover if there can be a height set with regard to container, if so obvious it
// prevents cacheing
var hasHeight = $('#nbItemContainer').attr('style');
if (typeof hasHeight != 'undefined')
$('#nbItemContainer').removeAttr('style');
$.each(updates, function(ind)
var itemDetails = new Object();
it = updates[ind];
//populate the 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 can become 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's not displayed in any 1 of the things yet
if($.inArray(it.author.image, newsbulletin.authorCutouts) == -1)
itemDetails.authorimage = it.author.image;
//add 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 an identity 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 the particular 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 strong #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);
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);
7500)
setInterval(
function()
window.api.getContentPane().html(
newsbulletin.load()
);
,
60000
);
setInterval(function()
// we might contact "pane.jScrollPane(settings)" once again nevertheless it is
// much more convenient to be able to contact via the API as then the original
// configurations we passed throughout tend to be immediately remembered.
// Initialization in the container should be completed right after every 1 associated with the markup
has been loaded
// since there's no listener that will could be passed in to reinitialise() regarding callback
if (isDoneLoading)
window.api.reinitialise();
isDoneLoading = false;
, 5000);
;
addOnload(newsbulletin.load());
http://abcnews.go.com/Politics/

More Related Content

What's hot

International News | World News
International News | World NewsInternational News | World News
International News | World Newsmoz4
 
Technology and Science News - ABC News
Technology and Science News - ABC NewsTechnology and Science News - ABC News
Technology and Science News - ABC Newslethalsummary6309
 
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 Coveragebrendacuthbert89
 
20/20 | Investigative Journalism & News Magazine
20/20 | Investigative Journalism & News Magazine20/20 | Investigative Journalism & News Magazine
20/20 | Investigative Journalism & News Magazinesean3dunlap5
 
20/20 | Investigative Journalism & News Magazine
20/20 | Investigative Journalism & News Magazine20/20 | Investigative Journalism & News Magazine
20/20 | Investigative Journalism & News Magazinewrathfulmedal3110
 
Technology and Science News - ABC News
Technology and Science News - ABC NewsTechnology and Science News - ABC News
Technology and Science News - ABC Newsdesertedalley1884
 
International News | World News
International News | World NewsInternational News | World News
International News | World Newsblogginatl1963
 
International News | World News
International News | World NewsInternational News | World News
International News | World Newsgreedycabin1256
 
U.S. News | National News
U.S. News | National NewsU.S. News | National News
U.S. News | National Newsblogginatl1963
 
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 Quinonesmoaninglunatic320
 
International News | World News
International News | World NewsInternational News | World News
International News | World Newsmoaninglunatic320
 
20/20 | Investigative Journalism & News Magazine
20/20 | Investigative Journalism & News Magazine20/20 | Investigative Journalism & News Magazine
20/20 | Investigative Journalism & News Magazineagonizingspeed722
 
Technology and Science News - ABC News
Technology and Science News - ABC NewsTechnology and Science News - ABC News
Technology and Science News - ABC Newsmoaninglunatic320
 

What's hot (20)

U.S. News | National News
U.S. News | National NewsU.S. News | National News
U.S. News | National News
 
U.S. News | National News
U.S. News | National NewsU.S. News | National News
U.S. News | National News
 
U.S. News | National News
U.S. News | National NewsU.S. News | National News
U.S. News | National News
 
U.S. News | National News
U.S. News | National NewsU.S. News | National News
U.S. News | National 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
 
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
 
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
 
20/20 | Investigative Journalism & News Magazine
20/20 | Investigative Journalism & News Magazine20/20 | Investigative Journalism & News Magazine
20/20 | Investigative Journalism & News Magazine
 
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
 
International News | World News
International News | World NewsInternational News | World News
International News | World News
 
International News | World News
International News | World NewsInternational News | World News
International News | World News
 
U.S. News | National News
U.S. News | National NewsU.S. News | National News
U.S. News | National 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
 
International News | World News
International News | World NewsInternational News | World News
International News | World 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
 

Viewers also liked

B2B Marketing: Twitter: Who’s Following Me? by Julie Bevacqua
B2B Marketing: Twitter: Who’s Following Me? by Julie BevacquaB2B Marketing: Twitter: Who’s Following Me? by Julie Bevacqua
B2B Marketing: Twitter: Who’s Following Me? by Julie BevacquaJulie Bevacqua
 
Zev’s sport
Zev’s sportZev’s sport
Zev’s sportucokzv
 
Final presentation for Social Media for Educator's class
Final presentation for Social Media for Educator's classFinal presentation for Social Media for Educator's class
Final presentation for Social Media for Educator's classWVHS
 
Evidencia del desarrollo del proyecto Jugando mejor aprendo
Evidencia del desarrollo del proyecto Jugando mejor aprendoEvidencia del desarrollo del proyecto Jugando mejor aprendo
Evidencia del desarrollo del proyecto Jugando mejor aprendopolacarla
 
Job opportunities
Job opportunitiesJob opportunities
Job opportunitiesbrendaqntr
 
Памятка об обязательном медицинском страховании
Памятка об обязательном медицинском страхованииПамятка об обязательном медицинском страховании
Памятка об обязательном медицинском страхованииPavel Lopatko
 
Aprendizaje memoristico
Aprendizaje memoristicoAprendizaje memoristico
Aprendizaje memoristicojacq1724
 
Echinacea purpurea
Echinacea purpureaEchinacea purpurea
Echinacea purpureaArslan Tahir
 
Plant-Derived Vaccines
Plant-Derived VaccinesPlant-Derived Vaccines
Plant-Derived VaccinesSusan Egbert
 
第5章 拡張モデル(前半)
第5章 拡張モデル(前半)第5章 拡張モデル(前半)
第5章 拡張モデル(前半)Akito Nakano
 
Actividad powerpoint mezclas
Actividad powerpoint mezclasActividad powerpoint mezclas
Actividad powerpoint mezclasberrinches1
 
Chainer meetup lt
Chainer meetup ltChainer meetup lt
Chainer meetup ltAce12358
 

Viewers also liked (13)

B2B Marketing: Twitter: Who’s Following Me? by Julie Bevacqua
B2B Marketing: Twitter: Who’s Following Me? by Julie BevacquaB2B Marketing: Twitter: Who’s Following Me? by Julie Bevacqua
B2B Marketing: Twitter: Who’s Following Me? by Julie Bevacqua
 
Zev’s sport
Zev’s sportZev’s sport
Zev’s sport
 
Comic
ComicComic
Comic
 
Final presentation for Social Media for Educator's class
Final presentation for Social Media for Educator's classFinal presentation for Social Media for Educator's class
Final presentation for Social Media for Educator's class
 
Evidencia del desarrollo del proyecto Jugando mejor aprendo
Evidencia del desarrollo del proyecto Jugando mejor aprendoEvidencia del desarrollo del proyecto Jugando mejor aprendo
Evidencia del desarrollo del proyecto Jugando mejor aprendo
 
Job opportunities
Job opportunitiesJob opportunities
Job opportunities
 
Памятка об обязательном медицинском страховании
Памятка об обязательном медицинском страхованииПамятка об обязательном медицинском страховании
Памятка об обязательном медицинском страховании
 
Aprendizaje memoristico
Aprendizaje memoristicoAprendizaje memoristico
Aprendizaje memoristico
 
Echinacea purpurea
Echinacea purpureaEchinacea purpurea
Echinacea purpurea
 
Plant-Derived Vaccines
Plant-Derived VaccinesPlant-Derived Vaccines
Plant-Derived Vaccines
 
第5章 拡張モデル(前半)
第5章 拡張モデル(前半)第5章 拡張モデル(前半)
第5章 拡張モデル(前半)
 
Actividad powerpoint mezclas
Actividad powerpoint mezclasActividad powerpoint mezclas
Actividad powerpoint mezclas
 
Chainer meetup lt
Chainer meetup ltChainer meetup lt
Chainer meetup lt
 

Similar to Politics News and U.S. Elections Coverage

World News Tonight With David Muir
World News Tonight With David MuirWorld News Tonight With David Muir
World News Tonight With David Muirnullcore325
 
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 Coverageerna8nielsen65
 
International News | World News
International News | World NewsInternational News | World News
International News | World Newsagonizingspeed722
 
International News | World News
International News | World NewsInternational News | World News
International News | World Newswhisperingwhiz946
 
20/20 | Investigative Journalism & News Magazine
20/20 | Investigative Journalism & News Magazine20/20 | Investigative Journalism & News Magazine
20/20 | Investigative Journalism & News Magazinealertmishap944
 
International News | World News
International News | World NewsInternational News | World News
International News | World Newsgreencontract5911
 
World News Tonight With David Muir
World News Tonight With David MuirWorld News Tonight With David Muir
World News Tonight With David Muirobsoletesermon471
 
Home and Garden | Home Improvement and Decorating Tips
Home and Garden | Home Improvement and Decorating TipsHome and Garden | Home Improvement and Decorating Tips
Home and Garden | Home Improvement and Decorating Tipsshortguidebook822
 
Technology and Science News - ABC News
Technology and Science News - ABC NewsTechnology and Science News - ABC News
Technology and Science News - ABC Newswhisperingwhiz946
 

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

World News Tonight With David Muir
World News Tonight With David MuirWorld News Tonight With David Muir
World News Tonight With David Muir
 
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
 
International News | World News
International News | World NewsInternational News | World News
International News | World News
 
International News | World News
International News | World NewsInternational News | World News
International News | World News
 
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
 
International News | World News
International News | World NewsInternational News | World News
International News | World News
 
World News Tonight With David Muir
World News Tonight With David MuirWorld News Tonight With David Muir
World News Tonight With David Muir
 
U.S. News | National News
U.S. News | National NewsU.S. News | National News
U.S. News | National News
 
Home and Garden | Home Improvement and Decorating Tips
Home and Garden | Home Improvement and Decorating TipsHome and Garden | Home Improvement and Decorating Tips
Home and Garden | Home Improvement and Decorating Tips
 
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
 

Politics News and U.S. Elections Coverage

  • 1. Politics News and U.S. Elections Coverage " 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 try and handle caching throughout webkit browsers dynamicJS.load('newsBulletin'+nbjsId, newsbulletin.baseloc+'/xmldata/newsbulletin?id=14635979&twOverride=&lpos='+newsbulletin.lpo s2+'&section=&'+nbjsId); //dynamicJS.load('newsBulletin','http://newspreview.corp.dig.com/xmldata/newsbulletin?id=1356450 5'); //display items newsbulletin.displayItems = function(nbItemObj) //check if status update this.isStatusUpdate = (nbItemObj.label == 'Status Update')?true:false; //item type class this.itemTypeClass = (this.isStatusUpdate)?'orange':'blue'; //bg position
  • 2. this.itemBgPos = '100% 55%'; if(nbItemObj.bgPos != null) this.itemBgPos = nbItemObj.bgPos; //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' //title this.title = ' '+nbItemObj.title+' '; if(nbItemObj.link != null && nbItemObj.link != '') this.title = '' //text this.text = '';
  • 3. this.textCapped = ''; this.morelink = 'More' if(nbItemObj.text != null) this.text = nbItemObj.text; //if item 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; //social this.social = ''; this.socialStyle = ''; this.authorBlock = ''; this.divider = ''; this.fb = '';
  • 4. if(nbItemObj.authorfb != null && nbItemObj.authorfb != '') this.fb = '' this.twitter = ''; if(nbItemObj.authortwitter != null && nbItemObj.authortwitter != '') this.twitter = '' this.bio = ''; if(nbItemObj.authorbio != null && nbItemObj.authorbio != '') this.bio = ''+nbItemObj.author+'' this.authorBlock = ' '+this.bio+' ' if(nbItemObj.author != null && nbItemObj.author != '') this.twitter != '') this.socialCustomStyle = ''; this.social = this.fb + this.twitter; this.socialStyle = ' style="height:21px; padding: 2px 0px;' + this.socialCustomStyle + '"'; else this.social = ''; this.textStyle = ''; if(nbItemObj.authorimage != null && nbItemObj.authorimage != '') this.textStyle = ' style=width:208px;'; otherwise this.categoryTag = ''; this.nbTextOverride = ''; this.rowTemp = ''+this.authorBlock+' '+nbItemObj.date+' '+this.title+'
  • 5. '+this.text+' '+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 = '' this.notetwitter = ''; if(nbNote.noteAuthor.twitter != null && nbNote.noteAuthor.twitter != '') this.notetwitter = '' this.notebio = ''; if(nbNote.noteAuthor.bio != null && nbNote.noteAuthor.bio != '') this.notebio = ''+nbNote.noteAuthor.name+'' this.noteAuthorBlock = ' '+this.notebio+' ' this.notesocial = ''; this.noteSocialStyle = ''; if(nbNote.noteAuthor.name != null && nbNote.noteAuthor.name != '') this.notetwitter != '') this.notesocial = this.notefb + this.notetwitter;
  • 6. this.noteSocialStyle = ' style="height:21px; padding: 2px 0px;"'; else this.notesocial = ''; if (idx == nbNotes.length-1) nbNoteDivider = ''; this.nbNoteDiv = ' '+nbNote.noteHeadline+' '+this.noteAuthorBlock+' '+nbNote.noteOverview+' '+this.notesocial+' '; nbNoteStr += this.nbNoteDiv; ); this.rowTemp += nbNoteStr; return this.rowTemp; function showMoreText(id) //grab outdated item height var oldItemHeight = $('#nbItem_'+id).height(); //retrieve your content material from the array $('#text_'+id).html(contentObject[id]) //store id the listing of opened objects fullTextList.push(id.toString()); var newContainerHeight = $("#nbItemContainer").height() + ($('#nbItem_'+id).height()- oldItemHeight); $("#nbItemContainer").css('height', newContainerHeight); //reinitialize scroll
  • 7. window.api.reinitialise(); 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'); lastNBObjStr = currNBObjStr; return isNewTemp; isHeaderLinkLoaded = false; // flag to examine on when the header hyperlink will be loaded isShareLinkLoaded = false; // flag to test when the share link can be loaded isDoneLoading = false; // flag to examine on if the html is performed loading in the jScrollPane function newsBulletin(data) if(data) isNewDataFlag = isNewData(data); if(isNewDataFlag) //clear contents first newsbulletin.nbDiv.innerHTML = ''; //console.log('refresh');
  • 8. 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 mcdougal cutouts array newsbulletin.authorCutouts = []; // examine to discover if there can be a height set with regard to container, if so obvious it // prevents cacheing var hasHeight = $('#nbItemContainer').attr('style'); if (typeof hasHeight != 'undefined') $('#nbItemContainer').removeAttr('style'); $.each(updates, function(ind) var itemDetails = new Object(); it = updates[ind]; //populate the 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;
  • 9. 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 can become 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's not displayed in any 1 of the things yet if($.inArray(it.author.image, newsbulletin.authorCutouts) == -1) itemDetails.authorimage = it.author.image; //add 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;
  • 10. //build an identity 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 the particular 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 strong #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); 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");
  • 11. clearTimeout(timeoutId); , 3000); 7500) setInterval( function() window.api.getContentPane().html( newsbulletin.load() ); , 60000 ); setInterval(function() // we might contact "pane.jScrollPane(settings)" once again nevertheless it is // much more convenient to be able to contact via the API as then the original // configurations we passed throughout tend to be immediately remembered. // Initialization in the container should be completed right after every 1 associated with the markup has been loaded // since there's no listener that will could be passed in to reinitialise() regarding callback if (isDoneLoading) window.api.reinitialise(); isDoneLoading = false; , 5000); ; addOnload(newsbulletin.load()); http://abcnews.go.com/Politics/