소스 검색

first commit

Benoit Sida 3 년 전
커밋
75c9634958
19개의 변경된 파일473개의 추가작업 그리고 0개의 파일을 삭제
  1. 1
    0
      .gitignore
  2. 16
    0
      .meteor/.finished-upgraders
  3. 1
    0
      .meteor/.gitignore
  4. 7
    0
      .meteor/.id
  5. 23
    0
      .meteor/packages
  6. 2
    0
      .meteor/platforms
  7. 1
    0
      .meteor/release
  8. 87
    0
      .meteor/versions
  9. 0
    0
      README.md
  10. 139
    0
      client/main.css
  11. 7
    0
      client/main.html
  12. 9
    0
      client/main.js
  13. 33
    0
      imports/api/links.js
  14. 6
    0
      imports/startup/accounts-config.js
  15. 20
    0
      imports/ui/AccountsUIWrapper.jsx
  16. 66
    0
      imports/ui/App.jsx
  17. 33
    0
      imports/ui/Link.jsx
  18. 16
    0
      package.json
  19. 6
    0
      server/main.js

+ 1
- 0
.gitignore 파일 보기

1
+node_modules/

+ 16
- 0
.meteor/.finished-upgraders 파일 보기

1
+# This file contains information which helps Meteor properly upgrade your
2
+# app when you run 'meteor update'. You should check it into version control
3
+# with your project.
4
+
5
+notices-for-0.9.0
6
+notices-for-0.9.1
7
+0.9.4-platform-file
8
+notices-for-facebook-graph-api-2
9
+1.2.0-standard-minifiers-package
10
+1.2.0-meteor-platform-split
11
+1.2.0-cordova-changes
12
+1.2.0-breaking-changes
13
+1.3.0-split-minifiers-package
14
+1.4.0-remove-old-dev-bundle-link
15
+1.4.1-add-shell-server-package
16
+1.4.3-split-account-service-packages

+ 1
- 0
.meteor/.gitignore 파일 보기

1
+local

+ 7
- 0
.meteor/.id 파일 보기

1
+# This file contains a token that is unique to your project.
2
+# Check it into your repository along with the rest of this directory.
3
+# It can be used for purposes such as:
4
+#   - ensuring you don't accidentally deploy one app on top of another
5
+#   - providing package authors with aggregated statistics
6
+
7
+jnbnbreixomact0ktw

+ 23
- 0
.meteor/packages 파일 보기

1
+# Meteor packages used by this project, one per line.
2
+# Check this file (and the other files in this directory) into your repository.
3
+#
4
+# 'meteor add' and 'meteor remove' will edit this file for you,
5
+# but you can also edit it by hand.
6
+
7
+meteor-base@1.0.4             # Packages every Meteor app needs to have
8
+mobile-experience@1.0.4       # Packages for a great mobile UX
9
+mongo@1.1.15                   # The database Meteor supports right now
10
+blaze-html-templates@1.0.4 # Compile .html files into Meteor Blaze views
11
+reactive-var@1.0.11            # Reactive variable for tracker
12
+jquery@1.11.10                  # Helpful client-side library
13
+tracker@1.1.2                 # Meteor's client-side reactive programming library
14
+
15
+standard-minifier-css@1.3.3   # CSS minifier run for production mode
16
+standard-minifier-js@1.2.2    # JS minifier run for production mode
17
+es5-shim@4.6.15                # ECMAScript 5 compatibility for older browsers.
18
+ecmascript@0.6.3              # Enable ECMAScript2015+ syntax in app code
19
+shell-server@0.2.2            # Server-side component of the `meteor shell` command
20
+
21
+react-meteor-data
22
+accounts-ui
23
+accounts-password

+ 2
- 0
.meteor/platforms 파일 보기

1
+server
2
+browser

+ 1
- 0
.meteor/release 파일 보기

1
+METEOR@1.4.3.1

+ 87
- 0
.meteor/versions 파일 보기

