var essb_handle_stats = function(oService, oPostID, oInstance) { var element = jQuery('.essb_'+oInstance); var instance_postion = jQuery(element).attr("data-essb-position") || ""; var instance_template = jQuery(element).attr("data-essb-template") || ""; var instance_button = jQuery(element).attr("data-essb-button-style") || ""; var instance_counters = jQuery(element).hasClass("essb_counters") ? true : false; var instance_nostats = jQuery(element).hasClass("essb_nostats") ? true : false; if (instance_nostats) { return; } var instance_mobile = false; if( (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i).test(navigator.userAgent) ) { instance_mobile = true; } if (typeof(essb_settings) != "undefined") { jQuery.post(essb_settings.ajax_url, { 'action': 'essb_stat_log', 'post_id': oPostID, 'service': oService, 'template': instance_template, 'mobile': instance_mobile, 'position': instance_postion, 'button': instance_button, 'counter': instance_counters, 'nonce': essb_settings.essb3_nonce }, function (data) { if (data) { }},'json'); } }; var essb_window = function(oUrl, oService, oInstance) { var element = jQuery('.essb_'+oInstance); var instance_post_id = jQuery(element).attr("data-essb-postid") || ""; var instance_position = jQuery(element).attr("data-essb-position") || ""; var wnd; var w = 800 ; var h = 500; if (oService == "twitter") { w = 500; h= 300; } var left = (screen.width/2)-(w/2); var top = (screen.height/2)-(h/2); if (oService == "twitter") { wnd = window.open( oUrl, "essb_share_window", "height=300,width=500,resizable=1,scrollbars=yes,top="+top+",left="+left ); } else { wnd = window.open( oUrl, "essb_share_window", "height=500,width=800,resizable=1,scrollbars=yes,top="+top+",left="+left ); } if (typeof(essb_settings) != "undefined") { if (essb_settings.essb3_stats) { if (typeof(essb_handle_stats) != "undefined") { essb_handle_stats(oService, instance_post_id, oInstance); } } if (essb_settings.essb3_ga) { essb_ga_tracking(oService, oUrl, instance_position); } } essb_self_postcount(oService, instance_post_id); var pollTimer = window.setInterval(function() { if (wnd.closed !== false) { window.clearInterval(pollTimer); essb_smart_onclose_events(oService, instance_post_id); } }, 200); }; var essb_self_postcount = function(oService, oCountID) { if (typeof(essb_settings) != "undefined") { oCountID = String(oCountID); jQuery.post(essb_settings.ajax_url, { 'action': 'essb_self_postcount', 'post_id': oCountID, 'service': oService, 'nonce': essb_settings.essb3_nonce }, function (data) { if (data) { }},'json'); } }; var essb_smart_onclose_events = function(oService, oPostID) { if (typeof (essbasc_popup_show) == 'function') { essbasc_popup_show(); } if (typeof essb_acs_code == 'function') { essb_acs_code(oService, oPostID); } }; var essb_tracking_only = function(oUrl, oService, oInstance, oAfterShare) { var element = jQuery('.essb_'+oInstance); if (oUrl == "") { oUrl = document.URL; } var instance_post_id = jQuery(element).attr("data-essb-postid") || ""; var instance_position = jQuery(element).attr("data-essb-position") || ""; if (typeof(essb_settings) != "undefined") { if (essb_settings.essb3_stats) { if (typeof(essb_handle_stats) != "undefined") { essb_handle_stats(oService, instance_post_id, oInstance); } } if (essb_settings.essb3_ga) { essb_ga_tracking(oService, oUrl, instance_position); } } essb_self_postcount(oService, instance_post_id); if (oAfterShare) { essb_smart_onclose_events(oService, instance_post_id); } }; var essb_pinterest_picker = function(oInstance) { essb_tracking_only('', 'pinterest', oInstance); var e=document.createElement('script'); e.setAttribute('type','text/javascript'); e.setAttribute('charset','UTF-8'); e.setAttribute('src','//assets.pinterest.com/js/pinmarklet.js?r='+Math.random()*99999999);document.body.appendChild(e); }; function essb_mailer(oTitle, oMessage, oSiteTitle, oUrl, oImage, oPermalink) { vex.defaultOptions.className = 'vex-theme-os'; vex.dialog.open({ message: 'Share this with a friend', input: '' + '<div class="vex-custom-field-wrapper"><strong>Your Email</strong></div>'+ '<input name="emailfrom" type="text" placeholder="Your Email" required />' + '<div class="vex-custom-field-wrapper"><strong>Recipient Email</strong></div>'+ '<input name="emailto" type="text" placeholder="Recipient Email" required />' + '<div class="vex-custom-field-wrapper" style="border-bottom: 1px solid #aaa !important; margin-top: 10px;"><h3></h3></div>'+ '<div class="vex-custom-field-wrapper" style="margin-top: 10px;"><strong>Subject</strong></div>'+ '<input name="emailsubject" type="text" placeholder="Subject" required value="'+oTitle+'" />' + '<div class="vex-custom-field-wrapper" style="margin-top: 10px;"><strong>Message</strong></div>'+ '<textarea name="emailmessage" placeholder="Message" required" rows="6" >'+oMessage+'</textarea>' + '', buttons: [ jQuery.extend({}, vex.dialog.buttons.YES, { text: 'Send' }), jQuery.extend({}, vex.dialog.buttons.NO, { text: 'Cancel' }) ], callback: function (data) { if (data.emailfrom && typeof(data.emailfrom) != "undefined") { var c = typeof(data.captchacode) != "undefined" ? data.captchacode : ""; essb_sendmail_ajax71597155(data.emailfrom, data.emailto, data.emailsubject, data.emailmessage, c, oSiteTitle, oUrl, oImage, oPermalink); } } }); }; function essb_sendmail_ajax71597155(emailfrom, emailto, emailsub, emailmessage, c, oSiteTitle, oUrl, oImage, oPermalink) { jQuery.post('http://tangosix.rs/assets/plugins/easy-social-share-buttons3/public/essb-mail.php', { 'from': emailfrom, 'to': emailto, 'sub': emailsub, 'message': emailmessage, 't': oSiteTitle, 'u': oUrl, 'img': oImage, 'p': oPermalink, 'c': c, 'salt': '664353959' }, function (data) { console.log(data); if (data) { alert(data.message); }},'json'); }; function essb_mailform_1236914661() { essb_tracking_only('', 'mail', '1236914661'); essb_mailer('Visit this site http://tangosix.rs', 'Hi, this may be interesting you: \"Udes vojnog helikoptera u Podgorici\"! This is the link: http://tangosix.rs/2016/10/06/udes-vojnog-helikoptera-u-podgorici/', 'Udes vojnog helikoptera u Podgorici', 'http://tangosix.rs', 'http://media.tangosix.rs/2016/06/1c88dff2-bdba-48da-a4c6-b5cbe8fd6aa8.jpg', 'http://tangosix.rs/2016/10/06/udes-vojnog-helikoptera-u-podgorici/', 'shortcode'); };