<button id="p1-destroy" onclick="$('#p1').progressbar('destroy');">destroy</button>\r
<button id="p1-start" onclick="$('#p1').progressbar('start');">Start</button>\r
<button id="p1-stop" onclick="$('#p1').progressbar('stop');">Stop</button>\r
-<button id="p1-pause" onclick="$('#p1').progressbar('reset');">reset</button>\r
+<button id="p1-stop" onclick="$('#p1').progressbar('pause');">pause</button>\r
<button id="p1-enable" onclick="$('#p1').progressbar('enable');">enable</button>\r
<button id="p1-disable" onclick="$('#p1').progressbar('disable');">disable</button>\r
<button id="p1-progress" onclick="$('#p1').progressbar('progress', 50);">progress to 50</button>\r
<button id="p2-destroy" onclick="$('#p2').progressbar('destroy');">destroy</button>\r
<button id="p2-start" onclick="$('#p2').progressbar('start');">Start</button>\r
<button id="p2-stop" onclick="$('#p2').progressbar('stop');">Stop</button>\r
-<button id="p2-pause" onclick="$('#p2').progressbar('reset');">reset</button>\r
+<button id="p2-stop" onclick="$('#p2').progressbar('pause');">pause</button>\r
<button id="p2-enable" onclick="$('#p2').progressbar('enable');">enable</button>\r
<button id="p2-disable" onclick="$('#p2').progressbar('disable');">disable</button>\r
<button id="p2-progress" onclick="$('#p2').progressbar('progress', 40);">progress to 50</button>\r
<button id="p3-destroy" onclick="$('#p3').progressbar('destroy');">destroy</button>\r
<button id="p3-start" onclick="$('#p3').progressbar('start');">Start</button>\r
<button id="p3-stop" onclick="$('#p3').progressbar('stop');">Stop</button>\r
-<button id="p3-pause" onclick="$('#p3').progressbar('reset');">reset</button>\r
+<button id="p3-stop" onclick="$('#p3').progressbar('pause');">pause</button>\r
<button id="p3-enable" onclick="$('#p3').progressbar('enable');">enable</button>\r
<button id="p3-disable" onclick="$('#p3').progressbar('disable');">disable</button>\r
<button id="p3-progress" onclick="$('#p3').progressbar('progress', $('#p3-value').val());">progress to</button>\r
\r
<button id="p2-startall" onclick="$('#p2, #p1, #p3').progressbar('start');">Start All</button>\r
<button id="p2-stopall" onclick="$('#p2, #p1, #p3').progressbar('stop');">Stop All</button>\r
-<button id="p2-stopall" onclick="$('#p2, #p1, #p3').progressbar('reset');">Reset All</button>\r
+<button id="p2-stopall" onclick="$('#p2, #p1, #p3').progressbar('pause');">Pause All</button>\r
\r
<script>\r
\r
.append(this.bar.append(this.textElement.addClass(options.textClass)), this.textBg)\r
.appendTo(this.element);\r
\r
+ jQuery.easing[this.identifier] = function (x, t, b, c, d) {\r
+ var inc = options.increment,\r
+ width = options.width,\r
+ step = ((inc > width ? width : inc)/width),\r
+ state = Math.round(x/step)*step;\r
+ return state > 1 ? 1 : state;\r
+ };\r
},\r
\r
plugins: {},\r
this.element.triggerHandler(n == "progressbar" ? n : ["progressbar", n].join(""), [e, this.ui()], this.options[n]);\r
},\r
destroy: function() {\r
- this.reset();\r
+ this.stop();\r
\r
this.element\r
.removeClass("ui-progressbar ui-progressbar-disabled")\r
this.disabled = true;\r
},\r
start: function() {\r
- if (this.disabled) return;\r
-\r
var self = this, options = this.options;\r
\r
- jQuery.easing[this.identifier] = function (x, t, b, c, d) {\r
- var inc = options.increment,\r
- width = options.width,\r
- step = ((inc > width ? width : inc)/width),\r
- state = Math.round(x/step)*step;\r
- return state > 1 ? 1 : state;\r
+ if (this.disabled) {\r
+ return;\r
};\r
+ \r
+ self.active = true;\r
+ \r
+ setTimeout(\r
+ function() {\r
+ self.active = false;\r
+ },\r
+ options.duration\r
+ );\r
+\r
+ this.animate();\r
+\r
+ this.propagate('start', this.ui());\r
+ return false;\r
+ },\r
+ animate: function() {\r
+ var self = this,\r
+ options = this.options,\r
+ interval = options.interval;\r
\r
this.bar.animate(\r
{\r
width: options.width\r
},\r
{\r
- duration: options.interval,\r
+ duration: interval,\r
easing: this.identifier,\r
step: function(step, b) {\r
- var elapsedTime = ((new Date().getTime()) - b.startTime);\r
- options.interval = options._interval - elapsedTime;\r
self.progress((step/options.width)*100);\r
+ var elapsedTime = ((new Date().getTime()) - b.startTime);\r
+ options.interval = interval - elapsedTime;\r
},\r
complete: function() {\r
delete jQuery.easing[self.identifier];\r
- self.stop();\r
+ self.pause();\r
+\r
+ if (self.active) {\r
+ /*TODO*/\r
+ self.stop();\r
+ self.animate();\r
+ }\r
}\r
}\r
);\r
-\r
- this.propagate('start', this.ui());\r
- return false;\r
},\r
- stop: function() {\r
+ pause: function() {\r
if (this.disabled) return;\r
this.bar.stop();\r
- this.propagate('stop', this.ui());\r
- return false;\r
-\r
+ this.propagate('pause', this.ui());\r
},\r
- reset: function() {\r
+ stop: function() {\r
this.bar.stop();\r
this.bar.width(0);\r
this.textElement.width(0);\r
this.bar.addClass('ui-hidden');\r
this.options.interval = this.options._interval;\r
- return false;\r
+ this.propagate('stop', this.ui());\r
},\r
progress: function(percentState) {\r
if (this.bar.is('.ui-hidden')) {\r