Skip to content

Commit

Permalink
refactor for latest component(1)
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Aug 12, 2012
1 parent 4880b72 commit ebca955
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 29 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
node_modules
test/*.js
test/*.css
components
build
14 changes: 10 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@

test/out.js: index.js popover.css
component build package.json test/out
build: popover.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
5 changes: 2 additions & 3 deletions component.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"component/tip": "*",
"component/jquery": "*"
},
"scripts": ["index.js"],
"styles": ["popover.css"],
"templates": ["popover.html"]
"scripts": ["index.js", "template.js"],
"styles": ["popover.css"]
}
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module.exports = Popover;
*/

function Popover(content, title) {
this.popover = o(render('popover'));
this.popover = o(require('./template'));
Tip.call(this, this.popover);
this.classname = 'popover';
this.el.addClass('popover');
Expand Down
19 changes: 0 additions & 19 deletions package.json

This file was deleted.

File renamed without changes.
1 change: 1 addition & 0 deletions template.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<title>Popover</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>
body {
padding: 60px;
Expand All @@ -25,7 +25,7 @@
</head>
<body>
<title>Popover</title>
<script src="out.js"></script>
<script src="../build/build.js"></script>
<a href="#" id="north">North</a>
<a href="#" id="east">East</a>
<a href="#" id="west">West</a>
Expand Down

0 comments on commit ebca955

Please sign in to comment.