mirror of
https://github.com/k4m4/movies-for-hackers.git
synced 2024-11-23 22:44:57 +00:00
Delete all gh-pages non-essential contents
This commit is contained in:
parent
e706a55f79
commit
f5dbe1886f
@ -1,20 +0,0 @@
|
|||||||
# Contribution Guidelines
|
|
||||||
|
|
||||||
## Please ensure your pull request adheres to the following guidelines:
|
|
||||||
|
|
||||||
* Make sure your submission is not a duplicate.
|
|
||||||
* Follow the appropriate format.
|
|
||||||
* Keep descriptions short and simple.
|
|
||||||
* End all descriptions with a full stop.
|
|
||||||
* Check your spelling and grammar.
|
|
||||||
* Make an individual pull request for each suggestion.
|
|
||||||
* The pull request and commit should have a useful title.
|
|
||||||
* Insert new suggestions at the bottom of a category.
|
|
||||||
* Use IMDb links & ratings.
|
|
||||||
|
|
||||||
|
|
||||||
Please note that this project is released with a [Contributor Code of Conduct](code-of-conduct.md).
|
|
||||||
By participating in this project you agree to abide by its terms.
|
|
||||||
|
|
||||||
Your contributions are much appreciated.
|
|
||||||
Thank you for your suggestions!
|
|
116
LICENSE.md
116
LICENSE.md
@ -1,116 +0,0 @@
|
|||||||
CC0 1.0 Universal
|
|
||||||
|
|
||||||
Statement of Purpose
|
|
||||||
|
|
||||||
The laws of most jurisdictions throughout the world automatically confer
|
|
||||||
exclusive Copyright and Related Rights (defined below) upon the creator and
|
|
||||||
subsequent owner(s) (each and all, an "owner") of an original work of
|
|
||||||
authorship and/or a database (each, a "Work").
|
|
||||||
|
|
||||||
Certain owners wish to permanently relinquish those rights to a Work for the
|
|
||||||
purpose of contributing to a commons of creative, cultural and scientific
|
|
||||||
works ("Commons") that the public can reliably and without fear of later
|
|
||||||
claims of infringement build upon, modify, incorporate in other works, reuse
|
|
||||||
and redistribute as freely as possible in any form whatsoever and for any
|
|
||||||
purposes, including without limitation commercial purposes. These owners may
|
|
||||||
contribute to the Commons to promote the ideal of a free culture and the
|
|
||||||
further production of creative, cultural and scientific works, or to gain
|
|
||||||
reputation or greater distribution for their Work in part through the use and
|
|
||||||
efforts of others.
|
|
||||||
|
|
||||||
For these and/or other purposes and motivations, and without any expectation
|
|
||||||
of additional consideration or compensation, the person associating CC0 with a
|
|
||||||
Work (the "Affirmer"), to the extent that he or she is an owner of Copyright
|
|
||||||
and Related Rights in the Work, voluntarily elects to apply CC0 to the Work
|
|
||||||
and publicly distribute the Work under its terms, with knowledge of his or her
|
|
||||||
Copyright and Related Rights in the Work and the meaning and intended legal
|
|
||||||
effect of CC0 on those rights.
|
|
||||||
|
|
||||||
1. Copyright and Related Rights. A Work made available under CC0 may be
|
|
||||||
protected by copyright and related or neighboring rights ("Copyright and
|
|
||||||
Related Rights"). Copyright and Related Rights include, but are not limited
|
|
||||||
to, the following:
|
|
||||||
|
|
||||||
i. the right to reproduce, adapt, distribute, perform, display, communicate,
|
|
||||||
and translate a Work;
|
|
||||||
|
|
||||||
ii. moral rights retained by the original author(s) and/or performer(s);
|
|
||||||
|
|
||||||
iii. publicity and privacy rights pertaining to a person's image or likeness
|
|
||||||
depicted in a Work;
|
|
||||||
|
|
||||||
iv. rights protecting against unfair competition in regards to a Work,
|
|
||||||
subject to the limitations in paragraph 4(a), below;
|
|
||||||
|
|
||||||
v. rights protecting the extraction, dissemination, use and reuse of data in
|
|
||||||
a Work;
|
|
||||||
|
|
||||||
vi. database rights (such as those arising under Directive 96/9/EC of the
|
|
||||||
European Parliament and of the Council of 11 March 1996 on the legal
|
|
||||||
protection of databases, and under any national implementation thereof,
|
|
||||||
including any amended or successor version of such directive); and
|
|
||||||
|
|
||||||
vii. other similar, equivalent or corresponding rights throughout the world
|
|
||||||
based on applicable law or treaty, and any national implementations thereof.
|
|
||||||
|
|
||||||
2. Waiver. To the greatest extent permitted by, but not in contravention of,
|
|
||||||
applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and
|
|
||||||
unconditionally waives, abandons, and surrenders all of Affirmer's Copyright
|
|
||||||
and Related Rights and associated claims and causes of action, whether now
|
|
||||||
known or unknown (including existing as well as future claims and causes of
|
|
||||||
action), in the Work (i) in all territories worldwide, (ii) for the maximum
|
|
||||||
duration provided by applicable law or treaty (including future time
|
|
||||||
extensions), (iii) in any current or future medium and for any number of
|
|
||||||
copies, and (iv) for any purpose whatsoever, including without limitation
|
|
||||||
commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes
|
|
||||||
the Waiver for the benefit of each member of the public at large and to the
|
|
||||||
detriment of Affirmer's heirs and successors, fully intending that such Waiver
|
|
||||||
shall not be subject to revocation, rescission, cancellation, termination, or
|
|
||||||
any other legal or equitable action to disrupt the quiet enjoyment of the Work
|
|
||||||
by the public as contemplated by Affirmer's express Statement of Purpose.
|
|
||||||
|
|
||||||
3. Public License Fallback. Should any part of the Waiver for any reason be
|
|
||||||
judged legally invalid or ineffective under applicable law, then the Waiver
|
|
||||||
shall be preserved to the maximum extent permitted taking into account
|
|
||||||
Affirmer's express Statement of Purpose. In addition, to the extent the Waiver
|
|
||||||
is so judged Affirmer hereby grants to each affected person a royalty-free,
|
|
||||||
non transferable, non sublicensable, non exclusive, irrevocable and
|
|
||||||
unconditional license to exercise Affirmer's Copyright and Related Rights in
|
|
||||||
the Work (i) in all territories worldwide, (ii) for the maximum duration
|
|
||||||
provided by applicable law or treaty (including future time extensions), (iii)
|
|
||||||
in any current or future medium and for any number of copies, and (iv) for any
|
|
||||||
purpose whatsoever, including without limitation commercial, advertising or
|
|
||||||
promotional purposes (the "License"). The License shall be deemed effective as
|
|
||||||
of the date CC0 was applied by Affirmer to the Work. Should any part of the
|
|
||||||
License for any reason be judged legally invalid or ineffective under
|
|
||||||
applicable law, such partial invalidity or ineffectiveness shall not
|
|
||||||
invalidate the remainder of the License, and in such case Affirmer hereby
|
|
||||||
affirms that he or she will not (i) exercise any of his or her remaining
|
|
||||||
Copyright and Related Rights in the Work or (ii) assert any associated claims
|
|
||||||
and causes of action with respect to the Work, in either case contrary to
|
|
||||||
Affirmer's express Statement of Purpose.
|
|
||||||
|
|
||||||
4. Limitations and Disclaimers.
|
|
||||||
|
|
||||||
a. No trademark or patent rights held by Affirmer are waived, abandoned,
|
|
||||||
surrendered, licensed or otherwise affected by this document.
|
|
||||||
|
|
||||||
b. Affirmer offers the Work as-is and makes no representations or warranties
|
|
||||||
of any kind concerning the Work, express, implied, statutory or otherwise,
|
|
||||||
including without limitation warranties of title, merchantability, fitness
|
|
||||||
for a particular purpose, non infringement, or the absence of latent or
|
|
||||||
other defects, accuracy, or the present or absence of errors, whether or not
|
|
||||||
discoverable, all to the greatest extent permissible under applicable law.
|
|
||||||
|
|
||||||
c. Affirmer disclaims responsibility for clearing rights of other persons
|
|
||||||
that may apply to the Work or any use thereof, including without limitation
|
|
||||||
any person's Copyright and Related Rights in the Work. Further, Affirmer
|
|
||||||
disclaims responsibility for obtaining any necessary consents, permissions
|
|
||||||
or other rights required for any use of the Work.
|
|
||||||
|
|
||||||
d. Affirmer understands and acknowledges that Creative Commons is not a
|
|
||||||
party to this document and has no duty or obligation with respect to this
|
|
||||||
CC0 or use of the Work.
|
|
||||||
|
|
||||||
For more information, please see
|
|
||||||
<http://creativecommons.org/publicdomain/zero/1.0/>
|
|
@ -1,74 +0,0 @@
|
|||||||
# Contributor Covenant Code of Conduct
|
|
||||||
|
|
||||||
## Our Pledge
|
|
||||||
|
|
||||||
In the interest of fostering an open and welcoming environment, we as
|
|
||||||
contributors and maintainers pledge to making participation in our project and
|
|
||||||
our community a harassment-free experience for everyone, regardless of age, body
|
|
||||||
size, disability, ethnicity, gender identity and expression, level of experience,
|
|
||||||
nationality, personal appearance, race, religion, or sexual identity and
|
|
||||||
orientation.
|
|
||||||
|
|
||||||
## Our Standards
|
|
||||||
|
|
||||||
Examples of behavior that contributes to creating a positive environment
|
|
||||||
include:
|
|
||||||
|
|
||||||
* Using welcoming and inclusive language
|
|
||||||
* Being respectful of differing viewpoints and experiences
|
|
||||||
* Gracefully accepting constructive criticism
|
|
||||||
* Focusing on what is best for the community
|
|
||||||
* Showing empathy towards other community members
|
|
||||||
|
|
||||||
Examples of unacceptable behavior by participants include:
|
|
||||||
|
|
||||||
* The use of sexualized language or imagery and unwelcome sexual attention or
|
|
||||||
advances
|
|
||||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
|
||||||
* Public or private harassment
|
|
||||||
* Publishing others' private information, such as a physical or electronic
|
|
||||||
address, without explicit permission
|
|
||||||
* Other conduct which could reasonably be considered inappropriate in a
|
|
||||||
professional setting
|
|
||||||
|
|
||||||
## Our Responsibilities
|
|
||||||
|
|
||||||
Project maintainers are responsible for clarifying the standards of acceptable
|
|
||||||
behavior and are expected to take appropriate and fair corrective action in
|
|
||||||
response to any instances of unacceptable behavior.
|
|
||||||
|
|
||||||
Project maintainers have the right and responsibility to remove, edit, or
|
|
||||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
|
||||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
|
||||||
permanently any contributor for other behaviors that they deem inappropriate,
|
|
||||||
threatening, offensive, or harmful.
|
|
||||||
|
|
||||||
## Scope
|
|
||||||
|
|
||||||
This Code of Conduct applies both within project spaces and in public spaces
|
|
||||||
when an individual is representing the project or its community. Examples of
|
|
||||||
representing a project or community include using an official project e-mail
|
|
||||||
address, posting via an official social media account, or acting as an appointed
|
|
||||||
representative at an online or offline event. Representation of a project may be
|
|
||||||
further defined and clarified by project maintainers.
|
|
||||||
|
|
||||||
## Enforcement
|
|
||||||
|
|
||||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
||||||
reported by contacting the project team at nikolaskam@gmail.com. All
|
|
||||||
complaints will be reviewed and investigated and will result in a response that
|
|
||||||
is deemed necessary and appropriate to the circumstances. The project team is
|
|
||||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
|
||||||
Further details of specific enforcement policies may be posted separately.
|
|
||||||
|
|
||||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
|
||||||
faith may face temporary or permanent repercussions as determined by other
|
|
||||||
members of the project's leadership.
|
|
||||||
|
|
||||||
## Attribution
|
|
||||||
|
|
||||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
|
||||||
available at [http://contributor-covenant.org/version/1/4][version]
|
|
||||||
|
|
||||||
[homepage]: http://contributor-covenant.org
|
|
||||||
[version]: http://contributor-covenant.org/version/1/4/
|
|
1
dist/css/app.css
vendored
1
dist/css/app.css
vendored
@ -1 +0,0 @@
|
|||||||
body{font-size:calc(10px + .5vw);padding:0 0 30px;font-family:Play,sans-serif;background:#000;color:#47c101}.container-fluid{max-width:1440px;overflow:auto}h1,h2,h3{color:#ba4ee4}h2{font-size:20px}a{color:#df3968}a:hover{color:#fff}th{position:relative;text-transform:capitalize;background:#052c36;color:#15afd9}.react-bs-table{border:1px solid #052c36;border-radius:2px;margin:0}.react-bs-table table td,.react-bs-table table th{white-space:normal;word-break:break-word}.table>tbody>tr>td,.table>tbody>tr>th,.table>tfoot>tr>td,.table>tfoot>tr>th,.table>thead>tr>td,.table>thead>tr>th{border-color:#052c36;padding:1px calc(0px + 1vw)}.table>tbody>tr>th,.table>tfoot>tr>th,.table>thead>tr>th{padding-right:20px}.table-hover>tbody>tr:hover{background:#060f00}td:nth-child(1),th:nth-child(1){width:50%}td:nth-child(2),th:nth-child(2){width:22%}td:nth-child(3),th:nth-child(3){width:14%}td:nth-child(4),th:nth-child(4){width:14%}.order{position:absolute;top:1px;right:3px}
|
|
1
dist/js/app.js
vendored
1
dist/js/app.js
vendored
@ -1 +0,0 @@
|
|||||||
"use strict";function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var _createClass=function(){function e(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),client=new XMLHttpRequest,objectifyMarkdownNotWomen=new marked.Renderer,moviesCollection,movies,cellCounter=0,lastHeading="",headers=["movie","genre","year","rating"],parseNowt=function(e,t){return e},parseTheImdb=function(e,t){if(null!=e)return e.replace("/10","")},Table=function(e){function t(e){_classCallCheck(this,t);var o=_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return o.movies=e.movies,o.columns=[],headers.map(function(e,t){var n=0==t,r="rating"==e;o.columns.push(React.createElement(TableHeaderColumn,{key:t,isKey:n,dataFormat:r?parseTheImdb:parseNowt,dataField:e,dataSort:!0},e))}),o}return _inherits(t,e),_createClass(t,[{key:"render",value:function(){return React.createElement(BootstrapTable,{data:this.movies,hover:!0},this.columns)}}]),t}(React.Component);objectifyMarkdownNotWomen.heading=function(e,t){lastHeading=e},objectifyMarkdownNotWomen.tablerow=function(e){cellCounter=0,movies.push({})},objectifyMarkdownNotWomen.tablecell=function(e,t){movies[movies.length-1][headers[cellCounter]]=e,cellCounter++},objectifyMarkdownNotWomen.table=function(e,t){movies[0][headers[0]].toLowerCase()==headers[0]&&movies.splice(0,1),null==movies[movies.length-1][headers[0]]&&movies.pop(),moviesCollection.push({heading:lastHeading,movies:movies}),movies=[{}]},client.open("GET",window.location.href+"README.md"),client.onreadystatechange=function(e){document.getElementById("root").innerHTML="",moviesCollection=[],movies=[{}],marked(client.responseText,{renderer:objectifyMarkdownNotWomen},function(){if(null!=moviesCollection[0]){console.log(moviesCollection);var e=[];moviesCollection.map(function(t,o){e.push(React.createElement("div",{key:o},React.createElement("h2",null,t.heading),React.createElement(Table,{movies:t.movies})))}),ReactDOM.render(React.createElement("div",null,e),document.getElementById("root"))}})},client.send();
|
|
29
index.html
29
index.html
@ -1,29 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<title>Movies for Hackers</title>
|
|
||||||
<meta name="description" content="movies-for-hackers - 🎬 A curated list of movies every hacker & cyberpunk must watch.">
|
|
||||||
<meta name="viewport" content="initial-scale=0.75"/>
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Play" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"/>
|
|
||||||
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/react-bootstrap-table/3.0.0/react-bootstrap-table-all.min.css"/>
|
|
||||||
<link rel="stylesheet" type="text/css" href="dist/css/app.css"/>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<div class="container-fluid">
|
|
||||||
<h1>Movies For Hackers</h1>
|
|
||||||
|
|
||||||
<p>Every aspiring hacker & cyberpunk must watch these movies - drawing directly from the impressive <a href="https://github.com/k4m4/movies-for-hackers">curated list</a> from <a href="https://github.com/k4m4">Nikolaos Kamarinakis</a></p>
|
|
||||||
|
|
||||||
<div id="root"></div>
|
|
||||||
|
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.3.1/react.js"></script>
|
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.3.1/react-dom.js"></script>
|
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-bootstrap-table/3.0.0/react-bootstrap-table.js"></script>
|
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/marked/0.3.6/marked.min.js"></script>
|
|
||||||
<script src="dist/js/app.js"></script>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1,22 +0,0 @@
|
|||||||
{
|
|
||||||
"css": [
|
|
||||||
{
|
|
||||||
"watch": [
|
|
||||||
"src/scss/**/*.scss"
|
|
||||||
],
|
|
||||||
"src": "src/scss/app.scss",
|
|
||||||
"dest": "./dist/css",
|
|
||||||
"filename": "app.css"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"js": [
|
|
||||||
{
|
|
||||||
"watch": [
|
|
||||||
"src/js/**/*.js"
|
|
||||||
],
|
|
||||||
"src": "src/js/app.js",
|
|
||||||
"dest": "dist/js",
|
|
||||||
"filename": "app.js"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,42 +0,0 @@
|
|||||||
version=0.1
|
|
||||||
|
|
||||||
#Colors
|
|
||||||
white="\033[1;37m"
|
|
||||||
grey="\033[0;37m"
|
|
||||||
purple="\033[0;35m"
|
|
||||||
red="\033[1;31m"
|
|
||||||
green="\033[1;32m"
|
|
||||||
yellow="\033[1;33m"
|
|
||||||
Purple="\033[0;35m"
|
|
||||||
Cyan="\033[0;36m"
|
|
||||||
Cafe="\033[0;33m"
|
|
||||||
Fiuscha="\033[0;35m"
|
|
||||||
blue="\033[1;34m"
|
|
||||||
transparent="\e[0m"
|
|
||||||
|
|
||||||
clear; echo ""
|
|
||||||
sleep 0.01 && echo "$purple "
|
|
||||||
sleep 0.2 && echo " ███╗ ███╗ ██████╗ ██╗ ██╗██╗███████╗███████╗ "
|
|
||||||
sleep 0.2 && echo " ████╗ ████║██╔═══██╗██║ ██║██║██╔════╝██╔════╝ "
|
|
||||||
sleep 0.2 && echo " ██╔████╔██║██║ ██║██║ ██║██║█████╗ ███████╗ "
|
|
||||||
sleep 0.2 && echo " ██║╚██╔╝██║██║ ██║╚██╗ ██╔╝██║██╔══╝ ╚════██║ "
|
|
||||||
sleep 0.2 && echo " ██║ ╚═╝ ██║╚██████╔╝ ╚████╔╝ ██║███████╗███████║ "
|
|
||||||
sleep 0.2 && echo " ╚═╝ ╚═╝ ╚═════╝ ╚═══╝ ╚═╝╚══════╝╚══════╝ "
|
|
||||||
|
|
||||||
echo ""
|
|
||||||
sleep 0.2 && echo " ███████╗ ██████╗ ██████╗ ██╗ ██╗ █████╗ ██████╗██╗ ██╗███████╗██████╗ ███████╗ "
|
|
||||||
sleep 0.2 && echo " ██╔════╝██╔═══██╗██╔══██╗ ██║ ██║██╔══██╗██╔════╝██║ ██╔╝██╔════╝██╔══██╗██╔════╝ "
|
|
||||||
sleep 0.2 && echo " █████╗ ██║ ██║██████╔╝ ███████║███████║██║ █████╔╝ █████╗ ██████╔╝███████╗ "
|
|
||||||
sleep 0.2 && echo " ██╔══╝ ██║ ██║██╔══██╗ ██╔══██║██╔══██║██║ ██╔═██╗ ██╔══╝ ██╔══██╗╚════██║ "
|
|
||||||
sleep 0.2 && echo " ██║ ╚██████╔╝██║ ██║ ██║ ██║██║ ██║╚██████╗██║ ██╗███████╗██║ ██║███████║ "
|
|
||||||
sleep 0.2 && echo " ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚══════╝ "
|
|
||||||
|
|
||||||
echo ""
|
|
||||||
|
|
||||||
sleep 0.1
|
|
||||||
echo $green" A list of movies every hacker & cyberpunk must watch ("$red"Movies For Hackers"$green")"
|
|
||||||
sleep 0.1
|
|
||||||
echo $blue " Made with <3 by:"$green" Nikolaos Kamarinakis ("$red"k4m4"$green")"
|
|
||||||
sleep 0.1
|
|
||||||
|
|
||||||
echo ""
|
|
6136
package-lock.json
generated
6136
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"dependencies": {
|
|
||||||
"babel-preset-react": "^6.23.0",
|
|
||||||
"lapis-compiler": "^1.5.7"
|
|
||||||
}
|
|
||||||
}
|
|
146
src/js/app.js
146
src/js/app.js
@ -1,146 +0,0 @@
|
|||||||
/**
|
|
||||||
* Vars
|
|
||||||
*/
|
|
||||||
var client = new XMLHttpRequest(),
|
|
||||||
objectifyMarkdownNotWomen = new marked.Renderer(),
|
|
||||||
moviesCollection,
|
|
||||||
movies,
|
|
||||||
cellCounter = 0,
|
|
||||||
lastHeading = '',
|
|
||||||
headers = ['movie', 'genre', 'year', 'rating'];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* React Table Component
|
|
||||||
* Using https://github.com/AllenFang/react-bootstrap-table
|
|
||||||
*/
|
|
||||||
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
|
|
||||||
constructor(props) {
|
|
||||||
// pass props to the base constructor:
|
|
||||||
super(props);
|
|
||||||
|
|
||||||
this.movies = props.movies;
|
|
||||||
|
|
||||||
this.columns = [];
|
|
||||||
|
|
||||||
// Create table headers (the rest is all handled by the plugin)
|
|
||||||
headers.map((header, i) => {
|
|
||||||
let isFirstItem = i == 0,
|
|
||||||
parseImdb = header == 'rating';
|
|
||||||
this.columns.push(
|
|
||||||
<TableHeaderColumn
|
|
||||||
key={i}
|
|
||||||
isKey={isFirstItem}
|
|
||||||
dataFormat={parseImdb ? parseTheImdb : parseNowt}
|
|
||||||
dataField={header}
|
|
||||||
dataSort={true}
|
|
||||||
>
|
|
||||||
{header}
|
|
||||||
</TableHeaderColumn>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Runs on render
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<BootstrapTable data={this.movies} hover={true}>
|
|
||||||
{this.columns}
|
|
||||||
</BootstrapTable>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Custom renderer for Marked plugin
|
|
||||||
* Turning the parsed markdown into an array of objects
|
|
||||||
*/
|
|
||||||
objectifyMarkdownNotWomen.heading = function(heading, level) {
|
|
||||||
lastHeading = heading;
|
|
||||||
};
|
|
||||||
|
|
||||||
objectifyMarkdownNotWomen.tablerow = function(content) {
|
|
||||||
cellCounter = 0;
|
|
||||||
movies.push({});
|
|
||||||
};
|
|
||||||
|
|
||||||
objectifyMarkdownNotWomen.tablecell = function(content, flags) {
|
|
||||||
movies[movies.length - 1][headers[cellCounter]] = content;
|
|
||||||
cellCounter++;
|
|
||||||
};
|
|
||||||
|
|
||||||
objectifyMarkdownNotWomen.table = function(header, body) {
|
|
||||||
// Test if the first movie object is actually just the headers (which it will be)
|
|
||||||
if (movies[0][headers[0]].toLowerCase() == headers[0]) {
|
|
||||||
movies.splice(0, 1);
|
|
||||||
}
|
|
||||||
// Similarly, test if the very last movie object is empty and pop it
|
|
||||||
if (movies[movies.length - 1][headers[0]] == null) {
|
|
||||||
movies.pop();
|
|
||||||
}
|
|
||||||
// Add movies to collection
|
|
||||||
moviesCollection.push({
|
|
||||||
heading: lastHeading,
|
|
||||||
movies: movies
|
|
||||||
});
|
|
||||||
movies = [{}];
|
|
||||||
};
|
|
||||||
|
|
||||||
// Ajax the markdown file with all movie data
|
|
||||||
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 = '';
|
|
||||||
moviesCollection = [];
|
|
||||||
movies = [{}];
|
|
||||||
|
|
||||||
/*
|
|
||||||
// Test markdown:
|
|
||||||
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,
|
|
||||||
{
|
|
||||||
renderer: objectifyMarkdownNotWomen
|
|
||||||
},
|
|
||||||
function() {
|
|
||||||
if (moviesCollection[0] == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
console.log(moviesCollection);
|
|
||||||
//document.body.innerHTML = JSON.stringify(moviesCollection);
|
|
||||||
|
|
||||||
// Create JSX for tables of each set of movies in moviesCollection
|
|
||||||
var moviesCollectionJSX = [];
|
|
||||||
moviesCollection.map((movies, i) => {
|
|
||||||
moviesCollectionJSX.push(
|
|
||||||
<div key={i}>
|
|
||||||
<h2>
|
|
||||||
{movies.heading}
|
|
||||||
</h2>
|
|
||||||
<Table movies={movies.movies} />
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
ReactDOM.render(
|
|
||||||
<div>
|
|
||||||
{moviesCollectionJSX}
|
|
||||||
</div>,
|
|
||||||
document.getElementById('root')
|
|
||||||
);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
};
|
|
||||||
client.send();
|
|
@ -1,100 +0,0 @@
|
|||||||
$brand-primary: #ba4ee4;
|
|
||||||
$brand-secondary: #47c101;
|
|
||||||
$brand-tertiary: #15afd9;
|
|
||||||
$headings-color: $brand-primary;
|
|
||||||
$link-color: #df3968;
|
|
||||||
$border-color: adjust-color($brand-tertiary, $lightness: -35%);
|
|
||||||
body {
|
|
||||||
font-size: calc(10px + .5vw);
|
|
||||||
padding: 0 0 30px;
|
|
||||||
font-family: 'Play', sans-serif;
|
|
||||||
background: black;
|
|
||||||
color: $brand-secondary;
|
|
||||||
}
|
|
||||||
.container-fluid {
|
|
||||||
max-width: 1440px;
|
|
||||||
overflow: auto;
|
|
||||||
}
|
|
||||||
h1,
|
|
||||||
h2,
|
|
||||||
h3 {
|
|
||||||
color: $headings-color;
|
|
||||||
}
|
|
||||||
h2 {
|
|
||||||
font-size: 20px;
|
|
||||||
}
|
|
||||||
a {
|
|
||||||
color: $link-color;
|
|
||||||
&:hover {
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
th {
|
|
||||||
position: relative;
|
|
||||||
text-transform: capitalize;
|
|
||||||
background: $border-color;
|
|
||||||
color: $brand-tertiary;
|
|
||||||
}
|
|
||||||
.react-bs-table {
|
|
||||||
border: 1px solid $border-color;
|
|
||||||
border-radius: 2px;
|
|
||||||
margin: 0;
|
|
||||||
&,
|
|
||||||
& table {
|
|
||||||
// We can't do this because, unbelievably, the <th> elements are in a separate table :( // table-layout: auto;
|
|
||||||
}
|
|
||||||
table {
|
|
||||||
td,
|
|
||||||
th {
|
|
||||||
// Override some bananas styles
|
|
||||||
// Why did they think nowrap was a smart idea? Fuck mobiles, right?
|
|
||||||
white-space: normal;
|
|
||||||
word-break: break-word;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.table {
|
|
||||||
// Cells
|
|
||||||
> thead,
|
|
||||||
> tbody,
|
|
||||||
> tfoot {
|
|
||||||
> tr {
|
|
||||||
> th,
|
|
||||||
> td {
|
|
||||||
border-color: $border-color;
|
|
||||||
padding: 1px calc(0px + 1vw);
|
|
||||||
}
|
|
||||||
> th {
|
|
||||||
padding-right: 20px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.table-hover {
|
|
||||||
> tbody {
|
|
||||||
> tr:hover {
|
|
||||||
background: adjust-color($brand-secondary, $lightness: -35%);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Quick solution to the forced table-layout: fixed
|
|
||||||
th,
|
|
||||||
td {
|
|
||||||
&:nth-child(1) {
|
|
||||||
width: 50%;
|
|
||||||
}
|
|
||||||
&:nth-child(2) {
|
|
||||||
width: 22%;
|
|
||||||
}
|
|
||||||
&:nth-child(3) {
|
|
||||||
width: 14%;
|
|
||||||
}
|
|
||||||
&:nth-child(4) {
|
|
||||||
width: 14%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.order {
|
|
||||||
position: absolute;
|
|
||||||
top: 1px;
|
|
||||||
right: 3px;
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user