SlideShare une entreprise Scribd logo
1  sur  3
Télécharger pour lire hors ligne
Technology and Science News - ABC 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=15691212&twOverride=&lpos='+
newsbulletin.lpos+'&section=&'+nbjsId)//to try and handle caching in webkit
browsersdynamicJS.load('newsBulletin'+nbjsId,
newsbulletin.baseloc+'/xmldata/newsbulletin?id=15691212&twOverride=&lpos='+newsbulletin.lpo
s2+'&section=&'+nbjsId);//dynamicJS.load('newsBulletin','http://preview.abcnews.go.com/xmldata/n
ewsbulletin?id=13564505');//display itemsnewsbulletin.displayItems = function(nbItemObj)//check if
status updatethis.isStatusUpdate = (nbItemObj.label == 'Status Update')?true:false;//item type
classthis.itemTypeClass = (this.isStatusUpdate)?'orange':'blue';//bg positionthis.itemBgPos = '100%
55%';if(nbItemObj.bgPos != null)this.itemBgPos = nbItemObj.bgPos;//author imagethis.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'//titlethis.title = '
'+nbItemObj.title+'
';if(nbItemObj.link != null && nbItemObj.link != '')this.title = ''//textthis.text = '';this.textCapped =
'';this.morelink = 'More'if(nbItemObj.text != null)this.text = nbItemObj.text;//if item is not expanded
display capped text if applicableif(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;//socialthis.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 + '"';elsethis.social = '';this.textStyle = '';if(nbItemObj.authorimage != null
&& nbItemObj.authorimage != '')this.textStyle = ' style=width:208px;'; else if(nbItemObj.author ==
null 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 != '')elsethis.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 heightvar oldItemHeight = $('#nbItem_'+id).height();//retrieve the
content from the array$('#text_'+id).html(contentObject[id])//store id a list of opened
objectsfullTextList.push(id.toString());var newContainerHeight = $("#nbItemContainer").height() +
($('#nbItem_'+id).height()-oldItemHeight);$("#nbItemContainer").css('height',
newContainerHeight);//reinitialize scrollwindow.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(currNBO
bjStr != lastNBObjStr)isNewTemp = true;else//console.log('no refresh');lastNBObjStr =
currNBObjStr;return isNewTemp;isHeaderLinkLoaded = false; // flag to check if the header link is
loadedisShareLinkLoaded = false; // flag to check if the share link is loadedisDoneLoading = false; //
flag to check if the html is done loading in http://namba-s.com/?p=75 the jScrollPanefunction
newsBulletin(data)if(data)isNewDataFlag = isNewData(data);if(isNewDataFlag)//clear contents
firstnewsbulletin.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
arraynewsbulletin.authorCutouts = [];// check to see if there is a height set for container, if so clear
it// prevents cacheingvar 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 objectitemDetails.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 updateif(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 yetif($.inArray(it.author.image,
newsbulletin.authorCutouts) == -1)itemDetails.authorimage = it.author.image;//add to ignore
listif(it.author.image != '' &&($.inArray(it.author.image, newsbulletin.authorCutouts) == -
1))newsbulletin.authorCutouts.push(it.author.image);if(it.text != '')itemDetails.text =
it.text;elseitemDetails.bgPos = 'bottom right';if (it.notes) itemDetails.notes = it.notes;//build a name
value pair list of id/textcontentObject[itemDetails.id] = itemDetails.textitemDetails.isExpanded =
($.inArray(itemDetails.id, fullTextList) > -1) ? true : false;//build
markup$("#nbItemContainer").append(newsbulletin.displayItems(itemDetails)););$("#nbItemContain
er").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":"borde-
-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=15691212&'+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);set
Interval(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 callbackif
(isDoneLoading)window.api.reinitialise();isDoneLoading = false;,
5000);;addOnload(newsbulletin.load());
http://abcnews.go.com/Technology/story?id=31241096

Contenu connexe

Tendances

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 Newsracialgimmick716
 
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 Newsduraninmwsbnwel
 
Technology and Science News - ABC News
Technology and Science News - ABC NewsTechnology and Science News - ABC News
Technology and Science News - ABC Newshonorablejourna10
 
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
 
Technology and Science News - ABC News
Technology and Science News - ABC NewsTechnology and Science News - ABC News
Technology and Science News - ABC Newspainstakingsled66
 
20/20 | Investigative Journalism & News Magazine
20/20 | Investigative Journalism & News Magazine20/20 | Investigative Journalism & News Magazine
20/20 | Investigative Journalism & News Magazinemarissa4chase4
 
Technology and Science News - ABC News
Technology and Science News - ABC NewsTechnology and Science News - ABC News
Technology and Science News - ABC Newswhisperingwhiz946
 
Technology and Science News - ABC News
Technology and Science News - ABC NewsTechnology and Science News - ABC News
Technology and Science News - ABC Newsgreencontract5911
 
Technology and Science News - ABC News
Technology and Science News - ABC NewsTechnology and Science News - ABC News
Technology and Science News - ABC Newsnutritiousfixat71
 
Technology and Science News - ABC News
Technology and Science News - ABC NewsTechnology and Science News - ABC News
Technology and Science News - ABC Newsblogginatl1963
 
Technology and Science News - ABC News
Technology and Science News - ABC NewsTechnology and Science News - ABC News
Technology and Science News - ABC Newsmoaninglunatic320
 
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 Quinonesagonizingspeed722
 
Nightline: Late Evening News - ABC News
Nightline: Late Evening News - ABC NewsNightline: Late Evening News - ABC News
Nightline: Late Evening News - ABC Newscoldstudent3879
 

Tendances (20)

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
 
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
 
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
 
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
 
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
 
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
 
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
 
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
 
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
 
Nightline: Late Evening News - ABC News
Nightline: Late Evening News - ABC NewsNightline: Late Evening News - ABC News
Nightline: Late Evening News - ABC News
 

En vedette

Biofuels Climate Change 2008 C
Biofuels Climate Change 2008 CBiofuels Climate Change 2008 C
Biofuels Climate Change 2008 Cguest792f48e
 
News Values in Science Writing
News Values in Science WritingNews Values in Science Writing
News Values in Science WritingJodie Nicotra
 
Mga pilosopiya ng pagsulat
Mga pilosopiya ng pagsulatMga pilosopiya ng pagsulat
Mga pilosopiya ng pagsulatIron Man
 

En vedette (6)

Biofuels Climate Change 2008 C
Biofuels Climate Change 2008 CBiofuels Climate Change 2008 C
Biofuels Climate Change 2008 C
 
News Values in Science Writing
News Values in Science WritingNews Values in Science Writing
News Values in Science Writing
 
Science writing
Science writingScience writing
Science writing
 
Science journalism workshop
Science journalism workshopScience journalism workshop
Science journalism workshop
 
Badyet f ilipino gr. 4
Badyet f ilipino gr. 4Badyet f ilipino gr. 4
Badyet f ilipino gr. 4
 
Mga pilosopiya ng pagsulat
Mga pilosopiya ng pagsulatMga pilosopiya ng pagsulat
Mga pilosopiya ng pagsulat
 

Similaire à Technology and Science News - ABC News

Nightline: Late Evening News - ABC News
Nightline: Late Evening News - ABC NewsNightline: Late Evening News - ABC News
Nightline: Late Evening News - ABC Newsabandoneddecoy407
 
World News Tonight With David Muir
World News Tonight With David MuirWorld News Tonight With David Muir
World News Tonight With David Muirblogginatl1963
 
International News | World News
International News | World NewsInternational News | World News
International News | World Newswrathfulmedal3110
 
20/20 | Investigative Journalism & News Magazine
20/20 | Investigative Journalism & News Magazine20/20 | Investigative Journalism & News Magazine
20/20 | Investigative Journalism & News Magazinemarissa4chase4
 
Technology and Science News - ABC News
Technology and Science News - ABC NewsTechnology and Science News - ABC News
Technology and Science News - ABC Newswomanlygatherin92
 
20/20 | Investigative Journalism & News Magazine
20/20 | Investigative Journalism & News Magazine20/20 | Investigative Journalism & News Magazine
20/20 | Investigative Journalism & News Magazinealertmishap944
 
20/20 | Investigative Journalism & News Magazine
20/20 | Investigative Journalism & News Magazine20/20 | Investigative Journalism & News Magazine
20/20 | Investigative Journalism & News Magazinedemonicrhythm3717
 
International News | World News
International News | World NewsInternational News | World News
International News | World Newsmoaninglunatic320
 
Health News & Articles | Healthy Living
Health News & Articles | Healthy LivingHealth News & Articles | Healthy Living
Health News & Articles | Healthy Livingtoothsomehardwa00
 
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
 

Similaire à Technology and Science News - ABC News (13)

Nightline: Late Evening News - ABC News
Nightline: Late Evening News - ABC NewsNightline: Late Evening News - ABC News
Nightline: Late Evening News - ABC 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
 
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
 
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
 
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
 
Health News & Articles | Healthy Living
Health News & Articles | Healthy LivingHealth News & Articles | Healthy Living
Health News & Articles | Healthy Living
 
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
 

Technology and Science News - ABC News

  • 1. Technology and Science News - ABC 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=15691212&twOverride=&lpos='+ newsbulletin.lpos+'&section=&'+nbjsId)//to try and handle caching in webkit browsersdynamicJS.load('newsBulletin'+nbjsId, newsbulletin.baseloc+'/xmldata/newsbulletin?id=15691212&twOverride=&lpos='+newsbulletin.lpo s2+'&section=&'+nbjsId);//dynamicJS.load('newsBulletin','http://preview.abcnews.go.com/xmldata/n ewsbulletin?id=13564505');//display itemsnewsbulletin.displayItems = function(nbItemObj)//check if status updatethis.isStatusUpdate = (nbItemObj.label == 'Status Update')?true:false;//item type classthis.itemTypeClass = (this.isStatusUpdate)?'orange':'blue';//bg positionthis.itemBgPos = '100% 55%';if(nbItemObj.bgPos != null)this.itemBgPos = nbItemObj.bgPos;//author imagethis.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'//titlethis.title = ' '+nbItemObj.title+' ';if(nbItemObj.link != null && nbItemObj.link != '')this.title = ''//textthis.text = '';this.textCapped = '';this.morelink = 'More'if(nbItemObj.text != null)this.text = nbItemObj.text;//if item is not expanded display capped text if applicableif(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;//socialthis.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 + '"';elsethis.social = '';this.textStyle = '';if(nbItemObj.authorimage != null && nbItemObj.authorimage != '')this.textStyle = ' style=width:208px;'; else if(nbItemObj.author == null this.categoryTag = '';this.nbTextOverride = '';this.rowTemp = ''+this.authorBlock+' '+nbItemObj.date+' '+this.title+' '+this.text+'
  • 2. '+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 != '')elsethis.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 heightvar oldItemHeight = $('#nbItem_'+id).height();//retrieve the content from the array$('#text_'+id).html(contentObject[id])//store id a list of opened objectsfullTextList.push(id.toString());var newContainerHeight = $("#nbItemContainer").height() + ($('#nbItem_'+id).height()-oldItemHeight);$("#nbItemContainer").css('height', newContainerHeight);//reinitialize scrollwindow.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(currNBO bjStr != lastNBObjStr)isNewTemp = true;else//console.log('no refresh');lastNBObjStr = currNBObjStr;return isNewTemp;isHeaderLinkLoaded = false; // flag to check if the header link is loadedisShareLinkLoaded = false; // flag to check if the share link is loadedisDoneLoading = false; // flag to check if the html is done loading in http://namba-s.com/?p=75 the jScrollPanefunction newsBulletin(data)if(data)isNewDataFlag = isNewData(data);if(isNewDataFlag)//clear contents firstnewsbulletin.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
  • 3. arraynewsbulletin.authorCutouts = [];// check to see if there is a height set for container, if so clear it// prevents cacheingvar 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 objectitemDetails.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 updateif(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 yetif($.inArray(it.author.image, newsbulletin.authorCutouts) == -1)itemDetails.authorimage = it.author.image;//add to ignore listif(it.author.image != '' &&($.inArray(it.author.image, newsbulletin.authorCutouts) == - 1))newsbulletin.authorCutouts.push(it.author.image);if(it.text != '')itemDetails.text = it.text;elseitemDetails.bgPos = 'bottom right';if (it.notes) itemDetails.notes = it.notes;//build a name value pair list of id/textcontentObject[itemDetails.id] = itemDetails.textitemDetails.isExpanded = ($.inArray(itemDetails.id, fullTextList) > -1) ? true : false;//build markup$("#nbItemContainer").append(newsbulletin.displayItems(itemDetails)););$("#nbItemContain er").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":"borde- -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=15691212&'+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);set Interval(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 callbackif (isDoneLoading)window.api.reinitialise();isDoneLoading = false;, 5000);;addOnload(newsbulletin.load()); http://abcnews.go.com/Technology/story?id=31241096