addSidebar(storySize, storyContent, storyGraph, lg);
var link = "#DisplaySizeId22 ul li.wnItem.link";
var linkTotal = checkLength(link);
if(linkTotal >= 1){
$wn(link+":first").addClass('featureSS');
$wn('#sidebarContent').prepend("");
$wn('#sidebarContent .ss.SBsection').prepend($wn(link+".featureSS"));
}
var feature = "#DisplaySizeId22 ul li.wnItem.feature.story";
var featureTotal = checkLength(feature);
if(featureTotal >= 1){
if(pageID == 'F' || pageID == ''){
//console.log("pageID = "+pageID);
$wn("#sidebarContent .additionalLinks").before("");
var idNum = $wn(""+feature+":first h4 a").attr("href");
var retIdNum = idNum.match(/\d+/);
requestFeed("http://api.worldnow.com/feed/v3.0/stories/" + retIdNum);
}
}
var poll = "#WNCol3 #WNDS12 .wnDVPoll";
var pollTotal = checkLength(poll);
if(pollTotal >= 1){
insertPoll(featureTotal, poll);
}
//console.log("featureTotal = "+featureTotal);
if(pollTotal == 0 && featureTotal == 0 && linkTotal == 0){
additionalLinks('featuring');
}else if(featureTotal >= 1 && linkTotal == 0){
if(pageID == 'N' || pageID == 'L'){
additionalLinks('featuring');
}else{
additionalLinks('');
}
}else{
additionalLinks('');
}
function insertPoll(a, b){
if (a == 0){
var pollContainer = "";
$wn('#sidebarContent .additionalLinks').before(pollContainer);
}else{
var pollContainer = "";
$wn(".wnStoryBodyGraphic:last").after(pollContainer);
}
$wn('#pollContent').append($wn(poll));
}
function additionalLinks(a){
var link = "#DisplaySizeId3 ul li.wnItem.link";
var feature = "#DisplaySizeId3 ul li.wnItem.feature.story";
var linkTotal = checkLength(link);
var featureTotal = checkLength(feature);
if(linkTotal >= 1 || featureTotal >= 1){
$wn('#sidebarContent .additionalLinks').append('');
}
if(linkTotal >= 1){
$wn('#sidebarContent .additionalLinks').append($wn(link));
$wn('.additionalLinks').fadeIn('fast');
}
if(featureTotal >= 1){
$wn('#sidebarContent .additionalLinks').append($wn(feature));
$wn('.additionalLinks').fadeIn('fast');
}
if(a == 'featuring'){
$wn('.additionalLinks .FAL').hide();
$wn('#sidebarContainer #sidebarHeader .FAL').show();
$wn('#sidebarContainer #sidebarHeader .moreHead').hide();
}else if(a == ''){
$wn('#sidebarContainer #sidebarHeader .FAL').hide();
}
}
function sidebarFeed(feed){
var feature = "#DisplaySizeId22 ul li.wnItem.feature.story";
$wn(""+feature+":first").remove();
var xml = feed.response.responseXML;
var story = xml.getElementsByTagName("story");
var body = story[0].getElementsByTagName("body")[0].childNodes[0].nodeValue;
var img = $wn(xml).find("story storyimage:first filename").text();
var clickable = $wn(xml).find("isclickable").text();
var title = $wn(xml).find("story abridged headline").text();
//story[0].getElementsByTagName("headline")[0].childNodes[0].nodeValue;
var bodyText = story[0].getElementsByTagName("body")[0].childNodes[0].nodeValue;
var pageURL = story[0].getElementsByTagName("pageurl")[0].childNodes[0].nodeValue;
var id = story[0].getElementsByTagName("id")[0].childNodes[0].nodeValue;
var headline = linkedHeadline(clickable, id, pageURL, title);
var image = SBimage(img, id, pageURL);
var storyBody = "
" + bodyText + "
"; var storyContent = ""+d+"
"; }else{ return ""+d+"
"; } } function SBimage(a, b, c){ if(a == ''){ return ''; }else{ return ""; } } function sidebarHeight(clickable){ $wn(document).ready(function(){ var sideBarHeight = $wn('#sidebarContainer').height(); var link = "#sidebarContent li.wnItem.feature"; var ss = "#sidebarContent li.featureSS"; var linkTotal = checkLength(link); var ssTotal = checkLength(ss); var storyHeight = $wn('#firstStory').height(); var percent = storyHeight; //console.log("sideBarHeight = "+sideBarHeight+" - bodyHeght = "+bodyHeight+" - clickable = "+clickable); if(sideBarHeight >= bodyHeight && clickable == 'True'){ storyHide(linkTotal, ssTotal, storyHeight, bodyHeight); //console.log("linkTotal = "+linkTotal+" ssTotal = "+ ssTotal+" storyHeight = "+ storyHeight+" bodyHeight = "+ bodyHeight); }else{ $wn(".continueReading.more").hide(); } }); } function storyHide(a, b, c, d){ //console.log("a = "+a+" - b = "+b+" - c = "+c+" - d = "+d); var lh = height(a,55,40); var sh = height(b,300,0); var sbe = lh+sh+250; var sbh = Math.round((d*.80)+(d-sbe)); var sIndex = $wn("#firstStory .summary p, #firstStory .summary h3, #firstStory .summary ol, #firstStory .summary ul").length; var percent = (sbh/c).toFixed(2); var showP = showParagraph(sIndex, percent); //console.log("lh = "+lh+" - sh = "+sh+ " - sbe = "+sbe+" - sbh = "+sbh+" - sIndex = "+sIndex+" - percent = "+percent+" - showP = "+showP); if (showP == sIndex){ $wn(".continueReading.more").hide(); }else{ for(i=sIndex; i>=showP; i--){ $wn("#firstStory .summary.abridged >:eq("+i+")").hide(); } } function showParagraph(a,c){ var b = Math.floor(a*c); if(b = 1){ return (b*a)+c; }else{ return a; } } } function sidebaruError(){} function requestFeed(url){WNHttpRequestManager.makeRequest(url, { onSuccess: sidebarInit, onError: sidebaruError});}; function sidebarInit(){sidebarFeed(this);} function checkLength(a){var items = $wn(""+a+"").length;return items;} function addSidebar(a, b, c, d){ if(a >= 3){$wn(c[0]).after(b);}else if(a >= 2 && aSource: http://www.fox19.com/story/19079888/health-insurance-rebates-in-ohio-to-total-113m
josephine baker super bowl start time target jason wu gi joe jason wu for target collection jason wu jason wu
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.