1
+accounts-base@1.2.14
2
+accounts-password@1.3.4
3
+accounts-ui@1.1.9
4
+accounts-ui-unstyled@1.2.0
5
+allow-deny@1.0.5
6
+autoupdate@1.3.12
7
+babel-compiler@6.14.1
8
+babel-runtime@1.0.1
9
+base64@1.0.10
10
+binary-heap@1.0.10
11
+blaze@2.3.0
12
+blaze-html-templates@1.1.0
13
+blaze-tools@1.0.10
14
+boilerplate-generator@1.0.11
15
+caching-compiler@1.1.9
16
+caching-html-compiler@1.1.0
17
+callback-hook@1.0.10
18
+check@1.2.4
19
+ddp@1.2.5
20
+ddp-client@1.3.3
21
+ddp-common@1.2.8
22
+ddp-rate-limiter@1.0.6
23
+ddp-server@1.3.13
24
+deps@1.0.12
25
+diff-sequence@1.0.7
26
+ecmascript@0.6.3
27
+ecmascript-runtime@0.3.15
28
+ejson@1.0.13
29
+email@1.1.18
30
+es5-shim@4.6.15
31
+fastclick@1.0.13
32
+geojson-utils@1.0.10
33
+hot-code-push@1.0.4
34
+html-tools@1.0.11
35
+htmljs@1.0.11
36
+http@1.2.11
37
+id-map@1.0.9
38
+jquery@1.11.10
39
+launch-screen@1.1.1
40
+less@2.7.9
41
+livedata@1.0.18
42
+localstorage@1.0.12
43
+logging@1.1.17
44
+meteor@1.6.1
45
+meteor-base@1.0.4
46
+minifier-css@1.2.16
47
+minifier-js@1.2.17
48
+minimongo@1.0.20
49
+mobile-experience@1.0.4
50
+mobile-status-bar@1.0.14
51
+modules@0.7.9
52
+modules-runtime@0.7.9
53
+mongo@1.1.15
54
+mongo-id@1.0.6
55
+npm-bcrypt@0.9.2
56
+npm-mongo@2.2.16_1
57
+observe-sequence@1.0.15
58
+ordered-dict@1.0.9
59
+promise@0.8.8
60
+random@1.0.10
61
+rate-limit@1.0.6
62
+react-meteor-data@0.2.9
63
+reactive-dict@1.1.8
64
+reactive-var@1.0.11
65
+reload@1.1.11
66
+retry@1.0.9
67
+routepolicy@1.0.12
68
+service-configuration@1.0.11
69
+session@1.1.7
70
+sha@1.0.9
71
+shell-server@0.2.2
72
+spacebars@1.0.13
73
+spacebars-compiler@1.1.0
74
+srp@1.0.10
75
+standard-minifier-css@1.3.3
76
+standard-minifier-js@1.2.2
77
+templating@1.3.0
78
+templating-compiler@1.3.0
79
+templating-runtime@1.3.0
80
+templating-tools@1.1.0
81
+tmeasday:check-npm-versions@0.2.0
82
+tracker@1.1.2
83
+ui@1.0.12
84
+underscore@1.0.10
85
+url@1.1.0
86
+webapp@1.3.13
87
+webapp-hashing@1.0.9

+ 0
- 0
README.md 파일 보기


+ 139
- 0
client/main.css 파일 보기

