[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/steverife/JavaScriptButtons/master/src/button.js [Back]  [Original]

'use strict';


var template = require('./util/template'),
    constants = require('./constants');


module.exports = function button(label, data, config) {
    var model, locale, style;

    config = config || {};
    locale = data.get('lc') || constants.DEFAULT_LOCALE;
    style = config.style || constants.DEFAULT_STYLE;

    label = constants.STRINGS[locale][label];
    label = label.replace('{wordmark}', 'PayPal [PayPal]');
    
    model = {
        style: style,
        size: config.size || constants.DEFAULT_SIZE,
        logo: constants.LOGO,
        label: label
    };
    
    return template(constants.TEMPLATES.button, model);
};

Web Proxy Viewer  |  New URL  |  Original Page