<commit_before>/**
 * Copyright 2015, GeoSolutions Sas.
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree.
 */

var React = require('react');
var {Button, Glyphicon, OverlayTrigger} = require('react-bootstrap');
var ImageButton = require('./ImageButton');

var ToggleButton = React.createClass({
    propTypes: {
        id: React.PropTypes.string,
        btnConfig: React.PropTypes.object,
        text: React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.element]),
        glyphicon: React.PropTypes.string,
        pressed: React.PropTypes.bool,
        onClick: React.PropTypes.func,
        tooltip: React.PropTypes.element,
        tooltipPlace: React.PropTypes.string,
        style: React.PropTypes.object,
        btnType: React.PropTypes.oneOf(['normal', 'image']),
        image: React.PropTypes.string
    },
    getDefaultProps() {
        return {
            onClick: () => {},
            pressed: false,
            tooltipPlace: "top",
            style: {width: "100%"},
            btnType: 'normal'
        };
    },
    onClick() {
        this.props.onClick(!this.props.pressed);
    },
    renderNormalButton() {
        return (
            <Button id={this.props.id} {...this.props.btnConfig} onClick={this.onClick} bsStyle={this.props.pressed ? 'primary' : 'default'} style={this.props.style}>
                {this.props.glyphicon ? <Glyphicon glyph={this.props.glyphicon}/> : null}
                {this.props.glyphicon && this.props.text ? "\u00A0" : null}
                {this.props.text}
            </Button>
        );
    },
    renderImageButton() {
        return (
            <ImageButton id={this.props.id} image={this.props.image} onClick={this.onClick} style={this.props.style}/><commit_msg>fixes #306, Unaligned info icon<commit_after>/**
 * Copyright 2015, GeoSolutions Sas.
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree.
 */

var React = require('react');
var {Button, Glyphicon, OverlayTrigger} = require('react-bootstrap');
var ImageButton = require('./ImageButton');

var ToggleButton = React.createClass({
    propTypes: {
        id: React.PropTypes.string,
        btnConfig: React.PropTypes.object,
        text: React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.element]),
        glyphicon: React.PropTypes.string,
        pressed: React.PropTypes.bool,
        onClick: React.PropTypes.func,
        tooltip: React.PropTypes.element,
        tooltipPlace: React.PropTypes.string,
        style: React.PropTypes.object,
        btnType: React.PropTypes.oneOf(['normal', 'image']),
        image: React.PropTypes.string
    },
    getDefaultProps() {
        return {
            onClick: () => {},
            pressed: false,
            tooltipPlace: "top",
            style: {width: "100%"},
            btnType: 'normal'
        };
    },
    onClick() {
        this.props.onClick(!this.props.pressed);
    },
    renderNormalButton() {
        return (
            <Button id={this.props.id} {...this.props.btnConfig} onClick={this.onClick} bsStyle={this.props.pressed ? 'primary' : 'default'} style={this.props.style}>
                {this.props.glyphicon ? <Glyphicon glyph={this.props.glyphicon}/> : null}
                {this.props.glyphicon && this.props.text && !React.isValidElement(this.props.text) ? "\u00A0" : null}
                {this.props.text}
            </Button>
        );
    },
    renderImageButton() {
        return (
            <ImageButton id={this.props.id} image={this.props.image} onClick={this.onClick} style={this.props.style}/>
{'fraction_non_alphanumeric': 0.14028586553732134, 'fraction_numerical': 0.006087877183695077, 'mean_word_length': 2.4669724770642203, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1077108', 'n_tokens_mistral': 1122, 'n_tokens_neox': 1088, 'n_words': 224}