U.S. News | National News

"newsbulletin.nbFooter = ""//append widget header$("#newsbulletin > .midcontainer").append("");$(...

U.S. News | National News
"
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=14640490&twOverride=&lpos='+newsbulle
tin.lpos+'&section=&'+nbjsId)
//to try and handle caching in webkit browsers
dynamicJS.load('newsBulletin'+nbjsId,
newsbulletin.baseloc+'/xmldata/newsbulletin?id=14640490&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 is not 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 != '')else
this.social = '';
this.textStyle = '';
if(nbItemObj.authorimage != null && nbItemObj.authorimage != '')
this.textStyle = ' style=width:208px;';
else
this.categoryTag = '';
this.nbTextOverride = '';
this.rowTemp = ''+this.title+'
'+nbItemObj.date+'
'+this.authorBlock+'
'+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 old item height
var oldItemHeight = $('#nbItem_'+id).height();
//retrieve the content from the array
$('#text_'+id).html(contentObject[id])
//store id a 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 = '';
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 check if the header link is loaded
isShareLinkLoaded = false; // flag to check if the share link is loaded
isDoneLoading = false; // flag to check if the html is done 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 a > .twitterContent").append("" +
twitterImg + "");
isHeaderLinkLoaded = true;
//clear the author cutouts array
newsbulletin.authorCutouts = [];
// check to see if there is a height set for container, if so clear 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 item 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's not displayed in any of the items 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 a name value pair list of id/text
contentObject[itemDetails.id] = itemDetails.text
itemDetails.isExpanded = ($.inArray(itemDetails.id, fullTextList) > -1) ? true : false;
//build markup
$("#nbItemContainer").append(newsbulletin.displayItems(itemDetails));
);
$("#nbItemContainer").append('');
//set the height of 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 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);
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 could call "pane.jScrollPane(settings)" again but it is
// more convenient to call via the API as then the original
// settings we passed in are automatically remembered.
// Initialization of the container should be done after all the markup has been loaded
// since there is no listener that could be passed into reinitialise() for callback
if (isDoneLoading)
window.api.reinitialise();
isDoneLoading = false;
, 5000);
;
addOnload(newsbulletin.load());
http://abcnews.go.com/US/wireStory/philadelphia-defends-response-fatal-fire-24479989

Recomendados

Politics News and U.S. Elections Coverage von
Politics News and U.S. Elections CoveragePolitics News and U.S. Elections Coverage
Politics News and U.S. Elections Coverageexoticshame065
159 views11 Folien
Politics News and U.S. Elections Coverage von
Politics News and U.S. Elections CoveragePolitics News and U.S. Elections Coverage
Politics News and U.S. Elections Coverageawarequalm2586
164 views11 Folien
U.S. News | National News von
U.S. News | National NewsU.S. News | National News
U.S. News | National Newsaccidentaldeity33
167 views11 Folien
U.S. News | National News von
U.S. News | National NewsU.S. News | National News
U.S. News | National Newsacousticassista07
210 views11 Folien
U.S. News | National News von
U.S. News | National NewsU.S. News | National News
U.S. News | National Newswhisperingwhiz946
60 views11 Folien
International News | World News von
International News | World NewsInternational News | World News
International News | World Newswhisperingwhiz946
70 views11 Folien

Más contenido relacionado

Was ist angesagt?

20/20 | Investigative Journalism & News Magazine von
20/20 | Investigative Journalism & News Magazine20/20 | Investigative Journalism & News Magazine
20/20 | Investigative Journalism & News Magazinealertmishap944
327 views11 Folien
20/20 | Investigative Journalism & News Magazine von
20/20 | Investigative Journalism & News Magazine20/20 | Investigative Journalism & News Magazine
20/20 | Investigative Journalism & News Magazineagonizingspeed722
51 views11 Folien
International News | World News von
International News | World NewsInternational News | World News
International News | World Newsmoz4
244 views11 Folien
U.S. News | National News von
U.S. News | National NewsU.S. News | National News
U.S. News | National Newswhisperingwhiz946
149 views11 Folien
What Would You Do? With John Quinones von
What Would You Do? With John QuinonesWhat Would You Do? With John Quinones
What Would You Do? With John Quinonesagonizingspeed722
89 views11 Folien
Technology and Science News - ABC News von
Technology and Science News - ABC NewsTechnology and Science News - ABC News
Technology and Science News - ABC Newslethalsummary6309
147 views11 Folien

