Permalink
Browse files

example works yay

  • Loading branch information...
1 parent 2b433c3 commit e2b99dc3484b0a3ba1f8505153facaf8e126b887 @substack committed Jul 4, 2011
Showing with 16 additions and 11 deletions.
  1. +3 −2 browser.js
  2. +7 −1 example/progress/main.js
  3. +2 −4 example/progress/server.js
  4. +1 −4 index.js
  5. +3 −0 package.json
View
@@ -53,9 +53,10 @@ module.exports = function () {
if (n < 0) n = 0;
if (n > 100) n = 100;
complete = n;
+ percent.text(n + '%');
- percent.ready(function () {
- finished.width(Math.floor(n / 100 * percent.width()));
+ div.ready(function () {
+ finished.width(Math.floor(n / 100 * remaining.width()));
});
return div;
View
@@ -1,6 +1,12 @@
var progressify = require('progressify');
-var $ = require('jquery');
+var $ = require('jquery-browserify');
$(window).ready(function () {
+ var p = progressify();
+ p.appendTo($('#p'));
+ var iv = setInterval(function () {
+ var dx = Math.floor(Math.random() * 3);
+ p.percent(p.percent() + dx);
+ }, 100);
});
@@ -3,10 +3,8 @@ var app = express.createServer();
app.use(express.static(__dirname));
var browserify = require('browserify');
-app.use(browserify({
- require : { jquery : 'jquery-browserify' },
- entry : 'main.js'
-}));
+app.use(browserify({ entry : 'main.js' }));
app.use(require('progressify'));
app.listen(8080);
+console.log('Listening on :8080');
View
@@ -1,5 +1,2 @@
var connect = require('connect');
-
-module.exports = function () {
- return connect.static(__dirname + '/static');
-};
+module.exports = connect.static(__dirname + '/static');
View
@@ -12,6 +12,9 @@
"dependencies" : {
"connect" : "1.5.x"
},
+ "dev-dependencies" : {
+ "jquery-browserify" : "1.6.x"
+ },
"repository" : {
"type" : "git",
"url" : "http://github.com/substack/node-progressify.git"

0 comments on commit e2b99dc

Please sign in to comment.