Skip to content

Commit 3b3ad1d

Browse files
committed
spelling
1 parent 791eef3 commit 3b3ad1d

File tree

4 files changed

+109
-111
lines changed

4 files changed

+109
-111
lines changed
File renamed without changes.

bulid/js/mprogress.js renamed to build/js/mprogress.js

Lines changed: 106 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
},
2323

2424
/**
25-
* (Internal) Queues a function to be executed.
25+
* Queues a function to be executed.
2626
*/
2727

2828
queue: (function() {
@@ -33,140 +33,138 @@
3333
if (fn) {
3434
fn(next);
3535
}
36-
}
36+
}
3737

38-
return function(fn) {
39-
pending.push(fn);
40-
if (pending.length == 1) next();
41-
};
42-
})(),
38+
return function(fn) {
39+
pending.push(fn);
40+
if (pending.length == 1) next();
41+
};
42+
})(),
4343

44-
/**
45-
* (Internal) Applies css properties to an element, similar to the jQuery
46-
* setcss method.
47-
*
48-
* While this helper does assist with vendor prefixed property names, it
49-
* does not perform any manipulation of values prior to setting styles.
50-
*/
51-
setcss: (function() {
52-
var cssPrefixes = [ 'Webkit', 'O', 'Moz', 'ms' ],
53-
cssProps = {};
44+
/**
45+
* Applies css properties to an element, similar to the jQuery
46+
* setcss method.
47+
*
48+
* While this helper does assist with vendor prefixed property names, it
49+
* does not perform any manipulation of values prior to setting styles.
50+
*/
51+
setcss: (function() {
52+
var cssPrefixes = [ 'Webkit', 'O', 'Moz', 'ms' ],
53+
cssProps = {};
5454

55-
function camelCase(string) {
56-
return string.replace(/^-ms-/, 'ms-').replace(/-([\da-z])/gi, function(match, letter) {
57-
return letter.toUpperCase();
58-
});
59-
}
55+
function camelCase(string) {
56+
return string.replace(/^-ms-/, 'ms-').replace(/-([\da-z])/gi, function(match, letter) {
57+
return letter.toUpperCase();
58+
});
59+
}
6060

61-
function getVendorProp(name) {
62-
var style = document.body.style;
63-
if (name in style) return name;
61+
function getVendorProp(name) {
62+
var style = document.body.style;
63+
if (name in style) return name;
6464

65-
var i = cssPrefixes.length,
66-
capName = name.charAt(0).toUpperCase() + name.slice(1),
67-
vendorName;
68-
while (i--) {
69-
vendorName = cssPrefixes[i] + capName;
70-
if (vendorName in style) return vendorName;
71-
}
65+
var i = cssPrefixes.length,
66+
capName = name.charAt(0).toUpperCase() + name.slice(1),
67+
vendorName;
68+
while (i--) {
69+
vendorName = cssPrefixes[i] + capName;
70+
if (vendorName in style) return vendorName;
71+
}
7272

73-
return name;
74-
}
73+
return name;
74+
}
7575

76-
function getStyleProp(name) {
77-
name = camelCase(name);
78-
return cssProps[name] || (cssProps[name] = getVendorProp(name));
79-
}
76+
function getStyleProp(name) {
77+
name = camelCase(name);
78+
return cssProps[name] || (cssProps[name] = getVendorProp(name));
79+
}
8080

81-
function applyCss(element, prop, value) {
82-
prop = getStyleProp(prop);
83-
element.style[prop] = value;
84-
}
81+
function applyCss(element, prop, value) {
82+
prop = getStyleProp(prop);
83+
element.style[prop] = value;
84+
}
8585

86-
return function(element, properties) {
87-
var args = arguments,
88-
prop,
89-
value;
86+
return function(element, properties) {
87+
var args = arguments,
88+
prop,
89+
value;
9090

91-
if (args.length == 2) {
92-
for (prop in properties) {
93-
value = properties[prop];
94-
if (value !== undefined && properties.hasOwnProperty(prop)) applyCss(element, prop, value);
91+
if (args.length == 2) {
92+
for (prop in properties) {
93+
value = properties[prop];
94+
if (value !== undefined && properties.hasOwnProperty(prop)) applyCss(element, prop, value);
95+
}
96+
} else {
97+
applyCss(element, args[1], args[2]);
9598
}
96-
} else {
97-
applyCss(element, args[1], args[2]);
9899
}
99-
}
100-
})(),
100+
})(),
101101

102-
clamp: function(n, min, max) {
103-
if (n < min) return min;
104-
if (n > max) return max;
105-
return n;
106-
},
107-
108-
/**
109-
* (Internal) converts a percentage (`0..1`) to a bar translateX
110-
* percentage (`-100%..0%`).
111-
*/
112-
toBarPerc: function(n) {
113-
return (-1 + n) * 100;
114-
},
102+
clamp: function(n, min, max) {
103+
if (n < min) return min;
104+
if (n > max) return max;
105+
return n;
106+
},
115107

116-
hasClass: function(element, name) {
117-
var list = typeof element == 'string' ? element : $$utils$$Utils.classList(element);
118-
return list.indexOf(' ' + name + ' ') >= 0;
119-
},
108+
/**
109+
* converts a percentage (`0..1`) to a bar translateX
110+
* percentage (`-100%..0%`).
111+
*/
112+
toBarPerc: function(n) {
113+
return (-1 + n) * 100;
114+
},
120115

121-
addClass: function(element, name) {
122-
var oldList = $$utils$$Utils.classList(element),
123-
newList = oldList + name;
116+
hasClass: function(element, name) {
117+
var list = typeof element == 'string' ? element : $$utils$$Utils.classList(element);
118+
return list.indexOf(' ' + name + ' ') >= 0;
119+
},
124120

125-
if ($$utils$$Utils.hasClass(oldList, name)) return;
121+
addClass: function(element, name) {
122+
var oldList = $$utils$$Utils.classList(element),
123+
newList = oldList + name;
126124

127-
// Trim the opening space.
128-
element.className = newList.substring(1);
129-
},
125+
if ($$utils$$Utils.hasClass(oldList, name)) return;
130126

131-
removeClass: function(element, name) {
132-
var oldList = $$utils$$Utils.classList(element),
133-
newList;
127+
// Trim the opening space.
128+
element.className = newList.substring(1);
129+
},
134130

135-
if (!$$utils$$Utils.hasClass(element, name)) return;
131+
removeClass: function(element, name) {
132+
var oldList = $$utils$$Utils.classList(element),
133+
newList;
136134

137-
// Replace the class name.
138-
newList = oldList.replace(' ' + name + ' ', ' ');
135+
if (!$$utils$$Utils.hasClass(element, name)) return;
139136

140-
// Trim the opening and closing spaces.
141-
element.className = newList.substring(1, newList.length - 1);
142-
},
137+
// Replace the class name.
138+
newList = oldList.replace(' ' + name + ' ', ' ');
143139

144-
showEl: function(element) {
145-
$$utils$$Utils.setcss(element, {
146-
display: 'block'
147-
});
148-
},
140+
// Trim the opening and closing spaces.
141+
element.className = newList.substring(1, newList.length - 1);
142+
},
149143

150-
hideEl: function(element) {
151-
$$utils$$Utils.setcss(element, {
152-
display: 'none'
153-
});
154-
},
144+
showEl: function(element) {
145+
$$utils$$Utils.setcss(element, {
146+
display: 'block'
147+
});
148+
},
155149

156-
classList: function(element) {
157-
return (' ' + (element.className || '') + ' ').replace(/\s+/gi, ' ');
158-
},
150+
hideEl: function(element) {
151+
$$utils$$Utils.setcss(element, {
152+
display: 'none'
153+
});
154+
},
159155

160-
/**
161-
* (Internal) Removes an element from the DOM.
162-
*/
163-
removeElement: function(element) {
164-
element && element.parentNode && element.parentNode.removeChild(element);
165-
}
156+
classList: function(element) {
157+
return (' ' + (element.className || '') + ' ').replace(/\s+/gi, ' ');
158+
},
166159

160+
/**
161+
* Removes an element from the DOM.
162+
*/
163+
removeElement: function(element) {
164+
element && element.parentNode && element.parentNode.removeChild(element);
165+
}
167166
};
168167

169-
170168
var $$utils$$default = $$utils$$Utils;
171169
(function(root, factory) {
172170
// UMD
@@ -694,7 +692,7 @@
694692
};
695693

696694
/**
697-
* Waits for all supplied jQuery or Zepto.js promises and
695+
* Waits for all supplied jQuery or Zepto promises and
698696
* increases the progress as the promises resolve.
699697
*
700698
* @param $promise jQuery or Zepto Promise
File renamed without changes.

gulpfile.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ var del = require('del');
88
var jsName = 'mprogress.js';
99
var jsMinName = 'mprogress.min.js';
1010
var devPath = './dev';
11-
var bulidPath = './bulid';
11+
var buildPath = './build';
1212

1313
var paths = {
1414
srcCSS: './src/css/*.styl',
@@ -52,9 +52,9 @@ gulp.task('watch', function(){
5252

5353
gulp.task('default', [ 'stylus', 'es6module']);
5454

55-
gulp.task('bulid', ['stylus', 'es6module'], function(){
55+
gulp.task('build', ['stylus', 'es6module'], function(){
5656
return gulp.src(devPath + '/*/*')
57-
.pipe(gulp.dest(bulidPath));
57+
.pipe(gulp.dest(buildPath));
5858
});
5959

6060
gulp.task('publish', ['stylus', 'es6module'], function(){

0 commit comments

Comments
 (0)