Tidying up after upstream fetch ready for PR

This commit is contained in:
Michael Cook 2017-08-29 12:24:03 +01:00
parent d273c032f1
commit 057d71f2c9
6 changed files with 6313 additions and 190 deletions

View File

@ -12,7 +12,7 @@ Check out my [blog](https://nikolaskama.me/) and follow me on [Twitter](https://
## Contents
## [View the sortable version](https://entozoon.github.io/movies-for-hackers/)
## [View the sortable version](https://k4m4.github.io/movies-for-hackers/)
- [Movies For Hackers](#movies-for-hackers)
- [Thrillers/Drama](#thrillers--drama)

6136
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -15,13 +15,13 @@ var client = new XMLHttpRequest(),
*/
const parseNowt = (cell, row) => {
return cell;
}
};
const parseTheImdb = (cell, row) => {
// Make it like 7.1 rather than 7.1/10, we all know what it's out of.
if (cell != null) {
return cell.replace('/10', '');
}
}
};
class Table extends React.Component {
// Runs on init
@ -35,8 +35,8 @@ class Table extends React.Component {
// Create table headers (the rest is all handled by the plugin)
headers.map((header, i) => {
let isFirstItem = (i == 0),
parseImdb = (header == 'rating')
let isFirstItem = i == 0,
parseImdb = header == 'rating';
this.columns.push(
<TableHeaderColumn
key={i}
@ -54,10 +54,7 @@ class Table extends React.Component {
// Runs on render
render() {
return (
<BootstrapTable
data={this.movies}
hover={true}
>
<BootstrapTable data={this.movies} hover={true}>
{this.columns}
</BootstrapTable>
);
@ -103,7 +100,7 @@ objectifyMarkdownNotWomen.table = function(header, body) {
client.open('GET', window.location.href + 'README.md');
client.onreadystatechange = function(e) {
// Wipe movies, collections and content as this'll run a bunch of times
document.getElementById("root").innerHTML = '';
document.getElementById('root').innerHTML = '';
moviesCollection = [];
movies = [{}];
@ -112,9 +109,12 @@ client.onreadystatechange = function(e) {
marked("## Thrillers / Drama\n\n| MOVIE | GENRE | YEAR | RATING |\n|--------------------------------------------------------------------------------------------|---------------------------|------|--------|\n| [WarGames: The Dead Code](http://www.imdb.com/title/tt0865957/) | Thriller/Drama | 2008 | 4.5/10 |\n| [WarGames](http://www.imdb.com/title/tt0086567/) | Thriller/Drama | 1983 | 7.1/10 |\n| [Hackers](http://www.imdb.com/title/tt0113243/) | Crime/Drama | 1995 | 6.2/10 |\n\n## Science Fiction / Fantasy\n\n| MOVIE | GENRE | YEAR | RATING |\n|--------------------------------------------------------------------------------------------|---------------------------|------|--------|\n| [The Matrix](http://www.imdb.com/title/tt0133093/) | Fantasy/Action | 1999 | 8.7/10 |\n| [The Lawnmower Man](http://www.imdb.com/title/tt0104692/) | Fantasy/Action | 1992 | 5.4/10 |", {
*/
marked(client.responseText, {
marked(
client.responseText,
{
renderer: objectifyMarkdownNotWomen
}, function() {
},
function() {
if (moviesCollection[0] == null) {
return;
}
@ -126,18 +126,21 @@ client.onreadystatechange = function(e) {
moviesCollection.map((movies, i) => {
moviesCollectionJSX.push(
<div key={i}>
<h2>{movies.heading}</h2>
<h2>
{movies.heading}
</h2>
<Table movies={movies.movies} />
</div>
)
);
});
ReactDOM.render(
<div>
{moviesCollectionJSX}
</div>,
document.getElementById("root")
document.getElementById('root')
);
}
);
});
};
client.send();

View File

@ -1,13 +1,9 @@
// Realistically, this would bring in bootstrap as a package and use it properly but this is a quick project.
$brand-primary: #ba4ee4;
$brand-secondary: #47c101;
$brand-tertiary: #15afd9;
$headings-color: $brand-primary;
$link-color: #df3968;
$border-color: adjust-color(
$brand-tertiary,
$lightness: -35%
);
$border-color: adjust-color($brand-tertiary, $lightness: -35%);
body {
font-size: calc(10px + .5vw);
padding: 0 0 30px;
@ -45,8 +41,7 @@ th {
margin: 0;
&,
& table {
// We can't do this because, unbelievably, the <th> elements are in a separate table :(
//table-layout: auto;
// We can't do this because, unbelievably, the <th> elements are in a separate table :( // table-layout: auto;
}
table {
td,
@ -78,10 +73,7 @@ th {
.table-hover {
> tbody {
> tr:hover {
background: adjust-color(
$brand-secondary,
$lightness: -35%
);
background: adjust-color($brand-secondary, $lightness: -35%);
}
}
}

View File

@ -1,8 +0,0 @@
@echo off
echo.
echo Pull from master - as it has the remote set by git remote add upstream https://github.com/k4m4/movies-for-hackers.git
echo.
git pull upstream master
git pull
git push
pause