Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var WebCall = {
- updateText: function(element_id, text, animate) {
- if (animate) {
- $('#' + element_id).fadeOut();
- }
- $('#' + element_id).html(text);
- if (animate) {
- $('#' + element_id).fadeIn('slow');
- }
- },
- updateBalance: function(response) {
- if ($('#balance').length > 0 && response) {
- var balance = parseInt(response.calculated_balance);
- balance = (Math.round(balance / 1000)) / 100;
- var fbalance = "";
- var balancestr = new String(balance);
- var balancearr = balancestr.split(".");
- if (balancearr.length == 1) fbalancestr = balancestr + "." + "00";
- else if (balancearr.length == 2) {
- if (balancearr[1].length == 1) fbalancestr = balancestr + "0";
- else if (balancearr[1].length == 2) fbalancestr = balancestr;
- }
- if (fbalancestr != "") {
- WebCall.updateText('balance', locale.currency_symbol + " " + fbalancestr);
- }
- }
- }
- };
- var errormessages = new Array();
- errormessages.push("");
- errormessages.push("Sorry, you do not have enough credit to complete this call. Visit your account page to buy credit!");
- errormessages.push("The call ended due to an unknown error");
- errormessages.push("The other party ended the call");
- errormessages.push("The call ended due to an unknown error");
- errormessages.push("You ended the call");
- errormessages.push("The other party ended the call");
- errormessages.push("an error has occurred- code {err-id}");
- errormessages.push("You were busy with another call");
- errormessages.push("The other party was busy");
- errormessages.push("You did not answer your call");
- errormessages.push("The other party did not answer your call");
- errormessages.push("Sorry, a local network problem ended this call");
- errormessages.push("Sorry, a remote network problem ended this call");
- errormessages.push("The number you are trying to call is not supported. Please check the number and try again.");
- errormessages.push("an error has occurred- code {err-id}");
- errormessages.push("<b>Sorry, this destination is not free</b><br><br>Please buy credit or log in. Or call only the <a href='\"/freetrial_rates\"'>free</a> destinations.");
- errormessages.push("The time limit for this call has been reached. Buy credit and make unlimited calls!");
- errormessages.push("Sorry, you are not allowed to make this call");
- errormessages.push("The number you called is invalid. Please check the number and try again.");
- errormessages.push("Your own number is invalid");
- errormessages.push("The number you called is invalid. Please check the number and try again.");
- errormessages.push("There is a problem with your account, please go to your account page.");
- errormessages.push("The maximum number of free calls has been reached or you did not click the link in your signup email.");
- errormessages.push("You rejected the call");
- errormessages.push("The other party rejected the call");
- var timenow = -1;
- var starttime = -1;
- var timeprice = "";
- var intervalid;
- var locale = {
- "connection_time": "connection time",
- "rate_cents": "Ct\/min",
- "free": "Free",
- "setup_fee": "setup fee",
- "cents": "Ct",
- "dialing": "dialing",
- "the_total_price_for_call_is": "The total price for this call is",
- "pickup": "Pick up your phone...",
- "ringing": "Ringing...",
- "picked_up": "Picked up",
- "waiting_other_party": "Waiting for other party to pick up the telephone",
- "call_disconnected": "The call was disconnected",
- "call_connected": "Call connected",
- "an_error_occured": "An unknown error has occured",
- "currency_symbol": "€",
- "no_longer_available": "<div>Our Phone-to-phone service is no longer available in your country.<\/div>",
- "technical_error": "A technical error has occured please try again later. If the problem persists please contact customer service.",
- "qs_error_message": "<div><\/div>"
- };
- $.ajax({
- type: "POST",
- url: "https://www.voipstunt.com/x_status/p2p",
- dataType: "json",
- data: "_xwcun=L2ImMKW1L2Im&_xwcup=ZKWyn2AunTEyn2SB&_xwcci=AQRjBQp4AmRlBD%253D%253D&_xwcwx=AGVlAQN4ZmR5&_xwcip=ZQNkYwxhZwtkYwx0&_xwccs=M25coTScMTR%253D&31d35abc82f90f7ac71d1c5aa235380f=2c0b27ac6c1beaa90575db1e229702d6",
- success: function(response) {
- if (response.error == "reload_page") {
- window.setTimeout('location.href=\'https://www.voipstunt.com/warning.html\';', 1000);
- } else {
- callBack(response);
- }
- }
- });
- var ASideSetupCharge = 0;
- var ASideTariff = 0;
- var ASideTariffIntervall = 0;
- var BSideSetupCharge = 0;
- var BSideTariff = 0;
- var BSideTariffIntervall = 0;
- var totalcpm = 0;
- var isconnected = false;
- var isdisconnecting = false;
- var disconnectoption = '<iframe id="disconnect-iframe" scrolling="no" frameborder="0" height="20" width="100%" border="0" style="overflow: hidden; background: transparent;" src="https://www.voipstunt.com/x_status/p2p_x?_xwcci=AQRjBQp4AmRlBD%3D%3D"></iframe>';
- var creditlink = {
- "data": "Click <a href=\"https:\/\/www.voipstunt.com\/buy_credit\/\">here<\/a> to buy more credits"
- };
- var redial_new_call_form = {
- "data": "<form style=\"display: inline;\" action=\"https:\/\/www.voipstunt.com\/phone_to_phone\/\" method=\"POST\">\n <input type=\"hidden\" name=\"phonenumber_from\" value=\"478061501\" \/>\n <input type=\"hidden\" name=\"phonenumber_to\" value=\"413218428\" \/>\n <input type=\"hidden\" name=\"prefix_from\" value=\"+61\" \/>\n <input type=\"hidden\" name=\"prefix_to\" value=\"+61\" \/>\n <input type=\"hidden\" name=\"action\" value=\"redial\" \/>\n <input type=\"submit\" class=\"button\" value=\"Redial\" \/>\n <input type=\"hidden\" id=\"31d35abc82f90f7ac71d1c5aa235380f\" name=\"31d35abc82f90f7ac71d1c5aa235380f\" value=\"2c0b27ac6c1beaa90575db1e229702d6\" \/><\/form>\n \n<form style=\"display: inline;\" action=\"https:\/\/www.voipstunt.com\/phone_to_phone\/\" method=\"POST\">\n <input type=\"hidden\" name=\"action\" value=\"makenewcall\" \/>\n <input type=\"submit\" class=\"button\" value=\"Make another call\" \/>\n <input type=\"hidden\" id=\"31d35abc82f90f7ac71d1c5aa235380f\" name=\"31d35abc82f90f7ac71d1c5aa235380f\" value=\"2c0b27ac6c1beaa90575db1e229702d6\" \/><\/form>"
- };
- var buy_credit_form = {
- "data": "<form><\/form>\n<form action=\"https:\/\/www.voipstunt.com\/buy_credit\/\" method=\"POST\" target=\"_parent\" style=\"display: inline;\">\n <input type=\"submit\" class=\"button\" value=\"Buy Credit\">\n <input type=\"hidden\" id=\"31d35abc82f90f7ac71d1c5aa235380f\" name=\"31d35abc82f90f7ac71d1c5aa235380f\" value=\"2c0b27ac6c1beaa90575db1e229702d6\" \/><\/form>"
- };
- function displayConnectionTime() {
- if (isconnected) {
- timenow = new Date();
- timenow = parseInt(timenow.getTime() / 1000);
- var conntime = timenow - starttime;
- var timestring = "";
- var connhours = Math.floor(conntime / 3600);
- var connminutes = Math.floor((conntime - (connhours * 3600)) / 60);
- var connseconds = ((conntime % 60) % 60);
- if (starttime == -1) {
- starttime = timenow;
- }
- if (connhours == 0) {
- connhours = "00";
- } else if (connhours < 10) {
- connhours = "0" + connhours;
- }
- if (connminutes == 0) {
- connminutes = "00";
- } else if (connminutes < 10) {
- connminutes = "0" + connminutes;
- }
- if (connseconds == 0) {
- connseconds = "00";
- } else if (connseconds < 10) {
- connseconds = "0" + connseconds;
- }
- conntime = connhours + ":" + connminutes + ":" + connseconds;
- var setupcharge = (ASideSetupCharge / 10000) + (BSideSetupCharge / 10000);
- var total = 0;
- total += (ASideTariff / 10000) * Math.ceil((timenow - starttime) / ASideTariffIntervall);
- total += (BSideTariff / 10000) * Math.ceil((timenow - starttime) / BSideTariffIntervall);
- if (ASideTariffIntervall == 0 || BSideTariffIntervall == 0) {
- total = 0;
- }
- totalcpm = parseFloat(ASideTariff / 10000) + parseFloat(BSideTariff / 10000);
- totalcpm = parseFloat(ASideTariff / 10000) + parseFloat(BSideTariff / 10000) + 5.0;
- timeprice = '' +
- '<div class="connection-time">(' + locale.connection_time + ': ' +
- (conntime) +
- ')' +
- '</div><div class="total-price"> ' + locale.the_total_price_for_call_is +
- " " + total +
- " " + locale.cents;
- if (setupcharge > 0) {
- timeprice = timeprice +
- ' + ' + setupcharge + " " + locale.setup_fee;
- }
- timeprice = timeprice +
- '.' +
- '</font>';
- WebCall.updateText('connection-message', timeprice);
- } else {
- window.clearInterval(intervalid);
- }
- }
- function callBack(response) {
- var original_response = response;
- var errorid = -1;
- if (response.endcause) {
- errorid = response.endcause;
- }
- if (response.ASideSetupCharge) {
- ASideSetupCharge = parseInt(response.ASideSetupCharge);
- ASideTariff = parseInt(response.ASideTariff);
- ASideTariffIntervall = parseInt(response.ASideTariffIntervall);
- BSideSetupCharge = parseInt(response.BSideSetupCharge);
- BSideTariff = parseInt(response.BSideTariff);
- BSideTariffIntervall = parseInt(response.BSideTariffIntervall);
- }
- if (response.callstate) {
- if (response.callstate == "connected") {
- displayConnectionTime();
- }
- }
- var additional_to = "";
- var additional_from = "";
- callstate = response.callstate;
- callstate_code = response.code;
- if (response.status) {
- if (response.status == "disconnected") {
- callstate = "disconnected";
- }
- }
- if ((callstate == "adialing" || callstate == "aringing" || callstate == "aanswered" || callstate == "bdialing" || callstate == "bringing" || callstate == "banswered" || callstate == "connected")) {
- if (!document.getElementById('disconnect-iframe')) {
- WebCall.updateText('disconnect-option', disconnectoption);
- }
- additional_from = '<div class="connection-fee">';
- if (ASideTariff != 0) {
- additional_from += parseFloat(ASideTariff / 10000) + " " + locale.rate_cents;
- } else {
- additional_from += locale.free;
- }
- additional_from += '</div>';
- additional_to = '<div class="connection-fee">';
- if (BSideTariff != 0) {
- additional_to += parseFloat(BSideTariff / 10000) + " " + locale.rate_cents;
- } else {
- additional_to += locale.free;
- }
- additional_to += '</div>';
- }
- if (callstate == "banswered") {
- WebCall.updateText('connection-message', '');
- WebCall.updateText('from-status', additional_from);
- createNewConnection(6);
- isconnected = false;
- } else if (callstate == "dialing") {
- WebCall.updateText('connection-message', locale.dialing);
- createNewConnection(1);
- isconnected = false;
- } else if (callstate == "adialing") {
- WebCall.updateText('connection-message', locale.dialing);
- WebCall.updateText('from-status', locale.pickup + additional_from);
- WebCall.updateText('to-status', ' ' + additional_to);
- createNewConnection(2);
- isconnected = false;
- } else if (callstate == "aringing") {
- WebCall.updateText('connection-message', '');
- WebCall.updateText('from-status', locale.pickup + additional_from);
- WebCall.updateText('to-status', ' ' + additional_to);
- createNewConnection(2);
- isconnected = false;
- } else if (callstate == "aanswered") {
- WebCall.updateText('connection-message', '');
- WebCall.updateText('from-status', additional_from);
- createNewConnection(3);
- isconnected = false;
- } else if (callstate == "bdialing") {
- WebCall.updateText('connection-message', locale.waiting_other_party);
- WebCall.updateText('from-status', locale.picked_up + additional_from);
- WebCall.updateText('to-status', locale.dialing + additional_to);
- createNewConnection(4);
- isconnected = false;
- } else if (callstate == "bringing") {
- WebCall.updateText('connection-message', locale.waiting_other_party);
- WebCall.updateText('from-status', locale.picked_up + additional_from);
- WebCall.updateText('to-status', locale.ringing + additional_to);
- createNewConnection(5);
- isconnected = false;
- } else if (callstate == "disconnected") {
- isconnected = false;
- var cause = "";
- if (errorid != -1 && errorid != 0) {
- cause = getErrorDisplay(response, errormessages[errorid]);
- if (errorid == 1 || errorid == 16) cause += " " + creditlink.data;
- if (errorid == 26) {
- cause = '' + locale.technical_error;
- }
- cause += "";
- }
- $('#connection-message').addClass('notification');
- $('#connection-message').addClass('error');
- $('#connection-message').addClass('png_bg');
- WebCall.updateText('connection-message', '<div>' + cause + '</div>');
- if (errorid == 1 || errorid == 16) {
- WebCall.updateText('calloptions', buy_credit_form.data);
- } else if (errorid == 27) {
- WebCall.updateText('connection-message', locale.no_longer_available);
- } else {
- WebCall.updateText('calloptions', redial_new_call_form.data);
- }
- WebCall.updateText('disconnect-option', '');
- WebCall.updateText('from-status', locale.call_disconnected);
- WebCall.updateText('to-status', locale.call_disconnected);
- createFinalConnection();
- } else if (callstate == "disconnecting") {
- isconnected = false;
- var cause = "";
- if (errorid != -1 && errorid != 0) {
- cause = getErrorDisplay(response, errormessages[errorid]);
- if (errorid == 1 || errorid == 16) {
- cause += ' ' + creditlink.data;
- }
- }
- WebCall.updateText('connection-message', cause);
- if (errorid == 1 || errorid == 16) {
- WebCall.updateText('calloptions', buy_credit_form.data);
- } else {
- WebCall.updateText('calloptions', redial_new_call_form.data);
- }
- WebCall.updateText('from-status', locale.call_disconnected);
- WebCall.updateText('to-status', locale.call_disconnected);
- WebCall.updateText('disconnect-option', '');
- } else if (callstate == "connected") {
- if (!isconnected) {
- WebCall.updateText('from-status', locale.call_connected + additional_from);
- WebCall.updateText('to-status', locale.call_connected + additional_to);
- }
- createNewConnection(6);
- isconnected = true;
- intervalid = window.setInterval('displayConnectionTime()', 1000);
- } else if (callstate == "error" || callstate == "unknown") {
- isconnected = false;
- WebCall.updateText('calloptions', redial_new_call_form.data);
- if (errorid == 27) {
- WebCall.updateText('connection-message', locale.no_longer_available);
- } else {
- WebCall.updateText('disconnect-option', '');
- }
- WebCall.updateText('from-status', locale.call_disconnected);
- WebCall.updateText('to-status', locale.call_disconnected);
- } else if (callstate == "missedstatus") {
- createNewConnection(callstate_code);
- WebCall.updateText('disconnect-option', '');
- } else {
- isconnected = false;
- if (original_response) {
- WebCall.updateText('calloptions', locale.an_error_occured);
- WebCall.updateText('from-status', locale.call_disconnected);
- WebCall.updateText('to-status', locale.call_disconnected);
- WebCall.updateText('disconnect-option', '');
- }
- }
- }
- function getErrorDisplay(response, localemessage) {
- var errormessage =
- (response.Error.Long != '') ? response.Error.Long :
- (response.Error.Medium != '') ? response.Error.Medium :
- (response.Error.Short != '') ? response.Error.Short :
- localemessage;
- var displaymessage = '<h5>' + response.Error.Header + '</h5>' + errormessage;
- return displaymessage;
- }
- function createFinalConnection() {
- $.ajax({
- type: "POST",
- url: "https://www.voipstunt.com/x_status/p2p_balance",
- dataType: "json",
- data: "_xwcun=L2ImMKW1L2Im&_xwcup=ZKWyn2AunTEyn2SB&_xwcci=AQRjBQp4AmRlBD%253D%253D&_xwcwx=AGVlAQN4ZmR5&_xwcip=ZQNkYwxhZwtkYwx0&31d35abc82f90f7ac71d1c5aa235380f=2c0b27ac6c1beaa90575db1e229702d6",
- success: function(response) {
- if (response.error == "reload_page") {
- window.setTimeout('location.href=\'https://www.voipstunt.com/warning.html\';', 1000);
- } else {
- WebCall.updateBalance(response);
- }
- }
- });
- }
- function createNewConnection(connstatus) {
- if (isdisconnecting) return;
- if (connstatus == 2) {
- $.ajax({
- type: "POST",
- url: "https://www.voipstunt.com/x_status/p2p",
- dataType: "json",
- data: "_xwcun=L2ImMKW1L2Im&_xwcup=ZKWyn2AunTEyn2SB&_xwcci=AQRjBQp4AmRlBD%253D%253D&_xwcwx=AGVlAQN4ZmR5&_xwcip=ZQNkYwxhZwtkYwx0&31d35abc82f90f7ac71d1c5aa235380f=2c0b27ac6c1beaa90575db1e229702d6&_xwccs=M25cM25cpzR%253D",
- success: function(response) {
- callBack(response);
- }
- });
- }
- if (connstatus == 3) {
- $.ajax({
- type: "POST",
- url: "https://www.voipstunt.com/x_status/p2p",
- dataType: "json",
- data: "_xwcun=L2ImMKW1L2Im&_xwcup=ZKWyn2AunTEyn2SB&_xwcci=AQRjBQp4AmRlBD%253D%253D&_xwcwx=AGVlAQN4ZmR5&_xwcip=ZQNkYwxhZwtkYwx0&31d35abc82f90f7ac71d1c5aa235380f=2c0b27ac6c1beaa90575db1e229702d6&_xwccs=MTIlMKqmozSu",
- success: function(response) {
- callBack(response);
- }
- });
- }
- if (connstatus == 4) {
- $.ajax({
- type: "POST",
- url: "https://www.voipstunt.com/x_status/p2p",
- dataType: "json",
- data: "_xwcun=L2ImMKW1L2Im&_xwcup=ZKWyn2AunTEyn2SB&_xwcci=AQRjBQp4AmRlBD%253D%253D&_xwcwx=AGVlAQN4ZmR5&_xwcip=ZQNkYwxhZwtkYwx0&31d35abc82f90f7ac71d1c5aa235380f=2c0b27ac6c1beaa90575db1e229702d6&_xwccs=M25cM25cpzV%253D",
- success: function(response) {
- callBack(response);
- }
- });
- }
- if (connstatus == 5) {
- $.ajax({
- type: "POST",
- url: "https://www.voipstunt.com/x_status/p2p",
- dataType: "json",
- data: "_xwcun=L2ImMKW1L2Im&_xwcup=ZKWyn2AunTEyn2SB&_xwcci=AQRjBQp4AmRlBD%253D%253D&_xwcwx=AGVlAQN4ZmR5&_xwcip=ZQNkYwxhZwtkYwx0&31d35abc82f90f7ac71d1c5aa235380f=2c0b27ac6c1beaa90575db1e229702d6&_xwccs=MTI0L2Ihoz9w",
- success: function(response) {
- callBack(response);
- }
- });
- }
- if (connstatus == 6 || connstatus == 7) {
- $.ajax({
- type: "POST",
- url: "https://www.voipstunt.com/x_status/p2p",
- dataType: "json",
- data: "_xwcun=L2ImMKW1L2Im&_xwcup=ZKWyn2AunTEyn2SB&_xwcci=AQRjBQp4AmRlBD%253D%253D&_xwcwx=AGVlAQN4ZmR5&_xwcip=ZQNkYwxhZwtkYwx0&31d35abc82f90f7ac71d1c5aa235380f=2c0b27ac6c1beaa90575db1e229702d6&_xwccs=MTI0L2Ihoz9wp2yx",
- success: function(response) {
- callBack(response);
- }
- });
- }
- }
- $(document).ready(function() {
- $('#search_keyword').keyup(function() {
- var keyword = $('#search_keyword').val();
- $.ajax({
- url: "https://www.voipstunt.com/component_loader/",
- data: "module=contacts&component=ajax_search&update_id=&" + $(this).closest('form').serialize(),
- async: true,
- success: function(response) {
- $('#contact_list_block').html(response);
- $('.toggle').click(
- function() {
- if ($(this).next().attr('class') == 'hide-details') {
- $(this).next().fadeTo(0, 400, function() { // next container will be shown
- $(this).slideDown(400);
- });
- $(this).removeClass('hr');
- $(this).next().removeClass('hide-details');
- $(this).next().addClass('show-details');
- } else {
- $(this).next().fadeTo(400, 0, function() { // next container will be hidden
- $(this).slideUp(400);
- });
- if ($(this).hasClass('contacts')) {
- $(this).addClass('hr');
- }
- $(this).next().removeClass('show-details');
- $(this).next().addClass('hide-details');
- }
- return false;
- }
- );
- },
- type: "POST"
- });
- });
- });
- $('.main-nav-phone_to_phone-index').addClass('active');
- $('#nav_phone_to_phone_index').addClass('active_nav');
- var more_position = $('.main-nav-more-menu').position();
- var hide = false;
- function more_menu(show) {
- if (show) {
- hide = true
- $('.footer-nav .more_menu').removeClass('not-visible').addClass('visible');
- $('.more_menu.visible').css('top', more_position.top).css('left', more_position.left + 50);
- } else if (hide == false) {
- $('.footer-nav .more_menu').removeClass('visible').addClass('not-visible');
- }
- }
- $(document).ready(function() {
- $('.main-nav-more-menu').hover(
- function() {
- more_menu(true);
- },
- function() {
- hide = false;
- setTimeout(function() {
- more_menu(false)
- }, 1000);
- }
- );
- $('.more_menu').hover(
- function() {
- more_menu(true);
- },
- function() {
- hide = false;
- setTimeout(function() {
- more_menu(false)
- }, 1000);
- }
- );
- });
- $('#dialogBtn').click(function() {
- openBrowserCall();
- });
- if (typeof WebSocket == 'undefined') {
- $('#webcall-dialog').hide();
- }
- function addHashLinkToAction(wc_page) {
- $('form').each(function() {
- var cur_action = $(this).attr('action');
- var new_action = '';
- if (cur_action.substr(cur_action.length - 1) == '/') {
- cur_action = cur_action.substr(0, cur_action.length - 1);
- }
- if (wc_page != '') {
- new_action = cur_action + wc_page;
- $(this).attr('action', new_action);
- } else {
- var n = cur_action.lastIndexOf('#');
- $(this).attr('action', cur_action.substr(0, n));
- }
- })
- }
- function openBrowserCall() {
- var isAuth = 1;
- var webcall_pages = new Array('#/login', '#/call', '#/sms', '#/phonebook');
- if ($.inArray(window.location.hash, webcall_pages) < 0 || window.location.protocol != 'https:') {
- window.location.href = 'https://www.voipstunt.com/phone_to_phone/#/phonebook';
- setCookie('open_browsercall', 1, 0, '/');;
- if ($.inArray(window.location.hash, webcall_pages) > -1) {
- $('#webcall-dialog').slideToggle();
- $('#dialogButtons').hide();
- addHashLinkToAction('/#/phonebook');
- }
- } else {
- addHashLinkToAction('/#/phonebook');
- $('#webcall-dialog').slideToggle();
- $('#dialogButtons').hide();
- }
- return false;
- }
- function minimizeBrowserCall() {
- addHashLinkToAction('');
- setCookie('open_browsercall', 0, 0, '/');
- $('#webcall-dialog').slideUp(function() {
- $('#dialogButtons').show();
- return false;
- });
- }
- $('#minimize-widget').click(function() {
- minimizeBrowserCall();
- });
- $('.close-widget').click(function() {
- var closeconfirm = confirm('Are you sure you want to close the "Make a Call" function?');
- if (closeconfirm) {
- $('#webcall-dialog-container').hide();
- setCookie('disable_makeacall_widget', 1, 3600);
- }
- return false;
- });
- if (retrieveCookie('open_browsercall') == 1) {
- openBrowserCall();
- setCookie('open_browsercall', 0, 'delete');
- }
- window.addEventListener('message', function(event) {
- if (event.origin === 'https://webclient.directwebconnect.com') {
- var location = (document.URL).replace(/#(.*)/, '#');
- switch (event.data.message) {
- case 'new_call':
- window.location.href = location + '/call/';
- break;
- case 'save_contact':
- window.postMessage({
- message: 'saveContact',
- number: event.data.params.number
- }, '*');
- window.location.href = location + '/phonebook/';
- break;
- case 'buy_credit':
- window.location.href = '/buy_credit2';
- break;
- }
- }
- }, false);
- var trackPm = new Array('Carte Bleue', 'Dankort DK', 'ChinaUnionPay', 'MBNet', 'Cartes Bancaires');
- $('#payment-method-list li').each(function() {
- $('a').click(function() {
- page_label = $(this).text();
- if ($.inArray(page_label, trackPm) > -1) {
- _gaq.push(['_trackEvent', 'Hard coded payment method clicks', 'click', page_label])
- }
- });
- $('input:image').click(function() {
- page_label = $(this).attr('value');
- if ($.inArray(page_label, trackPm) > -1) {
- _gaq.push(['_trackEvent', 'Hard coded payment method clicks', 'click', page_label])
- }
- });
- });
- (function() {
- function requireJs(file, callback) {
- var script = document.createElement('script');
- script.src = file;
- script.type = 'text/javascript';
- script.onload = callback;
- script.onreadystatechange = function() {
- if (this.readyState == 'complete') {
- callback();
- }
- }
- var s = document.getElementsByTagName('script')[0];
- s.parentNode.insertBefore(script, s);
- }
- var baOnload = function() {
- /*{DEBUG}*/
- ba.trackView();
- ba.trackClicks();
- ba.trackSubmits();
- };
- requireJs('/resource/ba/dist/ba.min.js', function() {
- baOnload();
- });
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement