<h1>Gigya test page</h1>

<script type="text/javascript" src="https://cdns.gigya.com/JS/socialize.js?apikey=3_uMFBTSRvPDal63Zq8JezwafdwGOEG0zCW442Ku4Xk2lEG1mxHXrUaGOGsaDLAoEF&lang=en"></script>
<script type="text/javascript" src="https://cdn.gigya-ext.com/screenset-validation.min.js"></script>

<script>
    /**
     * PDJ Gigya
     * This is a cleanup from the old forum-template code.
     */
    const getLocale = () => {
        let locale = window.location.href.split('locale=')[1];
        if (!locale || locale === undefined) {
            locale = window.location.href
                .split('/hc/')[1]
                .split('?')[0]
                .split('#')[0]
                .split('/')[0];
        } else {
            locale = locale.split('&')[0];
        }
        return locale;
    };
    const getLangParam = () => {
        const locale = getLocale();
        return (locale === 'en-us') ? 'en' : locale;
    };
    const isAdminMode = () => {
        return !!(window.HelpCenter.user.role === 'manager' || window.location.href.indexOf('preview_as_role') > -1);
    };
    const getPDJLangParam = () => {
        const locale = getLocale();
        switch (locale) {
            case 'en-us':
                return 'en';
            case 'es':
                return 'es-es';
            case 'fr':
                return 'fr-fr';
            case 'it':
                return 'it-it';
            case 'ja':
                return 'ja-jp';
            default:
                return locale;
        }
    };
    const setProfileLang = (newLang) => {
        if (window.gigya) {
            window.gigya.accounts.setAccountInfo({
                profile: {
                    locale: newLang
                }
            });
        }
    };
    window.getLocale = getLocale;
    window.getLangParam = getLangParam;
    window.isAdminMode = isAdminMode;
    window.getPDJLangParam = getPDJLangParam;
    window.setProfileLang = setProfileLang;
    const setUser = (userData) => {
        console.log('setUser', userData);
        console.log(userData.profile.firstName, userData.profile.thumbnailURL);
    };
    const setLoginRegister = () => {
        console.log('setLoginRegister');
    };
    const PDJGigya = () => {
        window.addEventListener('DOMContentLoaded', () => {
            if (!window.gigya) {
                return;
            }
            window.gigya.accounts.getAccountInfo({
                include: 'identities-active,profile,data',
                callback: r => {
                    if (r.errorCode === 0) {
                        setUser(r);
                    } else {
                        setLoginRegister();
                    }
                },
            });
        });
    };
    PDJGigya();
    // export {
    //   getLocale,
    //   getLangParam,
    //   isAdminMode,
    //   getPDJLangParam,
    //   PDJGigya,
    // };
</script>
<h1>Gigya test page</h1>

<script type="text/javascript" src="https://cdns.gigya.com/JS/socialize.js?apikey=3_uMFBTSRvPDal63Zq8JezwafdwGOEG0zCW442Ku4Xk2lEG1mxHXrUaGOGsaDLAoEF&lang=en"></script>
<script type="text/javascript" src="https://cdn.gigya-ext.com/screenset-validation.min.js"></script>

<script>
/**
 * PDJ Gigya
 * This is a cleanup from the old forum-template code.
 */

const getLocale = () => {
  let locale = window.location.href.split('locale=')[1];
  if (!locale || locale === undefined) {
    locale = window.location.href
      .split('/hc/')[1]
      .split('?')[0]
      .split('#')[0]
      .split('/')[0];
  } else {
    locale = locale.split('&')[0];
  }

  return locale;
};

const getLangParam = () => {
  const locale = getLocale();
  return (locale === 'en-us') ? 'en' : locale;
};

const isAdminMode = () => {
  return !!(window.HelpCenter.user.role === 'manager' || window.location.href.indexOf('preview_as_role') > -1);
};

const getPDJLangParam = () => {
  const locale = getLocale();
  switch (locale) {
    case 'en-us': return 'en';
    case 'es': return 'es-es';
    case 'fr': return 'fr-fr';
    case 'it': return 'it-it';
    case 'ja': return 'ja-jp';
    default: return locale;
  }
};

const setProfileLang = (newLang) => {
  if (window.gigya) {
    window.gigya.accounts.setAccountInfo({ profile: { locale: newLang }});
  }
};

window.getLocale = getLocale;
window.getLangParam = getLangParam;
window.isAdminMode = isAdminMode;
window.getPDJLangParam = getPDJLangParam;
window.setProfileLang = setProfileLang;

const setUser = (userData) => {
  console.log('setUser', userData);
  console.log(userData.profile.firstName, userData.profile.thumbnailURL);
};

const setLoginRegister = () => {
  console.log('setLoginRegister');
};

const PDJGigya = () => {
  window.addEventListener('DOMContentLoaded', () => {
    if (!window.gigya) {
      return;
    }

    window.gigya.accounts.getAccountInfo({
      include: 'identities-active,profile,data',
      callback: r => {
        if (r.errorCode === 0) {
          setUser(r);
        } else {
          setLoginRegister();
        }
      },
    });
  });
};

PDJGigya();

// export {
//   getLocale,
//   getLangParam,
//   isAdminMode,
//   getPDJLangParam,
//   PDJGigya,
// };
</script>