1
+/* CSS declarations go here */
2
+body {
3
+  font-family: sans-serif;
4
+  background-color: #315481;
5
+  background-image: linear-gradient(to bottom, #315481, #918e82 100%);
6
+  background-attachment: fixed;
7
+ 
8
+  position: absolute;
9
+  top: 0;
10
+  bottom: 0;
11
+  left: 0;
12
+  right: 0;
13
+ 
14
+  padding: 0;
15
+  margin: 0;
16
+ 
17
+  font-size: 14px;
18
+}
19
+ 
20
+.container {
21
+  max-width: 600px;
22
+  margin: 200px auto;
23
+  min-height: 100%;
24
+}
25
+
26
+.logo {
27
+  font-size: 4em;
28
+  color: white;
29
+  margin-bottom: 80px;
30
+  display: block;
31
+  text-shadow: 1px 1px black;
32
+  text-align: center;
33
+  font-family: 'BonvenoCFLight';
34
+}
35
+
36
+.box-container {
37
+  box-shadow: 0px 0px 20px 2px rgba(0,0,0, 0.3);
38
+}
39
+ 
40
+header {
41
+  background: #d2edf4;
42
+  background-image: linear-gradient(to bottom, #d0edf5, #e1e5f0 100%);
43
+  padding: 20px 15px 15px 15px;
44
+  position: relative;
45
+}
46
+ 
47
+#login-buttons {
48
+  display: block;
49
+}
50
+ 
51
+h1 {
52
+  font-size: 1.5em;
53
+  margin: 0;
54
+  margin-bottom: 10px;
55
+  display: inline-block;
56
+  margin-right: 1em;
57
+}
58
+ 
59
+form {
60
+  margin-top: 10px;
61
+  margin-bottom: -10px;
62
+  position: relative;
63
+}
64
+ 
65
+.new-link input {
66
+  box-sizing: border-box;
67
+  padding: 10px 0;
68
+  background: transparent;
69
+  border: none;
70
+  width: 100%;
71
+  padding-right: 80px;
72
+  font-size: 1em;
73
+}
74
+ 
75
+.new-link input:focus{
76
+  outline: 0;
77
+}
78
+ 
79
+ul {
80
+  margin: 0;
81
+  padding: 0;
82
+  background: white;
83
+}
84
+ 
85
+.delete {
86
+  float: right;
87
+  font-weight: bold;
88
+  background: none;
89
+  font-size: 1em;
90
+  border: none;
91
+  position: relative;
92
+}
93
+ 
94
+li {
95
+  position: relative;
96
+  list-style: none;
97
+  padding: 15px;
98
+  border-bottom: #eee solid 1px;
99
+}
100
+ 
101
+li .text {
102
+  margin-left: 10px;
103
+}
104
+ 
105
+li.checked {
106
+  color: #888;
107
+}
108
+ 
109
+li.checked .text {
110
+  text-decoration: line-through;
111
+}
112
+ 
113
+li.private {
114
+  background: #eee;
115
+  border-color: #ddd;
116
+}
117
+ 
118
+header #accounts-ui {
119
+  float: right;
120
+}
121
+ 
122
+.toggle-private {
123
+  margin-left: 5px;
124
+}
125
+ 
126
+@media (max-width: 600px) {
127
+  li {
128
+    padding: 12px 15px;
129
+  }
130
+ 
131
+  .search {
132
+    width: 150px;
133
+    clear: both;
134
+  }
135
+ 
136
+  .new-link input {
137
+    padding-bottom: 5px;
138
+  }
139
+}

+ 7
- 0
client/main.html 파일 보기

1
+<head>
2
+    <title>SoundWave</title>
3
+    <link rel="stylesheet" media="screen" href="https://fontlibrary.org/face/benveno" type="text/css"/>
4
+</head>
5
+<body>
6
+    <div id="main"></div>
7
+</body>

+ 9
- 0
client/main.js 파일 보기

1
+import React from 'react';
2
+import { Meteor } from 'meteor/meteor';
3
+import { render } from 'react-dom';
4
+import '../imports/startup/accounts-config.js';
5
+import App from '../imports/ui/App.jsx';
6
+ 
7
+Meteor.startup(() => {
8
+  render(<App />, document.getElementById('main'));
9
+});

+ 33
- 0
imports/api/links.js 파일 보기

1
+import { Meteor } from 'meteor/meteor';
2
+import { Mongo } from 'meteor/mongo';
3
+import { check, Match } from 'meteor/check';
4
+
5
+export const Links = new Mongo.Collection('links');
6
+
7
+const YTExp = /http(?:s?):\/\/(?:www\.)?youtu(?:be\.com\/watch\?v=|\.be\/)([\w\-_]*)/;
8
+
9
+if (Meteor.isServer) {
10
+	// This code only runs on the server
11
+	Meteor.publish('links', function linksPublication() {
12
+		return Links.find({
13
+			 completed: {$ne: true}
14
+		});
15
+	});
16
+}
17
+
18
+Meteor.methods({
19
+
20
+  'links.insert'(url) {
21
+	check(url, Match.Where((url) => YTExp.test(url)));
22
+    Links.insert({
23
+      url,
24
+      createdAt: new Date(),
25
+    });
26
+  },
27
+
28
+  'links.remove'(linkId) {
29
+    check(linkId, String);
30
+    Links.remove(linkId);
31
+  },
32
+
33
+});

+ 6
- 0
imports/startup/accounts-config.js 파일 보기

1
+
2
+import { Accounts } from 'meteor/accounts-base';
3
+
4
+Accounts.ui.config({
5
+  passwordSignupFields: 'USERNAME_ONLY',
6
+});

+ 20
- 0
imports/ui/AccountsUIWrapper.jsx 파일 보기

1
+import React, { Component } from 'react';
2
+import ReactDOM from 'react-dom';
3
+import { Template } from 'meteor/templating';
4
+import { Blaze } from 'meteor/blaze';
5
+
6
+export default class AccountsUIWrapper extends Component {
7
+  componentDidMount() {
8
+    // Use Meteor Blaze to render login buttons
9
+    this.view = Blaze.render(Template.loginButtons,
10
+      ReactDOM.findDOMNode(this.refs.container));
11
+  }
12
+  componentWillUnmount() {
13
+    // Clean up Blaze view
14
+    Blaze.remove(this.view);
15
+  }
16
+  render() {
17
+    // Just render a placeholder container that will be filled in
18
+    return <span id="accounts-ui" ref="container" />;
19
+  }
20
+}

