© | Les portions sont © Presse associée. Tous les droits sont réservés. Ce matériel ne peut être publié, diffusé, réécrit ou distribué.
WMYA MyTV 40 fournit des programmes de divertissement MyTV aux résidents près de Greenville, en Caroline du Sud, y compris Berea, Welcome, Mauldin, Conestee, Simpsonville, Spartanburg, Taylors, Greer, Piedmont, Anderson, Clemson, Liberty, Pickens et Easley, Caroline du Sud et Hendersonville, Asheville , Black Mountain, Flat Rock et Fletcher, Caroline du Nord.
//- FB.ui({
//- method: 'share',
//- href: window.location.href,
//- }, function(response){});
})
var socialGetter = (function() {
function injectScript(url) {
var script = document.createElement('script');
script.async = true;
script.src = url;
document.body.appendChild(script);
}
return {
getFacebookCount: function(url, callbackName) {
injectScript('https://graph.facebook.com/?id=' + url + '&callback=' + callbackName);
},
getTwitterCount: function(url, callbackName) {
injectScript('http://urls.api.twitter.com/1/urls/count.json?url=" + url + "&callback=' + callbackName);
}
};
})();
if(typeof FB !== 'object'){
window.fbAsyncInit = function() {
FB.init({
appId : '',
xfbml : true,
version : 'v2.5'
});
};
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "http://connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
}
if(typeof socialGetter !== 'function'){
var socialGetter = (function() {
function injectScript(url) {
var script = document.createElement('script');
script.async = true;
script.src = url;
document.body.appendChild(script);
}
return {
getFacebookCount: function(url, callbackName) {
injectScript('https://graph.facebook.com/?id=' + url + '&callback=' + callbackName);
},
getTwitterCount: function(url, callbackName) {
injectScript('http://urls.api.twitter.com/1/urls/count.json?url=" + url + "&callback=' + callbackName);
}
};
})();
}
$(function(){
socialGetter.getFacebookCount(window.location.href, 'facebookCallback');
//socialGetter.getTwitterCount(window.location.href, 'twitterCallback');
//console.log(window.location.href)
})
var storyUrl = window.location.origin + window.location.pathname;
var $sharer = $( '.social-share-tiles' );
var storyTitle = $('.story-title-text h1').text();
$( '.component-social-share-v2 .tile a' ).off().click( function ( e ) {
var self = this;
console.log( 'data-social', $(self).data('social') );
$.ajax( {
contentType: "application/json; charset=UTF-8",
type: "PUT",
url: "/api/rest/analytics/story/shared",
data: JSON.stringify( {
"url": window.location.href,
"storySlug": "firefighters-investigate-overnight-mobile-home-fire",
"storyType": "story",
"storyIdentifier": "69f8df39-fc1b-42da-a16e-54555319617c",
"shareType": $(self).data('social')
} )
} );
if($(self).data('social')==='facebook'){
if(''){
FB.ui({
method: 'share',
href: 'http://my40.tv/news/local/firefighters-investigate-overnight-mobile-home-fire',
}, function(response){});
return false;
} else {
window.open('http://www.facebook.com/sharer/sharer.php?u=http://my40.tv/news/local/firefighters-investigate-overnight-mobile-home-fire', '_blank');
}
}
if ( $( self ).data( "social" ) == "print" ) {
window.print();
return false;
}
} );
//- // DYNAMICALLY REPLACE {canonicalUrl} THE story.canonicalUrl IS EMPTY
//- $.each( $sharer.find( 'a' ), function () {
//- var href = $( this ).attr( 'href' ).replace( '{canonicalUrl}', storyUrl );
//- $( this ).attr( 'href', href );
//- } );
// Generate window for Twitter sharing
var genericShare = function (url, site) {
var width = ($(window).width() < 1024) ? $(window).width() - 40 : 575,
height = 450,
left = ($(window).width() - width) / 2,
top = ($(window).height() - height) / 2,
opts="status=1" +
',width=" + width +
",height=" + height +
",top=' + top +
',left=" + left;
window.open(url, site, opts);
};
var $twitter = $(".tile.twitter').find('a');
$twitter.click(function () {
genericShare('http://twitter.com/share?text=" + storyTitle + "&url=" + storyUrl, "Twitter');
});
},true);
//.fb-like.pull-left(data-href="wlos.com/news/local/firefighters-investigate-overnight-mobile-home-fire", data-layout="button_count", data-share="true", data-width="450")
//http://graph.facebook.com/?id=http://wjla.com/news/local/house-fire-kills-two-in-spotsylvania-county