Was ist angesagt?(20)

20/20 | Investigative Journalism & News Magazine von alertmishap944
20/20 | Investigative Journalism & News Magazine20/20 | Investigative Journalism & News Magazine
20/20 | Investigative Journalism & News Magazine
alertmishap944327 views
20/20 | Investigative Journalism & News Magazine von agonizingspeed722
20/20 | Investigative Journalism & News Magazine20/20 | Investigative Journalism & News Magazine
20/20 | Investigative Journalism & News Magazine
International News | World News von moz4
International News | World NewsInternational News | World News
International News | World News
moz4244 views
20/20 | Investigative Journalism & News Magazine von wrathfulmedal3110
20/20 | Investigative Journalism & News Magazine20/20 | Investigative Journalism & News Magazine
20/20 | Investigative Journalism & News Magazine
wrathfulmedal3110111 views
20/20 | Investigative Journalism & News Magazine von agonizingspeed722
20/20 | Investigative Journalism & News Magazine20/20 | Investigative Journalism & News Magazine
20/20 | Investigative Journalism & News Magazine
Politics News and U.S. Elections Coverage von unarmedhorse5807
Politics News and U.S. Elections CoveragePolitics News and U.S. Elections Coverage
Politics News and U.S. Elections Coverage
unarmedhorse5807348 views
20/20 | Investigative Journalism & News Magazine von sean3dunlap5
20/20 | Investigative Journalism & News Magazine20/20 | Investigative Journalism & News Magazine
20/20 | Investigative Journalism & News Magazine
sean3dunlap5135 views
Home and Garden | Home Improvement and Decorating Tips von shortguidebook822
Home and Garden | Home Improvement and Decorating TipsHome and Garden | Home Improvement and Decorating Tips
Home and Garden | Home Improvement and Decorating Tips
shortguidebook822187 views

Destacado

CNN.com - Transcripts von
CNN.com - TranscriptsCNN.com - Transcripts
CNN.com - Transcriptswillingtablewar49
201 views21 Folien
Text Of John Kerry's DNC Speech von
Text Of John Kerry's DNC SpeechText Of John Kerry's DNC Speech
Text Of John Kerry's DNC Speechwillingtablewar49
223 views10 Folien
Origins of American City Nicknames - Yahoo Voices von
Origins of American City Nicknames - Yahoo VoicesOrigins of American City Nicknames - Yahoo Voices
Origins of American City Nicknames - Yahoo Voiceswillingtablewar49
174 views4 Folien
historia de la arquitectura III von
historia de la arquitectura IIIhistoria de la arquitectura III
historia de la arquitectura IIIBarbara Brito S
98 views8 Folien
Aldis Grocery Store Locations North Carolina Through Wyoming von
Aldis Grocery Store Locations North Carolina Through WyomingAldis Grocery Store Locations North Carolina Through Wyoming
Aldis Grocery Store Locations North Carolina Through Wyomingwillingtablewar49
1.4K views72 Folien
Lesson 2 basic aerodynamics von
Lesson 2 basic aerodynamicsLesson 2 basic aerodynamics
Lesson 2 basic aerodynamicsHeather Howley
19.2K views40 Folien

Destacado(16)

