jQuery(function ($) {

    var FrontendScripts = {
        init: function () {
            $(document).on('click', '.rs_copy_clipboard_image', this.copy_to_clipboard);
        },
        copy_to_clipboard: function () {
            var temp = $('<input>');
            $('body').append(temp);
            var url = $(this).attr('data-referralurl');
            temp.val(url).select();
            document.execCommand('copy');
            $('.rs_alert_div_for_copy').css({display: 'block'}).delay(7000).fadeOut();
            temp.remove();
        },
    };
    FrontendScripts.init();
});
