'), list = $('').appendTo(box), sharedurl, encodedurl, i, l;
sharedurl = shared.data('shared');
title = shared.data('title');
encodedurl = encodeURIComponent(resolve(sharedurl));
for (l = 0; l ').appendTo(list);
if ($.isFunction(services[l].t)) {
var r = services[l].t(shared);
if (r) {
li.append($('').text(r));
} else {
continue;
}
} else {
li.append($('').text(services[l].t));
}
var s = services[l].s;
var ul = $('').appendTo(li);
for (i in s) {
if (s.hasOwnProperty(i)) {
var url = s[i].u.replace(/^%url%/, sharedurl).replace(/%url%/g, encodedurl);
if (i === 'em') {
url = url.replace(/^%title%/, title).replace(/%title%/g, encodeURIComponent(title + ' - Tgcom24'));
} else {
if (i === 'msg') {
url += '&next=' + encodedurl + '&app_id=206282216389866';
} else if (i === 'msg_mob') {
url += '&app_id=206282216389866';
}
}
var link = $('
' + s[i].n + '');
if (s[i].p) {
link.click(function(e) {
var w = popup(this.href, i, 1000, 700);
if (w) {
e.preventDefault();
return false;
}
;
});
}
ul.append($('').append(link));
}
}
}
return box;
}
function create_sharebox(sharebox, frameEvent) {
if ($('#overlay__share').length === 0) {
var overlay_sh = $('');
$('.d').append(overlay_sh);
}
$('#overlay__share').html('');
sharebox.appendTo('#overlay__share');
$('#overlay__y').on('click tap', function(e) {close_sharebox(e, frameEvent)});
$('#overlay__share').css('opacity', 1);
}
function close_sharebox(e, frameEvent) {
sharebox = null;
$('#overlay__share').css('opacity', 0);
$('#overlay__share').html('').remove();
frameEvent.source.postMessage({
sentinel: "player-embed",
type: "emit",
actionName: "play"
}, "*");
}
function resolve(url) {
var a = $('').attr('href', url);
return a[0].href;
}
var services = [{
t: 'Condividi su',
s: {
fb: {
n: 'Facebook',
u: 'https://www.facebook.com/sharer/sharer.php?u=%url%',
p: true
},
tw: {
n: 'Twitter',
u: 'https://twitter.com/intent/tweet?url=%url%',
p: true
},
wa: {
n: 'Whatsapp',
u: 'https://api.whatsapp.com/send?text=Da%20TGCOM24:%20%url%',
p: true
},
msg: {
n: 'Messenger',
u: 'http://facebook.com/dialog/send?link=%url%',
p: true
},
msg_mob: {
n: 'Messenger',
u: 'fb-messenger://share/?link=%url%',
p: true
},
tlg: {
n: 'Telegram',
u: 'https://telegram.me/share/url?url=%url%',
p: true
},
li: {
n: 'LinkedIn',
u: 'https://www.linkedin.com/shareArticle?url=%url%',
p: true
},
/* gp: {
n: 'Google+',
u: 'https://plus.google.com/share?url=%url%',
p: true
}, */
em: {
n: 'via email',
u: 'mailto:?subject=%title%&body=Da%20Tgcom24:%20%url%'
}
}
}];
function popup(uri, win_name, width, height, x, y) {
if (uri === "") {
return;
}
if (x == null) {
x = parseInt(screen.width / 2, 10) - width / 2;
}
if (y == null) {
y = parseInt(screen.height / 2, 10) - height / 2;
}
var optionstr, win, options = {
resizable: 'no',
scrollbars: 'yes'
}, optnames = ['resizable', 'scrollbars'], i, v, arg6 = arguments[6];
if ((typeof arg6 === 'undefined' ? 'undefined' : babelHelpers.typeof(arg6)) === 'object') {
if (arg6.resizable) {
options.resizable = arg6.resizable;
}
if (arg6.scrollbars) {
options.scrollbars = arg6.scrollbars;
}
}
optionstr = '';
for (i = 0; i