Origins of American City Nicknames - Yahoo Voices von willingtablewar49
Origins of American City Nicknames - Yahoo VoicesOrigins of American City Nicknames - Yahoo Voices
Origins of American City Nicknames - Yahoo Voices
willingtablewar49174 views
Aldis Grocery Store Locations North Carolina Through Wyoming von willingtablewar49
Aldis Grocery Store Locations North Carolina Through WyomingAldis Grocery Store Locations North Carolina Through Wyoming
Aldis Grocery Store Locations North Carolina Through Wyoming
willingtablewar491.4K views
Lesson 2 basic aerodynamics von Heather Howley
Lesson 2 basic aerodynamicsLesson 2 basic aerodynamics
Lesson 2 basic aerodynamics
Heather Howley19.2K views
Robinson Helicopter Private Lesson 1 von Heather Howley
Robinson Helicopter Private Lesson 1Robinson Helicopter Private Lesson 1
Robinson Helicopter Private Lesson 1
Heather Howley25.5K views
Du Mediaplanning au Content Management - Présentation Coca-Cola au Petit Club... von Petit Web
Du Mediaplanning au Content Management - Présentation Coca-Cola au Petit Club...Du Mediaplanning au Content Management - Présentation Coca-Cola au Petit Club...
Du Mediaplanning au Content Management - Présentation Coca-Cola au Petit Club...
Petit Web8.8K views
Formation gestion de projet - 04 - le cadrage von iafactory
Formation gestion de projet - 04 - le cadrageFormation gestion de projet - 04 - le cadrage
Formation gestion de projet - 04 - le cadrage
iafactory15.7K views
Présentation laconique ebloo-group 2011 von ebloo GROUP
Présentation laconique ebloo-group 2011Présentation laconique ebloo-group 2011
Présentation laconique ebloo-group 2011
ebloo GROUP3.6K views
Atelier IE10 Google+ : le réseau social qui fédère les services “Google” von Salon e-tourisme #VeM
Atelier IE10 Google+ : le réseau social qui fédère les services “Google”Atelier IE10 Google+ : le réseau social qui fédère les services “Google”
Atelier IE10 Google+ : le réseau social qui fédère les services “Google”
Identifier les risques von Carine Pascal
Identifier les risquesIdentifier les risques
Identifier les risques
Carine Pascal13.8K views

Similar a U.S. News | National News

International News | World News von
International News | World NewsInternational News | World News
International News | World Newsboringterminolo30
202 views11 Folien
U.S. News | National News von
U.S. News | National NewsU.S. News | National News
U.S. News | National Newspainstakingsled66
239 views12 Folien
Technology and Science News - ABC News von
Technology and Science News - ABC NewsTechnology and Science News - ABC News
Technology and Science News - ABC Newspainstakingsled66
125 views12 Folien
Politics News and U.S. Elections Coverage von
Politics News and U.S. Elections CoveragePolitics News and U.S. Elections Coverage
Politics News and U.S. Elections Coveragebrendacuthbert89
69 views11 Folien
20/20 | Investigative Journalism & News Magazine von
20/20 | Investigative Journalism & News Magazine20/20 | Investigative Journalism & News Magazine
20/20 | Investigative Journalism & News Magazinedemonicrhythm3717
267 views11 Folien
U.S. News | National News von
U.S. News | National NewsU.S. News | National News
U.S. News | National Newsblogginatl1963
168 views11 Folien

Similar a U.S. News | National News(18)

Politics News and U.S. Elections Coverage von brendacuthbert89
Politics News and U.S. Elections CoveragePolitics News and U.S. Elections Coverage
Politics News and U.S. Elections Coverage
brendacuthbert8969 views
20/20 | Investigative Journalism & News Magazine von demonicrhythm3717
20/20 | Investigative Journalism & News Magazine20/20 | Investigative Journalism & News Magazine
20/20 | Investigative Journalism & News Magazine
demonicrhythm3717267 views
Politics News and U.S. Elections Coverage von sccolumbia7779
Politics News and U.S. Elections CoveragePolitics News and U.S. Elections Coverage
Politics News and U.S. Elections Coverage
sccolumbia7779110 views
Politics News and U.S. Elections Coverage von greedycabin1256
Politics News and U.S. Elections CoveragePolitics News and U.S. Elections Coverage
Politics News and U.S. Elections Coverage
greedycabin1256163 views
Politics News and U.S. Elections Coverage von talloration5719
Politics News and U.S. Elections CoveragePolitics News and U.S. Elections Coverage
Politics News and U.S. Elections Coverage
talloration5719208 views
World News Tonight With David Muir von nullcore325
World News Tonight With David MuirWorld News Tonight With David Muir
World News Tonight With David Muir
nullcore325197 views

