Author: damoxc
Revision: 5108
Log:
move the progressbar renderer helper method to deluge.js
Diff:
Modified: trunk/deluge/ui/web/js/deluge.js
===================================================================
--- trunk/deluge/ui/web/js/deluge.js 2009-04-20 22:01:52 UTC (rev 5107)
+++ trunk/deluge/ui/web/js/deluge.js 2009-04-20 22:32:42 UTC (rev 5108)
@@ -26,6 +26,28 @@
version: '1.2-dev'
};
+(function() {
+ var tpl = '<div class="x-progress-wrap x-progress-renderered">' +
+ '<div class="x-progress-inner">' +
+ '<div style="width: {2}px" class="x-progress-bar">' +
+ '<div style="z-index: 99; width: {3}px"
class="x-progress-text">' +
+ '<div style="width: {1}px;">{0}</div>' +
+ '</div>' +
+ '</div>' +
+ '<div class="x-progress-text x-progress-text-back">' +
+ '<div style="width: {1}px;">{0}</div>' +
+ '</div>' +
+ '</div>' +
+ '</div>';
+
+ Deluge.progressBar = function(progress, width, text) {
+ var progressWidth = (width / 100.0) * progress;
+ var barWidth = progressWidth.toInt() - 1;
+ var textWidth = ((progressWidth.toInt() - 10) > 0 ?
progressWidth.toInt() - 10 : 0);
+ return String.format(tpl, text, width, barWidth, textWidth);
+ }
+})();
+
Deluge.Events = {
_events: new Hash(),
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"deluge-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/deluge-commit?hl=en
-~----------~----~----~----~------~----~------~--~---