Skip to content
Browse files

added version 0.5.0

  • Loading branch information...
1 parent 23092b2 commit 9950dbed393f009be97a593225f68ec8860904e9 @minddust committed Aug 28, 2012
Showing with 424 additions and 59 deletions.
  1. +8 −0 CHANGELOG.md
  2. +82 −25 README.md
  3. +134 −0 bootstrap-progressbar.css
  4. +59 −32 bootstrap-progressbar.js
  5. +137 −0 bootstrap-progressbar.less
  6. +2 −0 bootstrap-progressbar.min.css
  7. +2 −2 bootstrap-progressbar.min.js
View
8 CHANGELOG.md
@@ -1,5 +1,13 @@
# Changelog
+### 0.5.0
+
+ * added vertical progressbars
+ * added right alignment
+ * moved styles to css/less
+ * fixed some code formatting
+ * fixed different font sizes
+
### 0.4.6
* fixed flickering on centered text on multiple trigger (due to last fix)
107 README.md
@@ -1,4 +1,4 @@
-# bootstrap-progressbar - 0.4.6
+# bootstrap-progressbar - 0.5.0
`bootstrap-progressbar` is a [jQuery](http://jquery.com) plugin which extends the basic [twitter-bootstrap](http://twitter.github.com/bootstrap) progressbar. It provides the ability to animate the progressbar by adding Javascript in combination with the preexisting css transitions. Additionally you can display the current progress information in the bar or get the value via callback.
@@ -41,11 +41,48 @@
## Usage Extended
-You can now trigger progressbar as much as you want. Just change your `data` attribute and trigger `.progressbar()` again. All settings made before will be kept. Please have a look at the demo page for a working example.
+* Do i need the additional style file?
+
+ * for the horizontal bar with no or filled text: __NO__
+ * for any vertical bars or the horizontal bar with centered text: __YES__
+
+ ```html
+ <link rel="stylesheet/less" type="text/css" href="bootstrap-progressbar.less">
+ ```
+
+ or
+
+ ```html
+ <link rel="stylesheet" type="text/css" href="bootstrap-progressbar.css">
+ ```
+
+* Multiple trigger
+
+ You can trigger progressbar as much as you want. Just change your `data` attribute and trigger `.progressbar()` again. All settings made before will be kept. Please have a look at the demo page for a working example.
## Customization
-1. text and delay
+1. alignment
+
+ * to use a horizontal progressbar which is align to the right you have to add `right` to the `progress` element
+
+ ```html
+ <div class="progress right progress-info">
+ ```
+
+ * to use a vertical progressbar you have to add `vertical` to the `progress` element
+
+ ```html
+ <div class="progress vertical progress-info">
+ ```
+
+ * to use a vertical progressbar which is align to the bottom you have to add `vertical` and `bottom` to the `progress` element
+
+ ```html
+ <div class="progress vertical bottom progress-info">
+ ```
+
+2. text and delay
simply add additional parameters when activating the script
@@ -56,7 +93,6 @@ You can now trigger progressbar as much as you want. Just change your `data` att
refresh_speed: 50,
display_text: 2,
use_percentage: true,
- border_radius: '4px',
update: doSomethingCool( current_percentage ) { .. },
done: doSomethingCool( ) { .. },
fail: doSomethingCool( error_message ) { .. },
@@ -71,34 +107,55 @@ You can now trigger progressbar as much as you want. Just change your `data` att
* `1` __text on filled bar__ *(this mode doesn't change any css / html)*
* `2` __text on center__ *(this mode changes css / html due to styling requirements)*
* `use_percentage` determines whether the text will be displayed in percent or amount
- * `border_radius` hook to change the border radius of the progressbar
-
- * __you only have to set this if you are using centered text AND have overwritten the default bootstrap value__
* `update` callback where you can grab the actual percentage value
* `done` callback which indicates when progressbar is filled to the given value
* `fail` callback where you can grab an error message when something went wrong
-2. animation
+3. animation
to change the animation itself you have to overwrite either less or css
- * less
- ```css
- .progress .bar {
- .transition(width 2s ease-in-out);
- }
- ```
- * css
-
- ```css
- .progress .bar {
- -webkit-transition: width 2s ease-in-out;
- -moz-transition: width 2s ease-in-out;
- -ms-transition: width 2s ease-in-out;
- -o-transition: width 2s ease-in-out;
- transition: width 2s ease-in-out;
- }
- ```
+ 1. horizontal
+
+ * less
+
+ ```css
+ .progress .bar {
+ .transition(width 2s ease-in-out);
+ }
+ ```
+ * css
+
+ ```css
+ .progress .bar {
+ -webkit-transition: width 2s ease-in-out;
+ -moz-transition: width 2s ease-in-out;
+ -ms-transition: width 2s ease-in-out;
+ -o-transition: width 2s ease-in-out;
+ transition: width 2s ease-in-out;
+ }
+ ```
+
+ 1. vertical
+
+ * less
+
+ ```css
+ .progress.vertical .bar {
+ .transition(height 2s ease-in-out);
+ }
+ ```
+ * css
+
+ ```css
+ .progress.vertical .bar {
+ -webkit-transition: height 2s ease-in-out;
+ -moz-transition: height 2s ease-in-out;
+ -ms-transition: height 2s ease-in-out;
+ -o-transition: height 2s ease-in-out;
+ transition: height 2s ease-in-out;
+ }
+ ```
## License
View
134 bootstrap-progressbar.css
@@ -0,0 +1,134 @@
+/* ========================================================
+ * bootstrap-progressbar v0.5.0
+ * ========================================================
+ * Copyright 2012 minddust.com
+ *
+ * bootstrap-progressbar is published under Apache License,
+ * Version 2.0 (see LICENSE file).
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * ======================================================== */
+
+/* bootstrap-progressbar global styles */
+
+.progress {
+ position: relative;
+}
+.progress .bar {
+ position: absolute;
+ overflow: hidden;
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ border-radius: 4px;
+}
+.progress .progressbar-back-text {
+ position: absolute;
+ width: 100%;
+ height: 100%;
+ font-size: 12px;
+ text-align: center;
+}
+.progress .progressbar-front-text {
+ display: block;
+ width: 100%;
+ font-size: 12px;
+ text-align: center;
+}
+
+/* bootstrap-progressbar horizontal styles */
+
+.progress.right .bar {
+ right: 0;
+}
+.progress.right .progressbar-front-text {
+ position: absolute;
+ right: 0;
+}
+
+/* bootstrap-progressbar vertical styles */
+
+.progress.vertical {
+ width: 20px;
+ height: 100%;
+ float: left;
+ margin-right: 20px;
+ background-color: #f9f9f9;
+ background-image: -moz-linear-gradient(left, #f5f5f5, #f9f9f9);
+ background-image: -webkit-gradient(linear, 0 0, 100% 0, from(#f5f5f5), to(#f9f9f9));
+ background-image: -webkit-linear-gradient(left, #f5f5f5, #f9f9f9);
+ background-image: -o-linear-gradient(left, #f5f5f5, #f9f9f9);
+ background-image: linear-gradient(to right, #f5f5f5, #f9f9f9);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#fff9f9f9', GradientType=1);
+}
+.progress.vertical.bottom {
+ position: relative;
+}
+.progress.vertical.bottom .progressbar-front-text {
+ position: absolute;
+ bottom: 0;
+}
+.progress.vertical .bar {
+ width: 100%;
+ height: 0;
+ background-color: #0480be;
+ background-image: -moz-linear-gradient(left, #149bdf, #0480be);
+ background-image: -webkit-gradient(linear, 0 0, 100% 0, from(#149bdf), to(#0480be));
+ background-image: -webkit-linear-gradient(left, #149bdf, #0480be);
+ background-image: -o-linear-gradient(left, #149bdf, #0480be);
+ background-image: linear-gradient(to right, #149bdf, #0480be);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff149bdf', endColorstr='#ff0480be', GradientType=1);
+ -webkit-transition: height 0.6s ease;
+ -moz-transition: height 0.6s ease;
+ -o-transition: height 0.6s ease;
+ transition: height 0.6s ease;
+}
+.progress.vertical.bottom .bar {
+ position: absolute;
+ bottom: 0;
+}
+.progress-danger.vertical .bar,
+.progress.vertical .bar-danger {
+ background-color: #c43c35;
+ background-image: -moz-linear-gradient(left, #ee5f5b, #c43c35);
+ background-image: -webkit-gradient(linear, 0 0, 100% 0, from(#ee5f5b), to(#c43c35));
+ background-image: -webkit-linear-gradient(left, #ee5f5b, #c43c35);
+ background-image: -o-linear-gradient(left, #ee5f5b, #c43c35);
+ background-image: linear-gradient(to right, #ee5f5b, #c43c35);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffc43c35', GradientType=1);
+}
+.progress-success.vertical .bar,
+.progress.vertical .bar-success {
+ background-color: #57a957;
+ background-image: -moz-linear-gradient(left, #62c462, #57a957);
+ background-image: -webkit-gradient(linear, 0 0, 100% 0, from(#62c462), to(#57a957));
+ background-image: -webkit-linear-gradient(left, #62c462, #57a957);
+ background-image: -o-linear-gradient(left, #62c462, #57a957);
+ background-image: linear-gradient(to right, #62c462, #57a957);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff57a957', GradientType=1);
+}
+.progress-info.vertical .bar,
+.progress.vertical .bar-info {
+ background-color: #339bb9;
+ background-image: -moz-linear-gradient(left, #5bc0de, #339bb9);
+ background-image: -webkit-gradient(linear, 0 0, 100% 0, from(#5bc0de), to(#339bb9));
+ background-image: -webkit-linear-gradient(left, #5bc0de, #339bb9);
+ background-image: -o-linear-gradient(left, #5bc0de, #339bb9);
+ background-image: linear-gradient(to right, #5bc0de, #339bb9);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff339bb9', GradientType=1);
+}
+.progress-warning.vertical .bar,
+.progress.vertical .bar-warning {
+ background-color: #f89406;
+ background-image: -moz-linear-gradient(left, #fbb450, #f89406);
+ background-image: -webkit-gradient(linear, 0 0, 100% 0, from(#fbb450), to(#f89406));
+ background-image: -webkit-linear-gradient(left, #fbb450, #f89406);
+ background-image: -o-linear-gradient(left, #fbb450, #f89406);
+ background-image: linear-gradient(to right, #fbb450, #f89406);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450', endColorstr='#fff89406', GradientType=1);
+}
View
91 bootstrap-progressbar.js
@@ -1,5 +1,5 @@
/* ========================================================
- * bootstrap-progressbar v0.4.6
+ * bootstrap-progressbar v0.5.0
* ========================================================
* Copyright 2012 minddust.com
*
@@ -34,10 +34,13 @@
percentage = $this.attr('data-percentage'),
amount_part = $this.attr('data-amount-part'),
amount_total = $this.attr('data-amount-total'),
+ is_vertical,
update,
done,
fail;
+ is_vertical = $parent.hasClass('vertical');
+
update = (options.update && typeof(options.update) === 'function') ? options.update : $.fn.progressbar.defaults.update;
done = (options.done && typeof(options.done) === 'function') ? options.done : $.fn.progressbar.defaults.done;
fail = (options.fail && typeof(options.fail) === 'function') ? options.fail : $.fn.progressbar.defaults.fail;
@@ -56,41 +59,67 @@
}
}
- if (options.display_text === $.fn.progressbar.display_text.center && !$front && !$back) {
- $parent.css('position', 'relative');
- $this.css({
- 'position': 'absolute',
- 'float': 'left',
- 'overflow': 'hidden',
- '-webkit-border-radius': options.border_radius,
- '-moz-border-radius': options.border_radius,
- 'border-radius': options.border_radius
- });
-
- $parent.prepend('<span class="progressbar-back-text" style="position:absolute;width:100%;text-align:center"></span>');
- $this.prepend('<span class="progressbar-front-text" style="display:block;text-align:center"></span>');
- this.back = $back = $parent.find('.progressbar-back-text'),
- this.front = $front = $parent.find('.progressbar-front-text');
- $front.css('width', $parent.css('width'));
- $(window).resize(function() {
- $front.css('width', $parent.css('width'));
- }); // normal resizing would brick the structure because width is in px
+ if (options.display_text === $.fn.progressbar.display_text.center && !$front && !$back) {
+ this.back = $back = $('<span>').addClass('progressbar-back-text');
+ this.front = $front = $('<span>').addClass('progressbar-front-text');
+
+ $parent.prepend($back);
+ $this.prepend($front);
+
+ var parent_size;
+
+ if (is_vertical) {
+ parent_size = $parent.css('height');
+ $back.css('height', parent_size);
+ $back.css('line-height', parent_size);
+ $front.css('height', parent_size);
+ $front.css('line-height', parent_size);
+
+ $(window).resize(function() {
+ parent_size = $parent.css('height');
+ $back.css('height', parent_size);
+ $back.css('line-height', parent_size);
+ $front.css('height', parent_size);
+ $front.css('line-height', parent_size);
+ }); // normal resizing would brick the structure because width is in px
+ }
+ else {
+ parent_size = $parent.css('width');
+ $front.css('width', parent_size);
+
+ $(window).resize(function() {
+ parent_size = $parent.css('width');
+ $front.css('width', parent_size);
+ }); // normal resizing would brick the structure because width is in px
+ }
}
setTimeout(function() {
- $this.css('width', percentage+'%');
-
var current_percentage,
current_value,
- this_width,
- parent_width,
+ this_size,
+ parent_size,
text;
+ if (is_vertical) {
+ $this.css('height', percentage+'%');
+ }
+ else {
+ $this.css('width', percentage+'%');
+ }
+
var progress = setInterval(function() {
- this_width = $this.width();
- parent_width = $parent.width();
- current_percentage = Math.round(100 * this_width / parent_width);
- current_value = Math.round(this_width / parent_width * amount_total);
+ if (is_vertical) {
+ this_size = $this.height();
+ parent_size = $parent.height();
+ }
+ else {
+ this_size = $this.width();
+ parent_size = $parent.width();
+ }
+
+ current_percentage = Math.round(100 * this_size / parent_size);
+ current_value = Math.round(this_size / parent_size * amount_total);
if (current_percentage >= percentage) {
current_percentage = percentage;
@@ -102,18 +131,17 @@
if (options.display_text !== $.fn.progressbar.display_text.none) {
text = options.use_percentage ? (current_percentage +'%') : (current_value + ' / ' + amount_total);
- if (options.display_text === $.fn.progressbar.display_text.filled){
+ if (options.display_text === $.fn.progressbar.display_text.filled){
$this.text(text);
}
- else if (options.display_text === $.fn.progressbar.display_text.center) {
+ else if (options.display_text === $.fn.progressbar.display_text.center) {
$back.text(text);
$front.text(text);
}
}
update(current_percentage);
}, options.refresh_speed);
-
}, options.transition_delay);
}
};
@@ -147,7 +175,6 @@
refresh_speed: 50,
display_text: $.fn.progressbar.display_text.none,
use_percentage: true,
- border_radius: '4px',
update: $.noop,
done: $.noop,
fail: $.noop
View
137 bootstrap-progressbar.less
@@ -0,0 +1,137 @@
+/* ========================================================
+ * bootstrap-progressbar v0.5.0
+ * ========================================================
+ * Copyright 2012 minddust.com
+ *
+ * bootstrap-progressbar is published under Apache License,
+ * Version 2.0 (see LICENSE file).
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * ======================================================== */
+
+// local copy of twitter bootstrap defines
+// ---------------------------------------
+
+@baseLineHeight: 20px;
+@orange: #f89406;
+
+#gradient {
+ .horizontal(@startColor: #555, @endColor: #333) {
+ background-color: @endColor;
+ background-image: -moz-linear-gradient(left, @startColor, @endColor); // FF 3.6+
+ background-image: -webkit-gradient(linear, 0 0, 100% 0, from(@startColor), to(@endColor)); // Safari 4+, Chrome 2+
+ background-image: -webkit-linear-gradient(left, @startColor, @endColor); // Safari 5.1+, Chrome 10+
+ background-image: -o-linear-gradient(left, @startColor, @endColor); // Opera 11.10
+ background-image: linear-gradient(to right, @startColor, @endColor); // Standard, IE10
+ background-repeat: repeat-x;
+ filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)",argb(@startColor),argb(@endColor))); // IE9 and down
+ }
+}
+
+.transition(@transition) {
+ -webkit-transition: @transition;
+ -moz-transition: @transition;
+ -o-transition: @transition;
+ transition: @transition;
+}
+
+.border-radius(@radius) {
+ -webkit-border-radius: @radius;
+ -moz-border-radius: @radius;
+ border-radius: @radius;
+}
+
+// bootstrap-progressbar global styles
+// -----------------------------------
+
+@progressbarVerticalWidth: @baseLineHeight;
+@progressbarFontSize: 12px;
+
+.progress {
+ position: relative;
+}
+
+.progress .bar {
+ position: absolute;
+ overflow: hidden;
+ .border-radius(4px)
+}
+
+.progress .progressbar-back-text {
+ position: absolute;
+ width: 100%;
+ height: 100%;
+ font-size: @progressbarFontSize;
+ text-align: center;
+}
+
+.progress .progressbar-front-text {
+ display: block;
+ width: 100%;
+ font-size: @progressbarFontSize;
+ text-align: center;
+}
+
+// bootstrap-progressbar horizontal styles
+// ---------------------------------------
+
+.progress.right .bar {
+ right: 0;
+}
+
+.progress.right .progressbar-front-text {
+ position: absolute;
+ right: 0;
+}
+
+// bootstrap-progressbar vertical styles
+// -------------------------------------
+
+.progress.vertical {
+ width: @progressbarVerticalWidth;
+ height: 100%;
+ float: left;
+ margin-right: @progressbarVerticalWidth;
+ #gradient > .horizontal(#f5f5f5, #f9f9f9);
+}
+
+.progress.vertical.bottom {
+ position: relative;
+}
+
+.progress.vertical.bottom .progressbar-front-text {
+ position: absolute;
+ bottom: 0;
+}
+
+.progress.vertical .bar {
+ width: 100%;
+ height: 0;
+ #gradient > .horizontal(#149bdf, #0480be);
+ .transition(height .6s ease);
+}
+
+.progress.vertical.bottom .bar {
+ position: absolute;
+ bottom: 0;
+}
+
+// Danger (red)
+.progress-danger.vertical .bar, .progress.vertical .bar-danger {
+ #gradient > .horizontal(#ee5f5b, #c43c35);
+}
+
+// Success (green)
+.progress-success.vertical .bar, .progress.vertical .bar-success {
+ #gradient > .horizontal(#62c462, #57a957);
+}
+
+// Info (teal)
+.progress-info.vertical .bar, .progress.vertical .bar-info {
+ #gradient > .horizontal(#5bc0de, #339bb9);
+}
+
+// Warning (orange)
+.progress-warning.vertical .bar, .progress.vertical .bar-warning {
+ #gradient > .horizontal(lighten(@orange, 15%), @orange);
+}
View
2 bootstrap-progressbar.min.css
@@ -0,0 +1,2 @@
+/* bootstrap-progressbar v0.5.0 | Copyright 2012 minddust.com | http://www.apache.org/licenses/LICENSE-2.0 */
+.progress{position:relative}.progress .bar{position:absolute;overflow:hidden;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.progress .progressbar-back-text{position:absolute;width:100%;height:100%;font-size:12px;text-align:center}.progress .progressbar-front-text{display:block;width:100%;font-size:12px;text-align:center}.progress.right .bar{right:0}.progress.right .progressbar-front-text{position:absolute;right:0}.progress.vertical{width:20px;height:100%;float:left;margin-right:20px;background-color:#f9f9f9;background-image:-moz-linear-gradient(left,#f5f5f5,#f9f9f9);background-image:-webkit-gradient(linear,0 0,100% 0,from(#f5f5f5),to(#f9f9f9));background-image:-webkit-linear-gradient(left,#f5f5f5,#f9f9f9);background-image:-o-linear-gradient(left,#f5f5f5,#f9f9f9);background-image:linear-gradient(to right,#f5f5f5,#f9f9f9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5',endColorstr='#fff9f9f9',GradientType=1)}.progress.vertical.bottom{position:relative}.progress.vertical.bottom .progressbar-front-text{position:absolute;bottom:0}.progress.vertical .bar{width:100%;height:0;background-color:#0480be;background-image:-moz-linear-gradient(left,#149bdf,#0480be);background-image:-webkit-gradient(linear,0 0,100% 0,from(#149bdf),to(#0480be));background-image:-webkit-linear-gradient(left,#149bdf,#0480be);background-image:-o-linear-gradient(left,#149bdf,#0480be);background-image:linear-gradient(to right,#149bdf,#0480be);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff149bdf',endColorstr='#ff0480be',GradientType=1);-webkit-transition:height .6s ease;-moz-transition:height .6s ease;-o-transition:height .6s ease;transition:height .6s ease}.progress.vertical.bottom .bar{position:absolute;bottom:0}.progress-danger.vertical .bar,.progress.vertical .bar-danger{background-color:#c43c35;background-image:-moz-linear-gradient(left,#ee5f5b,#c43c35);background-image:-webkit-gradient(linear,0 0,100% 0,from(#ee5f5b),to(#c43c35));background-image:-webkit-linear-gradient(left,#ee5f5b,#c43c35);background-image:-o-linear-gradient(left,#ee5f5b,#c43c35);background-image:linear-gradient(to right,#ee5f5b,#c43c35);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b',endColorstr='#ffc43c35',GradientType=1)}.progress-success.vertical .bar,.progress.vertical .bar-success{background-color:#57a957;background-image:-moz-linear-gradient(left,#62c462,#57a957);background-image:-webkit-gradient(linear,0 0,100% 0,from(#62c462),to(#57a957));background-image:-webkit-linear-gradient(left,#62c462,#57a957);background-image:-o-linear-gradient(left,#62c462,#57a957);background-image:linear-gradient(to right,#62c462,#57a957);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462',endColorstr='#ff57a957',GradientType=1)}.progress-info.vertical .bar,.progress.vertical .bar-info{background-color:#339bb9;background-image:-moz-linear-gradient(left,#5bc0de,#339bb9);background-image:-webkit-gradient(linear,0 0,100% 0,from(#5bc0de),to(#339bb9));background-image:-webkit-linear-gradient(left,#5bc0de,#339bb9);background-image:-o-linear-gradient(left,#5bc0de,#339bb9);background-image:linear-gradient(to right,#5bc0de,#339bb9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de',endColorstr='#ff339bb9',GradientType=1)}.progress-warning.vertical .bar,.progress.vertical .bar-warning{background-color:#f89406;background-image:-moz-linear-gradient(left,#fbb450,#f89406);background-image:-webkit-gradient(linear,0 0,100% 0,from(#fbb450),to(#f89406));background-image:-webkit-linear-gradient(left,#fbb450,#f89406);background-image:-o-linear-gradient(left,#fbb450,#f89406);background-image:linear-gradient(to right,#fbb450,#f89406);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450',endColorstr='#fff89406',GradientType=1)}
View
4 bootstrap-progressbar.min.js
@@ -1,2 +1,2 @@
-/* bootstrap-progressbar v0.4.6 | Copyright 2012 minddust.com | http://www.apache.org/licenses/LICENSE-2.0 */
-(function(b){var e=function(c,d){this.element=b(c);this.options=b.extend({},b.fn.progressbar.defaults,d)};e.prototype={constructor:e,transition:function(){var c=this.element,d=c.parent(),f=this.back,g=this.front,a=this.options,i=c.attr("data-percentage"),e=c.attr("data-amount-part"),k=c.attr("data-amount-total"),o,p,h;o=a.update&&"function"===typeof a.update?a.update:b.fn.progressbar.defaults.update;p=a.done&&"function"===typeof a.done?a.done:b.fn.progressbar.defaults.done;h=a.fail&&"function"===typeof a.fail?a.fail:b.fn.progressbar.defaults.fail;if(a.use_percentage&&!i)h("bootstrap-progressbar: you can't use percentage without data-percentage being set");else{if(!a.use_percentage){if(!e&&!k){h("bootstrap-progressbar: you can't use values without data-amount-part and data-amount-total being set");return}i=Math.round(100*e/k)}a.display_text===b.fn.progressbar.display_text.center&&(!g&&!f)&&(d.css("position","relative"),c.css({position:"absolute","float":"left",overflow:"hidden","-webkit-border-radius":a.border_radius,"-moz-border-radius":a.border_radius,"border-radius":a.border_radius}),d.prepend('<span class="progressbar-back-text" style="position:absolute;width:100%;text-align:center"></span>'),c.prepend('<span class="progressbar-front-text" style="display:block;text-align:center"></span>'),this.back=f=d.find(".progressbar-back-text"),this.front=g=d.find(".progressbar-front-text"),g.css("width",d.css("width")),b(window).resize(function(){g.css("width",d.css("width"))}));setTimeout(function(){c.css("width",i+"%");var j,h,m,n,l,q=setInterval(function(){m=c.width();n=d.width();j=Math.round(100*m/n);h=Math.round(m/n*k);if(j>=i){j=i;h=e;p();clearInterval(q)}if(a.display_text!==b.fn.progressbar.display_text.none){l=a.use_percentage?j+"%":h+" / "+k;if(a.display_text===b.fn.progressbar.display_text.filled)c.text(l);else if(a.display_text===b.fn.progressbar.display_text.center){f.text(l);g.text(l)}}o(j)},a.refresh_speed)},a.transition_delay)}}};b.fn.progressbar=function(c){return this.each(function(){var d=b(this),f=d.data("progressbar"),g="object"===typeof c&&c;f||d.data("progressbar",f=new e(this,g));if("string"===typeof c)f[c]();f.transition()})};b.fn.progressbar.display_text={none:0,filled:1,center:2};b.fn.progressbar.defaults={transition_delay:300,refresh_speed:50,display_text:b.fn.progressbar.display_text.none,use_percentage:!0,border_radius:"4px",update:b.noop,done:b.noop,fail:b.noop};b.fn.progressbar.Constructor=e})(window.jQuery);
+/* bootstrap-progressbar v0.5.0 | Copyright 2012 minddust.com | http://www.apache.org/licenses/LICENSE-2.0 */
+(function(a){var h=function(d,e){this.element=a(d);this.options=a.extend({},a.fn.progressbar.defaults,e)};h.prototype={constructor:h,transition:function(){var d=this.element,e=d.parent(),f=this.back,g=this.front,c=this.options,j=d.attr("data-percentage"),h=d.attr("data-amount-part"),k=d.attr("data-amount-total"),l,p,q,i;l=e.hasClass("vertical");p=c.update&&"function"===typeof c.update?c.update:a.fn.progressbar.defaults.update;q=c.done&&"function"===typeof c.done?c.done:a.fn.progressbar.defaults.done;i=c.fail&&"function"===typeof c.fail?c.fail:a.fn.progressbar.defaults.fail;if(c.use_percentage&&!j)i("bootstrap-progressbar: you can't use percentage without data-percentage being set");else{if(!c.use_percentage){if(!h&&!k){i("bootstrap-progressbar: you can't use values without data-amount-part and data-amount-total being set");return}j=Math.round(100*h/k)}if(c.display_text===a.fn.progressbar.display_text.center&&!g&&!f){this.back=f=a("<span>").addClass("progressbar-back-text");this.front=g=a("<span>").addClass("progressbar-front-text");e.prepend(f);d.prepend(g);var b;l?(b=e.css("height"),f.css("height",b),f.css("line-height",b),g.css("height",b),g.css("line-height",b),a(window).resize(function(){b=e.css("height");f.css("height",b);f.css("line-height",b);g.css("height",b);g.css("line-height",b)})):(b=e.css("width"),g.css("width",b),a(window).resize(function(){b=e.css("width");g.css("width",b)}))}setTimeout(function(){var b,i,m,n,o;l?d.css("height",j+"%"):d.css("width",j+"%");var r=setInterval(function(){l?(m=d.height(),n=e.height()):(m=d.width(),n=e.width());b=Math.round(100*m/n);i=Math.round(m/n*k);b>=j&&(b=j,i=h,q(),clearInterval(r));c.display_text!==a.fn.progressbar.display_text.none&&(o=c.use_percentage?b+"%":i+" / "+k,c.display_text===a.fn.progressbar.display_text.filled?d.text(o):c.display_text===a.fn.progressbar.display_text.center&&(f.text(o),g.text(o)));p(b)},c.refresh_speed)},c.transition_delay)}}};a.fn.progressbar=function(d){return this.each(function(){var e=a(this),f=e.data("progressbar"),g="object"===typeof d&&d;f||e.data("progressbar",f=new h(this,g));if("string"===typeof d)f[d]();f.transition()})};a.fn.progressbar.display_text={none:0,filled:1,center:2};a.fn.progressbar.defaults={transition_delay:300,refresh_speed:50,display_text:a.fn.progressbar.display_text.none,use_percentage:!0,update:a.noop,done:a.noop,fail:a.noop};a.fn.progressbar.Constructor=h})(window.jQuery);

0 comments on commit 9950dbe

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