{{!--

{
    "callId": "98de0502cb4b4b7884e30179ac706ca7",
    "errorCode": 0,
    "apiVersion": 2,
    "time": "2023-09-22T11:39:25.767Z",
    "registeredTimestamp": 1678717260000,
    "UID": "031e115cdf42444d80affbe2fe0039a4",
    "UIDSignature": "dzUWnahF1CxFx+PabcYTAuem5sU=",
    "signatureTimestamp": "1695382765",
    "created": "2023-03-13T14:20:34.245Z",
    "createdTimestamp": 1678717234000,
    "data": {
        "pp": {
            "frm_previousLogins": 8,
            "pdj_previousLogins": 44,
            "ttl_previousLogins": 53,
            "clickProductRegistration": false,
            "rkb_previousLogins": 1
        },
        "terms": true,
        "KUVO_newsletter": false,
        "PDJ_newsletter": false
    },
    "identities": [
        {
            "provider": "facebook",
            "providerUID": "10154522704647144",
            "mappedProviderUIDs": [
                {
                    "providerUID": "10154522704647144",
                    "apiKey": "3_uMFBTSRvPDal63Zq8JezwafdwGOEG0zCW442Ku4Xk2lEG1mxHXrUaGOGsaDLAoEF"
                },
                {
                    "providerUID": "10154522704647144",
                    "apiKey": "3_7KX00UHfX1IzkMtlxX4eU2pXVL7t34NzwZqC7D6T6iQWyOc3UZogL73dQkIgiVQK"
                },
                {
                    "providerUID": "10154522704647144",
                    "apiKey": "3_8_mk4iT2Brb_gt-6Ep3SmcH8pQ0G50hbGVXPOUFRnumYCuAU3UWIx2apHFxL0Dge"
                }
            ],
            "allowsLogin": true,
            "isLoginIdentity": true,
            "isExpiredSession": false,
            "lastUpdated": "2023-09-22T11:30:55.281Z",
            "lastUpdatedTimestamp": 1695382255281,
            "oldestDataUpdated": "2023-09-22T11:30:55.072Z",
            "oldestDataUpdatedTimestamp": 1695382255072,
            "firstName": "Stijn",
            "lastName": "Van Minnebruggen",
            "nickname": "Stijn Van Minnebruggen",
            "email": "stijn@donotfold.be",
            "gender": "u",
            "photoURL": "https://graph.facebook.com/v6.0/10154522704647144/picture?type=large",
            "thumbnailURL": "https://graph.facebook.com/v6.0/10154522704647144/picture?type=square"
        },
        {
            "provider": "site",
            "providerUID": "031e115cdf42444d80affbe2fe0039a4",
            "allowsLogin": true,
            "isLoginIdentity": false,
            "isExpiredSession": false,
            "lastUpdated": "2023-09-22T11:33:53.106Z",
            "lastUpdatedTimestamp": 1695382433106,
            "oldestDataUpdated": "2023-03-31T08:02:25.132Z",
            "oldestDataUpdatedTimestamp": 1680249745132,
            "firstName": "Stijn",
            "lastName": "Van Minnebruggen",
            "nickname": "donotfold",
            "age": 40,
            "birthDay": 22,
            "birthMonth": 7,
            "birthYear": 1983,
            "country": "BE",
            "email": "stijn@donotfold.be",
            "gender": "m",
            "photoURL": "https://cdns.gigya.com/photos/7179111/a0d509d9d7884663a5238bb5d8144f0e/orig?ts=638180953971059578",
            "thumbnailURL": "https://cdns.gigya.com/photos/7179111/a0d509d9d7884663a5238bb5d8144f0e/thumbnail?ts=638180953971400521"
        }
    ],
    "isActive": true,
    "isRegistered": true,
    "isVerified": true,
    "lastLogin": "2023-09-22T11:30:55.281Z",
    "lastLoginTimestamp": 1695382255000,
    "lastUpdated": "2023-09-22T11:33:53.151Z",
    "lastUpdatedTimestamp": 1695382433151,
    "loginProvider": "facebook",
    "oldestDataUpdated": "2023-03-13T14:20:34.245Z",
    "oldestDataUpdatedTimestamp": 1678717234245,
    "password": {
        "created": "2023-03-31T08:41:18.529Z"
    },
    "profile": {
        "firstName": "Stijn",
        "lastName": "Van Minnebruggen",
        "nickname": "donotfold",
        "age": 40,
        "birthDay": 22,
        "birthMonth": 7,
        "birthYear": 1983,
        "country": "BE",
        "email": "stijn@donotfold.be",
        "gender": "m",
        "photoURL": "https://cdns.gigya.com/photos/7179111/a0d509d9d7884663a5238bb5d8144f0e/orig?ts=638180953971059578",
        "thumbnailURL": "https://cdns.gigya.com/photos/7179111/a0d509d9d7884663a5238bb5d8144f0e/thumbnail?ts=638180953971400521"
    },
    "registered": "2023-03-13T14:21:00.525Z",
    "socialProviders": "facebook,site",
    "verified": "2023-03-13T14:20:34.418Z",
    "verifiedTimestamp": 1678717234418,
    "status": "OK",
    "errorMessage": "",
    "statusMessage": "",
    "requestParams": {
        "connectWithoutLoginBehavior": "loginExistingUser",
        "defaultRegScreenSet": "pioneerdj.com-RegistrationLogin",
        "defaultMobileRegScreenSet": "pioneerdj.com-RegistrationLogin",
        "sessionExpiration": 0,
        "rememberSessionExpiration": -2,
        "apiDomain": "us1.gigya.com",
        "workflow": {
            "path": "workflow/resources/js/entryPoint.js"
        },
        "enabledProviders": "*",
        "lang": "en",
        "customEventMap": {
            "eventMap": [
                {
                    "events": "*",
                    "args": [
                        null
                    ]
                }
            ]
        },
        "APIKey": "3_uMFBTSRvPDal63Zq8JezwafdwGOEG0zCW442Ku4Xk2lEG1mxHXrUaGOGsaDLAoEF",
        "include": "identities-active,profile,data"
    },
    "operation": "/accounts.getAccountInfo"
}

--}}
/* No context defined. */
  • Content:
    {{!--
    <script type="text/javascript">
    
            function checkForSpecialCharacters(formData, toCheck) {
                var errors = {};
                toCheck.forEach(function (item) {
    
                    if (formData != null && !formData[item].match(new RegExp('^((?![\<,\>,\&,\"]).)*$'))) {
                        errors[item] = 'This character can not be used.';
                    }
                });
                return errors;
            }
    
            window.__gigyaConf = {
                validation: {
                    'gigya-register-screen': function (formData, eventType, callback) {
                        return checkForSpecialCharacters(formData, ['profile.firstName', 'profile.lastName']);
                    },
                    'gigya-update-profile-screen': function (formData, eventType, callback) {
                        var errors = checkForSpecialCharacters(formData, ['profile.nickname', 'profile.firstName', 'profile.lastName', 'profile.city', 'profile.zip']);
                        if (formData != null && formData['profile.nickname'].length == 0 && !enableEmptyNickname)
                            errors['profile.nickname'] = "You can not leave this field blank.";
                        return errors;
                    }
                },
                enableSSOToken: true,
                bypassCookiePolicy: 'always'
            };
    
            window.__functionsToExecute = [];
    
    </script>
    <script type="text/javascript" src="https://cdns.gigya.com/JS/socialize.js?apikey=3_uMFBTSRvPDal63Zq8JezwafdwGOEG0zCW442Ku4Xk2lEG1mxHXrUaGOGsaDLAoEF&lang=en"></script>
    <script type="text/javascript" src="https://cdn.gigya-ext.com/screenset-validation.min.js"></script>
    <script src="https://www.pioneerdj.com/Bundles/GigyaConnector/?v=BRgylmPSR3wzphDu1GZTJagOXWOE_y-Wt9_KZXAQtCc1"></script>
    
    
    
    <script type="text/javascript">
        // polyfill for startsWith method
        if (!String.prototype.startsWith) {
            String.prototype.startsWith = function(searchString, position){
                return this.substr(position || 0, searchString.length) === searchString;
            };
        }
    
        function getQueryStringValueByName(name, url) {
            if (!url) {
                url = window.location.href;
            }
            name = name.replace(/[\[\]]/g, "\\$&");
            var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
                results = regex.exec(url);
            if (!results) return null;
            if (!results[2]) return '';
            return decodeURIComponent(results[2].replace(/\+/g, " "));
        }
    
        //mark menu item as active
        jQuery(".gigyaMenu ul li a").bind('click', function () {
            jQuery(".gigyaMenu ul li a").removeClass("active");
            jQuery(this).addClass("active");
        });
    
        var jwtToken;
        function sendZendeskToken(data) {
            jQuery.ajax({
                type: "POST",
                url: "/ForumConnector/zenssologin.aspx",
                async: false,
                data: data.user,
                dataType: "jsonp",
                complete: function (res) {
                    jwtToken = JSON.parse(res.responseText);
                }
            });
        }
    
        function onLogout(response) {
            function loaded() {
                jQuery.ajax({
                    url: "/en-us/" + "api/Account/Logout",
                    async: false,
                    cache: false,
                    success: function(data) {
                        if (data.Success) {
                            var logoutContainer = jQuery("#LogoutContainer");
                            var loginRegister = jQuery("#LoginRegister");
                            if (logoutContainer != undefined) {
                                logoutContainer.hide();
                            }
                            if (loginRegister != undefined) {
                                loginRegister.show();
                            }
                            location.reload();
                        }
                    },
                    error: function() {
                        alert("Error during logout!");  //TODO: other way to inform about the error
                    }
                });
            }
            if (response.errorCode == 0) {
                var iframe = document.createElement("iframe");
                iframe.setAttribute("src", "https://forums.pioneerdj.com" + "/access/logout/");
                iframe.style.width = 0;
                iframe.style.height = 0;
                if (iframe.addEventListener) {
                    iframe.addEventListener("load", loaded, false);
                } else {
                    iframe.attachEvent("onload", loaded);
                }
                document.body.appendChild(iframe);
                setTimeout(loaded, 850);   //neccessary for firefox - in case iframe throws an error, firefox won't fire onload event
            }
        }
    
        function onLoginSocialize(response) {
            sendZendeskToken(response);
        }
    
        function loginToZendesk() {
            function loaded() {
                gigya.setSSOToken({
                    redirectURL: typeof (returnTo) === 'undefined' ? window.location.href : returnTo
                });
                window.location.reload();
            }
            var iframe = document.createElement("iframe");
            iframe.setAttribute("src", "https://pioneerdj.zendesk.com" + "/access/jwt" + "?jwt=" + jwtToken.token);
            iframe.style.width = 0;
            iframe.style.height = 0;
            document.body.appendChild(iframe);
            iframe.onload = loaded;
            iframe.onerror = loaded;
        }
    
        function onLogin(response) {
            if (response != undefined && response.UID != undefined) {
                // 206005 - autologin finalization triggered with email verification link
                if (getQueryStringValueByName('errorCode') == '206005') {
                    gigya.accounts.getAccountInfo({ callback: onEmailVerified, include: 'emails,data' });
                }
    
                var queue = function () {
                    typeof jwtToken !== "undefined"
                        ? loginToZendesk()
                        : setTimeout(function () {
                            queue();
                        }, 100);
                };
                queue();
            }
        }
    
        function onEmailVerified(response) {
            if (response != undefined && response.errorCode == 0) {
                var verifiedEmails = response.emails.verified;
                if (verifiedEmails.length > 1) {
                    // deactivate all account emails except for the new one that just got verified
                    var previousEmails = verifiedEmails.slice(0, verifiedEmails.length - 1).join(", ");
                    var storedEmails = response.data.previousEmailAddresses;
                    if (storedEmails != undefined) {
                        storedEmails = storedEmails + ", " + previousEmails;
                    } else {
                        storedEmails = previousEmails;
                    }
                    gigya.accounts.setAccountInfo({
                        removeLoginEmails: previousEmails,
                        data: { previousEmailAddresses: storedEmails }
                    });
                }
            }
        }
    
        function onProfileUpdate(response) {
            if (response.response.errorCode === 0) {
                if (response != undefined && response.profile != undefined) {
                    if (response.profile.photoURL != undefined) {
                        jQuery(".visual-wrap .in").css("background-image", "url('" + response.profile.photoURL + "')");
                    }
                    jQuery(".item-profile a .content-wrap .name").text(response.profile.firstName);
                    jQuery(".profile-box .content-wrap").html(response.profile.firstName + '<br/>');
                }
                showMessage("Your changes have been saved.");
            }
        }
    
        function onPasswordChange(response) {
            if (response.response.errorCode === 0) {
                selectMenuItem();
                showMessage("Your password has been changed.");
                navigateEditMyProfile();
            }
        }
    
        function onProfileFieldChange(response) {
            if (response != undefined) {
                jQuery('input[name="profile.email"]').bind('change', function () {
                    showMessage("Click ‘Save changes’ to change your email address. You’ll receive an email to verify your new email address.");
                });
            }
        }
    
        function selectMenuItem() {
            jQuery(".errorSection").hide();
            jQuery(".gigyaMenu ul li a").removeClass("active");
            jQuery(".gigyaMenu ul li a").first().addClass("active");
        }
    
        function showMessage(message) {
            jQuery(".errorSection").html("").hide();
            document.getElementById("messageSection").style.display = "block";
            document.getElementById("messageSection").innerHTML = message;
            window.scrollTo(0, 0);
        }
    
        function showLicenses() {
            showLoadingScreen();
            redirectIfLoggedOut();
            gigya.socialize.getUserInfo({ callback: generateUserLicences });
        }
    
        function generateUserLicences(response) {
            var gigyaPageTarget = jQuery("#gigya-page-target");
    
            if (response.errorCode == 0) {
                var user = response['user'];
                var uid = user['UID'];
    
                jQuery.get('/api/sitecore/PioneerDjAccount/GetLicences', { userId: uid }, function (data) {
                    hideLoadingScreen();
                    if (isLicencesScreenDisplayed() === true) {
                        gigyaPageTarget.html(data);
    
                        var cell = jQuery(".licences-container .licence .item .key");
                        if (typeof cell !== 'undefined') { cell.matchHeight(); }
                    }
                });
            }
            else {
                gigyaPageTarget.html('No licences could be found.');
            }
        }
    
        function isLicencesScreenDisplayed() {
            return jQuery("#license_btn").hasClass("active");
        }
    
        function navigateChangePassword() {
            parent.location.hash = 'password';
            gigya.accounts.showScreenSet({
                screenSet: 'pioneerdj.com-ProfileUpdate',
                containerID: 'gigya-page-target',
                startScreen: 'gigya-change-password-screen',
                lang: 'en',
                onAfterSubmit: changePasswordHandler,
                onBeforeScreenLoad: redirectIfLoggedOut,
                onError: errorEventHandler
            });
        }
    
        function navigateEditMyProfile() {
            parent.location.hash = 'editprofile';
            gigya.accounts.showScreenSet({
                screenSet: 'pioneerdj.com-ProfileUpdate',
                lang: 'en',
                containerID: 'gigya-page-target',
                onError: errorEventHandler,
                onAfterSubmit: updateProfileHandler,
                onBeforeScreenLoad: redirectIfLoggedOut,
                onAfterScreenLoad: changeProfileFieldHandler
            });
        }
    
        function redirectIfLoggedOut() {
            gigya.accounts.getAccountInfo({
                callback: function(response) {
                    if (response.errorCode != 0) {
                        window.location.href = '/';
                    }
                }
            });
        }
    
        function createOneNewsletterOption(response) {
            if (response != undefined) {
                var pdjCheckbox = jQuery("[name='data.PDJ_newsletter'][data-screenset-roles='instance']");
                var kuvoCheckbox = jQuery("[name='data.KUVO_newsletter'][data-screenset-roles='instance']");
    
                var mainCheckbox = '<div class="gigya-composite-control gigya-composite-control-checkbox"' +
                    ' style="display: block; margin-top:15px;"><input id="maincheckbox" type="checkbox">' +
                    '<label class="gigya-label" for="maincheckbox"><span class="gigya-label-text gigya-checkbox-text">' +
                    "Please keep me informed about Pioneer DJ products, services, features, including newsletters, promotions, events, tips and surveys." +
                    '</span></label></div>';
                kuvoCheckbox.parent().after(mainCheckbox);
    
                jQuery("#registerContainer").on('change', '#maincheckbox', function () {
                    pdjCheckbox.prop("checked", this.checked);
                    kuvoCheckbox.prop("checked", this.checked);
                });
    
                pdjCheckbox.parent().hide();
                kuvoCheckbox.parent().hide();
            }
        }
    
        // My Products functions
        function handleMyProductsError(data) {
    
            if (typeof data.responseJSON != 'undefined') {
                errorEventHandler({
                    errorMessage: data.responseJSON.error,
                    response: {
                        info: {
                            screen: "gigya-my-products-screen"
                        }
                    }
                });
            } else {
    
                errorEventHandler({
                    errorMessage: getErrorMessage(data),
                    response: {
                        info: {
                            screen: "gigya-my-products-screen"
                        }
                    }
                });
            }
        }
    
        function getErrorMessage(data) {
            if (data.status == 401 || data.status == 403) {
                return "Unauthorized user";
            }
            return "Unexpected error occurred";
        }
    
        function getAuthHeaders(response) {
            var authHeaders = {
                "PDJ-UID": response.user.UID,
                "PDJ-Timestamp": response.user.signatureTimestamp,
                "PDJ-UIDSignature": response.user.UIDSignature
            }
    
            return authHeaders;
        }
    
        function navigateMyProducts(msg) {
            showLoadingScreen();
            redirectIfLoggedOut();
            gigya.socialize.getUserInfo({ callback: getMyProducts, context: msg });
        }
    
        function isMyProductsScreenDisplayed() {
            return jQuery("#my-products-tab").hasClass("active");
        }
    
        function getMyProducts(response) {
            var gigyaPageTarget = jQuery("#gigya-page-target");
    
            if (response.errorCode == 0) {
    
                jQuery.ajax({
                    type: 'GET',
                    url: '/api/sitecore/ProductRegistration/Get',
                    headers: getAuthHeaders(response),
                    cache: false,
                    success: function (data) {
                        if (isMyProductsScreenDisplayed() === true) {
                            gigyaPageTarget.html(data);
                            jQuery('a.btn-link[href="#"]').each(function (i, o) { jQuery(o).addClass('hidden'); });
                            initCompleter();
                        }
                        if (response.context) {
                            var msg = response.context;
                            jQuery('#validation-success')
                                .removeClass('hidden');
                            jQuery('#validation-success')
                                .html(msg);
                        }
                        window.scrollTo(0, 0);
                        var $purchaseDateInput = jQuery("#input-purchase-date");
                        $purchaseDateInput.attr('readonly', 'readonly');
                        $purchaseDateInput.datepicker({
                            changeMonth: true,
                            changeYear: true,
                            constrainInput: true,
                            dateFormat: "dd/mm/yy",
                            maxDate: "14/09/2023"
                        });
    
                    },
                    error: function (data) {
                        errorEventHandler({
                            errorMessage: data.responseJSON.error
                        });
                    },
                    complete: function() {
                        hideLoadingScreen();
                    }
                });
            }
        }
    
        function showLoadingScreen() {
            jQuery("#gigya-page-target").children().hide();
            jQuery("#loading-message").show();
        }
    
        function hideLoadingScreen() {
            jQuery("#gigya-page-target").children().show();
            jQuery("#loading-message").hide();
        }
    
    </script>
    <script>
    for (var index = 0; index < window.__functionsToExecute.length; ++index) {
        window.__functionsToExecute[index]();
    }
    window.__functionsToExecute = [];
    </script>
    --}}
    
  • URL: /components/raw/gigya-test/_test-code-2.js
  • Filesystem Path: ../src/99_gigya/gigya-test/_test-code-2.js
  • Size: 15.8 KB
  • Content:
    /*
     * jQuery v1.9.1 included
     * /
    
    /* SSO HELPER FUNCTIONS * /
    
    //Gets the locale code from the URL
    //Usage:
    //var locale = getLocale();
    function getLocale() {
    	//first look for locale param
    	var loc = window.location.href
    		.split('locale=')[1];
    	if (!loc || loc == undefined) {
    		loc = window.location.href
    			.split('/hc/')[1]
    			.split('?')[0]
    			.split('#')[0]
    			.split('/')[0];
    	} else {
    		loc = loc.split('&')[0];
    	}
    
    	return loc;
    }
    
    function isAdminMode() {
    	//if manager or preview mode return true.
    	if (HelpCenter.user.role == "manager" || window.location.href.indexOf("preview_as_role") > -1) {
    		return true;
    	}
    	else {
    		return false;
    	}
    }
    
    //Returns the Gigya lang param based on Zendesk locale.
    function getLangParam() {
    	var myLoc = getLocale();
    	switch (myLoc) {
    		//For "en-us" we want to return "en", because that's what Gigya wants
    		case "en-us":
    			return "en";
    		//All other cases are fine for Gigya.
    		default:
    			return myLoc;
    	}
    }
    
    
    //Returns the PDJ lang param based on Zendesk locale.
    function getPDJLangParam() {
    	var myLoc = getLocale();
    	switch (myLoc) {
    		//For "en-us" we want to return "en", because that's what Gigya wants
    		case "en-us":
    			return "en";
    		case "es":
    			return "es-es";
    		case "fr":
    			return "fr-fr";
    		case "it":
    			return "it-it";
    		case "ja":
    			return "ja-jp";
    		//All other cases are fine for Gigya.
    		default:
    			return myLoc;
    	}
    }
    
    
    //returns screenset id for current locale
    function getProfileScrensetForLocale(){
    	var myLocale = getLangParam();
    	//if english, just use the screenset id as is
    	if (myLocale == "en") {
    		return _screenSetPrefixLocal;
    	} else {
    		return _screenSetPrefixLocal + "-" + myLocale.toUpperCase();
    	}
    }
    
    function getReturnTo() {
    	var returnToURL = window.location.href;
    
    	//Code to send lang code that pdj.com understands.
    	//PDJ.com wants the locale as "ja-jp".
    	if (getLocale() == "ja") {
    		returnToURL = returnToURL.replace("ja", "ja-jp");
    	}
    
    	return encodeURIComponent(returnToURL);
    }
    
     /* END HELPER FUNCTIONS * /
    
    /* SSO CONSTANTS * /
    var _photoURL = "https://www.pioneerdj.com/Content/img/gigya/photo_default.png";
    var _zendeskURL = "https://forums.pioneerdj.com";
    var _pdjURL = "https://www.pioneerdj.com";
    var _ssoURL = _pdjURL + "/Account/Login/";
    var _registerURL = _pdjURL + "/Account/register/?return_to=" + getReturnTo();
    var _gigyaLogoutURL = _pdjURL + "/ForumConnector/zenssologout.aspx?return_to=https%3A%2F%2Fwww.pioneerdj.com%2Fen%2F";
    var _zendeskLogoutURL = "/access/logout";
    var _screenSetPrefix = "pioneerdj.com";
    var _screenSetPrefixLocal = "navigationMenu-ProfileUpdate";
    var _licensesURL = _pdjURL + "/api/sitecore/PioneerDjAccount/GetLicences";
    var _licenseService = "https://www.kuvo.com/kuvoapi/user/licenseJSONP?routekey=";
    var _cancelURL = _pdjURL + "/" + getPDJLangParam() + "/Account/Cancel/";
    var _icon_i_url = "https://p4.zdassets.com/hc/theme_assets/82035/1115/icon_i.png";
    
    /* END SSO CONSTANTS * /
    
    
    function getLoginTextLocal() {
    	_LANG = getLangParam();
    	var myLang = "en";
    	if (_LANG) {
    		myLang = _LANG;
    	}
    	var localText = "Log in";
    	switch(_LANG) {
    		case "ja":
    			//use default english
    			break;
    		case "zh-cn":
    			localText = "登录";
    			break;
    		case "it":
    			localText = "Login";
    			break;
    		case "es":
    			localText = "Inicia sesión";
    			break;
    		case "fr":
    			localText = "Se connecter";
    			break;
    	}
    	return localText;
    }
    
    function getRegisterTextLocal() {
    	_LANG = getLangParam();
    	var myLang = "en";
    	if (_LANG) {
    		myLang = _LANG;
    	}
    	var localText = "Register";
    	switch(_LANG) {
    		case "ja":
    			//use default english
    			break;
    		case "zh-cn":
    			localText = "注册";
    			break;
    		case "it":
    			localText = "Registrazione";
    			break;
    		case "es":
    			localText = "Regístrate";
    			break;
    		case "fr":
    			localText = "S’inscrire";
    			break;
    	}
    	return localText;
    }
    
    function getLogoutTextLocal() {
    	_LANG = getLangParam();
    	var myLang = "en";
    	if (_LANG) {
    		myLang = _LANG;
    	}
    	var localText = "Log out";
    	switch(_LANG) {
    		case "ja":
    			//use default english
    			break;
    		case "zh-cn":
    			localText = "退出";
    			break;
    		case "it":
    			localText = "Logout";
    			break;
    		case "es":
    			localText = "Salir";
    			break;
    		case "fr":
    			localText = "Se déconnecter";
    			break;
    	}
    	return localText;
    }
    
    //Function to logout of Gigya
    function logoutGigya(callback) {
    	//log out of gigya
    	var iframe = document.createElement("iframe");
    	iframe.setAttribute("src", _gigyaLogoutURL);
    	iframe.style.width = 0;
    	iframe.style.height = 0;
    	document.body.appendChild(iframe);
    	//now logout of zendesk
    	iframe.onload = function() {
    		console.log("Logged out of Gigya");
    		callback();
    	}
    
    }
    
    //Function to logout of zendesk
    function logoutZendesk(callback) {
    	//log out of zendesk
    	$.ajax({
    		type: 'GET',
    		url: _zendeskLogoutURL,
    		success: function (data){
    			//successful response (logged out)
    			console.log("logged out of zendesk");
    			callback();
    		}
    	});
    }
    
    //Function to logout of Zendesk and Gigya
    function logoutAll(callback) {
    	//call zendesk logout URL which will call PDJ.com logout URL and redirect back.
    	//HOWEVER, we have to check to see if we are in admin mode.  if so, don't log out.
    	if (!isAdminMode()) {
    		logoutZendesk(function(){
    			gigya.accounts.logout({callback:function(){ callback();	}});
    		});
    
    		/*
    		logoutGigya(function() {
    			_firstTime = false;
    			logoutZendesk(function() {
    				callback();
    			});
    		});
    		* /
    	} else {
    		//admin mode
    	}
    }
    
    
    
    //Function called when logout link is called.
    function onClickLogout() {
    	//call zendesk logout which will go to pdj.com logout and return back.
    	//but only if not admin mode
    	if (!isAdminMode()) {
    		//logoutAll(function() {
    		//	console.log("logged out callback");
    		//	location.reload();
    		//});
    
    		window.location.href = _zendeskLogoutURL;
    
    	} else {
    		//admin mode
    	}
    }
    
    
    //same as localization.js
    function setProfileLang(newLang){
    	var params = {
    		profile: {
    			locale: newLang
    		}
    	}
    	gigya.accounts.setAccountInfo(params);
    }
    
    //same as headerSSO.js
    function onScreenLoad(eventObj){
    	gigya.accounts.showScreenSet({ screenSet: _screenSetPrefix + '-ProfileUpdate', lang: getLangParam(), containerID: 'gigya-page-target', onAfterScreenLoad: onProfileLoad, onAfterSubmit: updateProfileHandler, onError: errorEventHandler });
    	//mark menu item as active
    	jQuery(".gigyaMenu ul li a").bind('click', function () {
    		jQuery(".gigyaMenu ul li a").removeClass("active");
    		jQuery(this).addClass("active");
    	});
    	jQuery(".message-section .folder__container a").bind('click', function(){
          jQuery(".folder__content, .folder__container, .folder__trigger").toggleClass("js-folder--is-open");
    	  jQuery(".js-folder__content").toggle();
          jQuery(".go-to-item").toggle();
        });
    }
    
    //same as headerSSO.js
    function onProfileLoad(eventObj){
    	var firstName = eventObj.profile.firstName;
    	var photoURL = eventObj.profile.photoURL;
    	if (photoURL == undefined) {
    		photoURL = _photoURL;
    	}
    	jQuery("#menuUsername").text(firstName);
    	jQuery("#menuProfileImage").css("background-image", "url(" + photoURL + ")");
    
    	gigya.accounts.getAccountInfo({callback:function(response){
    		jQuery('.main-link-list.gigyaMenu > ul > li:eq(1)','#' + eventObj.currentScreen)[response.loginProvider === 'site' ? 'show' : 'hide']();
    	}});
    
    	onProfileFieldChange(eventObj);
    
    	cancelAccountFromForums();
    }
    
    //this function allows account cancellation from forums.
    function cancelAccountFromForums() {
    	//first we have to establish the session on pdj.com
    	establishSessionOnPDJ();
    	//We have to change the "Cancel account" link to absolute URL.
    	jQuery(".gigya-wrap .sub-link-list ul li a").attr('href', _cancelURL);
    }
    
    function establishSessionOnPDJ() {
    	var iframe = document.createElement("iframe");
    	iframe.setAttribute("src", _cancelURL);
    	iframe.style.width = 0;
    	iframe.style.height = 0;
    	document.body.appendChild(iframe);
    	//now logout of zendesk
    	iframe.onload = function() {
    		return true;
    	}
    }
    
    //same as profile_wrapper.js
    function ShowLicenses() {
    	gigya.socialize.getUserInfo({ callback: GenerateUserLicences });
    }
    
    	function licenseInfo(response) {
    		if ( response.errorCode == 0 ) {
    			//logged in
    			//$("#request").text(_licenseService + response['UID'] + "&registeredTimestamp=" + response['registeredTimestamp'] + "&version=1");
    			$.ajax({
    				type: 'GET',
    				crossDomain: true,
    				url: _licenseService + response['UID'] + "&registeredTimestamp=" + response['registeredTimestamp'] + "&version=1",
    				dataType: 'jsonp',
    				jsonpCallback: "callback",
    				success: function(data){
    					//$("#response").text(JSON.stringify(data));
    					var licenseList = data.licenseList;
    					var licenseListHTML = "";
    					if (licenseList && licenseList.length > 0) {
    						for (var key in licenseList) {
    							if (licenseList.hasOwnProperty(key)) {
    								var myLicense = getLicenseHTMLItem();
    								myLicense = myLicense.replace("_LICENSE_NAME_", licenseList[key].licensedName);
    								myLicense = myLicense.replace("_LICENSE_KEY_", licenseList[key].licenseKey);
    								myLicense = myLicense.replace("_LICENSE_TYPE_", licenseList[key].pcName);
    								myLicense = myLicense.replace("_LICENSE_ACTIVATED_", licenseList[key].activateDate);
    								myLicense = myLicense.replace("_LICENSE_EXPIRY_", licenseList[key].expirationDate);
    								licenseListHTML = licenseListHTML + myLicense;
    							}
    						}
    						licenseListHTML = getLicenseHTMLTop() + licenseListHTML + getLicenseHTMLBottom();
    					} else {
    						licenseListHTML = getNoLicenseMessage();
    					}
    					jQuery("#gigya-page-target").html(licenseListHTML);
    				},
    			});
    		} else {
    			window.location = _logoutURL;
    		}
    	}
    
    
    //same as profile_wrapper.js
    	function GenerateUserLicences(response) {
    		if (response.errorCode == 0) {
    			var user = response['user'];
    			var uid = user['UID'];
    
    			jQuery("#gigya-page-target").html(getLoadingMessage());
    			//grab JSON data from license service.
    			gigya.accounts.getAccountInfo({ callback: licenseInfo });
    		}
    		else {
    			window.location = "/";
    		}
    	}
    
    	function getLoadingMessage() {
    		var myMessage = "Please wait";
    		switch(_LANG) {
    			case "ja":
    				myMessage = "お待ちください。";
    				break;
    			case "zh-cn":
    				myMessage = "请稍候";
    				break;
    			case "it":
    				myMessage = "Ti preghiamo di attendere";
    				break;
    			case "es":
    				myMessage = "Por favor, espera";
    				break;
    			case "fr":
    				myMessage = "Merci de patienter";
    				break;
    		}
    		return myMessage;
    	}
    
    	function getNoLicenseMessage() {
    		var myMessage = "No licenses could be found.";
    		switch(_LANG) {
    			case "ja":
    				myMessage = "ライセンスは登録されていません。";
    				break;
    			case "zh-cn":
    				myMessage = "未发现许可证。";
    				break;
    			case "it":
    				myMessage = "Nessuna licenza disponibile.";
    				break;
    			case "es":
    				myMessage = "No hay licencias.";
    				break;
    			case "fr":
    				myMessage = "Aucune licence n’a été trouvée.";
    				break;
    		}
    		return myMessage;
    	}
    
    	function getLicenseHTMLTop() {
    		var myLicenseTop = '<div id="gigya-page-target" style="min-height:500px;" class="gigya-style-modern gigya-windows gigya-chrome"><h5 class="line-color-theme-1">Licenses</h5><div class="wrapper"><div class="licences-container">';
    		switch(_LANG) {
    			case "ja":
    				myLicenseTop = '<div id="gigya-page-target" style="min-height:500px;" class="gigya-style-modern gigya-windows gigya-chrome"><h5 class="line-color-theme-1">ライセンス確認</h5><div class="wrapper"><div class="licences-container">';
    				break;
    			case "zh-cn":
    				myLicenseTop = '<div id="gigya-page-target" style="min-height:500px;" class="gigya-style-modern gigya-windows gigya-chrome"><h5 class="line-color-theme-1">许可证</h5><div class="wrapper"><div class="licences-container">';
    				break;
    			case "it":
    				myLicenseTop = '<div id="gigya-page-target" style="min-height:500px;" class="gigya-style-modern gigya-windows gigya-chrome"><h5 class="line-color-theme-1">Licenze</h5><div class="wrapper"><div class="licences-container">';
    				break;
    			case "es":
    				myLicenseTop = '<div id="gigya-page-target" style="min-height:500px;" class="gigya-style-modern gigya-windows gigya-chrome"><h5 class="line-color-theme-1">Licencias</h5><div class="wrapper"><div class="licences-container">';
    				break;
    			case "fr":
    				myLicenseTop = '<div id="gigya-page-target" style="min-height:500px;" class="gigya-style-modern gigya-windows gigya-chrome"><h5 class="line-color-theme-1">Licences</h5><div class="wrapper"><div class="licences-container">';
    				break;
    		}
    		return myLicenseTop;
    	}
    
    	function getLicenseHTMLBottom() {
    		var myLicenseBottom = '</div></div><br><label class="gigya-label"><img src="' + _icon_i_url + '" style="vertical-align: top;"><span class="gigya-label-text" style="width: 90%; margin-left: 10px;">In order to update the expiry date, you need to start the rekordbox application after connecting a computer to the Internet.</span></label></div>';
    		switch(_LANG) {
    			case "ja":
    				myLicenseBottom = '</div></div><br><label class="gigya-label"><img src="' + _icon_i_url + '" style="vertical-align: top;"><span class="gigya-label-text " style="width: 90%; margin-left: 10px;">有効期限を更新するには、パソコンをインターネットに接続し、rekordboxアプリケーションを起動する必要があります。</span></label></div>';
    				break;
    			case "zh-cn":
    				myLicenseBottom = '</div></div><br><label class="gigya-label"><img src="' + _icon_i_url + '" style="vertical-align: top;"><span class="gigya-label-text" style="width: 90%; margin-left: 10px;">如要更新到期日,需在将电脑连接到互联网后启动 rekordbox 应用程序。</span></label></div>';
    				break;
    			case "it":
    				myLicenseBottom = '</div></div><br><label class="gigya-label"><img src="' + _icon_i_url + '" style="vertical-align: top;"><span class="gigya-label-text" style="width: 90%; margin-left: 10px;">Al fine di aggiornare la data di scadenza, devi avviare l\'applicazione rekordbox dopo aver collegato il computer a Internet.</span></label></div>';
    				break;
    			case "es":
    				myLicenseBottom = '</div></div><br><label class="gigya-label"><img src="' + _icon_i_url + '" style="vertical-align: top;"><span class="gigya-label-text" style="width: 90%; margin-left: 10px;">Para actualizar la fecha de caducidad, debes iniciar la aplicación rekordbox después de conectar un ordenador a Internet.</span></label></div>';
    				break;
    			case "fr":
    				myLicenseBottom = '</div></div><br><label class="gigya-label"><img src="' + _icon_i_url + '" style="vertical-align: top;"><span class="gigya-label-text" style="width: 90%; margin-left: 10px;">Pour mettre à jour la date d’expiration, vous devez redémarrer l’application rekordbox sur votre ordinateur après vous être connecté à internet.</span></label></div>';
    				break;
    		}
    		return myLicenseBottom;
    	}
    
    	function getLicenseHTMLItem() {
    		var myLicenseItem = '<div class="licence"><p class="item"><span class="key">Name</span><span class="value">_LICENSE_NAME_</span></p><p class="item"><span class="key">License Key</span><span class="value">_LICENSE_KEY_</span></p><p class="item"><span class="key">PC/Mac</span><span class="value">_LICENSE_TYPE_</span></p><p class="item"><span class="key">Activated Date</span><span class="value">_LICENSE_ACTIVATED_</span></p><p class="item"><span class="key">Expiry Date</span><span class="value">_LICENSE_EXPIRY_</span></p></div>';
    		switch(_LANG) {
    			case "ja":
    				myLicenseItem = '<div class="licence"><p class="item"><span class="key">名称</span><span class="value">_LICENSE_NAME_</span></p><p class="item"><span class="key">ライセンスキー</span><span class="value">_LICENSE_KEY_</span></p><p class="item"><span class="key">PC/Mac</span><span class="value">_LICENSE_TYPE_</span></p><p class="item"><span class="key">アクティベート日</span><span class="value">_LICENSE_ACTIVATED_</span></p><p class="item"><span class="key">有効期限</span><span class="value">_LICENSE_EXPIRY_</span></p></div>';
    				break;
    			case "zh-cn":
    				myLicenseItem = '<div class="licence"><p class="item"><span class="key">名称</span><span class="value">_LICENSE_NAME_</span></p><p class="item"><span class="key">许可证密钥</span><span class="value">_LICENSE_KEY_</span></p><p class="item"><span class="key">PC/Mac</span><span class="value">_LICENSE_TYPE_</span></p><p class="item"><span class="key">激活日期</span><span class="value">_LICENSE_ACTIVATED_</span></p><p class="item"><span class="key">到期日</span><span class="value">_LICENSE_EXPIRY_</span></p></div>';
    				break;
    			case "it":
    				myLicenseItem = '<div class="licence"><p class="item"><span class="key">Nome</span><span class="value">_LICENSE_NAME_</span></p><p class="item"><span class="key">Codice di licenza</span><span class="value">_LICENSE_KEY_</span></p><p class="item"><span class="key">PC/Mac</span><span class="value">_LICENSE_TYPE_</span></p><p class="item"><span class="key">Data di attivazione</span><span class="value">_LICENSE_ACTIVATED_</span></p><p class="item"><span class="key">Data di scadenza</span><span class="value">_LICENSE_EXPIRY_</span></p></div>';
    				break;
    			case "es":
    				myLicenseItem = '<div class="licence"><p class="item"><span class="key">Nombre</span><span class="value">_LICENSE_NAME_</span></p><p class="item"><span class="key">Clave de licencia</span><span class="value">_LICENSE_KEY_</span></p><p class="item"><span class="key">PC/Mac</span><span class="value">_LICENSE_TYPE_</span></p><p class="item"><span class="key">Fecha de Activación</span><span class="value">_LICENSE_ACTIVATED_</span></p><p class="item"><span class="key">Fecha de caducidad</span><span class="value">_LICENSE_EXPIRY_</span></p></div>';
    				break;
    			case "fr":
    				myLicenseItem = '<div class="licence"><p class="item"><span class="key">Nom</span><span class="value">_LICENSE_NAME_</span></p><p class="item"><span class="key">Clé de licence</span><span class="value">_LICENSE_KEY_</span></p><p class="item"><span class="key">PC/Mac</span><span class="value">_LICENSE_TYPE_</span></p><p class="item"><span class="key">Date d’Activation</span><span class="value">_LICENSE_ACTIVATED_</span></p><p class="item"><span class="key">Date d’Expiration</span><span class="value">_LICENSE_EXPIRY_</span></p></div>';
    				break;
    		}
    		return myLicenseItem;
    	}
    
    //same as profile_wrapper.js
    function showMessage(message) {
    	jQuery(".errorSection").html("").hide();
    	document.getElementById("messageSection").style.display = "block";
    	document.getElementById("messageSection").innerHTML = message;
    	window.scrollTo(0, 0);
    }
    
    //same as profile_wrapper.js
    //mark menu item as active
    jQuery(".gigyaMenu ul li a").bind('click', function () {
    	jQuery(".gigyaMenu ul li a").removeClass("active");
    	jQuery(this).addClass("active");
    });
    
    //same as profile_wrapper.js
    function onEmailVerified(response) {
    	if (response != undefined && response.errorCode == 0) {
    		var verifiedEmails = response.emails.verified;
    		if (verifiedEmails.length > 1) {
    			// deactivate all account emails except for the new one that just got verified
    			var previousEmails = verifiedEmails.slice(0, verifiedEmails.length - 1).join(", ");
    			var storedEmails = response.data.previousEmailAddresses;
    			if (storedEmails != undefined) {
    				storedEmails = storedEmails + ", " + previousEmails;
    			} else {
    				storedEmails = previousEmails;
    			}
    			gigya.accounts.setAccountInfo({
    				removeLoginEmails: previousEmails,
    				data: { previousEmailAddresses: storedEmails }
    			});
    		}
    	}
    }
    
    //same as in profile_wrapper.js
    function onProfileUpdate(response) {
    	if (response.response.errorCode === 0) {
    		var myMessage = "Your changes have been saved.";
    		if (response != undefined && response.profile != undefined) {
    			if (response.profile.photoURL != undefined) {
    				jQuery(".visual-wrap .in").css("background-image", "url('" + response.profile.photoURL + "')");
    			}
    			jQuery(".item-profile a .content-wrap .name").text(response.profile.firstName);
    			jQuery(".profile-box .content-wrap").html(response.profile.firstName + '<br/>');
    		}
    
    		switch(getLangParam()) {
    			case "ja":
    				myMessage = "変更内容が保存されました。";
    				break;
    			case "zh-cn":
    				myMessage = "您的更改已保存。";
    				break;
    			case "it":
    				myMessage = "Le modifiche sono state salvate.";
    				break;
    			case "es":
    				myMessage = "Tus cambios se han guardado.";
    				break;
    			case "fr":
    				myMessage = "Vos modifications ont été enregistrées.";
    				break;
    		}
    		showMessage(myMessage);
    
    	}
    }
    
    //same as in profile_wrapper.js
    function onPasswordChange(response) {
    	var myMessage = "Your password has been changed.";
    	if (response.response.errorCode === 0) {
    		selectMenuItem();
    		switch(getLangParam()) {
    			case "ja":
    				myMessage = "お客様のパスワードは変更されました。";
    				break;
    			case "zh-cn":
    				myMessage = "您的密码已更改。";
    				break;
    			case "it":
    				myMessage = "La tua password è stata cambiata.";
    				break;
    			case "es":
    				myMessage = "Tu contraseña se ha cambiado.";
    				break;
    			case "fr":
    				myMessage = "Votre mot de passe a été modifié.";
    				break;
    		}
    		showMessage(myMessage);
    	}
    }
    
    //same as in profile_wrapper.js
    function onProfileFieldChange(response) {
    	var myMessage = "Click 'Save changes' to change your email address. You'll receive an email to verify your new email address.";
    	if (response != undefined) {
    		jQuery('input[name="profile.email"]').bind('change', function () {
    			switch(getLangParam()) {
    				case "ja":
    					myMessage = "お客様のメールアドレスを変更するため、「変更内容を保存」をクリックしてください。後ほど、お客様の新しいメールアドレスに確認メールをお送りします。";
    					break;
    				case "zh-cn":
    					myMessage = "单击“保存更改”,更改您的电邮地址。您将收到一封电子邮件,确认您的新电邮地址。";
    					break;
    				case "it":
    					myMessage = "Clicca su 'Salva le modifiche' per cambiare il tuo indirizzo e-mail. Riceverai un'e-mail per verificare il tuo nuovo indirizzo e-mail.";
    					break;
    				case "es":
    					myMessage = "Haz clic en 'Guardar cambios' para cambiar tu dirección de correo electrónico. Recibirás un correo electrónico para verificar tu nueva dirección.";
    					break;
    				case "fr":
    					myMessage = "Cliquez sur « Enregistrer les modifications » pour changer votre adresse mail. Vous recevrez un email de vérification sur votre nouvelle adresse mail.";
    					break;
    			}
    			showMessage(myMessage);
    		});
    	}
    }
    
    //same as in profile_wrapper.js
    function selectMenuItem() {
    	jQuery(".errorSection").hide();
    	jQuery(".gigyaMenu ul li a").removeClass("active");
    	jQuery(".myProfile").addClass("active");
    }
    
    //same as in profile_wrapper.js
    function showMessage(message) {
    	jQuery(".errorSection").html("").hide();
    	document.getElementById("messageSection").style.display = "block";
    	document.getElementById("messageSection").innerHTML = message;
    	window.scrollTo(0, 0);
    }
    
    //same
    function NavigateChangePassword() {
    	jQuery("#messageSection").html("").hide();
    	gigya.accounts.showScreenSet({
    		screenSet: _screenSetPrefix + '-ProfileUpdate',
    		containerID: 'gigya-page-target',
    		startScreen: 'gigya-change-password-screen',
    		lang: getLangParam(),
    		onAfterSubmit: changePasswordHandler,
    		onBeforeScreenLoad: redirectIfLoggedOut,
    		onError: errorEventHandler
    	});
    }
    
    //same
    function NavigateEditMyProfile() {
    	jQuery("#messageSection").html("").hide();
    	gigya.accounts.showScreenSet({
    		screenSet: _screenSetPrefix + '-ProfileUpdate',
    		lang: getLangParam(),
    		containerID: 'gigya-page-target',
    		onError: errorEventHandler,
    		onAfterSubmit: updateProfileHandler,
    		onBeforeScreenLoad: redirectIfLoggedOut,
    		onAfterScreenLoad: changeProfileFieldHandler
    	});
    }
    
    function redirectIfLoggedOut() {
    	gigya.accounts.getAccountInfo({
    		callback: function (response) {
    			if (response.errorCode != 0) {
    				window.location.href = '/';
    			}
    		}
    	});
    }
    
    //same as in headerSSO.js
    function createOneNewslettterOption(response) {
    	if (response != undefined) {
    		var pdjCheckbox = jQuery("[name='data.PDJ_newsletter'][data-screenset-roles='instance']");
    		var kuvoCheckbox = jQuery("[name='data.KUVO_newsletter'][data-screenset-roles='instance']");
    		var myMessage = "Please keep me informed about Pioneer DJ products, services, features, including newsletters, promotions, events, tips and surveys.";
    		switch(getLangParam()) {
    			case "ja":
    				myMessage = "Pioneer DJニュースのメール送信を希望します(新製品、新サービス、プロモーション、イベント、アンケート等のお知らせ)。";
    				break;
    			case "zh-cn":
    				myMessage = "请及时通知我关于 Pioneer DJ 产品、服务、功能方面的信息,包括时事通讯、促销及其他活动、使用技巧及使用调查等。";
    				break;
    			case "it":
    				myMessage = "Vi prego di tenermi informato sui prodotti, servizi, funzioni Pioneer DJ, tra cui newsletter, promozioni, eventi, consigli e sondaggi.";
    				break;
    			case "es":
    				myMessage = "Deseo recibir información sobre los productos Pioneer DJ, servicios, características, incluyendo boletines informativos, promociones, eventos, consejos y encuestas.";
    				break;
    			case "fr":
    				myMessage = "Je désire être informé(e) des actualités sur les produits, services, fonctionnalités de Pioneer DJ, y compris des newsletters et des informations sur des offres spéciales, des événements, des conseils et astuces, et des enquêtes ou sondages.";
    				break;
    		}
    
    		var mainCheckbox = '<div class="gigya-composite-control gigya-composite-control-checkbox" style="display: block; margin-top:15px;"><input id="maincheckbox" type="checkbox"><label class="gigya-label"><span class="gigya-label-text gigya-checkbox-text">' + myMessage + '</span></label></div>';
    		kuvoCheckbox.parent().after(mainCheckbox);
    
    		jQuery("#registerContainer").on('change', '#maincheckbox', function () {
    			pdjCheckbox.prop("checked", this.checked);
    			kuvoCheckbox.prop("checked", this.checked);
    		});
    
    		pdjCheckbox.parent().hide();
    		kuvoCheckbox.parent().hide();
    	}
    }
    
    //same as in headerSSO.js
    $(function(){
    	jQuery(".message-section .folder__container a").bind('click', function(){
    	  jQuery(".folder__content, .folder__container, .folder__trigger").toggleClass("js-folder--is-open");
    	  jQuery(".js-folder__content").toggle();
    	  jQuery(".go-to-item").toggle();
    	});
    });
    
    //same as in profile_wrapper.js
    function updateProfileHandler(response) {
        onProfileUpdate(response);
    }
    
    //same as in profile_wrapper.js
    function changeProfileFieldHandler(response) {
        onProfileFieldChange(response);
    }
    
    //same as in profile_wrapper.js
    function changePasswordHandler(response) {
        onPasswordChange(response);
    }
    
    //same as headerSSO.js
    function errorEventHandler(eventobj) {
        jQuery("#messageSection").html("").hide();
        if (jQuery(".errorContainer").length > 0) {
            if (eventobj != undefined && eventobj.errorMessage != undefined && eventobj.response.info.screen != "gigya-change-password-screen") {
                jQuery(".errorSection").html(eventobj.errorMessage);
                jQuery(".errorSection").show();
                window.scrollTo(0, 0);
            }
        }
    }
    
    	function showActivities() {
    		if ( HelpCenter.user.role == "anonymous" ) {
    			$('.my-activities').hide();
    		}
    		else {
    			$('.my-activities').show();
    		}
    	}
    
    
    $(document).ready(function() {
    
    //SSO CODE
    function showHeader(response) {
      var headerSSO = document.getElementById("headerSSO");
      // console.log("currentURL; " + window.location.href);
      var currentURL = window.location.href;
      var URL_location_url = new URL(window.parent.location.href);
      var URL_params = URL_location_url.searchParams;
      var URL_dropbox_code = URL_params.get('code');
      var URL_location_hash = window.parent.location.hash
      var pdjlang = getPDJLangParam();
      if (response.errorCode == 0) {
    		// fix: https://trello.com/c/BOtKUiDD/58-twitter
    		enableEmptyNickname = (response.identities.length === 1 && response.identities[0].provider === "site");
    		//logged in
    		$('.my-activities').show();
            var profile = response['profile'];
    		var firstName = profile['firstName'];
    		var photoURL = profile['photoURL'];
    		if (photoURL == undefined) {
    			photoURL = _photoURL;
    		}
        headerSSO.innerHTML = '<div class="action-nav"><ul><li class="item-profile"><a href="https://www.pioneerdj.com/' + pdjlang + '/account/profile/" class="profile-link" target="_blank"><span class="visual-wrap"><span class="in" style="background-image: url(\'' + photoURL + '\');"></span></span><span class="content-wrap"><span class="name">' + firstName + '</span></span></a></li>		<li id="LoginRegister"><a href="#" onclick="onClickLogout();">' + getLogoutTextLocal() + '</a> </li></ul></div>';
        }
        else {
    
    		//if not logged into gigya, we should explicitly log out again, just to be sure.
    		//but only if not in admin mode
    		if (!isAdminMode()) {
    			//logoutAll(function() {
    				//console.log("logged out on load");
    			//});
    		}
    		headerSSO.innerHTML = '<div class="action-nav"><ul><li><a href="' + _registerURL + '">' + getRegisterTextLocal() + '</a></li><li id="LoginRegister"><a href="' + _ssoURL + '?return_to=' + getReturnTo() + '">' + getLoginTextLocal() + '</a> </li></ul></div>';
        }
    }
    
    gigya.accounts.getAccountInfo({ include: "identities-active,profile,data", callback: showHeader });
    
      // GIGYA PROPLAN REDIRECT
      var currentURL = window.location.href;
      var URL_location_url = new URL(window.parent.location.href);
      var URL_params = URL_location_url.searchParams;
      var URL_dropbox_code = URL_params.get('code');
      var URL_location_hash = window.parent.location.hash
      var pdjlang = getPDJLangParam();
    
      // MY PAGE Consolidation (Plan-M) [15 Sep 2022]
      /* Commented 26 xx Apr 2023.
      if (URL_location_hash === "#editprofile" || URL_location_hash === "#password" || URL_location_hash === "#licenses" || URL_location_hash === "#cloudsettings") {
        var redirectURL = "https://www.pioneerdj.com/" + pdjlang + "/account/profile/" + URL_location_hash;
        //console.log("redirectTo: " + redirectURL);
        window.location.href = redirectURL;
      }
      * /
    
      // MY PAGE UI/UX improvements (Renewal) [26 Apr 2023]
      if (URL_location_hash === "#editprofile") {
        var redirectURL = "https://www.pioneerdj.com/" + pdjlang + "/account/profile/information/";
        // console.log("redirectTo: " + redirectURL);
        window.location.href = redirectURL;
      } else if (URL_location_hash === "#password") {
        var redirectURL = "https://www.pioneerdj.com/" + pdjlang + "/account/profile/password/";
        // console.log("redirectTo: " + redirectURL);
        window.location.href = redirectURL;
      } else if (URL_location_hash === "#licenses") {
        var redirectURL = "https://www.pioneerdj.com/" + pdjlang + "/account/rekordbox/";
        // console.log("redirectTo: " + redirectURL);
        window.location.href = redirectURL;
      } else if (URL_location_hash === "#cloudsettings") {
        var redirectURL = "https://www.pioneerdj.com/" + pdjlang + "/account/rekordbox/cloud-settings";
        // console.log("redirectTo: " + redirectURL);
        window.location.href = redirectURL;
      }
    
      // END GIGYA PROPLAN REDIRECT
    });
    /************************************************************************************************************
    //END SSO CODE
    ************************************************************************************************************ /
    ////////////////////
    // Begin custom Helper Code
    ////////////////////
    
    
    $(document).ready(function () {
        // social share popups
        $(".share a").click(function (e) {
            e.preventDefault();
            window.open(this.href, "", "height = 500, width = 500");
        });
    
        // toggle the share dropdown in communities
        $(".share-label").on("click", function (e) {
            e.stopPropagation();
            var isSelected = this.getAttribute("aria-selected") == "true";
            this.setAttribute("aria-selected", !isSelected);
            $(".share-label").not(this).attr("aria-selected", "false");
        });
    
        $(document).on("click", function () {
            $(".share-label").attr("aria-selected", "false");
        });
    
        // show form controls when the textarea receives focus or backbutton is used and value exists
        var $answerbodyTextarea = $(".answer-body textarea"),
            $answerFormControls = $(".answer-form-controls"),
            $commentContainerTextarea = $(".comment-container textarea"),
            $commentContainerFormControls = $(".comment-form-controls");
    
        $answerbodyTextarea.on("focus", function () {
            $answerFormControls.show();
        });
    
        $commentContainerTextarea.on("focus", function () {
            $commentContainerFormControls.show();
        });
    
        if ($commentContainerTextarea.val() !== "") {
            $commentContainerFormControls.show();
        }
    
        if ($answerbodyTextarea.val() !== "") {
            $answerFormControls.show();
        }
    
        // PULSE'S CODE /////////////////////////////////////////////////
        // PULSE'S VARIABLES
    
        var currentLanguage = $('.language-selector a:first').text();
        var questiontitle = $('h1.question-title').text();
        var cbc = '<a href="/hc">Pioneer DJ</a> &gt; ';
        var loc1 = $('.question-topic-list li').first().html();
        var loc2 = $('h1.topic-heading').html();
        var locref = document.referrer;
        var loctoraiz = false;
        var locddj = false;
        var loccdj = false;
        var locdjm = false;
        var locxdj = false;
        var myPage = "";
    
        var urlreq = window.location.href.indexOf("requests/new") != -1;
        var urleap = window.location.href.indexOf("72189") != -1;
        var urlveap = window.location.href.indexOf("82626") != -1;
        var urlrbx = window.location.href.indexOf("72145") != -1;
        var urlagent = window.location.href.indexOf("72819") != -1;
        var urlliteagent = window.location.href.indexOf("65306") != -1;
        var urlpa = window.location.href.indexOf("70396") != -1;
        var urllic = window.location.href.indexOf("76676") != -1;
        var urlecom = window.location.href.indexOf("72053") != -1;
        var urltoraiz = window.location.href.indexOf("200467403") != -1;
        var urlddj = window.location.href.indexOf("200307759") != -1;
        var urlcdj = window.location.href.indexOf("200319715") != -1;
        var urldjm = window.location.href.indexOf("200307689") != -1;
        var urlxdj = window.location.href.indexOf("200307789") != -1;
        var urlaccount = window.location.href.indexOf("175743") != -1;
        var urltest = window.location.href.indexOf("194823") != -1;
        var urlgbsupport = window.location.href.indexOf("182226") != -1;
        var urlmobileapp = window.location.href.indexOf("74503") != -1;
        var urlrbtest = window.location.href.indexOf("360000001646") != -1;
        var urllighting = window.location.href.indexOf("115000046523") != -1;
        var urlpdjasupport = window.location.href.indexOf("202826") != -1;
      	var urlemeasupport = window.location.href.indexOf("360000756532") != -1;
      	var urlatafollowup = window.location.href.indexOf("900001133163") != -1;
    
        var dreap = document.referrer.indexOf("72189") != -1;
        var drveap = document.referrer.indexOf("82626") != -1;
        var drrbx = document.referrer.indexOf("72145") != -1;
        var drecom = document.referrer.indexOf("72053") != -1;
        var drliteagent = document.referrer.indexOf("65306") != -1;
        var drpa = document.referrer.indexOf("70396") != -1;
        var drlic = document.referrer.indexOf("76676") != -1;
        var jtx = document.referrer.indexOf("ja/requests/new") != -1;
        var estx = document.referrer.indexOf("es/requests/new") != -1;
        var ittx = document.referrer.indexOf("it/requests/new") != -1;
        var ftx = document.referrer.indexOf("fr/requests/new") != -1;
        var draccount = document.referrer.indexOf("175743") != -1;
        var drtest = document.referrer.indexOf("194823") != -1;
        var drgbsupport = document.referrer.indexOf("182226") != -1;
        var drmobileapp = document.referrer.indexOf("74503") != -1;
        var drrbtest = document.referrer.indexOf("360000001646") != -1;
        var drlighting = document.referrer.indexOf("115000046523") != -1;
        var drpdjasupport = document.referrer.indexOf("202826") != -1;
      	var dremeasupport = document.referrer.indexOf("360000756532") != -1;
      	var dratafollowup = document.referrer.indexOf("900001133163") != -1;
    
      	var desatafollowup = "We're sorry that the information provided in our support document was not sufficient to assist you in resolving your issue. Please complete the form below and our support team will get back to you shortly.";
    
        var reqeap = "rekordbox EAP support request form";
        var reqrbx = "rekordbox support request form";
        var reqeshop = "Pioneer DJ E-SHOP Support Request Form";
        var reqecom = "";
        var reqveap = "rekordbox Video EAP Support Request Form";
        var reqmobileapp = "Mobile App Inquiry Form";
        var toraizmessage = "<h2 class='announcement'><i class='fa fa-question-circle' aria-hidden='true'></i> Survey for owners of <a href='https://pioneerdj.eu.qualtrics.com/jfe/form/SV_5j0RaukGFf2oSC9' target='_blank'>SQUID</a></h2>";
        var ddjmessage = "<h2 class='announcement'><i class='fa fa-question-circle' aria-hidden='true'></i> Survey for owners of <a href='https://pioneerdj.eu.qualtrics.com/jfe/form/SV_cOXe5uUEqD42b0G' target='_blank'>DDJ-REV7</a> / <a href='https://pioneerdj.eu.qualtrics.com/jfe/form/SV_1FjoErPlY6JneJM' target='_blank'>REV1</a> / <a href='https://pioneerdj.eu.qualtrics.com/jfe/form/SV_3KtQvB02AnA9kLH' target='_blank'>1000SRT</a> / <a href='https://pioneerdj.eu.qualtrics.com/jfe/form/SV_abFKigdjKiVFHtb' target='_blank'>800</a> / <a href='https://pioneerdj.eu.qualtrics.com/jfe/form/SV_8w5aRvIfieZrTrT' target='_blank'>200</a> / <a href='https://pioneerdj.eu.qualtrics.com/jfe/form/SV_3edZ0ne3OhAs62h' target='_blank'>XP2</a> / <a href='https://pioneerdj.eu.qualtrics.com/jfe/form/SV_b2PM38GQwOFB8nr' target='_blank'>FLX6</a>";
      	var djmmessage = "<h2 class='announcement'><i class='fa fa-question-circle' aria-hidden='true'></i> Survey for owners of <a href='https://pioneerdj.eu.qualtrics.com/jfe/form/SV_cwsR5dKmh4MjXoy' target='_blank'>DJM-S11</a> / <a href='https://pioneerdj.eu.qualtrics.com/jfe/form/SV_1Nb0p0R1UJfCRn0' target='_blank'>DJM-S7</a></h2>";
        var xdjmessage = "<h2 class='announcement'><i class='fa fa-question-circle' aria-hidden='true'></i> Survey for owners of <a href='https://pioneerdj.eu.qualtrics.com/jfe/form/SV_ezIjBC7khMH3EY6' target='_blank'>XDJ-XZ</a> / <a href='https://pioneerdj.eu.qualtrics.com/jfe/form/SV_bK78NNZyW2KRxjv' target='_blank'>XDJ-RR</a></h2>";
    
        var reqtest = "rekordbox support request form [TEST]";
        var reqgbsupport = "Pioneer DJ GB Support Request Form";
        var reqpdjasupport = "Pioneer DJ Support Request Form";
      	var reqemeasupport = "Pioneer DJ EMEA Support Request Form"; //PULSE UPDATE THIS
      	var reqatafollowup = "Pioneer DJ - Follow-up Support Request Form"
    
        if (locref.indexOf("200319715") != -1) {
            loccdj = true;
            myPage = "CDJ";
        } else if (locref.indexOf("200307759") != -1) {
            locddj = true;
            myPage = "DDJ";
        } else if (locref.indexOf("200307689") != -1) {
            locdjm = true;
            myPage = "DJM";
        } else if (locref.indexOf("200307789") != -1) {
            locxdj = true;
            myPage = "XDJ";
        } else if (locref.indexOf("200467403") != -1) {
            loctoraiz = true;
            myPage = "TORAIZ";
        }
    
        if (loc2) {
            if (urlcdj || loccdj) {
                // $('#announcement').replaceWith(cdjmessage);
            }
            if (urldjm || locdjm) {
                $('#announcement').replaceWith(djmmessage);
            }
            if (urlxdj || locxdj) {
                $('#announcement').replaceWith(xdjmessage);
            }
            if (urltoraiz || loctoraiz) {
                $('#announcement').replaceWith(toraizmessage);
            }
            if (urlddj || locddj) {
                $('#announcement').replaceWith(ddjmessage);
            }
        }
        // START LANGUAGES
        // START JAPANESE
        if ((currentLanguage.indexOf('日本語') >= 0) || (jtx)) {
    
            // Hide non-Japanese forum categories
            var topictitle = ["rekordbox", "rekordbox BETA", "MIDI Maps", "Pulselocker", "The Lounge", "CDJ", "PLX", "DDJ", "DJM", "XDJ", "HDJ", "RMX & EFX", "Speakers", "Legacy Products", "Other Software", "TORAIZ"];
            if (window.location.href.indexOf("community") >= 0) {
                for (var i = 0, j = topictitle.length; i < j; i++) {
                    $("a").filter(function () {
                        return $(this).text() === topictitle[i];
                    }).parent().parent().remove();
                }
            }
    
            var tkt_mobile = "<h4>モバイルアプリケーション等に関するお問い合わせの場合は、以下の欄で「その他」を選択し詳細(アプリケーション名、バージョンなど)を記入してください。</h4>";
            var tkt_hardware = "<h3>このお問合せに関連してお使いの機器があれば、チェックしてください。</h3>";
            var ls = "<a href='/hc/ja/community/topics'>フォーラム</a> &gt; ";
            var lsnolink = "フォーラム";
            var anon = "<h4 style='color:red;' id='anonrequest'>Pioneer DJフォーラムのアカウントをお持ちの方は、そのメールアドレスを以下にご記入ください。</h4>";
            var reqmobileapp = "モバイルアプリお問合わせフォーム";
            // Replace text
            $('h2.search-results-subheading:contains("コミュニティ")').text('フォーラム');
            $('a:contains("コミュニティ")').text('フォーラムを参照');
            $("label[for='request_description']").text("お問合せ内容");
            $(".request_description p").text("問題をご説明いただく際はできるだけ具体的に詳細な内容をお知らせください。1度のお問合せで複数の質問をする場合は、1、2、3などの番号を付けてください。");
            $("#icon-reload").text("他の画像を表示する");
            $('div.request_custom_fields_24345049').detach().insertAfter($('div.request_custom_fields_24401655'));
    
            // Hide FAQs box
            $('#FAQs').remove();
    
            // LIGHTING PAGE HTML DESCRPTION TEXT REPLACEMENT
            var lightingDesc = "<h2 class='announcement'><i class='fa fa-exclamation-circle'></i> 照明機器をすでにお持ちのお客様へ:</h2>ライブラリにお手持ちの照明機器が見つからなかった場合は、<a href='https://forums.pioneerdj.com/hc/ja/community/posts/360000690083'>照明機器の登録方法</a>をご覧ください。<a href='https://rekordbox.com/ja/support/faq/lighting-6/#faq-q500268'>Fixture Library History</a>から最近登録された照明機器情報の確認も可能です。<br /><br /><ul style='list-style-type: circle; padding-left:20px;'><li>MODEから制御できるDMX照明機器の機能は、ディマー、ストロボ、カラー、ムービングヘッド(PAN/TILT)です。</li><li>上記以外のDMX照明機器に搭載されている機能は正確に動作しない場合がございます。</li><li>また、レーザーやフォグマシーン、Effect系ライト等の機器はサポート対象外ですので、予めご了承下さい。</li></ul>";
    
    
            // FINISH JAPANESE
        } else {
            // NOT JAPANESE Hide Japanese forum categories
    
            var topictitle = ["CDJプレーヤー", "DDJ コントローラー&XDJ システム", "DJM ミキサー", "rekordbox (日本語)", "rekordbox ベータ (日本語)", "RMX&EFX エフェクター", "Serato (日本語)", "Traktor (日本語)", "Virtual DJ (日本語)", "その他", "TORAIZ"];
            if (window.location.href.indexOf("community") >= 0) {
                for (var i = 0, j = topictitle.length; i < j; i++) {
                    $("a").filter(function () {
                        return $(this).text() === topictitle[i];
                    }).parent().parent().remove();
                }
            }
    
            // HIDE JAPANESE topics from new post topic drop-down options:
            var topicoption = ["200307849", "200307889", "200307879", "200307899", "200307869", "200307919", "200307859", "200307929", "200307909", "115000033343"];
            if (window.location.href.indexOf("new") >= 0) {
                for (var i = 0, j = topicoption.length; i < j; i++) {
                    $('#community_post_topic_id option[value="' + topicoption[i] + '"]').remove();
                }
                $('.nesty-panel').on('DOMNodeInserted', function (e) {
                    $('li#200307849').remove();
                    $('li#200307889').remove();
                    $('li#200307879').remove();
                    $('li#200307899').remove();
                    $('li#200307869').remove();
                    $('li#200307919').remove();
                    $('li#200307859').remove();
                    $('li#200307929').remove();
                    $('li#200307909').remove();
                    $('li#115000033343').remove();
                });
            }
            // START SPANISH
    
            if ((currentLanguage.indexOf('Español') >= 0) || (estx)) {
                var lightingDesc = "<h2 class='announcement'><i class='fa fa-exclamation-circle'></i> Para clientes que ya tienen equipos de iluminación.</h2><ul style='list-style-type: circle; padding-left:20px;'><li>Solo se pueden controlar con el modo Lighting características específicas del dispositivo de iluminación DMX, como, el atenuador, el estroboscópico, el color, el gobo, y el cabezal móvil (PAN/TILT).</li><li>Los accesorios, que tienen otras características, pueden no funcionar como se espera.</li><li>No se admiten características como luces de efecto, láseres, máquinas de humo, y sistemas de iluminación todo-en-uno.</li></ul>En el caso improbable de que no pueda encontrar su dispositivo en la biblioteca, <a href='https://forums.pioneerdj.com/hc/es/community/posts/360000690083'>consulte estas instrucciones sobre cómo solicitar una actualización del dispositivo.</a>. Puede ver la última actualización y los accesorios agregados recientemente en <a href='https://rekordbox.com/es/support/faq/lighting-6/#faq-q500268'>la publicación Historial de la biblioteca de dispositivos</a>.<br /><br />";
                // var tkt_hardware = "<h3>Selezionare la casella qualsiasi per hardware che si sta utilizzando in relazione a questa richiesta di supporto:</h3>";
                var ls = "<a href='/hc/es/community/topics'>Foros de usuarios</a> &gt; ";
                var lsnolink = "Foros de usuarios";
                var anon = "<h4 style='color:red;' id='anonrequest'>Se siete in possesso di un account DJ Pioneer Forum, si prega di utilizzare lo stesso indirizzo di posta elettronica nel modulo sottostante.</h4>";
                var reqeap = "Formulario de ayuda rekordbox EAP";
                var reqrbx = "Formulario de ayuda rekordbox";
                var articles = "Últimas noticias";
                var community1 = "Foros de usuarios";
                var community2 = "browse Foros de usuarios";
                var desclic = "<strong>NOTA:</strong> Este formulario es solo para los titulares de cuenta Pioneer DJ y no es para uso del público en general. Si usted está buscando el apoyo rekordbox, <a href='https://rekordbox.com/es/support/inquiry.php'>realizar una consulta aquí</a>.<br /><br />Para obtener instrucciones adicionales sobre cómo completar este formulario, <a href='http://pioneerdjhub.s3.amazonaws.com/assets/product%20planning/rekordbox/Account_Holder_Support_Document/Account_Holder_rekordbox_dj_License_Request_ESP.pdf' target='_blank'>por favor descarga este documento de soporte</a>.";
                var reqlic = "Solicitud de Licencia rekordbox dj para Titular de la cuenta Pioneer DJ";
    
                // FINISH SPANISH
                // START ITALIAN
    
            } else if ((currentLanguage.indexOf('Italiano') >= 0) || (ittx)) {
                var lightingDesc = "<h2 class='announcement'><i class='fa fa-exclamation-circle'></i> Ai clienti che dispongono già di apparecchiature di illuminazione.</h2><ul style='list-style-type: circle; padding-left:20px;'><li>Solo le funzioni specifiche di alcuni apparecchi di illuminazione DMX quali dimmer, strobe, gobo, color, e moving head (PAN/TILT) si possono controllare con la Lighting mode.</li><li>Può accadere che gli apparecchi con altre funzioni non funzionino come previsto.</li><li>Alcuni effetti luce, laser, macchine per generare fumo, e sistemi di illuminazione tutto in uno, non sono supportate.</li></ul>Nell'improbabile eventualità che non sia possibile trovare la fixture nella libreria, <a href='https://forums.pioneerdj.com/hc/it/community/posts/3600006900838'>consultare queste istruzioni su come richiedere un aggiornamento della fixture</a>. È possibile visualizzare l'ultimo aggiornamento e i dispositivi aggiunti di recente nel <a href='https://rekordbox.com/it/support/faq/lighting-6/#faq-q500268'>post Cronologia della libreria Fixture</a>..<br /><br />";
                //var tkt_hardware = "<h3>Marque la casilla de cualquiera de los siguientes aparatos que utilice, relacionados con esta consulta:</h3>";
                var ls = "<a href='/hc/it/community/topics'>Foros de usuarios</a> &gt; ";
                var lsnolink = "Foros de usuarios";
                var anon = "<h4 style='color:red;' id='anonrequest'>Si ya dispone de una cuenta en el Foro de Pioneer DJ, por favor, utilice esa dirección de email en el formulario.</h4>";
                var reqeap = "Modulo di richiesta rekordbox EAP";
                var reqrbx = "Modulo di richiesta rekordbox";
                var articles = "Prodotti in promozione";
                var community1 = "Forum di utenti";
                var community2 = "Forum di utenti";
                var desclic = "<strong>Attenzione:</strong> questo modulo è destinato soltanto ai titolari dell'account Pioneer DJ e non al grande pubblico. Se stai cercando assistenza per rekordbox, <a href='https://rekordbox.com/it/support/inquiry.php'>ti preghiamo di formulare qui la tua richiesta</a>.<br /><br />Per maggiori istruzioni sulla compilazione del modulo, <a href='http://pioneerdjhub.s3.amazonaws.com/assets/product%20planning/rekordbox/Account_Holder_Support_Document/Account_Holder_rekordbox_dj_License_Request_IT.pdf' target='_blank'>scarica il documento relativo al supporto</a>.";
                var reqlic = "Modulo di richiesta licenza per rekordbox dj per titolari dell'account Pioneer DJ";
    
                // FINISH ITALIAN
                // START FRENCH
    
            } else if ((currentLanguage.indexOf('Français') >= 0) || (ftx)) {
    
                var lightingDesc = "<h2 class='announcement'><i class='fa fa-exclamation-circle'></i> Aux clients qui ont déjà du matériel d'éclairage.</h2><ul style='list-style-type: circle; padding-left:20px;'><li>Seules certaines fonctions d'équipemens de jeux de lumière DMX spécifiques – telles que le variatuer, l'effet stroboscopique, gobo, la couleur et la tête tournante (PAN/TILT) – peuvent être contrôlées avec le mode Lighting.</li><li>Les équipements qui ont d'autres fonctions peuvent ne pas fonctionner comme prévu.</li><li>Certains effets, lasers, machines à fumée, et systèmes de jeux de lumière tout-en-un, ne sont pas prises en charge.</li></ul>Dans le cas peu probable où vous ne pouvez pas trouver votre appareil dans la bibliothèque, <a href='https://forums.pioneerdj.com/hc/fr/community/posts/360000690083'>consultez ces instructions sur la façon de demander une mise à jour de l'appareil</a>. Vous pouvez voir la dernière mise à jour et les derniers appareils ajoutés dans la <a href='https://rekordbox.com/fr/support/faq/lighting-6/#faq-q500268'>publication Historique de la bibliothèque de luminaires</a>.<br /><br />";
                //var tkt_hardware = "<h3>Cochez la case pour tout matériel que vous utilisez dans le cadre de cette demande de soutien:</h3>";
                var ls = "<a href='/hc/fr/community/topics'>Forums</a> &gt; ";
                var lsnolink = "Forums";
                var anon = "<h4 style='color:red;' id='anonrequest'>Si vous avez déjà un compte DJ Pioneer Forums, s'il vous plaît utiliser cette adresse e-mail dans le formulaire ci-dessous.</h4>";
                var reqeap = "Formulaire de demande d'rekordbox EAP";
                var reqrbx = "Formulaire de demande d'rekordbox";
                var articles = "Articles Promus";
                var community1 = "Forums";
                var community2 = "Forums";
                var desclic = "<strong>REMARQUE IMPORTANTE:</strong> Ce formulaire est réservé aux revendeurs et n’est pas destiné au client final. Si vous avez besoin de support sur rekordbox, merci de <a href='https://rekordbox.com/fr/support/inquiry.php'>faire un ticket de support ici</a>.<br /><br />Pour plus d’informations concernant ce formulaire, <a href='http://pioneerdjhub.s3.amazonaws.com/assets/product%20planning/rekordbox/Account_Holder_Support_Document/Account_Holder_rekordbox_dj_License_Request_FR.pdf' target='_blank'>merci de télécharger le document de support</a>.";
                var reqlic = "Fomulaire de demande de nouvelle licence rekordbox dj";
    
                // FINISH FRENCH
                // START ENGLISH / DEFAULT
    
            } else {
                // LIGHTING PAGE HTML DESCRPTION TEXT REPLACEMENT
                var lightingDesc = "<h2 class='announcement'><i class='fa fa-exclamation-circle'></i> To customers who already have lighting equipment.</h2><ul style='list-style-type: circle; padding-left:20px;'><li>Only specific DMX lighting fixture features  – such as the dimmer, strobe, gobo, color, and moving head (PAN/TILT) – can be controlled with Lighting mode.</li><li>Fixtures with other features, may not work as expected.</li><li>Some effect lights, lasers, fog machines, and all-in-one lighting systems, aren't supported.</li></ul><br />In the unlikely event that you cannot find your fixture in the library, <a href='https://forums.pioneerdj.com/hc/en-us/community/posts/360000690083'>see these instructions on how to request a fixture update</a>. You can view the latest update and recently added fixtures in the <a href='https://rekordbox.com/en/support/faq/lighting-6/#faq-q500268'>Fixture Library History</a>.<br /><br />Refer to <a href='https://rekordbox.com/en/support/faq/lighting-6' target='_blank'>FAQs for Lighting function</a> for more information.";
    
                var tkt_mobile = "<h4>For inquiries about mobile applications, please select “Other” and enter details (application name, version, etc.) in the following fields.</h4>";
                //var tkt_hardware = "<h3>Check the box for any hardware you are using in relation to this support request:</h3>";
                var ls = "<a href='/hc/en/community/topics'>DJ Products</a> &gt; ";
                var lsnolink = "DJ Products";
                var anon = "";
                var articles = "Latest News";
                var community1 = "DJ Products";
                var community2 = "browse DJ Products";
                var desclic = "<strong>PLEASE NOTE:</strong> This form is for Pioneer DJ Account Holders only and is not for use of the general public. If you are looking for rekordbox support, <a href='https://rekordbox.com/en/support/inquiry.php'>please make an inquiry here</a>.<br /><br />For additional instructions on completing this form, <a href='http://pioneerdjhub.s3.amazonaws.com/assets/product%20planning/rekordbox/Account_Holder_Support_Document/Account_Holder_rekordbox_dj_License_Request_ENG.pdf' target='_blank'>please download this support document</a>.";
                var reqlic = "Pioneer DJ Account Holder rekordbox dj Licence Request Form";
    
                var reqaccount = "Pioneer DJ Account Question Inquiry Form";
                var descaccount = "This form is for users who  have questions about their Pioneer DJ Account. If you are looking for rekordbox support, <a href='https://rekordbox.com/en/support/inquiry.php'>please make an inquiry here</a>.";
    
                /***
                      if (urltoraiz){
                        var debug6 = "In debug6";
                        var ls = "<a href='/hc/en-us/community/topics/200467403'>Production Instruments</a> &gt; ";
                            var lsnolink = "Production Instruments";
                            var community1 = "Production Instruments";
                            var community2 = "browse Production Instruments";
                            }
                      if (loc1 = "TORAIZ"){
                        var debug7 = "In debug7";
                        var ls = "<a href='/hc/en-us/community/topics/200467403'>Production Instruments</a> &gt; ";
                        var loc1 = "<a href='/hc/en-us/community/topics/200467403'>TORAIZ</a>";
                        if (loc2) {
                          var loc2 = "<a href='/hc/en-us/community/topics/200467403'>TORAIZ</a> &gt; ";}
                      }
                ** /
            }
        }
    
        // END LANGUAGES
        // Replace text, set language-specific variables
    
        $('.topic-description:contains("Lighting Description")').html(lightingDesc);
        $('h3:contains("Promoted articles")').text(articles);
        $('h2.search-results-subheading:contains("Community")').text(community1);
        $('a:contains("Community")').text(community2);
    
        // MIDI MAPS FORUM DISCLAIMER TEXT REPLACEMENT
        var MIDIDisclaimer = "<h3>Disclaimer</h3><br />Pioneer DJ has provided this forum as a venue to share user-created MIDI maps. Please note that these files are created by end-users and Pioneer DJ does not claim any guarantee or responsibility over the function, quality, availability, or possibly incomplete nature of these MIDI map files, legally or otherwise, nor will Pioneer DJ provide any technical support for use of these files.<br /><br />When creating a file to share on our forum, please name the file with the product manufacturer and model name, your username, a version number (useful if you plan on making revisions) and a date. For example: <strong>Pioneer DJ - DDJ-SP1 - Pulse - v1.0 - 2019-02-24.midi.csv</strong><br /><br />We recommend using a file-sharing service like Dropbox to host your file as we are unable to receive CSV file uploads by users. Please DO NOT zip your file; if you wish to provide accompanying documentation (eg. a graphic layout of your mapping to the hardware), either provide it in the forum post or in a linked PDF.<br /><br />When posting a new topic, please include the product manufacturer and model name. For example: <strong>Pioneer DJ - DDJ-SP1</strong><br /><br /><strong style='color:red;'>Do not post requests for maps or any other topics in this forum, it is for MIDI maps only. Any user not adhering to these rules will have their post(s) removed.</strong>";
    
        $('.topic-description:contains("MIDI Disclaimer")').html(MIDIDisclaimer);
        // END MIDI DISCLAIMER REPLACEMENT
    
        // PRODUCT SUGGESTIONS FORUM DISCLAIMER TEXT REPLACEMENT
        var SuggestionsDisclaimer = "This forum is solely for posting product and feature suggestions. It can be a new idea, or a fix for an existing function in hardware or software, but we ask that you post only ONE suggestion per topic!<br /><br />You are welcome to discuss any suggestions, but please DO NOT post a new idea as a response to another user's topic; post a new topic instead.<br /><h3>SUBMISSION OF SUGGESTIONS</h3>Any submission of suggestions, proposals, ideas, materials, or other information concerning Pioneer DJ's products and/or services (hereinafter collectively referred to as “Suggestions”) shall be deemed as your acceptance of the following terms:<br /><br /><ul><li><strong>(A)</strong> Pioneer DJ has no obligation to treat any Suggestions in confidence, to use nor to commercialize any Suggestions.</li><br /><li><strong>(B)</strong> Pioneer DJ has no obligation to report or inform of any status of use of any Suggestions.</li><br /><li><strong>(C)</strong> Pioneer DJ has no obligation to provide compensation, either monetary, exchange of goods, or recognition, for the use of any Suggestions.</li><br /><li><strong>(D)</strong> You shall not assert any claim that Pioneer DJ's products or services infringe copyrights, industrial property or any other intellectual property rights contained in the Suggestions in the event Pioneer DJ commercializes such Suggestions or similar ideas.</li><br /><li><strong>(E)</strong> You shall not submit any material that is copyrighted, protected by trade secret or otherwise subject to third party proprietary rights or that violates any third party rights.</li>";
    
        $('.topic-description:contains("Suggestions Disclaimer")').html(SuggestionsDisclaimer);
        // END SUGGESTIONS DISCLAIMER REPLACEMENT
    
        // START BREADCRUMBS
    
        if (questiontitle) {
            $('.community-heading').replaceWith(cbc + ls + loc1 + " &gt; " + questiontitle);
        } else {
            if (loc1) {
                $('.community-heading').replaceWith(cbc + ls + loc1);
            } else if (loc2) {
                $('.community-heading').replaceWith(cbc + ls + loc2);
            } else {
                $('.community-heading').replaceWith(cbc + lsnolink);
            }
        }
    
        // END BREADCRUMBS
        // START FORUMS
    
        // Move community comments box to bottom of replies
        $('.main-column').append($('.answer-form').detach());
    
        // END FORUMS
        // START HC
    
        // Dumb down the number of "latest news" promoted articles to 10.
    
        if (typeof $('.promoted-articles ul').get(0) != 'undefined') {
            var _sectionArticles = $('.promoted-articles ul');
            _sectionArticles.each(function (_aidx, _aitm) {
                var _itmCount = $(_aitm).find('li').length;
                var _allLink = $(_aitm).prev('h3').find('a').attr('href');
                if (_itmCount > 10) {
                    for (var x = (_itmCount - 1); x > 9; x--) {
                        $($(_aitm).find('li')[x]).remove();
                    }
                }
            });
        }
    
        // Variable to check the organization:
        var jstring = JSON.stringify(HelpCenter.user.organizations);
    
        /****
        Hide the entire EAP box
          if (jstring.indexOf("rekordbox EAP") >= 0 || role == 'manager' || role == 'agent') {
        // the user is either a member of the EAP, an Agent or Manager, show the EAP box:
            if ((currentLanguage.indexOf('日本語') >= 0) || (jtx)) {
                $('<li id="EAP"><a href="/hc/ja/sections/201057469">rekordbox<br />Early Adopter Program</a></li>').insertAfter($('a:contains("フォーラム")').parent());
            } else {
              $('<li id="EAP"><a href="/hc/en-us/sections/201057469">rekordbox<br />Early Adopter Program</a></li>').insertAfter($('#staffbox'));
            }
          }
        **** /
    
        // the user is either a member of the EAP, an Agent or Manager, show the EAP box:
        if (jstring.indexOf("Red") >= 0 || role == 'manager' || role == 'agent') {
            if ((currentLanguage.indexOf('日本語') >= 0) || (jtx)) {
                $('<li id="VEAPbox"><a href="/hc/en-us/sections/202023463">rekordbox Video<br />Early Adopter Program</a></li>').insertAfter($('a:contains("フォーラム")').parent());
            } else {
                $('<li id="VEAPbox"><a href="/hc/en-us/sections/202023463">rekordbox Video<br />Early Adopter Program</a></li>').insertAfter($('#contactbox'));
            }
        }
    
        // END HC
        // START TICKET MANAGEMENT
    
        // If the user is at the requests/new URL, but not a public form, send them home
        if (urlreq && (urleap || urlrbx || urlecom || urlliteagent || urlpa || urlveap || urllic || urltest || urlgbsupport || urlpdjasupport || urlemeasupport || urlatafollowup || urlmobileapp || urlrbtest)) {
            // hide the ticket form selection drop-down
            $('.request_ticket_form_id').hide();
        } else if (urlreq && !(urleap || urlrbx || urlecom || urlliteagent || urlpa || urlveap || urllic || urlaccount || urltest || urlgbsupport || urlpdjasupport || urlemeasupport || urlatafollowup || urlmobileapp || urlrbtest)) {
            window.location = "https://forums.pioneerdj.com/hc";
        }
    
        // Change text based on the ticket form type
    
        // EAP---
        if (urleap || dreap) {
            // Is the user EAP? If not and they somehow got to this URL, hide the form and send them home
            if (jstring.indexOf("rekordbox EAP") < 0) {
                $('.request-form').remove();
                window.location = "https://forums.pioneerdj.com/hc";
            } else {
                $('h1:contains("Submit a request")').text(reqeap);
                $('.request_ticket_form_id').hide();
            }
    
            // VEAP---
        } else if (urlveap || drveap) {
            if (jstring.indexOf("Red") < 0) {
                $('.request-form').remove();
                window.location = "https://forums.pioneerdj.com/hc";
            } else {
                $('h1:contains("Submit a request")').text(reqveap);
                $('.request_ticket_form_id').hide();
            }
    
            // rekordbox inquiry---
        } else if (urlrbx || drrbx) {
            $('h1:contains("Submit a request")').text(reqrbx);
            $('.request_ticket_form_id').hide();
    
            // Account inquiry---
        } else if (urlaccount || draccount) {
            $('h1:contains("Submit a request")').text(reqaccount);
            $('h3#first').html(descaccount);
    
            $('.request_ticket_form_id').hide();
            $('.searchbox').parent().remove();
            $('p:contains("brief description")').hide();
            $('#upload-dropzone').parent().hide();
    
            // Italian Ecommerce---
        } else if (urlecom || drecom) {
            if ((currentLanguage.indexOf('Italiano') >= 0) || (ittx)) {
                $('h1:contains("Submit a request")').text(reqecom);
                $('.request_ticket_form_id').hide();
            } else {
                window.location = "https://forums.pioneerdj.com/hc";
            }
    
            // LiteAgent redirect--
        } else if (urlliteagent || drliteagent) {
            window.location = "https://forums.pioneerdj.com/hc";
    
            // ProAudio redirect--
        } else if (urlpa || drpa) {
            window.location = "https://pioneerproaudio.zendesk.com/hc/en-us/requests/new?ticket_form_id=70396";
    
            // Account Holder license request---
        } else if (urllic || drlic) {
            $('h1:contains("Submit a request")').text(reqlic);
            $('h1:contains("Envoyer une demande")').text(reqlic);
            $('h1:contains("Invia una richiesta")').text(reqlic);
            $('h1:contains("Enviar una solicitud")').text(reqlic);
            $('h3#first').html(desclic);
    
            var PrefillMachine = {
                init: function () {
                    this.bindUIActions();
                },
                bindUIActions: function () {
                    $("#request_custom_fields_24345049").on("focus", this.prefillCorrectly);
                },
    
                prefillCorrectly: function () {
                    $('#request_subject').val('Account Holder rekordbox dj Licence Request');
                    $('#request_description').val('Account Holder rekordbox dj Licence Request');
                }
            }
    
            PrefillMachine.init();
    
            $('.request_ticket_form_id').hide();
            $('.searchbox').parent().remove();
            $('.request_subject').css('display', 'none');
            $('.request_description').css('display', 'none');
            $('p:contains("brief description")').hide();
    
            // Pioneer DJ GB Support---
        } else if (urlgbsupport || drgbsupport) {
            $('h1:contains("Submit a request")').text(reqgbsupport);
            $('.request_ticket_form_id').hide();
    
            // PDJA Support---
        } else if (urlpdjasupport || drpdjasupport) {
            $('h1:contains("Submit a request")').text(reqpdjasupport);
            $('.request_ticket_form_id').hide();
    
            // EMEA Support---
        } else if (urlemeasupport || dremeasupport) {
            $('h1:contains("Submit a request")').text(reqemeasupport);
            $('.request_ticket_form_id').hide();
    
     				// ATA Follow-up Support---
        } else if (urlatafollowup || dratafollowup) {
            $('h1:contains("Submit a request")').text(reqatafollowup);
            $('.request_ticket_form_id').hide();
          	$('h3#first').html(desatafollowup);
    
            // test inquiry---
        } else if (urltest || drtest) {
            $('h1:contains("Submit a request")').text(reqtest);
            $('.request_ticket_form_id').hide();
    
            // rec app inqiury---
        } else if (urlmobileapp || drmobileapp) {
            if ((currentLanguage.indexOf('日本語') >= 0) || (jtx)) {
                $('h1:contains("リクエストを送信")').text(reqmobileapp);
            } else {
                $('h1:contains("Submit a request")').text(reqmobileapp);
            }
            $('.request_ticket_form_id').hide();
    
            // Anything else---
        } else {
            // remove forms from the dropdown selector
            $('#request_issue_type_select option[value="72819"]').remove();
            $('#request_issue_type_select option[value="65306"]').remove();
    
            // remove the EAP from and ECOMM form the nesty-input after it's been created.
            $('div').on('DOMNodeInserted', function (e) {
                $('.nesty-panel').on('DOMNodeInserted', function (e) {
                    $(this).children('ul').children().remove('#72189');
                    //        $(this).children('ul').children().remove('#72053');
                });
            });
        }
    
        // If anonymous, show the recommendation to use the same email address, if not, hide it
        if (role == "anonymous") {
            $(anon).insertBefore($('.request-form').parent());
        } else {
            $('#anonrequest').remove();
        }
    
        // Tidy up the form and make it look good:
        //  $('.request-form').append($('footer:not(".footer")').detach());
        // $(tkt_hardware).insertAfter($('label:contains("Pro DJ LINK")').parent());
        $('.request_description').detach().insertBefore($('#upload-dropzone').parent());
    
        // add mobile app text
        $(tkt_mobile).insertAfter($("div[class='form-field string  required  request_custom_fields_24401825']"));
    
        // move the error notification box below the user nav bar
        $('.notification-error').detach().insertAfter($('.user-nav-wrapper'));
    
        // END TICKETS
        // Helper Code for Moderators---
        var communityloc = window.location.href.indexOf("community");
        var role = HelpCenter.user.role;
        if (role == 'manager' || role == 'agent') {
            $('<li id="staffbox"><a href="/hc/en-us/categories/4414005560857">AlphaTheta Staff</a></li>').insertAfter($('#contactbox'));
    
            //$('li#statusNone.question').css('background-color','#fff0f0');
            //COLOUR CODING STYLE POSTS:
            $('li#statusAnsweredticket').css('background-image', 'repeating-linear-gradient(45deg,rgba(255, 240, 240, 1),rgba(255, 240, 240, 1) 10px,rgba(240, 255, 240, 1) 10px,rgba(240, 255, 240, 1) 20px)');
            $('li#statusNoneticket').css('background-image', 'repeating-linear-gradient(45deg,rgba(0, 0, 0, 0.0),rgba(0, 0, 0, 0.0) 10px,rgba(240, 255, 240, 1) 10px,rgba(240, 255, 240, 1) 20px)');
            $('li#statusAnswered.question').css('background-color', '#f0ffff'); //No Official Answer Posted + Marked as Answered = Blue
            $('li#statusAnswered.question.question-official-answer').css('background-color', '#f0fff0'); //Official Answer + Marked as Answered = Green
            $('li#statusNone.question.question-official-answer').css('background-color', '#fff8ec'); //Official Answer - Not Marked as Answered = Yellow
            $('li.closed').css('background-image', 'repeating-linear-gradient(45deg,rgba(0, 0, 0, 0.0),rgba(0, 0, 0, 0.0) 10px,rgba(200, 200, 200, 0.2) 10px,rgba(200, 200, 200, 0.2) 20px)');
            $('li#statusAnsweredticket.closed').css('background-image', 'repeating-linear-gradient(45deg,rgba(255, 240, 240, 1),rgba(255, 240, 240, 1) 10px,rgba(120, 133, 120, 0.2) 10px,rgba(120, 133, 120, 0.2) 20px)');
            if (communityloc != -1) {
    
                $("<div style='position: fixed; bottom: 50%; right: 50px; z-index: 9999; font-size: 0.7em; border: 5px solid #999; background-color: #fff;'><div style='padding: 5px;'><strong>LEGEND</strong></div><div style='padding: 5px; background-image: repeating-linear-gradient(45deg,rgba(0, 0, 0, 0.0),rgba(0, 0, 0, 0.0) 10px,rgba(200, 200, 200, 0.3) 10px,rgba(200, 200, 200, 0.3) 20px);'>Closed</div><div style='padding: 5px; background-color: #f0fff0;'>Official + Answered</div><div style='padding: 5px; background-color: #fff8ec;'>Official - Not Answered</div><div style='padding: 5px; background-color: #f0ffff;'>Answered - No Official</div><div style='padding: 5px; background-color: #fff0f0;'>Ticketed</div><div style='padding: 5px; background-color: #fff;'><a onclick='modMacro()'>Insert rekordbox Ticket</a></div><div style='padding: 5px; background-color: #eee;'><a onclick='modMacro2()'>Insert Contact Link</a></div><div style='padding: 5px; background-color: #fff;'><a onclick='modMacro3()'>Insert ASC Link</a></div>").insertAfter($('.community-enabled'));
            }
    
            /////////////////////
            //FOR DEBUGGING ONLY:
            //
            var uuid = JSON.stringify(HelpCenter.user.identifier);
            /* if (uuid = "b89b7d183fdbdbe39a1398d0364d719f4e15e19a") {
                $('.footer').append('<b style="color:red;">DEBUG:</b><br />uuid: ' + uuid + '<br />jstring: ' + jstring + '<br /> urlreq: ' + urlreq + '<br />urleap: ' + urleap + '<br />urlrbx: ' + urlrbx + '<br />Language: ' + currentLanguage + '<br />ls: ' + ls + '<br />loc1: ' + loc1 + '<br />loc2: ' + loc2 + '<br />locref: ' + locref + '<br />loctoraiz: ' + loctoraiz + '<br />locddj: ' + locddj + '<br />loccdj: ' + loccdj + '<br />locdjm: ' + locdjm + '<br />locxdj: ' + locxdj + '<br />communityloc: ' + communityloc + '<br />myPage: ' + myPage + '<br />');
            }* /
            //
            /////////////////////
    
        } else {
            $('span.question-actions').remove();
        }
    
    });
    
    /////////////////
    // End of Doucument Ready section
    /////////////////
    
    function modMacro() {
        var $iframe = $('#community_comment_body_ifr');
        var macro = "Sorry to hear that, <a href=\"https://rekordbox.com/en/support/inquiry.php\" target=\"_blank\">please file an inquiry ticket here</a> and our support team will gather some additional information to assist you in resolving this issue.";
        $iframe.ready(function () {
            $iframe.contents().find("body").append(macro);
        });
    }
    function modMacro2() {
        var $iframe = $('#community_comment_body_ifr');
        var macro = "Please <a href=\"https://support.pioneerdj.com/hc/en-us/categories/4417227498393\" target=\"_blank\">create a ticket with the support team in your region</a> for further assistance in resolving this issue.";
        $iframe.ready(function () {
            $iframe.contents().find("body").append(macro);
        });
    }
    function modMacro3() {
        var $iframe = $('#community_comment_body_ifr');
        var macro = "Please <a href=\"https://support.pioneerdj.com/hc/en-us/sections/4417230277017\" target=\"_blank\">contact an authorized service centre in your region</a> to have your hardware inspected and/or repaired.";
        $iframe.ready(function () {
            $iframe.contents().find("body").append(macro);
        });
    }
    // END Helper Code---
    
    */
    
  • URL: /components/raw/gigya-test/_test-code.js
  • Filesystem Path: ../src/99_gigya/gigya-test/_test-code.js
  • Size: 74.7 KB

No notes defined.