Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

refactor for latest component(1)

  • Loading branch information...
commit a411b70a6a485fd774668e33231e6f78c50cd8a5 1 parent c81ba68
@tj tj authored
View
2  .gitignore
@@ -1,3 +1,5 @@
node_modules
test/*.js
test/*.css
+components
+build
View
14 Makefile
@@ -1,8 +1,14 @@
-test/out.js: notification.js notification.css
- component build package.json test/out
+build: notification.css index.js template.js components
+ @component build
+
+template.js: template.html
+ @component convert $<
+
+components:
+ @component install
clean:
- rm -f test/out.{js,css}
+ rm -fr build components
-.PHONY: clean
+.PHONY: clean
View
12 component.json
@@ -0,0 +1,12 @@
+{
+ "name": "notification",
+ "description": "Notification component",
+ "version": "0.0.2",
+ "keywords": ["notify", "notification", "ui", "growl"],
+ "dependencies": {
+ "component/emitter": "*",
+ "component/jquery": "*"
+ },
+ "scripts": ["index.js", "template.js"],
+ "styles": ["notification.css"]
+}
View
2  notification.js → index.js
@@ -86,7 +86,7 @@ exports.error = type('error');
function Notification(options) {
Emitter.call(this);
options = options || {};
- this.el = o(render('notification'));
+ this.el = o(require('./template'));
this.render(options);
if (Notification.effect) this.effect(Notification.effect);
};
View
19 package.json
@@ -1,19 +0,0 @@
-{
- "name": "notification",
- "description": "Notification component for the client (growl-like)",
- "version": "0.0.2",
- "keywords": ["notification", "component", "ui"],
- "dependencies": {
- "emitter-component": "*",
- "jquery-component": "*"
- },
- "component": {
- "styles": ["notification.css"],
- "scripts": {
- "notification": "notification.js"
- },
- "templates": {
- "notification": "notification.html"
- }
- }
-}
View
0  notification.html → template.html
File renamed without changes
View
1  template.js
@@ -0,0 +1 @@
+module.exports = '<li class="notification hide">\n <div class="content">\n <span class="title">Title</span>\n <a href="#" class="close">×</a>\n <p>Message</p>\n </div>\n</li>';
View
4 test/index.html
@@ -3,7 +3,7 @@
<head>
<title>Notification</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <link rel="stylesheet" href="out.css" />
+ <link rel="stylesheet" href="../build/build.css" />
<style>
a {
text-decoration: none;
@@ -13,7 +13,7 @@
</head>
<body>
<title>Notification</title>
- <script src="out.js"></script>
+ <script src="../build/build.js"></script>
<script>
var notify = require('notification');
</script>
Please sign in to comment.
Something went wrong with that request. Please try again.