+ 66
- 0
imports/ui/App.jsx 파일 보기

1
+import React, { Component, PropTypes } from 'react';
2
+import ReactDOM from 'react-dom';
3
+import { Meteor } from 'meteor/meteor';
4
+import { createContainer } from 'meteor/react-meteor-data';
5
+import { Links } from '../api/links.js';
6
+import Link from './Link.jsx';
7
+import AccountsUIWrapper from './AccountsUIWrapper.jsx';
8
+
9
+// App component - represents the whole app
10
+class App extends Component {
11
+	constructor(props) {
12
+		super(props);
13
+		this.state = { };
14
+	}
15
+
16
+	renderLinks() {
17
+		return this.props.links.map((link) => {
18
+			return (
19
+				<Link key={link._id} link={link} />
20
+			)
21
+		});
22
+	}
23
+
24
+	handleSubmit(event) {
25
+		event.preventDefault();
26
+
27
+		// Find the text field via the React ref
28
+		const text = ReactDOM.findDOMNode(this.refs.textInput).value.trim();
29
+
30
+		Meteor.call('links.insert', text);
31
+
32
+		// Clear form
33
+		ReactDOM.findDOMNode(this.refs.textInput).value = '';
34
+	}
35
+
36
+	render() {
37
+		return (
38
+			<div className="container">
39
+				<h1 className="logo">SoundWave</h1>
40
+				<div className="box-container">
41
+					<header>
42
+						<AccountsUIWrapper />
43
+						<form className="new-link" onSubmit={this.handleSubmit.bind(this)}>
44
+							<input type="text" ref="textInput" placeholder="Search a video" />
45
+						</form>
46
+					</header>
47
+					<ul>{ this.renderLinks() }</ul>
48
+				</div>
49
+			</div>
50
+		);
51
+	}
52
+}
53
+
54
+App.propTypes = {
55
+	links: PropTypes.array.isRequired,
56
+	currentUser: PropTypes.object,
57
+};
58
+
59
+export default createContainer(() => {
60
+	Meteor.subscribe('links');
61
+
62
+	return {
63
+		links: Links.find({}, {sort: {createdAt: -1}}).fetch(),
64
+		currentUser: Meteor.user(),
65
+	};
66
+}, App);

+ 33
- 0
imports/ui/Link.jsx 파일 보기

1
+import React, {Component, PropTypes} from 'react';
2
+import classnames from 'classnames';
3
+
4
+// Task component - represents a single todo item
5
+export default class Link extends Component {
6
+
7
+	deleteThisLink() {
8
+		Meteor.call('links.remove', this.props.link._id);
9
+	}
10
+
11
+	render() {
12
+		// Give tasks a different className when they are checked off,
13
+		// so that we can style them nicely in CSS
14
+		const linkClassName = classnames({
15
+			completed: this.props.link.completed,
16
+		});
17
+
18
+		return (
19
+			<li className={linkClassName}>
20
+				<button className="delete" onClick={this.deleteThisLink.bind(this)}>
21
+					&times;
22
+				</button>
23
+				<span className="text">{this.props.link.url}</span>
24
+			</li>
25
+		);
26
+	}
27
+}
28
+
29
+Link.propTypes = {
30
+	// This component gets the task to display through a React prop.
31
+	// We can use propTypes to indicate it is required
32
+	link: PropTypes.object.isRequired,
33
+};

+ 16
- 0
package.json 파일 보기

1
+{
2
+  "name": "SoundWave",
3
+  "private": true,
4
+  "scripts": {
5
+    "start": "meteor run"
6
+  },
7
+  "dependencies": {
8
+    "babel-runtime": "^6.20.0",
9
+    "bcrypt": "^1.0.2",
10
+    "classnames": "^2.2.5",
11
+    "meteor-node-stubs": "~0.2.4",
12
+    "react": "^15.4.2",
13
+    "react-addons-pure-render-mixin": "^15.4.2",
14
+    "react-dom": "^15.4.2"
15
+  }
16
+}

+ 6
- 0
server/main.js 파일 보기

1
+import { Meteor } from 'meteor/meteor';
2
+import '../imports/api/links.js';
3
+
4
+Meteor.startup(() => {
5
+  // code to run on server at startup
6
+});