From be05edac7d5b1add307ad8236b50170a5b22dd18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Severin=20M=C3=BCnger?= Date: Sun, 15 Sep 2013 01:57:03 +0200 Subject: [PATCH] Added Progress Control --- examples/widgetapp/widget.js | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/examples/widgetapp/widget.js b/examples/widgetapp/widget.js index 76efbde4..8d0122c5 100644 --- a/examples/widgetapp/widget.js +++ b/examples/widgetapp/widget.js @@ -1,6 +1,6 @@ // Generated by CoffeeScript 1.6.1 (function() { - var $el, Mini, WSF_AUTOCOMPLETE_CONTROL, WSF_BUTTON_CONTROL, WSF_CHECKBOX_CONTROL, WSF_CHECKBOX_LIST_CONTROL, WSF_CONTROL, WSF_FORM_ELEMENT_CONTROL, WSF_HTML_CONTROL, WSF_INPUT_CONTROL, WSF_MAX_VALIDATOR, WSF_MIN_VALIDATOR, WSF_REGEXP_VALIDATOR, WSF_TEXTAREA_CONTROL, WSF_VALIDATOR, cache, controls, name, state, template, tmpl, trigger_callback, type, typemap, validatormap, _ref, _ref1, _ref2, + var $el, Mini, WSF_AUTOCOMPLETE_CONTROL, WSF_BUTTON_CONTROL, WSF_CHECKBOX_CONTROL, WSF_CHECKBOX_LIST_CONTROL, WSF_CONTROL, WSF_FORM_ELEMENT_CONTROL, WSF_HTML_CONTROL, WSF_INPUT_CONTROL, WSF_MAX_VALIDATOR, WSF_MIN_VALIDATOR, WSF_PROGRESS_CONTROL, WSF_REGEXP_VALIDATOR, WSF_TEXTAREA_CONTROL, WSF_VALIDATOR, cache, controls, name, state, template, tmpl, trigger_callback, type, typemap, validatormap, _ref, _ref1, _ref2, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; @@ -463,6 +463,25 @@ })(WSF_CONTROL); + WSF_PROGRESS_CONTROL = (function(_super) { + + __extends(WSF_PROGRESS_CONTROL, _super); + + function WSF_PROGRESS_CONTROL() { + return WSF_PROGRESS_CONTROL.__super__.constructor.apply(this, arguments); + } + + WSF_PROGRESS_CONTROL.prototype.update = function(state) { + if (state.progress != null) { + window.states[this.control_name]['progress'] = state.progress; + return $('#' + this.control_name).children('.progress-bar').attr('aria-valuenow', state.progress).width(state.progress + '%'); + } + }; + + return WSF_PROGRESS_CONTROL; + + })(WSF_CONTROL); + typemap = { "WSF_BUTTON_CONTROL": WSF_BUTTON_CONTROL, "WSF_INPUT_CONTROL": WSF_INPUT_CONTROL, @@ -471,7 +490,8 @@ "WSF_CHECKBOX_CONTROL": WSF_CHECKBOX_CONTROL, "WSF_FORM_ELEMENT_CONTROL": WSF_FORM_ELEMENT_CONTROL, "WSF_HTML_CONTROL": WSF_HTML_CONTROL, - "WSF_CHECKBOX_LIST_CONTROL": WSF_CHECKBOX_LIST_CONTROL + "WSF_CHECKBOX_LIST_CONTROL": WSF_CHECKBOX_LIST_CONTROL, + "WSF_PROGRESS_CONTROL": WSF_PROGRESS_CONTROL }; _ref = window.states;