Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

example works yay

  • Loading branch information...
commit e2b99dc3484b0a3ba1f8505153facaf8e126b887 1 parent 2b433c3
James Halliday authored July 04, 2011
5  browser.js
@@ -53,9 +53,10 @@ module.exports = function () {
53 53
         if (n < 0) n = 0;
54 54
         if (n > 100) n = 100;
55 55
         complete = n;
  56
+        percent.text(n + '%');
56 57
         
57  
-        percent.ready(function () {
58  
-            finished.width(Math.floor(n / 100 * percent.width()));
  58
+        div.ready(function () {
  59
+            finished.width(Math.floor(n / 100 * remaining.width()));
59 60
         });
60 61
         
61 62
         return div;
8  example/progress/main.js
... ...
@@ -1,6 +1,12 @@
1 1
 var progressify = require('progressify');
2  
-var $ = require('jquery');
  2
+var $ = require('jquery-browserify');
3 3
 
4 4
 $(window).ready(function () {
  5
+    var p = progressify();
  6
+    p.appendTo($('#p'));
5 7
     
  8
+    var iv = setInterval(function () {
  9
+        var dx = Math.floor(Math.random() * 3);
  10
+        p.percent(p.percent() + dx);
  11
+    }, 100);
6 12
 });
6  example/progress/server.js
@@ -3,10 +3,8 @@ var app = express.createServer();
3 3
 app.use(express.static(__dirname));
4 4
 
5 5
 var browserify = require('browserify');
6  
-app.use(browserify({
7  
-    require : { jquery : 'jquery-browserify' },
8  
-    entry : 'main.js'
9  
-}));
  6
+app.use(browserify({ entry : 'main.js' }));
10 7
 app.use(require('progressify'));
11 8
 
12 9
 app.listen(8080);
  10
+console.log('Listening on :8080');
5  index.js
... ...
@@ -1,5 +1,2 @@
1 1
 var connect = require('connect');
2  
-
3  
-module.exports = function () {
4  
-    return connect.static(__dirname + '/static');
5  
-};
  2
+module.exports = connect.static(__dirname + '/static');
3  package.json
@@ -12,6 +12,9 @@
12 12
     "dependencies" : {
13 13
         "connect" : "1.5.x"
14 14
     },
  15
+    "dev-dependencies" : {
  16
+        "jquery-browserify" : "1.6.x"
  17
+    },
15 18
     "repository" : {
16 19
         "type" : "git",
17 20
         "url" : "http://github.com/substack/node-progressify.git"

0 notes on commit e2b99dc

Please sign in to comment.
Something went wrong with that request. Please try again.