Más de willingtablewar49

Vic Dillinger's Thanksgiving Day Bash! von
Vic Dillinger's Thanksgiving Day Bash!Vic Dillinger's Thanksgiving Day Bash!
Vic Dillinger's Thanksgiving Day Bash!willingtablewar49
244 views9 Folien
Funny Band Jokes von
Funny Band JokesFunny Band Jokes
Funny Band Jokeswillingtablewar49
5.3K views27 Folien
Test von
TestTest
Testwillingtablewar49
124 views1 Folie
Transcript: John Kerry | Fox News von
Transcript: John Kerry | Fox NewsTranscript: John Kerry | Fox News
Transcript: John Kerry | Fox Newswillingtablewar49
481 views10 Folien
Origins of American City Nicknames - Yahoo Voices von
Origins of American City Nicknames - Yahoo VoicesOrigins of American City Nicknames - Yahoo Voices
Origins of American City Nicknames - Yahoo Voiceswillingtablewar49
130 views4 Folien
CNN.com - Transcripts von
CNN.com - TranscriptsCNN.com - Transcripts
CNN.com - Transcriptswillingtablewar49
225 views19 Folien

U.S. News | National News

  • 1. U.S. News | National News " 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=14640490&twOverride=&lpos='+newsbulle tin.lpos+'&section=&'+nbjsId) //to try and handle caching in webkit browsers dynamicJS.load('newsBulletin'+nbjsId, newsbulletin.baseloc+'/xmldata/newsbulletin?id=14640490&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%';
  • 2. 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)
  • 3. this.text = nbItemObj.text; //if item is not 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+'
  • 4. ' if(nbItemObj.author != null && nbItemObj.author != '')else this.social = ''; this.textStyle = ''; if(nbItemObj.authorimage != null && nbItemObj.authorimage != '') this.textStyle = ' style=width:208px;'; else this.categoryTag = ''; this.nbTextOverride = ''; this.rowTemp = ''+this.title+' '+nbItemObj.date+' '+this.authorBlock+' '+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 = '';
  • 5. 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;
  • 6. return this.rowTemp; function showMoreText(id) //grab old item height var oldItemHeight = $('#nbItem_'+id).height(); //retrieve the content from the array $('#text_'+id).html(contentObject[id]) //store id a 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 = ''; 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');
  • 7. lastNBObjStr = currNBObjStr; return isNewTemp; isHeaderLinkLoaded = false; // flag to check if the header link is loaded isShareLinkLoaded = false; // flag to check if the share link is loaded isDoneLoading = false; // flag to check if the html is done 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 a > .twitterContent").append("" + twitterImg + ""); isHeaderLinkLoaded = true; //clear the author cutouts array newsbulletin.authorCutouts = []; // check to see if there is a height set for container, if so clear it // prevents cacheing var hasHeight = $('#nbItemContainer').attr('style');
  • 8. 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 item 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'
  • 9. itemDetails.authortwitter = 'http://twitter.com/abc' //only pass the author image if it's not displayed in any of the items 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 a name value pair list of id/text contentObject[itemDetails.id] = itemDetails.text itemDetails.isExpanded = ($.inArray(itemDetails.id, fullTextList) > -1) ? true : false; //build markup $("#nbItemContainer").append(newsbulletin.displayItems(itemDetails)); ); $("#nbItemContainer").append(''); //set the height of 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 solid #eaeaea"); $("#newsbulletin > .midcontainer > .nbFooter").append("");
  • 10. 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=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()
  • 11. // we could call "pane.jScrollPane(settings)" again but it is // more convenient to call via the API as then the original // settings we passed in are automatically remembered. // Initialization of the container should be done after all the markup has been loaded // since there is no listener that could be passed into reinitialise() for callback if (isDoneLoading) window.api.reinitialise(); isDoneLoading = false; , 5000); ; addOnload(newsbulletin.load()); http://abcnews.go.com/US/wireStory/philadelphia-defends-response-fatal-fire-24479989