This document contains code for displaying science and technology news updates from ABC News on a webpage. The code loads news updates from an external data source, formats the content, and displays it within a scrolling container on the page. It also includes functionality for expanding condensed news items, sharing content, and periodically refreshing the displayed updates.
This document contains code for dynamically loading and displaying technology and science news articles from ABC News on a webpage. It includes functions for retrieving article data from an API, generating HTML markup for each article, handling expanding full article text, and reinitializing the content display after updates.
This document contains code for displaying news bulletin items and notes. It includes functions for loading data, displaying items, and handling author information. On page load, it retrieves data, parses it, and appends items and notes to the container div through separate display functions. It also handles expanding truncated text and reinitializing the scroll pane on updates.
The document is code for a news bulletin widget that loads news articles and displays them on a webpage. It includes functions for loading new data from an API, displaying individual articles, handling expanding text, and reinitializing the content area. The code retrieves article details, formats them into HTML, and appends the results to the content container.
This document contains code for displaying science and technology news updates from ABC News on a webpage. The code loads news updates from an external data source, formats the content, and displays it within a scrolling container on the page. It also includes functionality for expanding condensed news items, sharing content, and periodically refreshing the displayed updates.
This document contains code for dynamically loading and displaying technology and science news articles from ABC News on a webpage. It includes functions for retrieving article data from an API, generating HTML markup for each article, handling expanding full article text, and reinitializing the content display after updates.
This document contains code for displaying news bulletin items and notes. It includes functions for loading data, displaying items, and handling author information. On page load, it retrieves data, parses it, and appends items and notes to the container div through separate display functions. It also handles expanding truncated text and reinitializing the scroll pane on updates.
The document is code for a news bulletin widget that loads news articles and displays them on a webpage. It includes functions for loading new data from an API, displaying individual articles, handling expanding text, and reinitializing the content area. The code retrieves article details, formats them into HTML, and appends the results to the content container.
The document is about the ABC News show "What Would You Do? With John Quinones". It provides code for displaying news bulletin items and updates on a webpage. The code defines functions for loading, displaying, and updating news items with details like titles, text, images, and social links. It also handles expanding text, loading more content, and reinitializing the scroll pane after updates.
The document is about the ABC News show "What Would You Do? With John Quinones". It provides code for displaying news bulletin items and updates on a webpage. The code defines functions for loading, displaying, and updating news items with details like titles, text, images, and social links. It also handles expanding text, loading more content, and reinitializing the scroll pane after updates.
This document is a news bulletin from ABC News that provides technology and science news updates. It includes the headline, date, text and social sharing options for each news item. When notes are included, it also displays the note headline, author details and overview. Images and links are included for authors and social media profiles. The bulletin can be dynamically updated with new items and includes options to expand the text of each item.
This document is a news bulletin from ABC News that provides technology and science news updates. It includes the headline, text snippet, author and date for each news item. It also includes options to share or see more of each item. The bulletin dynamically loads and displays the latest news updates using JavaScript.
This document is an article from the ABC News technology and science section. It discusses updates to their news bulletin widget, including updating the content and links displayed in the widget periodically. It also describes the code for displaying items, notes, and social media information for authors within the widget. The widget code handles checking for new data, loading and displaying items, and setting timeouts to prevent caching issues.
This document contains code for dynamically loading and displaying news bulletin items on a website. It includes functions for retrieving new data, building HTML elements for each item, and handling interactions like expanding text. The code handles author images, social links, notes and reinitializing the content container on updates.
The document is an international news article from ABC News. It discusses international news and world news headlines. The article provides updates on news from around the globe.
1. U.S. News | National News
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;
this.twitter = '';
if(nbItemObj.authortwitter != null nbItemObj.authortwitter != '')
this.twitter = ''
//title
this.title = '
'+nbItemObj.title+'
';
if(nbItemObj.link != null nbItemObj.link != '')
this.title = ''
2. //display items
newsbulletin.displayItems = function(nbItemObj)
//check if status update
this.isStatusUpdate = (nbItemObj.label == 'Status Update')?true:false;
//item Post Traumatic Stress Disorder type class
this.itemTypeClass = (this.isStatusUpdate)?'orange':'blue';
//bg position
this.itemBgPos = '100% 55%';
if(nbItemObj.bgPos != null)
this.itemBgPos = nbItemObj.bgPos;
$.each(updates, function(ind)
http://www.thefreedictionary.com/anxiety
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;
3. 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'
else
this.social = '';
//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');
//add to ignore list
if(it.author.image != '' ($.inArray(it.author.image, newsbulletin.authorCutouts) == -1))
newsbulletin.authorCutouts.push(it.author.image);
this.bio = '';
if(nbItemObj.authorbio != null nbItemObj.authorbio != '')
this.bio = ''+nbItemObj.author+''
this.authorBlock = '
'+this.bio+'
'
if (idx == nbNotes.length-1)
nbNoteDivider = '';
//text
6. 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'
this.nbNoteDiv = '
'+nbNote.noteHeadline+'
'+this.noteAuthorBlock+'
'+nbNote.noteOverview+'
//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");
7. clearTimeout(timeoutId);
, 3000);
if(it.author.name == '')
itemDetails.author = 'ABC News'
itemDetails.authorfb = 'http://www.facebook.com/abcnews'
itemDetails.authortwitter = 'http://twitter.com/abc'
if (it.notes)
itemDetails.notes = it.notes;
this.notesocial = '';
this.noteSocialStyle = '';
if(nbNote.noteAuthor.name != null nbNote.noteAuthor.name != '')else
this.notesocial = '';
return this.rowTemp;
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;
8. if (headerLink != '' headerLink != null !isHeaderLinkLoaded)
var twitterImg = " "
$("#newsbulletin .midcontainer .widget_head").append("");
$("#newsbulletin .midcontainer .widget_head .twitterLink a .twitterContent").append("" +
twitterImg + "");
isHeaderLinkLoaded = true;
if(it.text != '')
itemDetails.text = it.text;
else
itemDetails.bgPos = 'bottom right';
this.textStyle = '';
if(nbItemObj.authorimage != null nbItemObj.authorimage != '')
this.textStyle = ' style=width:208px;';
else nbItemObj.author == '')
this.textStyle = ' style="padding-bottom:2px; margin-bottom:5px;"';
'+this.notesocial+'
';
nbNoteStr += this.nbNoteDiv;
);
this.rowTemp += nbNoteStr;
//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;
function showMoreText(id)
//grab old item height
var oldItemHeight = $('#nbItem_'+id).height();
9. //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();
this.notebio = '';
if(nbNote.noteAuthor.bio != null nbNote.noteAuthor.bio != '')
this.notebio = ''+nbNote.noteAuthor.name+''
this.noteAuthorBlock = '
'+this.notebio+'
'
"
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=14640490twOverride=lpos='+newsbulletin.
lpos+'section='+nbjsId)
//to try and handle caching in webkit browsers