<commit_before><!DOCTYPE html>
<html>
  <head>
    <title>Hello React</title>

    <link rel="stylesheet" href="thirdparty/bootstrap.min.css" type="text/css" />
    <link rel="stylesheet" href="css/styles.css" type="text/css" />

    <script src="projects.json"></script>
    <script src="thirdparty/react.0.12.2.js"></script>
    <script src="thirdparty/JSXTransformer.0.12.2.js"></script>
    <script type="text/javascript" src="thirdparty/jquery.min.js" charset="utf-8"></script>
    <script type="text/javascript" src="thirdparty/bootstrap.min.js" charset="utf-8"></script>

  </head>
  <body>
    <h1> starting the page off right</h1>
    <div id="container">
    </div>
    <script type="text/jsx">


     var Container = React.createClass({
            getInitialState: function() {
              return {
                title: "Submit TimeSheet",
                projects: projects,
                currentProject : null
              };
            },
            updateCurrentProject: function(projectName) {
              console.log("updateCurrentProject " + projectName)
              this.setState({"currentProject" : projectName});
              console.log(this.state)
            },
            render: function() {
              return (
                <div id="mainView">
                  <p>{this.state.title}</p>
                  <ProjectList projects={this.state.projects} clickCurrentProject={this.updateCurrentProject}></ProjectList>
                   <ProjectView currentProject={this.state.currentProject}></ProjectView>
                </div>

              );
            }
        });


         var ProjectList = React.createClass({
            getInitialState: function() {
                return {
                    projects : []
                };
            },
            handleProjectShow: function(projectName) {
              console.log(projectName);
              this.props.clickCurrentProject(projectName);
            },
            render: function() {
                console.log(this.props)
                var loop = this.props.projects.map(function (e) {
                      return (
                            <ProjectName name={e.name} handleProjectShow={this.handleProjectShow}></ProjectName>
                        );
                    }, this);
                return (
                    <div id="ProjectList">
                        <p>Project List</p>
                        {loop}
                    </div>
            );
            }
         });

         var ProjectName = React.createClass({
            handleProjectShow: function() {
              console.log(this.props.name);
              this.props.handleProjectShow(this.props.name);
            },
            render: function() {
              return (
                <h3 className="project-title" onClick={this.handleProjectShow}>project - {this.props.name}</h3>
                )
            }
         });

         var ProjectView = React.createClass({
            getInitialState: function() {
                return {
                };
            },
            render: function() {
              return (
                <div id="ProjectView">
                current project :{this.props.currentProject}
                </div>
              );
            }
         });


        React.render(
          <Container />,
        document.getElementById('container')
      );
    </script>
  </body><commit_msg>pass whole project over as variable<commit_after><!DOCTYPE html>
<html>
  <head>
    <title>Hello React</title>

    <link rel="stylesheet" href="thirdparty/bootstrap.min.css" type="text/css" />
    <link rel="stylesheet" href="css/styles.css" type="text/css" />

    <script src="projects.json"></script>
    <script src="thirdparty/react.0.12.2.js"></script>
    <script src="thirdparty/JSXTransformer.0.12.2.js"></script>
    <script type="text/javascript" src="thirdparty/jquery.min.js" charset="utf-8"></script>
    <script type="text/javascript" src="thirdparty/bootstrap.min.js" charset="utf-8"></script>

  </head>
  <body>
    <h1> starting the page off right</h1>
    <div id="container">
    </div>
    <script type="text/jsx">


     var Container = React.createClass({
            getInitialState: function() {
              return {
                title: "Submit TimeSheet",
                projects: projects,
                currentProject : projects[0]
              };
            },
            updateCurrentProject: function(projectName) {
              console.log("updateCurrentProject " + projectName)

              // this.state.projects.map(function (e) {
              //   if (e.name == projectName) {
              //     console.log("found it")
              //     console.log(e)

              //   }

              // });

              for (var i = 0; i < this.state.projects.length; i++) {
                if (this.state.projects[i].name ==projectName) {
                  console.log(this.state.projects[i])
                  this.setState({"currentProject" : this.state.projects[i]});
                  break;
                }
              }


              // this.setState({"currentProject" : projectName});
              // console.log(this.state)
            },
            render: function() {
              return (
                <div id="mainView">
                  <p>{this.state.title}</p>
                  <ProjectList projects={this.state.projects} clickCurrentProject={this.updateCurrentProject}></ProjectList>
                   <ProjectView currentProject={this.state.currentProject}></ProjectView>
                </div>

              );
            }
        });


         var ProjectList = React.createClass({
            getInitialState: function() {
                return {
                    projects : []
                };
            },
            handleProjectShow: function(projectName) {
              console.log(projectName);
              this.props.clickCurrentProject(projectName);
            },
            render: function() {
                console.log(this.props)
                var loop = this.props.projects.map(function (e) {
                      return (
                            <ProjectName name={e.name} handleProjectShow={this.handleProjectShow}></ProjectName>
                        );
                    }, this);
                return (
                    <div id="ProjectList">
                        <p>Project List</p>
                        {loop}
                    </div>
            );
            }
         });

         var ProjectName = React.createClass({
            handleProjectShow: function() {
              console.log(this.props.name);
              this.props.handleProjectShow(this.props.name);
            },
            render: function() {
              return (
                <h3 className="project-title" onClick={this.handleProjectShow}>project - {this.props.name}</h3>
                )
            }
         });

         var ProjectView = React.createClass({
            getInitialState: function() {
                return {
                };
            },
            render: function() {
              return (
                <div id="ProjectView">
                  <p>current project :{this.props.currentProject}</p>
                  <p>color {this.props.currentProject.color} </p>
                </div>
              );
            }
         });


        React.render(
          <Container />,
        document.getElementById('container')
      );
    </script>
  </body>
{'fraction_non_alphanumeric': 0.12852623253361456, 'fraction_numerical': 0.003954653308726601, 'mean_word_length': 1.3739048811013768, 'pattern_counts': {'":': 0, '<': 98, '<?xml version=': 0, '>': 97, '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': '6359916', 'n_tokens_mistral': 1961, 'n_tokens_neox': 1860, 'n_words': 303}