mirror of
https://github.com/k4m4/movies-for-hackers.git
synced 2024-11-23 14:34:55 +00:00
Tidying up after upstream fetch ready for PR
This commit is contained in:
parent
d273c032f1
commit
057d71f2c9
@ -12,7 +12,7 @@ Check out my [blog](https://nikolaskama.me/) and follow me on [Twitter](https://
|
|||||||
|
|
||||||
## Contents
|
## 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)
|
- [Movies For Hackers](#movies-for-hackers)
|
||||||
- [Thrillers/Drama](#thrillers--drama)
|
- [Thrillers/Drama](#thrillers--drama)
|
||||||
|
6136
package-lock.json
generated
Normal file
6136
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -15,13 +15,13 @@ var client = new XMLHttpRequest(),
|
|||||||
*/
|
*/
|
||||||
const parseNowt = (cell, row) => {
|
const parseNowt = (cell, row) => {
|
||||||
return cell;
|
return cell;
|
||||||
}
|
};
|
||||||
const parseTheImdb = (cell, row) => {
|
const parseTheImdb = (cell, row) => {
|
||||||
// Make it like 7.1 rather than 7.1/10, we all know what it's out of.
|
// Make it like 7.1 rather than 7.1/10, we all know what it's out of.
|
||||||
if (cell != null) {
|
if (cell != null) {
|
||||||
return cell.replace('/10', '');
|
return cell.replace('/10', '');
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
class Table extends React.Component {
|
class Table extends React.Component {
|
||||||
// Runs on init
|
// Runs on init
|
||||||
@ -35,8 +35,8 @@ class Table extends React.Component {
|
|||||||
|
|
||||||
// Create table headers (the rest is all handled by the plugin)
|
// Create table headers (the rest is all handled by the plugin)
|
||||||
headers.map((header, i) => {
|
headers.map((header, i) => {
|
||||||
let isFirstItem = (i == 0),
|
let isFirstItem = i == 0,
|
||||||
parseImdb = (header == 'rating')
|
parseImdb = header == 'rating';
|
||||||
this.columns.push(
|
this.columns.push(
|
||||||
<TableHeaderColumn
|
<TableHeaderColumn
|
||||||
key={i}
|
key={i}
|
||||||
@ -54,10 +54,7 @@ class Table extends React.Component {
|
|||||||
// Runs on render
|
// Runs on render
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<BootstrapTable
|
<BootstrapTable data={this.movies} hover={true}>
|
||||||
data={this.movies}
|
|
||||||
hover={true}
|
|
||||||
>
|
|
||||||
{this.columns}
|
{this.columns}
|
||||||
</BootstrapTable>
|
</BootstrapTable>
|
||||||
);
|
);
|
||||||
@ -103,7 +100,7 @@ objectifyMarkdownNotWomen.table = function(header, body) {
|
|||||||
client.open('GET', window.location.href + 'README.md');
|
client.open('GET', window.location.href + 'README.md');
|
||||||
client.onreadystatechange = function(e) {
|
client.onreadystatechange = function(e) {
|
||||||
// Wipe movies, collections and content as this'll run a bunch of times
|
// Wipe movies, collections and content as this'll run a bunch of times
|
||||||
document.getElementById("root").innerHTML = '';
|
document.getElementById('root').innerHTML = '';
|
||||||
moviesCollection = [];
|
moviesCollection = [];
|
||||||
movies = [{}];
|
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("## 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
|
renderer: objectifyMarkdownNotWomen
|
||||||
}, function() {
|
},
|
||||||
|
function() {
|
||||||
if (moviesCollection[0] == null) {
|
if (moviesCollection[0] == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -126,18 +126,21 @@ client.onreadystatechange = function(e) {
|
|||||||
moviesCollection.map((movies, i) => {
|
moviesCollection.map((movies, i) => {
|
||||||
moviesCollectionJSX.push(
|
moviesCollectionJSX.push(
|
||||||
<div key={i}>
|
<div key={i}>
|
||||||
<h2>{movies.heading}</h2>
|
<h2>
|
||||||
|
{movies.heading}
|
||||||
|
</h2>
|
||||||
<Table movies={movies.movies} />
|
<Table movies={movies.movies} />
|
||||||
</div>
|
</div>
|
||||||
)
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
ReactDOM.render(
|
ReactDOM.render(
|
||||||
<div>
|
<div>
|
||||||
{moviesCollectionJSX}
|
{moviesCollectionJSX}
|
||||||
</div>,
|
</div>,
|
||||||
document.getElementById("root")
|
document.getElementById('root')
|
||||||
|
);
|
||||||
|
}
|
||||||
);
|
);
|
||||||
});
|
|
||||||
};
|
};
|
||||||
client.send();
|
client.send();
|
||||||
|
@ -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-primary: #ba4ee4;
|
||||||
$brand-secondary: #47c101;
|
$brand-secondary: #47c101;
|
||||||
$brand-tertiary: #15afd9;
|
$brand-tertiary: #15afd9;
|
||||||
$headings-color: $brand-primary;
|
$headings-color: $brand-primary;
|
||||||
$link-color: #df3968;
|
$link-color: #df3968;
|
||||||
$border-color: adjust-color(
|
$border-color: adjust-color($brand-tertiary, $lightness: -35%);
|
||||||
$brand-tertiary,
|
|
||||||
$lightness: -35%
|
|
||||||
);
|
|
||||||
body {
|
body {
|
||||||
font-size: calc(10px + .5vw);
|
font-size: calc(10px + .5vw);
|
||||||
padding: 0 0 30px;
|
padding: 0 0 30px;
|
||||||
@ -45,8 +41,7 @@ th {
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
&,
|
&,
|
||||||
& table {
|
& table {
|
||||||
// We can't do this because, unbelievably, the <th> elements are in a separate table :(
|
// We can't do this because, unbelievably, the <th> elements are in a separate table :( // table-layout: auto;
|
||||||
//table-layout: auto;
|
|
||||||
}
|
}
|
||||||
table {
|
table {
|
||||||
td,
|
td,
|
||||||
@ -78,10 +73,7 @@ th {
|
|||||||
.table-hover {
|
.table-hover {
|
||||||
> tbody {
|
> tbody {
|
||||||
> tr:hover {
|
> tr:hover {
|
||||||
background: adjust-color(
|
background: adjust-color($brand-secondary, $lightness: -35%);
|
||||||
$brand-secondary,
|
|
||||||
$lightness: -35%
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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
|
|
Loading…
Reference in New Issue
Block a user