commit/galaxy-central: guerler: ToolForm: Add sliders, radio buttons for boolean and integer fields, Ui: Update frames
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/e8ab30c9e347/ Changeset: e8ab30c9e347 User: guerler Date: 2014-09-02 22:06:35 Summary: ToolForm: Add sliders, radio buttons for boolean and integer fields, Ui: Update frames Affected #: 10 files diff -r 36327228fe4f1f648e4fabe783d446c8dd6c1f73 -r e8ab30c9e3471de1b874e580663560f6a4a7f143 static/scripts/mvc/tools/tools-section.js --- a/static/scripts/mvc/tools/tools-section.js +++ b/static/scripts/mvc/tools/tools-section.js @@ -19,7 +19,7 @@ // add table class for tr tag // this assist in transforming the form into a json structure - options.cls_tr = 'form-row'; + options.cls_tr = 'section-row'; // create table this.table = new Table.View(options); @@ -230,12 +230,21 @@ case 'hidden': field = this._field_hidden(input_def, data); break; - } - - // check if field type was detected - if (!field) { - console.debug('tools-form::_addRow() : Unmatched field type (' + field_type + ').'); - return; + + // integer field + case 'integer': + field = this._field_integer(input_def, data); + break; + + // boolean field + case 'boolean': + field = this._field_radiobutton(input_def, data); + break; + + // default + default: + field = this._field_text(input_def, data); + console.debug('tools-form::_addRow() : Unmatched field type (' + field_type + ').'); } // set value @@ -449,6 +458,18 @@ }); }, + // integer field + _field_integer: function(input_def, data) { + var id = input_def.id; + return new Ui.Slider.View({ + id : 'field-' + id, + value : data.get(id), + onchange : function(value) { + data.set(id, value); + } + }); + }, + // text area _field_textarea : function(input_def, data) { var id = input_def.id; @@ -480,6 +501,25 @@ id : 'field-' + id, value : data.get(id) }); + }, + + // hidden field + _field_radiobutton : function(input_def, data) { + var id = input_def.id; + return new Ui.RadioButton.View({ + id : 'field-' + id, + value : data.get(id), + data : [ + { + label : 'Yes', + value : 'true' + }, + { + label : 'No', + value : 'false' + } + ] + }); } }); diff -r 36327228fe4f1f648e4fabe783d446c8dd6c1f73 -r e8ab30c9e3471de1b874e580663560f6a4a7f143 static/scripts/mvc/tools/tools-tree.js --- a/static/scripts/mvc/tools/tools-tree.js +++ b/static/scripts/mvc/tools/tools-tree.js @@ -39,7 +39,7 @@ var id = $(child).attr('id'); // create new branch - if ($(child).hasClass('form-row') || $(child).hasClass('tab-pane')) { + if ($(child).hasClass('section-row') || $(child).hasClass('tab-pane')) { // create sub dictionary dict[id] = {}; diff -r 36327228fe4f1f648e4fabe783d446c8dd6c1f73 -r e8ab30c9e3471de1b874e580663560f6a4a7f143 static/scripts/mvc/ui/ui-frames.js --- a/static/scripts/mvc/ui/ui-frames.js +++ b/static/scripts/mvc/ui/ui-frames.js @@ -2,14 +2,11 @@ define([], function() { // frame manager -var View = Backbone.View.extend( -{ +var View = Backbone.View.extend({ // defaults inputs - options: - { + options: { // default frame size - frame: - { + frame: { cols : 6, rows : 3 }, @@ -67,14 +64,14 @@ visible: null, // initialize - initialize : function(options) - { + initialize : function(options) { // add to masthead menu var self = this; // read in defaults - if (options) + if (options) { this.options = _.defaults(options, this.options); + } // set visibility this.visible = this.options.visible; @@ -129,8 +126,7 @@ // catch window resize event var self = this; - $(window).resize(function () - { + $(window).resize(function () { if (self.visible) self._panel_refresh(); }); @@ -145,11 +141,9 @@ * argument that is the frame's content DOM element * content: the content to be loaded into the frame. */ - add: function(options) - { + add: function(options) { // frame default options - var frameOptions = - { + var frameOptions = { title: '', content: null, target: '', @@ -157,18 +151,19 @@ } // read in defaults - if (options) + if (options) { options = _.defaults(options, frameOptions); - else + } else { options = frameOptions; + } // check for content - if(!options.content) + if(!options.content) { return; + } // check for number of frames - if (this.frame_counter >= this.options.frame_max) - { + if (this.frame_counter >= this.options.frame_max) { alert("You have reached the maximum number of allowed frames (" + this.options.frame_max + ")."); return; } @@ -177,8 +172,7 @@ var frame_id = '#frame-' + (this.frame_counter_id++); // check if frame exists - if ($(frame_id).length !== 0) - { + if ($(frame_id).length !== 0) { alert("This frame already exists. This page might contain multiple frame managers."); return; } @@ -190,8 +184,7 @@ var $frame_el = null; if (options.type === 'url') { $frame_el = $(this._template_frame_url(frame_id.substring(1), options.title, options.content)); - } - else if (options.type === 'other') { + } else if (options.type === 'other') { $frame_el = $(this._template_frame(frame_id.substring(1), options.title)); // Load content into frame. @@ -234,13 +227,13 @@ this._frame_insert(frame, {top: 0, left: 0}, true); // show frames if hidden - if (!this.visible) + if (!this.visible) { this.show(); + } }, // show panel - show: function() - { + show: function() { // show this.visible = true; @@ -261,8 +254,7 @@ }, // hide panel - hide: function() - { + hide: function() { // make sure that no event is currently processing if (this.event.type !== null) return; @@ -298,16 +290,14 @@ */ // event - event: - { + event: { type : null, target : null, xy : null }, // events - events: - { + events: { // global frame events 'mousemove' : '_event_frame_mouse_move', 'mouseup' : '_event_frame_mouse_up', @@ -325,24 +315,26 @@ }, // drag start - _event_frame_mouse_down: function (e) - { + _event_frame_mouse_down: function (e) { // skip if event is already active - if (this.event.type !== null) + if (this.event.type !== null) { return; + } // check for drag event - if ($(e.target).hasClass('f-header') || - $(e.target).hasClass('f-title')) + if ($(e.target).hasClass('f-header') || $(e.target).hasClass('f-title')) { this.event.type = 'drag'; + } // check for resize event - if ($(e.target).hasClass('f-resize')) + if ($(e.target).hasClass('f-resize')) { this.event.type = 'resize'; + } // skip if no event has to be handled - if (this.event.type === null) + if (this.event.type === null) { return; + } // prevent e.preventDefault(); @@ -351,32 +343,36 @@ this.event.target = this._frame_identify(e.target); // check if frame is locked - if (this.event.target.grid_lock) - { + if (this.event.target.grid_lock) { this.event.type = null; return; } // backup event details - this.event.xy = {x: e.originalEvent.pageX, y: e.originalEvent.pageY}; + this.event.xy = { + x: e.originalEvent.pageX, + y: e.originalEvent.pageY + }; // prepare drag/resize this._frame_drag_start(this.event.target); }, // mouse move event - _event_frame_mouse_move: function (e) - { + _event_frame_mouse_move: function (e) { // check - if (this.event.type != 'drag' && this.event.type != 'resize') + if (this.event.type != 'drag' && this.event.type != 'resize') { return; + } // current position - var event_xy_new = {x: e.originalEvent.pageX , y: e.originalEvent.pageY}; + var event_xy_new = { + x : e.originalEvent.pageX, + y : e.originalEvent.pageY + }; // position delta - var event_xy_delta = - { + var event_xy_delta = { x : event_xy_new.x - this.event.xy.x, y : event_xy_new.y - this.event.xy.y }; @@ -388,8 +384,7 @@ var p = this._frame_screen (this.event.target); // resize event - if (this.event.type == 'resize') - { + if (this.event.type == 'resize') { // update p.width += event_xy_delta.x; p.height += event_xy_delta.y; @@ -421,8 +416,7 @@ } // drag event - if (this.event.type == 'drag') - { + if (this.event.type == 'drag') { // update p.left += event_xy_delta.x; p.top += event_xy_delta.y; @@ -437,8 +431,9 @@ }; // increase priority of current frame - if (l.left !== 0) + if (l.left !== 0) { l.left++; + } // fix position this._frame_insert(this.frame_shadow, l); @@ -446,11 +441,11 @@ }, // mouse up - _event_frame_mouse_up: function (e) - { + _event_frame_mouse_up: function (e) { // check - if (this.event.type != 'drag' && this.event.type != 'resize') + if (this.event.type != 'drag' && this.event.type != 'resize') { return; + } // stop this._frame_drag_stop(this.event.target); @@ -460,11 +455,11 @@ }, // drag start - _event_frame_close: function (e) - { + _event_frame_close: function (e) { // check - if (this.event.type !== null) + if (this.event.type !== null) { return; + } // prevent e.preventDefault(); @@ -474,8 +469,7 @@ var self = this; // fade out - $(frame.id).fadeOut('fast', function() - { + $(frame.id).fadeOut('fast', function() { // remove element $(frame.id).remove(); @@ -498,11 +492,11 @@ }, // drag start - _event_frame_lock: function (e) - { + _event_frame_lock: function (e) { // check - if (this.event.type !== null) + if (this.event.type !== null) { return; + } // prevent e.preventDefault(); @@ -511,8 +505,7 @@ var frame = this._frame_identify(e.target); // check - if (frame.grid_lock) - { + if (frame.grid_lock) { // unlock frame.grid_lock = false; @@ -536,11 +529,11 @@ }, // show/hide panel - _event_hide: function (e) - { + _event_hide: function (e) { // check - if (this.event.type !== null) + if (this.event.type !== null) { return; + } // hide panel this.hide(); @@ -549,11 +542,11 @@ /** * Fired when scrolling occurs on panel. */ - _event_panel_scroll: function(e) - { + _event_panel_scroll: function(e) { // check - if (this.event.type !== null || !this.visible) + if (this.event.type !== null || !this.visible) { return; + } // Stop propagation if scrolling is happening inside a frame. // TODO: could propagate scrolling if at top/bottom of frame. @@ -574,8 +567,7 @@ }, // scroll up - _event_panel_scroll_up: function(e) - { + _event_panel_scroll_up: function(e) { // check if (this.event.type !== null) return; @@ -588,8 +580,7 @@ }, // scroll down - _event_panel_scroll_down: function(e) - { + _event_panel_scroll_down: function(e) { // check if (this.event.type !== null) return; @@ -606,14 +597,12 @@ */ // identify - _frame_identify: function(target) - { + _frame_identify: function(target) { return this.frame_list['#' + $(target).closest('.frame').attr('id')]; }, // drag start - _frame_drag_start : function (frame) - { + _frame_drag_start : function (frame) { // set focus this._frame_focus(frame, true); @@ -635,8 +624,7 @@ }, // drag stop - _frame_drag_stop : function (frame) - { + _frame_drag_stop : function (frame) { // remove focus this._frame_focus(frame, false); @@ -665,8 +653,7 @@ */ // converts a pixel coordinate to grids - _to_grid_coord: function (type, px) - { + _to_grid_coord: function (type, px) { // determine sign var sign = (type == 'width' || type == 'height') ? 1 : -1; @@ -677,8 +664,7 @@ }, // converts a grid coordinate to pixels - _to_pixel_coord: function (type, g) - { + _to_pixel_coord: function (type, g) { // determine sign var sign = (type == 'width' || type == 'height') ? 1 : -1; @@ -691,8 +677,7 @@ }, // get grid coordinates - _to_grid: function (px) - { + _to_grid: function (px) { // full set return { top : this._to_grid_coord('top', px.top), @@ -703,8 +688,7 @@ }, // get pixel coordinates - _to_pixel: function(g) - { + _to_pixel: function(g) { return { top : this._to_pixel_coord('top', g.top), left : this._to_pixel_coord('left', g.left), @@ -718,18 +702,15 @@ */ // check collision - _is_collision: function(g) - { + _is_collision: function(g) { // is collision pair - function is_collision_pair (a, b) - { + function is_collision_pair (a, b) { return !(a.left > b.left + b.width - 1 || a.left + a.width - 1 < b.left || a.top > b.top + b.height - 1 || a.top + a.height - 1 < b.top); } // search - for (var i in this.frame_list) - { + for (var i in this.frame_list) { // get frame var frame = this.frame_list[i]; @@ -747,8 +728,7 @@ }, // location/grid rank - _location_rank: function(loc) - { + _location_rank: function(loc) { return (loc.top * this.cols) + loc.left; }, @@ -757,8 +737,7 @@ */ // update frame counter - _menu_refresh: function() - { + _menu_refresh: function() { // scroll up possible? if (this.visible) { if (this.top == this.options.top_min) @@ -784,15 +763,13 @@ */ // panel on animation complete / frames not moving - _panel_animation_complete: function() - { + _panel_animation_complete: function() { var self = this; $(".frame").promise().done(function() {self._panel_scroll(0, true)}); }, // refresh panel - _panel_refresh: function(animate) - { + _panel_refresh: function(animate) { // get current size this.cols = parseInt($(window).width() / this.options.cell, 10) + 1; @@ -801,8 +778,7 @@ }, // update scroll - _panel_scroll: function(delta, animate) - { + _panel_scroll: function(delta, animate) { // new top value var top_new = this.top - this.options.scroll * delta; @@ -811,17 +787,14 @@ top_new = Math.min(top_new, this.options.top_min); // update screen if necessary - if (this.top != top_new) - { + if (this.top != top_new) { // update screen - for (var i in this.frame_list) - { + for (var i in this.frame_list) { // get frame var frame = this.frame_list[i]; // skip - if (frame.grid_location !== null) - { + if (frame.grid_location !== null) { var screen_location = { top : frame.screen_location.top - (this.top - top_new), left : frame.screen_location.left @@ -843,14 +816,12 @@ */ // frame insert at given location - _frame_insert: function(frame, new_loc, animate) - { + _frame_insert: function(frame, new_loc, animate) { // define var place_list = []; // frame to place - if (frame) - { + if (frame) { // reset grid location frame.grid_location = null; @@ -860,14 +831,12 @@ // search var i = null; - for (i in this.frame_list) - { + for (i in this.frame_list) { // get frame var f = this.frame_list[i]; // check - if (f.grid_location !== null && !f.grid_lock) - { + if (f.grid_location !== null && !f.grid_lock) { // reset grid location f.grid_location = null; @@ -877,21 +846,20 @@ } // sort place list by rank - place_list.sort(function(a, b) - { + place_list.sort(function(a, b) { var i = a[1]; var j = b[1]; return i < j ? -1 : (i > j ? 1 : 0); }); // place - for (i = 0; i < place_list.length; i++) + for (i = 0; i < place_list.length; i++) { this._frame_place(place_list[i][0], animate); + } // identify maximum viewport size this.top_max = 0; - for (var i in this.frame_list) - { + for (var i in this.frame_list) { // get frame var frame = this.frame_list[i]; @@ -911,8 +879,7 @@ }, // naive frame place - _frame_place: function(frame, animate) - { + _frame_place: function(frame, animate) { // reset grid location frame.grid_location = null; @@ -921,38 +888,36 @@ // try grid coordinates var done = false; - for (var i = 0; i < this.options.rows; i++) - { + for (var i = 0; i < this.options.rows; i++) { // ensure that the first grid column is checked despite limited window space - for (var j = 0; j < Math.max(1, this.cols - g.width); j++) - { + for (var j = 0; j < Math.max(1, this.cols - g.width); j++) { // coordinates g.top = i; g.left = j; // no collision - if (!this._is_collision(g)) - { + if (!this._is_collision(g)) { done = true; break; } } // break - if (done) + if (done) { break; + } } // check if valid spot was found - if (done) + if (done) { this._frame_grid(frame, g, animate); - else + } else { console.log("Grid dimensions exceeded."); + } }, // focus - _frame_focus: function(frame, has_focus) - { + _frame_focus: function(frame, has_focus) { // get new z-value var z = this.frame_z + (has_focus ? 1 : 0); @@ -961,15 +926,13 @@ }, // new left/top position frame - _frame_offset: function(frame, p, animate) - { + _frame_offset: function(frame, p, animate) { // update screen location frame.screen_location.left = p.left; frame.screen_location.top = p.top; // animate - if (animate) - { + if (animate) { // set focus on animated this._frame_focus(frame, true); @@ -988,8 +951,7 @@ }, // resize frame - _frame_resize: function(frame, p) - { + _frame_resize: function(frame, p) { // update css $(frame.id).css({width: p.width, height: p.height}); @@ -999,8 +961,7 @@ }, // new grid location - _frame_grid: function (frame, l, animate) - { + _frame_grid: function (frame, l, animate) { // update grid location frame.grid_location = l; @@ -1012,8 +973,7 @@ }, // get frame dimensions - _frame_screen: function(frame) - { + _frame_screen: function(frame) { var p = frame.screen_location; return {top: p.top, left: p.left, width: p.width, height: p.height}; }, @@ -1023,14 +983,12 @@ */ // main element - _template: function() - { + _template: function() { return '<div class="galaxy-frame"></div>'; }, // fill regular frame template - _template_frame: function(id, title) - { + _template_frame: function(id, title) { // check title if (!title) title = ''; @@ -1050,8 +1008,7 @@ }, // fill regular frame template - _template_frame_url: function(id, title, url) - { + _template_frame_url: function(id, title, url) { // url if (url.indexOf('?') == -1) url += '?'; @@ -1068,20 +1025,17 @@ }, // fill shadow template - _template_shadow: function(id) - { + _template_shadow: function(id) { return '<div id="' + id + '" class="frame-shadow corner"></div>'; }, // fill background template in order to cover underlying iframes - _template_background: function() - { + _template_background: function() { return '<div class="frame-background"></div>'; }, // fill menu button template - _template_menu: function() - { + _template_menu: function() { return '<div class="frame-scroll-up frame-menu fa fa-chevron-up fa-2x"></div>' + '<div class="frame-scroll-down frame-menu fa fa-chevron-down fa-2x"></div>'; } diff -r 36327228fe4f1f648e4fabe783d446c8dd6c1f73 -r e8ab30c9e3471de1b874e580663560f6a4a7f143 static/scripts/mvc/ui/ui-misc.js --- a/static/scripts/mvc/ui/ui-misc.js +++ b/static/scripts/mvc/ui/ui-misc.js @@ -1,6 +1,6 @@ // dependencies -define(['utils/utils', 'mvc/ui/ui-select-default', 'mvc/ui/ui-checkbox', 'mvc/ui/ui-radiobutton', 'mvc/ui/ui-button-menu', 'mvc/ui/ui-modal'], - function(Utils, Select, Checkbox, RadioButton, ButtonMenu, Modal) { +define(['utils/utils', 'mvc/ui/ui-select-default', 'mvc/ui/ui-slider', 'mvc/ui/ui-checkbox', 'mvc/ui/ui-radiobutton', 'mvc/ui/ui-button-menu', 'mvc/ui/ui-modal'], + function(Utils, Select, Slider, Checkbox, RadioButton, ButtonMenu, Modal) { /** * This class contains backbone wrappers for basic ui elements such as Images, Labels, Buttons, Input fields etc. @@ -456,6 +456,7 @@ Searchbox : Searchbox, Select : Select, Textarea : Textarea, - Hidden : Hidden + Hidden : Hidden, + Slider : Slider } }); diff -r 36327228fe4f1f648e4fabe783d446c8dd6c1f73 -r e8ab30c9e3471de1b874e580663560f6a4a7f143 static/scripts/mvc/ui/ui-slider.js --- /dev/null +++ b/static/scripts/mvc/ui/ui-slider.js @@ -0,0 +1,85 @@ +// dependencies +define(['utils/utils'], function(Utils) { + +// plugin +var View = Backbone.View.extend({ + // options + optionsDefault: { + value : '', + min : 1, + max : 100 + }, + + // initialize + initialize : function(options) { + // link this + var self = this; + + // configure options + this.options = Utils.merge(options, this.optionsDefault); + + // create new element + this.setElement(this._template(this.options)); + + // backup slider + this.$slider = this.$el.find('#slider'); + + // backup integer field + this.$text = this.$el.find('#text'); + + // load slider plugin + this.$slider.slider(this.options); + + // add text field event + this.$text.on('change', function () { + self.value($(this).val()); + }); + + // add text field event + this.$text.on('keydown', function (event) { + var v = event.which; + if (!(v == 13 || v == 8 || v == 189 || (v >= 48 && v <= 57))) { + event.preventDefault(); + } + }); + + // add slider event + this.$slider.on('slide', function (event, ui) { + self.value(ui.value); + }); + }, + + // value + value : function (new_val) { + if (new_val !== undefined) { + // limit + new_val = Math.max(Math.min(new_val, this.options.max), this.options.min); + + // trigger on change event + if (this.options.onchange) { + this.options.onchange(new_val); + } + + // set values + this.$slider.slider('value', new_val); + this.$text.val(new_val); + } + + // return current value + return this.$text.val(); + }, + + // element + _template: function(options) { + return '<div id="' + options.id + '" style="">' + + '<input id="text" type="text" class="ui-input" style="width: 50px; float: left"/>' + + '<div id="slider" style="width: calc(100% - 60px); float: left; top: 8px; left: 10px;"/>' + + '</div>'; + } +}); + +return { + View : View +}; + +}); diff -r 36327228fe4f1f648e4fabe783d446c8dd6c1f73 -r e8ab30c9e3471de1b874e580663560f6a4a7f143 static/scripts/packed/mvc/tools/tools-section.js --- a/static/scripts/packed/mvc/tools/tools-section.js +++ b/static/scripts/packed/mvc/tools/tools-section.js @@ -1,1 +1,1 @@ -define(["utils/utils","mvc/ui/ui-table","mvc/ui/ui-misc","mvc/ui/ui-tabs"],function(c,b,e,a){var d=Backbone.View.extend({initialize:function(g,f){this.app=g;this.inputs=f.inputs;this.datasets=g.datasets;this.data=g.data;f.cls_tr="form-row";this.table=new b.View(f);this.setElement(this.table.$el);this.render()},render:function(){this.table.delAll();for(var f in this.inputs){this._add(this.inputs[f],this.data)}},_add:function(h,j){var g=this;var f=jQuery.extend(true,{},h);f.id=c.uuid();this.app.input_list[f.id]=f;var i=f.type;switch(i){case"conditional":this._addConditional(f,j);break;case"repeat":this._addRepeat(f);break;default:this._addRow(i,f,j)}},_addConditional:function(f,j){f.label=f.test_param.label;f.value=f.test_param.value;this._addRow("conditional",f,j);for(var h in f.cases){var g=f.id+"-section-"+h;var k=new d(this.app,{inputs:f.cases[h].inputs,cls:"ui-table-plain"});this.table.add("");this.table.add(k.$el);this.table.append(g)}},_addRepeat:function(f){var g=this;var k=new a.View({title_new:"Add "+f.title,max:f.max,onnew:function(){var i=f.id+"-section-"+c.uuid();var m=new d(g.app,{inputs:f.inputs,cls:"ui-table-plain"});k.add({id:i,title:f.title,$el:m.$el,ondel:function(){k.del(i);k.retitle(f.title);g.app.refresh()}});k.retitle(f.title);k.show(i);g.app.refresh()}});for(var j=0;j<f.min;j++){var h=f.id+"-section-"+c.uuid();var l=new d(g.app,{inputs:f.inputs,cls:"ui-table-plain"});k.add({id:h,title:f.title,$el:l.$el})}k.retitle(f.title);this.table.add("");this.table.add(k.$el);this.table.append(f.id)},_addRow:function(i,f,g){var k=f.id;var h=null;switch(i){case"text":h=this._field_text(f,g);break;case"select":h=this._field_select(f,g);break;case"radiobutton":h=this._field_radio(f,g);break;case"data":h=this._field_data(f,g);break;case"data_column":h=this._field_column(f,g);break;case"textarea":h=this._field_textarea(f,g);break;case"conditional":h=this._field_conditional(f,g);break;case"hidden":h=this._field_hidden(f,g);break}if(!h){console.debug("tools-form::_addRow() : Unmatched field type ("+i+").");return}if(!g.get(k)){g.set(k,f.value)}h.value(g.get(k));this.app.field_list[k]=h;var j=$("<div/>");j.append(h.$el);if(f.help){j.append('<div class="ui-table-form-info">'+f.help+"</div>")}this.table.add('<span class="ui-table-form-title">'+f.label+"</span>","20%");this.table.add(j);this.table.append(k)},_field_conditional:function(f,l){var g=this;var h=[];for(var j in f.test_param.options){var k=f.test_param.options[j];h.push({label:k[0],value:k[1]})}var m=f.id;return new e.Select.View({id:"field-"+m,data:h,value:l.get(m),onchange:function(u){l.set(m,u);for(var s in f.cases){var o=f.cases[s];var r=f.id+"-section-"+s;var n=g.table.get(r);var q=false;for(var p in o.inputs){var t=o.inputs[p].type;if(t&&t!=="hidden"){q=true;break}}if(o.value==u&&q){n.fadeIn("fast")}else{n.hide()}}}})},_field_data:function(f,l){var g=this;var m=f.id;var k=this.datasets.filterType();var h=[];for(var j in k){h.push({label:k[j].get("name"),value:k[j].get("id")})}return new e.Select.View({id:"field-"+m,data:h,value:h[0].value,onchange:function(s){l.set(m,s);var o=g.app.tree.findReferences(m);var u=g.datasets.filter(s);if(u&&o.length>0){console.debug("tool-form::field_data() - Selected dataset "+s+".");var t=u.get("metadata_column_types");if(!t){console.debug("tool-form::field_data() - FAILED: Could not find metadata for dataset "+s+".")}var r=[];for(var q in t){r.push({label:"Column: "+(parseInt(q)+1)+" ["+t[q]+"]",value:q})}for(var p in o){var n=g.app.field_list[o[p]];if(n){n.update(r);if(!n.exists(n.value())){n.value(n.first())}}}}else{console.debug("tool-form::field_data() - FAILED: Could not find dataset "+s+".")}}})},_field_column:function(f,g){var h=f.id;return new e.Select.View({id:"field-"+h,value:g.get(h),onchange:function(i){g.set(h,i)}})},_field_select:function(f,l){var g=[];for(var h in f.options){var j=f.options[h];g.push({label:j[0],value:j[1]})}var k=e.Select;if(f.display=="checkboxes"){k=e.Checkbox}var m=f.id;return new k.View({id:"field-"+m,data:g,value:l.get(m),onchange:function(i){l.set(m,i)}})},_field_text:function(f,g){var h=f.id;return new e.Input({id:"field-"+h,value:g.get(h),onchange:function(i){g.set(h,i)}})},_field_textarea:function(f,g){var h=f.id;return new e.Textarea({id:"field-"+h,onchange:function(){g.set(h,field.value())}})},_field_radio:function(f,g){var h=f.id;return new e.RadioButton({id:"field-"+h,data:f.data,value:g.get(h),onchange:function(i){g.set(h,i)}})},_field_hidden:function(f,g){var h=f.id;return new e.Hidden({id:"field-"+h,value:g.get(h)})}});return{View:d}}); \ No newline at end of file +define(["utils/utils","mvc/ui/ui-table","mvc/ui/ui-misc","mvc/ui/ui-tabs"],function(c,b,e,a){var d=Backbone.View.extend({initialize:function(g,f){this.app=g;this.inputs=f.inputs;this.datasets=g.datasets;this.data=g.data;f.cls_tr="section-row";this.table=new b.View(f);this.setElement(this.table.$el);this.render()},render:function(){this.table.delAll();for(var f in this.inputs){this._add(this.inputs[f],this.data)}},_add:function(h,j){var g=this;var f=jQuery.extend(true,{},h);f.id=c.uuid();this.app.input_list[f.id]=f;var i=f.type;switch(i){case"conditional":this._addConditional(f,j);break;case"repeat":this._addRepeat(f);break;default:this._addRow(i,f,j)}},_addConditional:function(f,j){f.label=f.test_param.label;f.value=f.test_param.value;this._addRow("conditional",f,j);for(var h in f.cases){var g=f.id+"-section-"+h;var k=new d(this.app,{inputs:f.cases[h].inputs,cls:"ui-table-plain"});this.table.add("");this.table.add(k.$el);this.table.append(g)}},_addRepeat:function(f){var g=this;var k=new a.View({title_new:"Add "+f.title,max:f.max,onnew:function(){var i=f.id+"-section-"+c.uuid();var m=new d(g.app,{inputs:f.inputs,cls:"ui-table-plain"});k.add({id:i,title:f.title,$el:m.$el,ondel:function(){k.del(i);k.retitle(f.title);g.app.refresh()}});k.retitle(f.title);k.show(i);g.app.refresh()}});for(var j=0;j<f.min;j++){var h=f.id+"-section-"+c.uuid();var l=new d(g.app,{inputs:f.inputs,cls:"ui-table-plain"});k.add({id:h,title:f.title,$el:l.$el})}k.retitle(f.title);this.table.add("");this.table.add(k.$el);this.table.append(f.id)},_addRow:function(i,f,g){var k=f.id;var h=null;switch(i){case"text":h=this._field_text(f,g);break;case"select":h=this._field_select(f,g);break;case"radiobutton":h=this._field_radio(f,g);break;case"data":h=this._field_data(f,g);break;case"data_column":h=this._field_column(f,g);break;case"textarea":h=this._field_textarea(f,g);break;case"conditional":h=this._field_conditional(f,g);break;case"hidden":h=this._field_hidden(f,g);break;case"integer":h=this._field_integer(f,g);break;case"boolean":h=this._field_radiobutton(f,g);break;default:h=this._field_text(f,g);console.debug("tools-form::_addRow() : Unmatched field type ("+i+").")}if(!g.get(k)){g.set(k,f.value)}h.value(g.get(k));this.app.field_list[k]=h;var j=$("<div/>");j.append(h.$el);if(f.help){j.append('<div class="ui-table-form-info">'+f.help+"</div>")}this.table.add('<span class="ui-table-form-title">'+f.label+"</span>","20%");this.table.add(j);this.table.append(k)},_field_conditional:function(f,l){var g=this;var h=[];for(var j in f.test_param.options){var k=f.test_param.options[j];h.push({label:k[0],value:k[1]})}var m=f.id;return new e.Select.View({id:"field-"+m,data:h,value:l.get(m),onchange:function(u){l.set(m,u);for(var s in f.cases){var o=f.cases[s];var r=f.id+"-section-"+s;var n=g.table.get(r);var q=false;for(var p in o.inputs){var t=o.inputs[p].type;if(t&&t!=="hidden"){q=true;break}}if(o.value==u&&q){n.fadeIn("fast")}else{n.hide()}}}})},_field_data:function(f,l){var g=this;var m=f.id;var k=this.datasets.filterType();var h=[];for(var j in k){h.push({label:k[j].get("name"),value:k[j].get("id")})}return new e.Select.View({id:"field-"+m,data:h,value:h[0].value,onchange:function(s){l.set(m,s);var o=g.app.tree.findReferences(m);var u=g.datasets.filter(s);if(u&&o.length>0){console.debug("tool-form::field_data() - Selected dataset "+s+".");var t=u.get("metadata_column_types");if(!t){console.debug("tool-form::field_data() - FAILED: Could not find metadata for dataset "+s+".")}var r=[];for(var q in t){r.push({label:"Column: "+(parseInt(q)+1)+" ["+t[q]+"]",value:q})}for(var p in o){var n=g.app.field_list[o[p]];if(n){n.update(r);if(!n.exists(n.value())){n.value(n.first())}}}}else{console.debug("tool-form::field_data() - FAILED: Could not find dataset "+s+".")}}})},_field_column:function(f,g){var h=f.id;return new e.Select.View({id:"field-"+h,value:g.get(h),onchange:function(i){g.set(h,i)}})},_field_select:function(f,l){var g=[];for(var h in f.options){var j=f.options[h];g.push({label:j[0],value:j[1]})}var k=e.Select;if(f.display=="checkboxes"){k=e.Checkbox}var m=f.id;return new k.View({id:"field-"+m,data:g,value:l.get(m),onchange:function(i){l.set(m,i)}})},_field_text:function(f,g){var h=f.id;return new e.Input({id:"field-"+h,value:g.get(h),onchange:function(i){g.set(h,i)}})},_field_integer:function(f,g){var h=f.id;return new e.Slider.View({id:"field-"+h,value:g.get(h),onchange:function(i){g.set(h,i)}})},_field_textarea:function(f,g){var h=f.id;return new e.Textarea({id:"field-"+h,onchange:function(){g.set(h,field.value())}})},_field_radio:function(f,g){var h=f.id;return new e.RadioButton({id:"field-"+h,data:f.data,value:g.get(h),onchange:function(i){g.set(h,i)}})},_field_hidden:function(f,g){var h=f.id;return new e.Hidden({id:"field-"+h,value:g.get(h)})},_field_radiobutton:function(f,g){var h=f.id;return new e.RadioButton.View({id:"field-"+h,value:g.get(h),data:[{label:"Yes",value:"true"},{label:"No",value:"false"}]})}});return{View:d}}); \ No newline at end of file diff -r 36327228fe4f1f648e4fabe783d446c8dd6c1f73 -r e8ab30c9e3471de1b874e580663560f6a4a7f143 static/scripts/packed/mvc/tools/tools-tree.js --- a/static/scripts/packed/mvc/tools/tools-tree.js +++ b/static/scripts/packed/mvc/tools/tools-tree.js @@ -1,1 +1,1 @@ -define([],function(){return Backbone.Model.extend({initialize:function(a){this.app=a},refresh:function(){if(!this.app.section){return{}}this.dict={};this.xml=$("<div/>");this._iterate(this.app.section.$el,this.dict,this.xml)},_iterate:function(d,e,b){var a=this;var c=$(d).children();c.each(function(){var i=this;var h=$(i).attr("id");if($(i).hasClass("form-row")||$(i).hasClass("tab-pane")){e[h]={};var f=a.app.input_list[h];if(f){e[h]={input:f}}var g=$('<div id="'+h+'"/>');b.append(g);a._iterate(i,e[h],g)}else{a._iterate(i,e,b)}})},findReferences:function(c){var f=[];var b=this;function d(g,i){var h=$(i).children();var k=[];var j=false;h.each(function(){var n=this;var m=$(n).attr("id");if(m!==c){var l=b.app.input_list[m];if(l){if(l.name==g){j=true;return false}if(l.data_ref==g){k.push(m)}}}});if(!j){f=f.concat(k);h.each(function(){d(g,this)})}}var e=this.xml.find("#"+c);if(e.length>0){var a=this.app.input_list[c];if(a){d(a.name,e.parent())}}return f}})}); \ No newline at end of file +define([],function(){return Backbone.Model.extend({initialize:function(a){this.app=a},refresh:function(){if(!this.app.section){return{}}this.dict={};this.xml=$("<div/>");this._iterate(this.app.section.$el,this.dict,this.xml)},_iterate:function(d,e,b){var a=this;var c=$(d).children();c.each(function(){var i=this;var h=$(i).attr("id");if($(i).hasClass("section-row")||$(i).hasClass("tab-pane")){e[h]={};var f=a.app.input_list[h];if(f){e[h]={input:f}}var g=$('<div id="'+h+'"/>');b.append(g);a._iterate(i,e[h],g)}else{a._iterate(i,e,b)}})},findReferences:function(c){var f=[];var b=this;function d(g,i){var h=$(i).children();var k=[];var j=false;h.each(function(){var n=this;var m=$(n).attr("id");if(m!==c){var l=b.app.input_list[m];if(l){if(l.name==g){j=true;return false}if(l.data_ref==g){k.push(m)}}}});if(!j){f=f.concat(k);h.each(function(){d(g,this)})}}var e=this.xml.find("#"+c);if(e.length>0){var a=this.app.input_list[c];if(a){d(a.name,e.parent())}}return f}})}); \ No newline at end of file diff -r 36327228fe4f1f648e4fabe783d446c8dd6c1f73 -r e8ab30c9e3471de1b874e580663560f6a4a7f143 static/scripts/packed/mvc/ui/ui-misc.js --- a/static/scripts/packed/mvc/ui/ui-misc.js +++ b/static/scripts/packed/mvc/ui/ui-misc.js @@ -1,1 +1,1 @@ -define(["utils/utils","mvc/ui/ui-select-default","mvc/ui/ui-checkbox","mvc/ui/ui-radiobutton","mvc/ui/ui-button-menu","mvc/ui/ui-modal"],function(l,b,e,m,q,n){var d=Backbone.View.extend({optionsDefault:{url:"",cls:""},initialize:function(r){this.options=l.merge(r,this.optionsDefault);this.setElement(this._template(this.options))},_template:function(r){return'<img class="ui-image '+r.cls+'" src="'+r.url+'"/>'}});var k=Backbone.View.extend({optionsDefault:{title:"",cls:""},initialize:function(r){this.options=l.merge(r,this.optionsDefault);this.setElement(this._template(this.options))},title:function(r){this.$el.html(r)},_template:function(r){return'<label class="ui-label '+r.cls+'">'+r.title+"</label>"},value:function(){return options.title}});var c=Backbone.View.extend({optionsDefault:{floating:"right",icon:"",tooltip:"",placement:"bottom",title:"",cls:""},initialize:function(r){this.options=l.merge(r,this.optionsDefault);this.setElement(this._template(this.options));$(this.el).tooltip({title:r.tooltip,placement:"bottom"})},_template:function(r){return'<div><span class="fa '+r.icon+'" class="ui-icon"/> '+r.title+"</div>"}});var g=Backbone.View.extend({optionsDefault:{id:null,title:"",floating:"right",cls:"btn btn-default",icon:""},initialize:function(r){this.options=l.merge(r,this.optionsDefault);this.setElement(this._template(this.options));$(this.el).on("click",r.onclick);$(this.el).tooltip({title:r.tooltip,placement:"bottom"})},_template:function(r){var s='<button id="'+r.id+'" type="submit" style="float: '+r.floating+';" type="button" class="ui-button '+r.cls+'">';if(r.icon){s+='<i class="icon fa '+r.icon+'"></i> '}s+=r.title+"</button>";return s}});var h=Backbone.View.extend({optionsDefault:{id:null,title:"",floating:"right",cls:"icon-btn",icon:"",tooltip:"",onclick:null},initialize:function(r){this.options=l.merge(r,this.optionsDefault);this.setElement(this._template(this.options));$(this.el).on("click",r.onclick);$(this.el).tooltip({title:r.tooltip,placement:"bottom"})},_template:function(r){var s="";if(r.title){s="width: auto;"}var t='<div id="'+r.id+'" style="float: '+r.floating+"; "+s+'" class="ui-button-icon '+r.cls+'">';if(r.title){t+='<div class="button"><i class="icon fa '+r.icon+'"/> <span class="title">'+r.title+"</span></div>"}else{t+='<i class="icon fa '+r.icon+'"/>'}t+="</div>";return t}});var f=Backbone.View.extend({optionsDefault:{title:"",cls:""},initialize:function(r){this.options=l.merge(r,this.optionsDefault);this.setElement(this._template(this.options));$(this.el).on("click",r.onclick)},_template:function(r){return'<div><a href="javascript:void(0)" class="ui-anchor '+r.cls+'">'+r.title+"</a></div>"}});var o=Backbone.View.extend({optionsDefault:{message:"",status:"info",persistent:false},initialize:function(r){this.options=l.merge(r,this.optionsDefault);this.setElement("<div></div>")},update:function(s){this.options=l.merge(s,this.optionsDefault);if(s.message!=""){this.$el.html(this._template(this.options));this.$el.find(".alert").append(s.message);this.$el.fadeIn();if(!s.persistent){var r=this;window.setTimeout(function(){if(r.$el.is(":visible")){r.$el.fadeOut()}else{r.$el.hide()}},3000)}}else{this.$el.fadeOut()}},_template:function(r){return'<div class="ui-message alert alert-'+r.status+'"/>'}});var a=Backbone.View.extend({optionsDefault:{onclick:null,searchword:""},initialize:function(s){this.options=l.merge(s,this.optionsDefault);this.setElement(this._template(this.options));var r=this;if(this.options.onclick){this.$el.on("submit",function(u){var t=r.$el.find("#search");r.options.onclick(t.val())})}},_template:function(r){return'<div class="ui-search"><form onsubmit="return false;"><input id="search" class="form-control input-sm" type="text" name="search" placeholder="Search..." value="'+r.searchword+'"><button type="submit" class="btn search-btn"><i class="fa fa-search"></i></button></form></div>'}});var j=Backbone.View.extend({optionsDefault:{value:"",type:"text",placeholder:"",disabled:false,visible:true,cls:""},initialize:function(s){this.options=l.merge(s,this.optionsDefault);this.setElement(this._template(this.options));if(this.options.disabled){this.$el.prop("disabled",true)}if(!this.options.visible){this.$el.hide()}var r=this;this.$el.on("input",function(){if(r.options.onchange){r.options.onchange(r.$el.val())}})},value:function(r){if(r!==undefined){this.$el.val(r)}return this.$el.val()},_template:function(r){return'<input id="'+r.id+'" type="'+r.type+'" value="'+r.value+'" placeholder="'+r.placeholder+'" class="ui-input '+r.cls+'">'}});var i=Backbone.View.extend({optionsDefault:{value:"",type:"text",placeholder:"",disabled:false,visible:true,cls:""},initialize:function(s){this.options=l.merge(s,this.optionsDefault);this.setElement(this._template(this.options));if(this.options.disabled){this.$el.prop("disabled",true)}if(!this.options.visible){this.$el.hide()}var r=this;this.$el.on("input",function(){if(r.options.onchange){r.options.onchange(r.$el.val())}})},value:function(r){if(r!==undefined){this.$el.val(r)}return this.$el.val()},_template:function(r){return'<textarea id="'+r.id+'" class="ui-textarea '+r.cls+'" rows="5"></textarea>'}});var p=Backbone.View.extend({optionsDefault:{value:""},initialize:function(r){this.options=l.merge(r,this.optionsDefault);this.setElement(this._template(this.options))},value:function(r){if(r!==undefined){this.$el.val(r)}return this.$el.val()},_template:function(r){return'<hidden id="'+r.id+'" value="'+r.value+'"/>'}});return{Anchor:f,Button:g,ButtonIcon:h,ButtonMenu:q,Icon:c,Image:d,Input:j,Label:k,Message:o,Modal:n,RadioButton:m,Checkbox:e,Searchbox:a,Select:b,Textarea:i,Hidden:p}}); \ No newline at end of file +define(["utils/utils","mvc/ui/ui-select-default","mvc/ui/ui-slider","mvc/ui/ui-checkbox","mvc/ui/ui-radiobutton","mvc/ui/ui-button-menu","mvc/ui/ui-modal"],function(e,h,k,i,b,r,c){var q=Backbone.View.extend({optionsDefault:{url:"",cls:""},initialize:function(s){this.options=e.merge(s,this.optionsDefault);this.setElement(this._template(this.options))},_template:function(s){return'<img class="ui-image '+s.cls+'" src="'+s.url+'"/>'}});var l=Backbone.View.extend({optionsDefault:{title:"",cls:""},initialize:function(s){this.options=e.merge(s,this.optionsDefault);this.setElement(this._template(this.options))},title:function(s){this.$el.html(s)},_template:function(s){return'<label class="ui-label '+s.cls+'">'+s.title+"</label>"},value:function(){return options.title}});var d=Backbone.View.extend({optionsDefault:{floating:"right",icon:"",tooltip:"",placement:"bottom",title:"",cls:""},initialize:function(s){this.options=e.merge(s,this.optionsDefault);this.setElement(this._template(this.options));$(this.el).tooltip({title:s.tooltip,placement:"bottom"})},_template:function(s){return'<div><span class="fa '+s.icon+'" class="ui-icon"/> '+s.title+"</div>"}});var g=Backbone.View.extend({optionsDefault:{id:null,title:"",floating:"right",cls:"btn btn-default",icon:""},initialize:function(s){this.options=e.merge(s,this.optionsDefault);this.setElement(this._template(this.options));$(this.el).on("click",s.onclick);$(this.el).tooltip({title:s.tooltip,placement:"bottom"})},_template:function(s){var t='<button id="'+s.id+'" type="submit" style="float: '+s.floating+';" type="button" class="ui-button '+s.cls+'">';if(s.icon){t+='<i class="icon fa '+s.icon+'"></i> '}t+=s.title+"</button>";return t}});var o=Backbone.View.extend({optionsDefault:{id:null,title:"",floating:"right",cls:"icon-btn",icon:"",tooltip:"",onclick:null},initialize:function(s){this.options=e.merge(s,this.optionsDefault);this.setElement(this._template(this.options));$(this.el).on("click",s.onclick);$(this.el).tooltip({title:s.tooltip,placement:"bottom"})},_template:function(s){var t="";if(s.title){t="width: auto;"}var u='<div id="'+s.id+'" style="float: '+s.floating+"; "+t+'" class="ui-button-icon '+s.cls+'">';if(s.title){u+='<div class="button"><i class="icon fa '+s.icon+'"/> <span class="title">'+s.title+"</span></div>"}else{u+='<i class="icon fa '+s.icon+'"/>'}u+="</div>";return u}});var p=Backbone.View.extend({optionsDefault:{title:"",cls:""},initialize:function(s){this.options=e.merge(s,this.optionsDefault);this.setElement(this._template(this.options));$(this.el).on("click",s.onclick)},_template:function(s){return'<div><a href="javascript:void(0)" class="ui-anchor '+s.cls+'">'+s.title+"</a></div>"}});var a=Backbone.View.extend({optionsDefault:{message:"",status:"info",persistent:false},initialize:function(s){this.options=e.merge(s,this.optionsDefault);this.setElement("<div></div>")},update:function(t){this.options=e.merge(t,this.optionsDefault);if(t.message!=""){this.$el.html(this._template(this.options));this.$el.find(".alert").append(t.message);this.$el.fadeIn();if(!t.persistent){var s=this;window.setTimeout(function(){if(s.$el.is(":visible")){s.$el.fadeOut()}else{s.$el.hide()}},3000)}}else{this.$el.fadeOut()}},_template:function(s){return'<div class="ui-message alert alert-'+s.status+'"/>'}});var f=Backbone.View.extend({optionsDefault:{onclick:null,searchword:""},initialize:function(t){this.options=e.merge(t,this.optionsDefault);this.setElement(this._template(this.options));var s=this;if(this.options.onclick){this.$el.on("submit",function(v){var u=s.$el.find("#search");s.options.onclick(u.val())})}},_template:function(s){return'<div class="ui-search"><form onsubmit="return false;"><input id="search" class="form-control input-sm" type="text" name="search" placeholder="Search..." value="'+s.searchword+'"><button type="submit" class="btn search-btn"><i class="fa fa-search"></i></button></form></div>'}});var n=Backbone.View.extend({optionsDefault:{value:"",type:"text",placeholder:"",disabled:false,visible:true,cls:""},initialize:function(t){this.options=e.merge(t,this.optionsDefault);this.setElement(this._template(this.options));if(this.options.disabled){this.$el.prop("disabled",true)}if(!this.options.visible){this.$el.hide()}var s=this;this.$el.on("input",function(){if(s.options.onchange){s.options.onchange(s.$el.val())}})},value:function(s){if(s!==undefined){this.$el.val(s)}return this.$el.val()},_template:function(s){return'<input id="'+s.id+'" type="'+s.type+'" value="'+s.value+'" placeholder="'+s.placeholder+'" class="ui-input '+s.cls+'">'}});var j=Backbone.View.extend({optionsDefault:{value:"",type:"text",placeholder:"",disabled:false,visible:true,cls:""},initialize:function(t){this.options=e.merge(t,this.optionsDefault);this.setElement(this._template(this.options));if(this.options.disabled){this.$el.prop("disabled",true)}if(!this.options.visible){this.$el.hide()}var s=this;this.$el.on("input",function(){if(s.options.onchange){s.options.onchange(s.$el.val())}})},value:function(s){if(s!==undefined){this.$el.val(s)}return this.$el.val()},_template:function(s){return'<textarea id="'+s.id+'" class="ui-textarea '+s.cls+'" rows="5"></textarea>'}});var m=Backbone.View.extend({optionsDefault:{value:""},initialize:function(s){this.options=e.merge(s,this.optionsDefault);this.setElement(this._template(this.options))},value:function(s){if(s!==undefined){this.$el.val(s)}return this.$el.val()},_template:function(s){return'<hidden id="'+s.id+'" value="'+s.value+'"/>'}});return{Anchor:p,Button:g,ButtonIcon:o,ButtonMenu:r,Icon:d,Image:q,Input:n,Label:l,Message:a,Modal:c,RadioButton:b,Checkbox:i,Searchbox:f,Select:h,Textarea:j,Hidden:m,Slider:k}}); \ No newline at end of file diff -r 36327228fe4f1f648e4fabe783d446c8dd6c1f73 -r e8ab30c9e3471de1b874e580663560f6a4a7f143 static/scripts/packed/mvc/ui/ui-slider.js --- /dev/null +++ b/static/scripts/packed/mvc/ui/ui-slider.js @@ -0,0 +1,1 @@ +define(["utils/utils"],function(a){var b=Backbone.View.extend({optionsDefault:{value:"",min:1,max:100},initialize:function(d){var c=this;this.options=a.merge(d,this.optionsDefault);this.setElement(this._template(this.options));this.$slider=this.$el.find("#slider");this.$text=this.$el.find("#text");this.$slider.slider(this.options);this.$text.on("change",function(){c.value($(this).val())});this.$text.on("keydown",function(f){var e=f.which;if(!(e==13||e==8||e==189||(e>=48&&e<=57))){f.preventDefault()}});this.$slider.on("slide",function(e,f){c.value(f.value)})},value:function(c){if(c!==undefined){c=Math.max(Math.min(c,this.options.max),this.options.min);if(this.options.onchange){this.options.onchange(c)}this.$slider.slider("value",c);this.$text.val(c)}return this.$text.val()},_template:function(c){return'<div id="'+c.id+'" style=""><input id="text" type="text" class="ui-input" style="width: 50px; float: left"/><div id="slider" style="width: calc(100% - 60px); float: left; top: 8px; left: 10px;"/></div>'}});return{View:b}}); \ No newline at end of file diff -r 36327228fe4f1f648e4fabe783d446c8dd6c1f73 -r e8ab30c9e3471de1b874e580663560f6a4a7f143 templates/webapps/galaxy/tool_form.api.mako --- a/templates/webapps/galaxy/tool_form.api.mako +++ b/templates/webapps/galaxy/tool_form.api.mako @@ -29,7 +29,8 @@ 'citations' : tool_citations } %> -${h.js( "libs/bibtex" )} +${h.js( "libs/bibtex", "libs/jquery/jquery-ui" )} +${h.css( 'base', 'jquery-ui/smoothness/jquery-ui')} <script> require(['mvc/tools/tools-form'], function(ToolsForm){ $(function(){ Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org