<commit_before>/*
Copyright 2016 Mozilla

Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
*/

import React, { PropTypes } from 'react';

import Style from '../../../shared/style';
import Btn from '../../../shared/widgets/btn';
import VerticalSeparator from '../../../shared/widgets/vertical-separator';

const WINDOW_DECORATIONS_STYLE = Style.registerStyle({
  alignItems: 'center',
  margin: '0px 5px',
});

const APP_MENU_BUTTON_STYLE = Style.registerStyle({
  margin: '0 5px',
});

const WINDOW_CONTROL_BUTTONS_STYLE = Style.registerStyle({
  margin: '0 1px',
});

const Decorations = function(props) {
  return (
    <div className={WINDOW_DECORATIONS_STYLE}>
      <Btn id="browser-menu"
        className={APP_MENU_BUTTON_STYLE}
        title="Menu"
        image="glyph-menu-16.svg"
        imgWidth="18px"
        imgHeight="18px"
        onClick={props.handleOpenMenu} />
      <VerticalSeparator />
      {props.children}
      <Btn id="browser-minimize"
        className={WINDOW_CONTROL_BUTTONS_STYLE}
        title="Minimize"
        image="glyph-window-minimize-16.svg"
        imgWidth="18px"
        imgHeight="18px"
        imgPosition="center 4px"
        onClick={props.handleMinimize} />
      <Btn id="browser-maximize"
        className={WINDOW_CONTROL_BUTTONS_STYLE}
        title="Maximize"
        image="glyph-window-maximize-16.svg"
        imgWidth="18px"
        imgHeight="18px"
        imgPosition="center bottom"
        onClick={props.handleMaximize} />
      <Btn id="browser-close"
        className={WINDOW_CONTROL_BUTTONS_STYLE}
        title="Close"
        image="glyph-window-close-16.svg"
        imgWidth="18px"
        imgHeight="18px"
        imgPosition="center bottom"
        onClick={props.handleClose} />
    </div>
  );
};

Decorations.displayName = 'Decorations';

Decorations.propTypes = {
  handleOpenMenu: PropTypes.func.isRequired,
  handleMinimize: PropTypes.func.isRequired,
  handleMaximize: PropTypes.func.isRequired,
  handleClose: PropTypes.func.isRequired,
  children: PropTypes.oneOfType([
    PropTypes.arrayOf(PropTypes.node),
    PropTypes.node,
  ]),
};

export default Decorations;<commit_msg>Add an 'Overview' button that should open the page summaries view<commit_after>/*
Copyright 2016 Mozilla

Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
*/

import React, { PropTypes } from 'react';

import Style from '../../../shared/style';
import Btn from '../../../shared/widgets/btn';
import VerticalSeparator from '../../../shared/widgets/vertical-separator';

const WINDOW_DECORATIONS_STYLE = Style.registerStyle({
  alignItems: 'center',
  margin: '0px 5px',
});

const APP_MENU_BUTTON_STYLE = Style.registerStyle({
  margin: '0 5px',
});

const OVERVIEW_BUTTON_STYLE = Style.registerStyle({
  color: 'var(--theme-content-color)',
  margin: '0 5px',
});

const WINDOW_CONTROL_BUTTONS_STYLE = Style.registerStyle({
  margin: '0 1px',
});

const Decorations = function(props) {
  return (
    <div className={WINDOW_DECORATIONS_STYLE}>
      <Btn id="browser-menu"
        className={APP_MENU_BUTTON_STYLE}
        title="Menu"
        image="glyph-menu-16.svg"
        imgWidth="18px"
        imgHeight="18px"
        onClick={props.handleOpenMenu} />
      <VerticalSeparator />
      <Btn id="pages-overview"
        className={OVERVIEW_BUTTON_STYLE}
        title="Page summaries"
        onClick={props.handleOpenOverview}>
        Overview
      </Btn>
      {props.children}
      <Btn id="browser-minimize"
        className={WINDOW_CONTROL_BUTTONS_STYLE}
        title="Minimize"
        image="glyph-window-minimize-16.svg"
        imgWidth="18px"
        imgHeight="18px"
        imgPosition="center 4px"
        onClick={props.handleMinimize} />
      <Btn id="browser-maximize"
        className={WINDOW_CONTROL_BUTTONS_STYLE}
        title="Maximize"
        image="glyph-window-maximize-16.svg"
        imgWidth="18px"
        imgHeight="18px"
        imgPosition="center bottom"
        onClick={props.handleMaximize} />
      <Btn id="browser-close"
        className={WINDOW_CONTROL_BUTTONS_STYLE}
        title="Close"
        image="glyph-window-close-16.svg"
        imgWidth="18px"
        imgHeight="18px"
        imgPosition="center bottom"
        onClick={props.handleClose} />
    </div>
  );
};

Decorations.displayName = 'Decorations';

Decorations.propTypes = {
  handleOpenMenu: PropTypes.func.isRequired,
  handleOpenOverview: PropTypes.func.isRequired,
  handleMinimize: PropTypes.func.isRequired,
  handleMaximize: PropTypes.func.isRequired,
  handleClose: PropTypes.func.isRequired,
  children: PropTypes.oneOfType([
    PropTypes.arrayOf(PropTypes.node),
    PropTypes.node,
  ]),
};

export default Decorations;
{'fraction_non_alphanumeric': 0.11704384724186705, 'fraction_numerical': 0.014144271570014143, 'mean_word_length': 3.3582434514637907, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5990288', 'n_tokens_mistral': 1774, 'n_tokens_neox': 1706, 'n_words': 395}