Permalink
Browse files

refactor for latest component(1)

  • Loading branch information...
1 parent a836c84 commit f269252a1954d01772c6ae591d4c947220bd1547 @tj tj committed Aug 12, 2012
Showing with 18 additions and 29 deletions.
  1. +2 −0 .gitignore
  2. +10 −4 Makefile
  3. +2 −3 component.json
  4. +1 −1 index.js
  5. +0 −19 package.json
  6. 0 overlay.html → template.html
  7. +1 −0 template.js
  8. +2 −2 test/index.html
View
@@ -1,3 +1,5 @@
node_modules
test/*.js
test/*.css
+build
+components
View
@@ -1,8 +1,14 @@
-test/out.js: index.js overlay.css
- component build package.json test/out
+build: overlay.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
@@ -7,7 +7,6 @@
"component/emitter": "*",
"component/jquery": "*"
},
- "scripts": ["index.js"],
- "styles": ["overlay.css"],
- "templates": ["overlay.html"]
+ "scripts": ["index.js", "template.js"],
+ "styles": ["overlay.css"]
}
View
@@ -41,7 +41,7 @@ function Overlay(options) {
Emitter.call(this);
options = options || {};
this.closable = options.closable;
- this.el = o(render('overlay'));
+ this.el = o(require('./template'));
this.el.appendTo('body');
if (this.closable) this.el.click(this.hide.bind(this));
}
View
@@ -1,19 +0,0 @@
-{
- "name": "overlay-component",
- "description": "Page overlay component",
- "version": "0.0.2",
- "keywords": ["component", "overlay"],
- "dependencies": {
- "emitter-component": "*",
- "jquery-component": "*"
- },
- "component": {
- "styles": ["overlay.css"],
- "scripts": {
- "overlay": "index.js"
- },
- "templates": {
- "overlay": "overlay.html"
- }
- }
-}
File renamed without changes.
View
@@ -0,0 +1 @@
+module.exports = '<div id="overlay" class="hide"></div>';
View
@@ -3,11 +3,11 @@
<head>
<title>Overlay</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" />
</head>
<body>
<title>Overlay</title>
- <script src="out.js"></script>
+ <script src="../build/build.js"></script>
<script>
var overlay = require('overlay');

0 comments on commit f269252

Please sign in to comment.