Showing
26 changed files
with
401 additions
and
0 deletions
.gitignore
0 → 100644
1 | +node_modules |
Chrome-App/getSource.js
0 → 100644
Chrome-App/icon.png
0 → 100644

1001 Bytes
Chrome-App/manifest.json
0 → 100644
Chrome-App/popup.html
0 → 100644
Chrome-App/popup.js
0 → 100644
1 | +chrome.extension.onMessage.addListener(function(request, sender) { | ||
2 | + if (request.action == "getSource") { | ||
3 | + document.body.innerText = request.source; | ||
4 | + } | ||
5 | +}); | ||
6 | + | ||
7 | +function onWindowLoad() { | ||
8 | + chrome.tabs.executeScript(null, { | ||
9 | + file: "getSource.js" | ||
10 | + }, function() { | ||
11 | + if (chrome.extension.lastError) { | ||
12 | + document.body.innerText = 'There was an error injecting script : \n' + chrome.extension.lastError.message; | ||
13 | + } | ||
14 | + }); | ||
15 | +} | ||
16 | +window.onload = onWindowLoad; |
Client/.gitignore
0 → 100644
Client/README.md
0 → 100644
This diff is collapsed. Click to expand it.
Client/package.json
0 → 100644
1 | +{ | ||
2 | + "name": "3line", | ||
3 | + "version": "0.1.0", | ||
4 | + "private": true, | ||
5 | + "devDependencies": { | ||
6 | + "react-scripts": "0.6.1" | ||
7 | + }, | ||
8 | + "dependencies": { | ||
9 | + "react": "^15.3.2", | ||
10 | + "react-dom": "^15.3.2" | ||
11 | + }, | ||
12 | + "scripts": { | ||
13 | + "start": "react-scripts start", | ||
14 | + "build": "react-scripts build", | ||
15 | + "test": "react-scripts test --env=jsdom", | ||
16 | + "eject": "react-scripts eject" | ||
17 | + } | ||
18 | +} |
Client/public/favicon.ico
0 → 100644
No preview for this file type
Client/public/index.html
0 → 100644
1 | +<!doctype html> | ||
2 | +<html lang="en"> | ||
3 | + <head> | ||
4 | + <meta charset="utf-8"> | ||
5 | + <meta name="viewport" content="width=device-width, initial-scale=1"> | ||
6 | + <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico"> | ||
7 | + <!-- | ||
8 | + Notice the use of %PUBLIC_URL% in the tag above. | ||
9 | + It will be replaced with the URL of the `public` folder during the build. | ||
10 | + Only files inside the `public` folder can be referenced from the HTML. | ||
11 | + | ||
12 | + Unlike "/favicon.ico" or "favico.ico", "%PUBLIC_URL%/favicon.ico" will | ||
13 | + work correctly both with client-side routing and a non-root public URL. | ||
14 | + Learn how to configure a non-root public URL by running `npm run build`. | ||
15 | + --> | ||
16 | + <title>React App</title> | ||
17 | + </head> | ||
18 | + <body> | ||
19 | + <div id="root"></div> | ||
20 | + <!-- | ||
21 | + This HTML file is a template. | ||
22 | + If you open it directly in the browser, you will see an empty page. | ||
23 | + | ||
24 | + You can add webfonts, meta tags, or analytics to this file. | ||
25 | + The build step will place the bundled scripts into the <body> tag. | ||
26 | + | ||
27 | + To begin the development, run `npm start`. | ||
28 | + To create a production bundle, use `npm run build`. | ||
29 | + --> | ||
30 | + </body> | ||
31 | +</html> |
Client/src/App.css
0 → 100644
1 | +.App { | ||
2 | + text-align: center; | ||
3 | +} | ||
4 | + | ||
5 | +.App-logo { | ||
6 | + animation: App-logo-spin infinite 20s linear; | ||
7 | + height: 80px; | ||
8 | +} | ||
9 | + | ||
10 | +.App-header { | ||
11 | + background-color: #222; | ||
12 | + height: 150px; | ||
13 | + padding: 20px; | ||
14 | + color: white; | ||
15 | +} | ||
16 | + | ||
17 | +.App-intro { | ||
18 | + font-size: large; | ||
19 | +} | ||
20 | + | ||
21 | +@keyframes App-logo-spin { | ||
22 | + from { transform: rotate(0deg); } | ||
23 | + to { transform: rotate(360deg); } | ||
24 | +} |
Client/src/App.js
0 → 100644
1 | +import React, { Component } from 'react'; | ||
2 | +import logo from './logo.svg'; | ||
3 | +import './App.css'; | ||
4 | + | ||
5 | +class App extends Component { | ||
6 | + render() { | ||
7 | + return ( | ||
8 | + <div className="App"> | ||
9 | + <div className="App-header"> | ||
10 | + <img src={logo} className="App-logo" alt="logo" /> | ||
11 | + <h2>Welcome to React</h2> | ||
12 | + </div> | ||
13 | + <p className="App-intro"> | ||
14 | + To get started, edit <code>src/App.js</code> and save to reload. | ||
15 | + </p> | ||
16 | + </div> | ||
17 | + ); | ||
18 | + } | ||
19 | +} | ||
20 | + | ||
21 | +export default App; |
Client/src/App.test.js
0 → 100644
Client/src/index.css
0 → 100644
Client/src/index.js
0 → 100644
Client/src/logo.svg
0 → 100644
1 | +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3"> | ||
2 | + <g fill="#61DAFB"> | ||
3 | + <path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/> | ||
4 | + <circle cx="420.9" cy="296.5" r="45.7"/> | ||
5 | + <path d="M520.5 78.1z"/> | ||
6 | + </g> | ||
7 | +</svg> |
Server/app.js
0 → 100644
1 | +var express = require('express'); | ||
2 | +var path = require('path'); | ||
3 | +var favicon = require('serve-favicon'); | ||
4 | +var logger = require('morgan'); | ||
5 | +var cookieParser = require('cookie-parser'); | ||
6 | +var bodyParser = require('body-parser'); | ||
7 | + | ||
8 | +var routes = require('./routes/index'); | ||
9 | +var users = require('./routes/users'); | ||
10 | + | ||
11 | +var app = express(); | ||
12 | + | ||
13 | +// view engine setup | ||
14 | +app.set('views', path.join(__dirname, 'views')); | ||
15 | +app.set('view engine', 'jade'); | ||
16 | + | ||
17 | +// uncomment after placing your favicon in /public | ||
18 | +//app.use(favicon(path.join(__dirname, 'public', 'favicon.ico'))); | ||
19 | +app.use(logger('dev')); | ||
20 | +app.use(bodyParser.json()); | ||
21 | +app.use(bodyParser.urlencoded({ extended: false })); | ||
22 | +app.use(cookieParser()); | ||
23 | +app.use(express.static(path.join(__dirname, 'public'))); | ||
24 | + | ||
25 | +app.use('/', routes); | ||
26 | +app.use('/users', users); | ||
27 | + | ||
28 | +// catch 404 and forward to error handler | ||
29 | +app.use(function(req, res, next) { | ||
30 | + var err = new Error('Not Found'); | ||
31 | + err.status = 404; | ||
32 | + next(err); | ||
33 | +}); | ||
34 | + | ||
35 | +// error handlers | ||
36 | + | ||
37 | +// development error handler | ||
38 | +// will print stacktrace | ||
39 | +if (app.get('env') === 'development') { | ||
40 | + app.use(function(err, req, res, next) { | ||
41 | + res.status(err.status || 500); | ||
42 | + res.render('error', { | ||
43 | + message: err.message, | ||
44 | + error: err | ||
45 | + }); | ||
46 | + }); | ||
47 | +} | ||
48 | + | ||
49 | +// production error handler | ||
50 | +// no stacktraces leaked to user | ||
51 | +app.use(function(err, req, res, next) { | ||
52 | + res.status(err.status || 500); | ||
53 | + res.render('error', { | ||
54 | + message: err.message, | ||
55 | + error: {} | ||
56 | + }); | ||
57 | +}); | ||
58 | + | ||
59 | + | ||
60 | +module.exports = app; |
Server/bin/www
0 → 100755
1 | +#!/usr/bin/env node | ||
2 | + | ||
3 | +/** | ||
4 | + * Module dependencies. | ||
5 | + */ | ||
6 | + | ||
7 | +var app = require('../app'); | ||
8 | +var debug = require('debug')('server:server'); | ||
9 | +var http = require('http'); | ||
10 | + | ||
11 | +/** | ||
12 | + * Get port from environment and store in Express. | ||
13 | + */ | ||
14 | + | ||
15 | +var port = normalizePort(process.env.PORT || '3000'); | ||
16 | +app.set('port', port); | ||
17 | + | ||
18 | +/** | ||
19 | + * Create HTTP server. | ||
20 | + */ | ||
21 | + | ||
22 | +var server = http.createServer(app); | ||
23 | + | ||
24 | +/** | ||
25 | + * Listen on provided port, on all network interfaces. | ||
26 | + */ | ||
27 | + | ||
28 | +server.listen(port); | ||
29 | +server.on('error', onError); | ||
30 | +server.on('listening', onListening); | ||
31 | + | ||
32 | +/** | ||
33 | + * Normalize a port into a number, string, or false. | ||
34 | + */ | ||
35 | + | ||
36 | +function normalizePort(val) { | ||
37 | + var port = parseInt(val, 10); | ||
38 | + | ||
39 | + if (isNaN(port)) { | ||
40 | + // named pipe | ||
41 | + return val; | ||
42 | + } | ||
43 | + | ||
44 | + if (port >= 0) { | ||
45 | + // port number | ||
46 | + return port; | ||
47 | + } | ||
48 | + | ||
49 | + return false; | ||
50 | +} | ||
51 | + | ||
52 | +/** | ||
53 | + * Event listener for HTTP server "error" event. | ||
54 | + */ | ||
55 | + | ||
56 | +function onError(error) { | ||
57 | + if (error.syscall !== 'listen') { | ||
58 | + throw error; | ||
59 | + } | ||
60 | + | ||
61 | + var bind = typeof port === 'string' | ||
62 | + ? 'Pipe ' + port | ||
63 | + : 'Port ' + port; | ||
64 | + | ||
65 | + // handle specific listen errors with friendly messages | ||
66 | + switch (error.code) { | ||
67 | + case 'EACCES': | ||
68 | + console.error(bind + ' requires elevated privileges'); | ||
69 | + process.exit(1); | ||
70 | + break; | ||
71 | + case 'EADDRINUSE': | ||
72 | + console.error(bind + ' is already in use'); | ||
73 | + process.exit(1); | ||
74 | + break; | ||
75 | + default: | ||
76 | + throw error; | ||
77 | + } | ||
78 | +} | ||
79 | + | ||
80 | +/** | ||
81 | + * Event listener for HTTP server "listening" event. | ||
82 | + */ | ||
83 | + | ||
84 | +function onListening() { | ||
85 | + var addr = server.address(); | ||
86 | + var bind = typeof addr === 'string' | ||
87 | + ? 'pipe ' + addr | ||
88 | + : 'port ' + addr.port; | ||
89 | + debug('Listening on ' + bind); | ||
90 | +} |
Server/package.json
0 → 100644
1 | +{ | ||
2 | + "name": "server", | ||
3 | + "version": "0.0.0", | ||
4 | + "private": true, | ||
5 | + "scripts": { | ||
6 | + "start": "node ./bin/www" | ||
7 | + }, | ||
8 | + "dependencies": { | ||
9 | + "body-parser": "~1.15.1", | ||
10 | + "cookie-parser": "~1.4.3", | ||
11 | + "debug": "~2.2.0", | ||
12 | + "express": "~4.13.4", | ||
13 | + "jade": "~1.11.0", | ||
14 | + "morgan": "~1.7.0", | ||
15 | + "serve-favicon": "~2.3.0" | ||
16 | + } | ||
17 | +} |
Server/public/stylesheets/style.css
0 → 100644
Server/routes/index.js
0 → 100644
Server/routes/users.js
0 → 100644
Server/views/error.jade
0 → 100644
Server/views/index.jade
0 → 100644
-
Please register or login to post a comment