$(function () { inputChanges(); // Clipboard Copy new Clipboard('#copyCode', { text: function (trigger) { $(".copyLabelPopup").show().delay(1000).fadeOut(500); return inputChanges(); } }); }); function esc(input) { return ('' + input) /* Forces the conversion to string. */ .replace(/&/g, '&') /* This MUST be the 1st replacement. */ .replace(/'/g, ''') /* The 4 other predefined entities, required. */ .replace(/"/g, '"') .replace(//g, '>') /* You may add other replacements here for HTML only (but it's not necessary). Or for XML, only if the named entities are defined in its DTD. */ ; } Vue.use(VeeValidate); const dictionary = { en: { attributes: { price: 'Price', checkoutDesc: 'Checkout Description', orderId: 'Order Id', serverIpn: 'Server IPN', notifyEmail: 'Send Email Notifications', browserRedirect: 'Browser Redirect', payButtonImageUrl: "Pay Button Image Url" } } }; VeeValidate.Validator.localize(dictionary); function inputChanges(event, buttonSize) { if (buttonSize !== null && buttonSize !== undefined) { srvModel.buttonSize = buttonSize; } var width = "209px"; var widthInput = "3em"; if (srvModel.buttonSize === 0) { width = "146px"; widthInput = "2em"; } else if (srvModel.buttonSize === 1) { width = "168px"; } else if (srvModel.buttonSize === 2) { width = "209px"; } var html = '
'; $("#mainCode").text(html).html(); $("#preview").html(html); $('pre code').each(function (i, block) { hljs.highlightBlock(block); }); return html; } function addinput(name, value) { var html = '\n '; return html; } function addPlusMinusButton(type) { var button = document.getElementById('template-button-plus-minus').innerHTML.trim(); if (type === "+") { return button.replace(/TYPE/g, '+'); } else { return button.replace(/TYPE/g, '-'); } } function addInputPrice(price, widthInput, customFn) { var input = document.getElementById('template-input-price').innerHTML.trim(); input = input.replace(/PRICEVALUE/g, price); input = input.replace("WIDTHINPUT", widthInput); if (customFn) { return input.replace("CUSTOM", customFn); } return input.replace("CUSTOM", ""); } function addSelectCurrency() { return document.getElementById('template-select-currency').innerHTML.trim(); } function addSlider(price, min, max, step, width) { var input = document.getElementById('template-input-slider').innerHTML.trim(); input = input.replace("PRICE", price); input = input.replace("MIN", min); input = input.replace("MAX", max); input = input.replace("STEP", step); input = input.replace("WIDTH", width); return input; }