1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/deb003947e0e/ Changeset: deb003947e0e User: guerler Date: 2014-09-11 18:02:21 Summary: ToolForm: Implements error handling, applies fixes to styles and structure, UI: Fixes code style for frames Affected #: 11 files diff -r d1f6d05706d0f03c7a31cd5f8b3890c55e565af0 -r deb003947e0e02de4613912b14832944954576a5 static/scripts/mvc/tools/tools-form.js --- a/static/scripts/mvc/tools/tools-form.js +++ b/static/scripts/mvc/tools/tools-form.js @@ -1,8 +1,11 @@ +/* + This is the main class of the tool form plugin. It is referenced as 'app' in all lower level modules. +*/ define(['mvc/ui/ui-portlet', 'mvc/ui/ui-misc', 'mvc/citation/citation-model', 'mvc/citation/citation-view', - 'mvc/tools', 'mvc/tools/tools-template', 'mvc/tools/tools-datasets', 'mvc/tools/tools-section', 'mvc/tools/tools-tree'], + 'mvc/tools', 'mvc/tools/tools-template', 'mvc/tools/tools-datasets', 'mvc/tools/tools-section', 'mvc/tools/tools-tree', 'mvc/tools/tools-jobs'], function(Portlet, Ui, CitationModel, CitationView, - Tools, ToolTemplate, ToolDatasets, ToolSection, ToolTree) { + Tools, ToolTemplate, ToolDatasets, ToolSection, ToolTree, ToolJobs) { // create tool model var Model = Backbone.Model.extend({ @@ -32,12 +35,18 @@ // creates a tree/json structure from the input form this.tree = new ToolTree(this); + // creates the job handler + this.job_handler = new ToolJobs(this); + // reset field list this.field_list = {}; // reset sequential input definition list this.input_list = {}; + // reset input element definition list + this.element_list = {}; + // initialize datasets this.datasets = new ToolDatasets({ history_id : this.options.history_id, @@ -47,6 +56,13 @@ }); }, + // reset form + reset: function() { + for (var i in this.element_list) { + this.element_list[i].reset(); + } + }, + // initialize tool form _initializeToolForm: function() { // link this @@ -102,7 +118,7 @@ title : 'Execute', floating : 'clear', onclick : function() { - self._submit(); + self.job_handler.submit(); } }) }, @@ -157,7 +173,7 @@ // trigger refresh self.refresh(); - self._submit(); + //self.job_handler.submit(); } }); }, @@ -174,11 +190,6 @@ // log console.debug('tools-form::refresh() - Recreated tree structure. Refresh.'); - }, - - // submit - _submit: function() { - console.log(this.tree.finalize()); } }); diff -r d1f6d05706d0f03c7a31cd5f8b3890c55e565af0 -r deb003947e0e02de4613912b14832944954576a5 static/scripts/mvc/tools/tools-jobs.js --- a/static/scripts/mvc/tools/tools-jobs.js +++ b/static/scripts/mvc/tools/tools-jobs.js @@ -1,9 +1,7 @@ -// dependencies +/* + This class handles job submissions and the error handling. +*/ define(['utils/utils'], function(Utils) { - -/** - * This class handles job submissions. - */ return Backbone.Model.extend({ // initialize initialize: function(app, options) { @@ -15,34 +13,49 @@ }, // create job - submit: function(data, success, error) { + submit: function() { // link this var self = this; + // create job definition for submission to tools api + var job_def = { + tool_id : this.app.options.id, + inputs : this.app.tree.finalize() + } + + // reset + this.app.reset(); + // post job - Utils.request('POST', config.root + 'api/tools', data, + Utils.request('POST', galaxy_config.root + 'api/tools', job_def, // success handler function(response) { if (!response.outputs || response.outputs.length == 0) { - // call error - error && error(); - } else { - // update galaxy history console.log(response); } + self._refreshHdas(); }, // error handler function(response) { - var message = ''; - if (response && response.message && response.message.data && response.message.data.input) { - message = response.message.data.input + '.'; + if (response && response.message && response.message.data) { + var error_messages = self.app.tree.match(response.message.data); + for (var id in error_messages) { + var error_text = error_messages[id]; + if (!error_text) { + error_text = 'Please verify this parameter.'; + } + self.app.element_list[id].error(error_text); + } } - - // call error - error && error(); - } ); + }, + + // refresh history panel + _refreshHdas: function() { + if (parent.Galaxy && parent.Galaxy.currHistoryPanel) { + parent.Galaxy.currHistoryPanel.refreshContents(); + } } }); diff -r d1f6d05706d0f03c7a31cd5f8b3890c55e565af0 -r deb003947e0e02de4613912b14832944954576a5 static/scripts/mvc/tools/tools-section.js --- a/static/scripts/mvc/tools/tools-section.js +++ b/static/scripts/mvc/tools/tools-section.js @@ -1,6 +1,60 @@ +/* + This class creates a tool form section and populates it with input elements. It also handles repeat blocks and conditionals by recursively creating new sub sections. New input elements can be plugged in by adding cases to the switch block defined in the _addRow() function. +*/ define(['utils/utils', 'mvc/ui/ui-table', 'mvc/ui/ui-misc', 'mvc/ui/ui-tabs', 'mvc/tools/tools-select-dataset'], function(Utils, Table, Ui, Tabs, SelectDataset) { + // input field element wrapper + var InputElement = Backbone.View.extend({ + // initialize input wrapper + initialize: function(options) { + this.setElement(this._template(options)); + }, + + // set error text + error: function(text) { + // set text + this.$el.find('.ui-table-form-error-text').html(text); + this.$el.find('.ui-table-form-error').fadeIn(); + this.$el.addClass('ui-table-row-error'); + }, + + // reset + reset: function() { + this.$el.find('.ui-table-form-error').hide(); + this.$el.removeClass('ui-table-form-error'); + }, + + // template + _template: function(options) { + var $input; + if (options.highlight) { + $input = $('<div class="ui-table-element ui-table-form-section"/>'); + } else { + $input = $('<div class="ui-table-element"/>'); + } + + // add error + $input.append('<div class="ui-table-form-error"><span class="fa fa-arrow-down"/><span class="ui-table-form-error-text"></div>'); + + // add label + if (options.label) { + $input.append('<div class="ui-table-form-title-strong">' + options.label + '</div>'); + } + + // add input element + $input.append(options.$el); + + // add help + if (options.help) { + $input.append('<div class="ui-table-form-info">' + options.help + '</div>'); + } + + // return input element + return $input; + } + }); + // create form view var View = Backbone.View.extend({ // initialize @@ -76,7 +130,7 @@ input_def.value = input_def.test_param.value; // build options field - this._addRow('conditional', input_def); + var table_row = this._addRow('conditional', input_def); // add fields for (var i in input_def.cases) { @@ -89,13 +143,16 @@ cls : 'ui-table-plain' }); + // create input field wrapper + var input_element = new InputElement({ + label : '', + help : input_def.help, + $el : sub_section.$el, + highlight : true + }); + // create table row - this.table.add(this._create_field({ - label : '', - help : input_def.help, - $el : sub_section.$el, - color : true - })); + this.table.add(input_element.$el); // append to table this.table.append(sub_section_id); @@ -175,13 +232,16 @@ // retitle tabs tabs.retitle(input_def.title); + // create input field wrapper + var input_element = new InputElement({ + label : input_def.title, + help : input_def.help, + $el : tabs.$el, + highlight : true + }); + // create table row - this.table.add(this._create_field({ - label : input_def.title, - help : input_def.help, - $el : tabs.$el, - color : true - })); + this.table.add(input_element.$el); // append row to table this.table.append(input_def.id); @@ -265,15 +325,24 @@ // add to field list this.app.field_list[id] = field; - // create table row - this.table.add(this._create_field({ + // create input field wrapper + var input_element = new InputElement({ label : input_def.label, help : input_def.help, $el : field.$el - })); + }); + + // add to element list + this.app.element_list[id] = input_element; + + // create table row + this.table.add(input_element.$el); // append to table this.table.append(id); + + // return table row + return this.table.get(id) }, // conditional input field @@ -349,7 +418,7 @@ } // get referenced columns - var column_list = self.app.tree.findReferences(id, 'data_column'); + var column_list = self.app.tree.references(id, 'data_column'); // find selected dataset var dataset = self.app.datasets.filter(value); @@ -385,11 +454,20 @@ // get column type var column_type = meta[key]; + // column index + var column_index = (parseInt(key) + 1); + + // column type label + var column_label = 'Text'; + if (column_type == 'int' || column_type == 'float') { + column_label = 'Number'; + } + // add to selection if (column_type == 'int' || column_type == 'float' || !numerical) { columns.push({ - 'label' : 'Column: ' + (parseInt(key) + 1) + ' [' + meta[key] + ']', - 'value' : key + 'label' : 'Column: ' + column_index + ' [' + column_label + ']', + 'value' : column_index }); } } @@ -485,27 +563,9 @@ _field_boolean : function(input_def) { return new Ui.RadioButton.View({ id : 'field-' + input_def.id, - data : [ { label : 'Yes', value : true }, - { label : 'No', value : false }] + data : [ { label : 'Yes', value : 'true' }, + { label : 'No', value : 'false' }] }); - }, - - // create a field element with title and help information - _create_field: function(options) { - var $input; - if (options.color) { - $input = $('<div class="ui-table-form-section"/>'); - } else { - $input = $('<div/>'); - } - if (options.label) { - $input.append('<div class="ui-table-form-title-strong">' + options.label + '</div>'); - } - $input.append(options.$el); - if (options.help) { - $input.append('<div class="ui-table-form-info">' + options.help + '</div>'); - } - return $input; } }); diff -r d1f6d05706d0f03c7a31cd5f8b3890c55e565af0 -r deb003947e0e02de4613912b14832944954576a5 static/scripts/mvc/tools/tools-tree.js --- a/static/scripts/mvc/tools/tools-tree.js +++ b/static/scripts/mvc/tools/tools-tree.js @@ -1,3 +1,6 @@ +/* + This class maps the tool form to javascript datastructures. Once refreshed it converts the tool form (including sub sections) into a xml (containing only ids) and a detailed dictionary representation. The xml object is a jquery element and can be searched/filtered e.g. in order to hierarchically identify referenced fields. Once the job is ready for submission, the finalize function will transform the generic dictionary representation into the specific flat dictionary format required by the tools api. +*/ // dependencies define([], function() { @@ -9,7 +12,8 @@ this.app = app; }, - // creates tree structure + /** Refresh the datastructures representing the ToolForm. + */ refresh: function() { // create dictionary this.dict = {}; @@ -26,13 +30,23 @@ this._iterate(this.app.section.$el, this.dict, this.xml); }, - // convert to job dictionary + /** Convert dictionary representation into tool api specific flat dictionary format. + */ finalize: function() { // link this var self = this; // dictionary formatted for job submission - var job_def = {}; + this.job_def = {}; + + // dictionary with api specific identifiers + this.job_ids = {}; + + // add identifier and value to job definition + function add(job_input_id, input_id, input_value) { + self.job_def[job_input_id] = input_value; + self.job_ids[job_input_id] = input_id; + }; // converter between raw dictionary and job dictionary function convert(identifier, head) { @@ -65,6 +79,9 @@ // get conditional value var value = self.app.field_list[input.id].value(); + // add conditional value + add (job_input_id + '|' + input.test_param.name, input.id, value); + // find selected case for (var j in input.cases) { if (input.cases[j].value == value) { @@ -72,13 +89,28 @@ break; } } - - // break + break; + // handle data inputs + case 'data': + var value = { + id : self.app.field_list[input.id].value(), + src : 'hda' + } + add(job_input_id, input.id, value); + break; + // handle boolean input + case 'boolean': + var value = self.app.field_list[input.id].value(); + if (value === 'true') { + value = input.truevalue; + } else { + value = input.falsevalue; + } + add (job_input_id, input.id, value); break; default: // handle default value - var value = self.app.field_list[input.id].value(); - job_def[job_input_id] = value; + add (job_input_id, input.id, self.app.field_list[input.id].value()); } } } @@ -88,11 +120,46 @@ convert('', this.dict); // return result - return job_def; + return this.job_def; }, - // find referenced elements - findReferences: function(identifier, type) { + /** Matches identifier from api response to input element + */ + match: function(response) { + // final result dictionary + var result = {}; + + // link this + var self = this; + + // search throughout response + function search (id, head) { + if (typeof head === 'string') { + var input_id = self.app.tree.job_ids[id]; + if (input_id) { + result[input_id] = head; + } + } else { + for (var i in head) { + var new_id = i; + if (id !== '') { + new_id = id + '|' + new_id; + } + search (new_id, head[i]); + } + } + } + + // match all ids and return messages + search('', response); + + // return matched results + return result; + }, + + /** Find referenced elements. + */ + references: function(identifier, type) { // referenced elements var referenced = []; @@ -164,7 +231,8 @@ return referenced; }, - // iterate + /** Iterate through the tool form dom and map it to the dictionary and xml representation. + */ _iterate: function(parent, dict, xml) { // get child nodes var self = this; diff -r d1f6d05706d0f03c7a31cd5f8b3890c55e565af0 -r deb003947e0e02de4613912b14832944954576a5 static/scripts/mvc/ui/ui-frames.js --- a/static/scripts/mvc/ui/ui-frames.js +++ b/static/scripts/mvc/ui/ui-frames.js @@ -83,10 +83,10 @@ this.setElement(this._template()); // load background - $(this.el).append(this._template_background()); + $(this.el).append(this._templateBackground()); // load menu buttons - $(this.el).append(this._template_menu()); + $(this.el).append(this._templateMenu()); // load to main frame $(this.el_main).append($(this.el)); @@ -97,7 +97,7 @@ var id_shadow = '#frame-shadow'; // add shadow template - $(this.el).append(this._template_shadow(id_shadow.substring(1))); + $(this.el).append(this._templateShadow(id_shadow.substring(1))); // initialize frame this.frame_shadow = { @@ -109,13 +109,13 @@ }; // initialize size - this._frame_resize(this.frame_shadow, {width: 0, height: 0}); + this._frameResize(this.frame_shadow, {width: 0, height: 0}); // add shadow to frame list this.frame_list[id_shadow] = this.frame_shadow; // initialize panel - this._panel_refresh(); + this._panelRefresh(); // apply visibility if (!this.visible) { @@ -128,7 +128,7 @@ var self = this; $(window).resize(function () { if (self.visible) - self._panel_refresh(); + self._panelRefresh(); }); }, @@ -183,9 +183,9 @@ // append var $frame_el = null; if (options.type === 'url') { - $frame_el = $(this._template_frame_url(frame_id.substring(1), options.title, options.content)); + $frame_el = $(this._templateFrameUrl(frame_id.substring(1), options.title, options.content)); } else if (options.type === 'other') { - $frame_el = $(this._template_frame(frame_id.substring(1), options.title)); + $frame_el = $(this._templateFrame(frame_id.substring(1), options.title)); // Load content into frame. var content_elt = $frame_el.find('.f-content'); @@ -208,8 +208,8 @@ }; // set dimensions - options.width = this._to_pixel_coord('width', this.options.frame.cols); - options.height = this._to_pixel_coord('height', this.options.frame.rows); + options.width = this._toPixelCoord('width', this.options.frame.cols); + options.height = this._toPixelCoord('height', this.options.frame.rows); // default z-index this.frame_z = parseInt($(frame.id).css('z-index')); @@ -221,10 +221,10 @@ this.frame_counter++; // resize - this._frame_resize(frame, {width: options.width, height: options.height}); + this._frameResize(frame, {width: options.width, height: options.height}); // place frame - this._frame_insert(frame, {top: 0, left: 0}, true); + this._frameInsert(frame, {top: 0, left: 0}, true); // show frames if hidden if (!this.visible) { @@ -247,10 +247,10 @@ this.$el.find(".frame-background").show(); // show panel - this._panel_refresh(); + this._panelRefresh(); // refresh - this._menu_refresh(); + this._menuRefresh(); }, // hide panel @@ -272,7 +272,7 @@ this.$el.find(".frame-menu").hide(); // refresh - this._menu_refresh(); + this._menuRefresh(); }, // length @@ -299,23 +299,23 @@ // events events: { // global frame events - 'mousemove' : '_event_frame_mouse_move', - 'mouseup' : '_event_frame_mouse_up', - 'mouseleave' : '_event_frame_mouse_up', - 'mousewheel' : '_event_panel_scroll', - 'DOMMouseScroll' : '_event_panel_scroll', + 'mousemove' : '_eventFrameMouseMove', + 'mouseup' : '_eventFrameMouseUp', + 'mouseleave' : '_eventFrameMouseUp', + 'mousewheel' : '_eventPanelScroll', + 'DOMMouseScroll' : '_eventPanelScroll', // events fixed to elements - 'mousedown .frame' : '_event_frame_mouse_down', - 'mousedown .frame-background' : '_event_hide', - 'mousedown .frame-scroll-up' : '_event_panel_scroll_up', - 'mousedown .frame-scroll-down' : '_event_panel_scroll_down', - 'mousedown .f-close' : '_event_frame_close', - 'mousedown .f-pin' : '_event_frame_lock' + 'mousedown .frame' : '_eventFrameMouseDown', + 'mousedown .frame-background' : '_eventHide', + 'mousedown .frame-scroll-up' : '_eventPanelScroll_up', + 'mousedown .frame-scroll-down' : '_eventPanelScroll_down', + 'mousedown .f-close' : '_eventFrameClose', + 'mousedown .f-pin' : '_eventFrameLock' }, // drag start - _event_frame_mouse_down: function (e) { + _eventFrameMouseDown: function (e) { // skip if event is already active if (this.event.type !== null) { return; @@ -340,7 +340,7 @@ e.preventDefault(); // identify frame - this.event.target = this._frame_identify(e.target); + this.event.target = this._frameIdentify(e.target); // check if frame is locked if (this.event.target.grid_lock) { @@ -355,11 +355,11 @@ }; // prepare drag/resize - this._frame_drag_start(this.event.target); + this._frameDragStart(this.event.target); }, // mouse move event - _event_frame_mouse_move: function (e) { + _eventFrameMouseMove: function (e) { // check if (this.event.type != 'drag' && this.event.type != 'resize') { return; @@ -381,7 +381,7 @@ this.event.xy = event_xy_new; // object position / size - var p = this._frame_screen (this.event.target); + var p = this._frameScreen (this.event.target); // resize event if (this.event.type == 'resize') { @@ -395,23 +395,23 @@ p.height = Math.max(p.height, min_dim); // apply resize to frame - this._frame_resize(this.event.target, p); + this._frameResize(this.event.target, p); // break down to grid coordinates - p.width = this._to_grid_coord('width', p.width) + 1; - p.height = this._to_grid_coord('height', p.height) + 1; + p.width = this._toGridCoord('width', p.width) + 1; + p.height = this._toGridCoord('height', p.height) + 1; // transfer back to pixels - p.width = this._to_pixel_coord('width', p.width); - p.height = this._to_pixel_coord('height', p.height); + p.width = this._toPixelCoord('width', p.width); + p.height = this._toPixelCoord('height', p.height); // apply - this._frame_resize(this.frame_shadow, p); + this._frameResize(this.frame_shadow, p); // fix position - this._frame_insert(this.frame_shadow, { - top : this._to_grid_coord('top', p.top), - left : this._to_grid_coord('left', p.left) + this._frameInsert(this.frame_shadow, { + top : this._toGridCoord('top', p.top), + left : this._toGridCoord('left', p.left) }); } @@ -422,12 +422,12 @@ p.top += event_xy_delta.y; // apply - this._frame_offset(this.event.target, p); + this._frameOffset(this.event.target, p); // get location of shadow var l = { - top : this._to_grid_coord('top', p.top), - left : this._to_grid_coord('left', p.left) + top : this._toGridCoord('top', p.top), + left : this._toGridCoord('left', p.left) }; // increase priority of current frame @@ -436,26 +436,26 @@ } // fix position - this._frame_insert(this.frame_shadow, l); + this._frameInsert(this.frame_shadow, l); } }, // mouse up - _event_frame_mouse_up: function (e) { + _eventFrameMouseUp: function (e) { // check if (this.event.type != 'drag' && this.event.type != 'resize') { return; } // stop - this._frame_drag_stop(this.event.target); + this._frameDragStop(this.event.target); // reset event this.event.type = null; }, // drag start - _event_frame_close: function (e) { + _eventFrameClose: function (e) { // check if (this.event.type !== null) { return; @@ -465,7 +465,7 @@ e.preventDefault(); // get frame - var frame = this._frame_identify(e.target); + var frame = this._frameIdentify(e.target); var self = this; // fade out @@ -480,10 +480,10 @@ self.frame_counter--; // reload - self._panel_refresh(true); + self._panelRefresh(true); // refresh scroll state once all animations completed - self._panel_animation_complete(); + self._panelAnimationComplete(); // hide if no frames left if (self.visible && self.frame_counter == 0) @@ -492,7 +492,7 @@ }, // drag start - _event_frame_lock: function (e) { + _eventFrameLock: function (e) { // check if (this.event.type !== null) { return; @@ -502,7 +502,7 @@ e.preventDefault(); // get frame - var frame = this._frame_identify(e.target); + var frame = this._frameIdentify(e.target); // check if (frame.grid_lock) { @@ -529,7 +529,7 @@ }, // show/hide panel - _event_hide: function (e) { + _eventHide: function (e) { // check if (this.event.type !== null) { return; @@ -542,7 +542,7 @@ /** * Fired when scrolling occurs on panel. */ - _event_panel_scroll: function(e) { + _eventPanelScroll: function(e) { // check if (this.event.type !== null || !this.visible) { return; @@ -563,11 +563,11 @@ var delta = e.originalEvent.detail ? e.originalEvent.detail : e.originalEvent.wheelDelta / -3; // refresh panel - this._panel_scroll(delta); + this._panelScroll(delta); }, // scroll up - _event_panel_scroll_up: function(e) { + _eventPanelScroll_up: function(e) { // check if (this.event.type !== null) return; @@ -576,11 +576,11 @@ e.preventDefault(); // scroll up - this._panel_scroll(-this.options.scroll); + this._panelScroll(-this.options.scroll); }, // scroll down - _event_panel_scroll_down: function(e) { + _eventPanelScroll_down: function(e) { // check if (this.event.type !== null) return; @@ -589,7 +589,7 @@ e.preventDefault(); // scroll down - this._panel_scroll(this.options.scroll); + this._panelScroll(this.options.scroll); }, /* @@ -597,21 +597,21 @@ */ // identify - _frame_identify: function(target) { + _frameIdentify: function(target) { return this.frame_list['#' + $(target).closest('.frame').attr('id')]; }, // drag start - _frame_drag_start : function (frame) { + _frameDragStart : function (frame) { // set focus - this._frame_focus(frame, true); + this._frameFocus(frame, true); // get current dimensions - var p = this._frame_screen (frame); + var p = this._frameScreen (frame); // initialize shadow - this._frame_resize(this.frame_shadow, p); - this._frame_grid(this.frame_shadow, frame.grid_location); + this._frameResize(this.frame_shadow, p); + this._frameGrid(this.frame_shadow, frame.grid_location); // reset location frame.grid_location = null; @@ -624,16 +624,16 @@ }, // drag stop - _frame_drag_stop : function (frame) { + _frameDragStop : function (frame) { // remove focus - this._frame_focus(frame, false); + this._frameFocus(frame, false); // get new dimensions - var p = this._frame_screen(this.frame_shadow); + var p = this._frameScreen(this.frame_shadow); // update frame - this._frame_resize(frame, p); - this._frame_grid(frame, this.frame_shadow.grid_location, true); + this._frameResize(frame, p); + this._frameGrid(frame, this.frame_shadow.grid_location, true); // reset location of shadow this.frame_shadow.grid_location = null; @@ -645,7 +645,7 @@ $('.f-cover').hide(); // refresh scroll state once all animations completed - this._panel_animation_complete(); + this._panelAnimationComplete(); }, /* @@ -653,7 +653,7 @@ */ // converts a pixel coordinate to grids - _to_grid_coord: function (type, px) { + _toGridCoord: function (type, px) { // determine sign var sign = (type == 'width' || type == 'height') ? 1 : -1; @@ -664,7 +664,7 @@ }, // converts a grid coordinate to pixels - _to_pixel_coord: function (type, g) { + _toPixelCoord: function (type, g) { // determine sign var sign = (type == 'width' || type == 'height') ? 1 : -1; @@ -677,23 +677,23 @@ }, // get grid coordinates - _to_grid: function (px) { + _toGrid: function (px) { // full set return { - top : this._to_grid_coord('top', px.top), - left : this._to_grid_coord('left', px.left), - width : this._to_grid_coord('width', px.width), - height : this._to_grid_coord('height', px.height) + top : this._toGridCoord('top', px.top), + left : this._toGridCoord('left', px.left), + width : this._toGridCoord('width', px.width), + height : this._toGridCoord('height', px.height) }; }, // get pixel coordinates - _to_pixel: function(g) { + _toPixel: function(g) { return { - top : this._to_pixel_coord('top', g.top), - left : this._to_pixel_coord('left', g.left), - width : this._to_pixel_coord('width', g.width), - height : this._to_pixel_coord('height', g.height) + top : this._toPixelCoord('top', g.top), + left : this._toPixelCoord('left', g.left), + width : this._toPixelCoord('width', g.width), + height : this._toPixelCoord('height', g.height) }; }, @@ -702,7 +702,7 @@ */ // check collision - _is_collision: function(g) { + _isCollision: function(g) { // is collision pair function is_collision_pair (a, b) { return !(a.left > b.left + b.width - 1 || a.left + a.width - 1 < b.left || @@ -728,7 +728,7 @@ }, // location/grid rank - _location_rank: function(loc) { + _locationRank: function(loc) { return (loc.top * this.cols) + loc.left; }, @@ -737,7 +737,7 @@ */ // update frame counter - _menu_refresh: function() { + _menuRefresh: function() { // scroll up possible? if (this.visible) { if (this.top == this.options.top_min) @@ -763,22 +763,22 @@ */ // panel on animation complete / frames not moving - _panel_animation_complete: function() { + _panelAnimationComplete: function() { var self = this; - $(".frame").promise().done(function() {self._panel_scroll(0, true)}); + $(".frame").promise().done(function() {self._panelScroll(0, true)}); }, // refresh panel - _panel_refresh: function(animate) { + _panelRefresh: function(animate) { // get current size this.cols = parseInt($(window).width() / this.options.cell, 10) + 1; // recalculate frame positions - this._frame_insert(null, null, animate); + this._frameInsert(null, null, animate); }, // update scroll - _panel_scroll: function(delta, animate) { + _panelScroll: function(delta, animate) { // new top value var top_new = this.top - this.options.scroll * delta; @@ -799,7 +799,7 @@ top : frame.screen_location.top - (this.top - top_new), left : frame.screen_location.left } - this._frame_offset(frame, screen_location, animate); + this._frameOffset(frame, screen_location, animate); } } @@ -808,7 +808,7 @@ } // refresh - this._menu_refresh(); + this._menuRefresh(); }, /* @@ -816,7 +816,7 @@ */ // frame insert at given location - _frame_insert: function(frame, new_loc, animate) { + _frameInsert: function(frame, new_loc, animate) { // define var place_list = []; @@ -826,7 +826,7 @@ frame.grid_location = null; // set first one to be placed - place_list.push([frame, this._location_rank(new_loc)]); + place_list.push([frame, this._locationRank(new_loc)]); } // search @@ -854,7 +854,7 @@ // place for (i = 0; i < place_list.length; i++) { - this._frame_place(place_list[i][0], animate); + this._framePlace(place_list[i][0], animate); } // identify maximum viewport size @@ -875,16 +875,16 @@ this.top_max = Math.min(this.top_max, this.options.top_min); // panel menu - this._menu_refresh(); + this._menuRefresh(); }, // naive frame place - _frame_place: function(frame, animate) { + _framePlace: function(frame, animate) { // reset grid location frame.grid_location = null; // grid coordinates of new frame - var g = this._to_grid(this._frame_screen(frame)); + var g = this._toGrid(this._frameScreen(frame)); // try grid coordinates var done = false; @@ -896,7 +896,7 @@ g.left = j; // no collision - if (!this._is_collision(g)) { + if (!this._isCollision(g)) { done = true; break; } @@ -910,14 +910,14 @@ // check if valid spot was found if (done) { - this._frame_grid(frame, g, animate); + this._frameGrid(frame, g, animate); } else { console.log("Grid dimensions exceeded."); } }, // focus - _frame_focus: function(frame, has_focus) { + _frameFocus: function(frame, has_focus) { // get new z-value var z = this.frame_z + (has_focus ? 1 : 0); @@ -926,7 +926,7 @@ }, // new left/top position frame - _frame_offset: function(frame, p, animate) { + _frameOffset: function(frame, p, animate) { // update screen location frame.screen_location.left = p.left; frame.screen_location.top = p.top; @@ -934,7 +934,7 @@ // animate if (animate) { // set focus on animated - this._frame_focus(frame, true); + this._frameFocus(frame, true); // prepare for callback var self = this; @@ -943,7 +943,7 @@ $(frame.id).animate({top: p.top, left: p.left}, 'fast', function() { // remove focus - self._frame_focus(frame, false); + self._frameFocus(frame, false); }); } else // update css @@ -951,7 +951,7 @@ }, // resize frame - _frame_resize: function(frame, p) { + _frameResize: function(frame, p) { // update css $(frame.id).css({width: p.width, height: p.height}); @@ -961,19 +961,19 @@ }, // new grid location - _frame_grid: function (frame, l, animate) { + _frameGrid: function (frame, l, animate) { // update grid location frame.grid_location = l; // place frame - this._frame_offset(frame, this._to_pixel(l), animate); + this._frameOffset(frame, this._toPixel(l), animate); // update grid rank - frame.grid_rank = this._location_rank(l); + frame.grid_rank = this._locationRank(l); }, // get frame dimensions - _frame_screen: function(frame) { + _frameScreen: function(frame) { var p = frame.screen_location; return {top: p.top, left: p.left, width: p.width, height: p.height}; }, @@ -988,7 +988,7 @@ }, // fill regular frame template - _template_frame: function(id, title) { + _templateFrame: function(id, title) { // check title if (!title) title = ''; @@ -1008,7 +1008,7 @@ }, // fill regular frame template - _template_frame_url: function(id, title, url) { + _templateFrameUrl: function(id, title, url) { // url if (url.indexOf('?') == -1) url += '?'; @@ -1017,7 +1017,7 @@ url += 'widget=True'; // element - var $el = $(this._template_frame(id, title)); + var $el = $(this._templateFrame(id, title)); $el.find('.f-content').append('<iframe scrolling="auto" class="f-iframe" src="' + url + '"></iframe>'); // load template @@ -1025,17 +1025,17 @@ }, // fill shadow template - _template_shadow: function(id) { + _templateShadow: function(id) { return '<div id="' + id + '" class="frame-shadow corner"></div>'; }, // fill background template in order to cover underlying iframes - _template_background: function() { + _templateBackground: function() { return '<div class="frame-background"></div>'; }, // fill menu button template - _template_menu: function() { + _templateMenu: 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 d1f6d05706d0f03c7a31cd5f8b3890c55e565af0 -r deb003947e0e02de4613912b14832944954576a5 static/scripts/mvc/ui/ui-portlet.js --- a/static/scripts/mvc/ui/ui-portlet.js +++ b/static/scripts/mvc/ui/ui-portlet.js @@ -1,9 +1,8 @@ // dependencies define(['utils/utils'], function(Utils) { -// return -var View = Backbone.View.extend( -{ +// portlet view class +var View = Backbone.View.extend({ // visibility visible: false, diff -r d1f6d05706d0f03c7a31cd5f8b3890c55e565af0 -r deb003947e0e02de4613912b14832944954576a5 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","mvc/tools/tools-select-dataset"],function(d,b,f,a,c){var e=Backbone.View.extend({initialize:function(h,g){this.app=h;this.inputs=g.inputs;g.cls_tr="section-row";this.table=new b.View(g);this.setElement(this.table.$el);this.render()},render:function(){this.table.delAll();for(var g in this.inputs){this._add(this.inputs[g])}},_add:function(i){var h=this;var g=jQuery.extend(true,{},i);g.id=d.uuid();this.app.input_list[g.id]=g;var j=g.type;switch(j){case"conditional":this._addConditional(g);break;case"repeat":this._addRepeat(g);break;default:this._addRow(j,g)}},_addConditional:function(g){g.label=g.test_param.label;g.value=g.test_param.value;this._addRow("conditional",g);for(var j in g.cases){var h=g.id+"-section-"+j;var k=new e(this.app,{inputs:g.cases[j].inputs,cls:"ui-table-plain"});this.table.add(this._create_field({label:"",help:g.help,$el:k.$el,color:true}));this.table.append(h)}},_addRepeat:function(g){var h=this;var l=new a.View({title_new:"Add "+g.title,max:g.max,onnew:function(){var i=g.id+"-section-"+d.uuid();var n=new e(h.app,{inputs:g.inputs,cls:"ui-table-plain"});l.add({id:i,title:g.title,$el:n.$el,ondel:function(){l.del(i);l.retitle(g.title);h.app.refresh()}});l.retitle(g.title);l.show(i);h.app.refresh()}});for(var k=0;k<g.min;k++){var j=g.id+"-section-"+d.uuid();var m=new e(h.app,{inputs:g.inputs,cls:"ui-table-plain"});l.add({id:j,title:g.title,$el:m.$el})}l.retitle(g.title);this.table.add(this._create_field({label:g.title,help:g.help,$el:l.$el,color:true}));this.table.append(g.id)},_addRow:function(i,g){var j=g.id;var h=null;switch(i){case"text":h=this._field_text(g);break;case"select":h=this._field_select(g);break;case"data":h=this._field_data(g);break;case"data_column":h=this._field_data_colum(g);break;case"conditional":h=this._field_conditional(g);break;case"hidden":h=this._field_hidden(g);break;case"integer":h=this._field_slider(g);break;case"float":h=this._field_slider(g);break;case"boolean":h=this._field_boolean(g);break}if(!h){if(g.options){h=this._field_select(g)}else{h=this._field_text(g)}console.debug("tools-form::_addRow() : Auto matched field type ("+i+").")}if(g.value!==undefined){h.value(g.value)}this.app.field_list[j]=h;this.table.add(this._create_field({label:g.label,help:g.help,$el:h.$el}));this.table.append(j)},_field_conditional:function(g){var h=this;var j=[];for(var k in g.test_param.options){var l=g.test_param.options[k];j.push({label:l[0],value:l[1]})}return new f.Select.View({id:"field-"+g.id,data:j,onchange:function(t){for(var r in g.cases){var n=g.cases[r];var q=g.id+"-section-"+r;var m=h.table.get(q);var p=false;for(var o in n.inputs){var s=n.inputs[o].type;if(s&&s!=="hidden"){p=true;break}}if(n.value==t&&p){m.fadeIn("fast")}else{m.hide()}}}})},_field_data:function(g){var h=this;var i=g.id;return new c.View(this.app,{id:"field-"+i,extensions:g.extensions,multiple:g.multiple,onchange:function(r){if(r instanceof Array){r=r[0]}var p=h.app.tree.findReferences(i,"data_column");var k=h.app.datasets.filter(r);if(k&&p.length>0){console.debug("tool-form::field_data() - Selected dataset "+r+".");var t=k.get("metadata_column_types");if(!t){console.debug("tool-form::field_data() - FAILED: Could not find metadata for dataset "+r+".")}for(var m in p){var n=h.app.input_list[p[m]];var o=h.app.field_list[p[m]];if(!n||!o){console.debug("tool-form::field_data() - FAILED: Column not found.")}var l=n.numerical;var j=[];for(var s in t){var q=t[s];if(q=="int"||q=="float"||!l){j.push({label:"Column: "+(parseInt(s)+1)+" ["+t[s]+"]",value:s})}}if(o){o.update(j);if(!o.exists(o.value())){o.value(o.first())}}}}else{console.debug("tool-form::field_data() - FAILED: Could not find dataset "+r+".")}}})},_field_select:function(g){var h=[];for(var j in g.options){var k=g.options[j];h.push({label:k[0],value:k[1]})}var l=f.Select;switch(g.display){case"checkboxes":l=f.Checkbox;break;case"radio":l=f.RadioButton;break}return new l.View({id:"field-"+g.id,data:h,multiple:g.multiple})},_field_data_colum:function(g){return new f.Select.View({id:"field-"+g.id,multiple:g.multiple})},_field_text:function(g){return new f.Input({id:"field-"+g.id,area:g.area})},_field_slider:function(g){var h=1;if(g.type=="float"){h=(g.max-g.min)/10000}return new f.Slider.View({id:"field-"+g.id,min:g.min||0,max:g.max||1000,step:h})},_field_hidden:function(g){return new f.Hidden({id:"field-"+g.id})},_field_boolean:function(g){return new f.RadioButton.View({id:"field-"+g.id,data:[{label:"Yes",value:true},{label:"No",value:false}]})},_create_field:function(g){var h;if(g.color){h=$('<div class="ui-table-form-section"/>')}else{h=$("<div/>")}if(g.label){h.append('<div class="ui-table-form-title-strong">'+g.label+"</div>")}h.append(g.$el);if(g.help){h.append('<div class="ui-table-form-info">'+g.help+"</div>")}return h}});return{View:e}}); \ No newline at end of file +define(["utils/utils","mvc/ui/ui-table","mvc/ui/ui-misc","mvc/ui/ui-tabs","mvc/tools/tools-select-dataset"],function(d,b,g,a,c){var e=Backbone.View.extend({initialize:function(h){this.setElement(this._template(h))},error:function(h){this.$el.find(".ui-table-form-error-text").html(h);this.$el.find(".ui-table-form-error").fadeIn();this.$el.addClass("ui-table-row-error")},reset:function(){this.$el.find(".ui-table-form-error").hide();this.$el.removeClass("ui-table-form-error")},_template:function(h){var i;if(h.highlight){i=$('<div class="ui-table-element ui-table-form-section"/>')}else{i=$('<div class="ui-table-element"/>')}i.append('<div class="ui-table-form-error"><span class="fa fa-arrow-down"/><span class="ui-table-form-error-text"></div>');if(h.label){i.append('<div class="ui-table-form-title-strong">'+h.label+"</div>")}i.append(h.$el);if(h.help){i.append('<div class="ui-table-form-info">'+h.help+"</div>")}return i}});var f=Backbone.View.extend({initialize:function(i,h){this.app=i;this.inputs=h.inputs;h.cls_tr="section-row";this.table=new b.View(h);this.setElement(this.table.$el);this.render()},render:function(){this.table.delAll();for(var h in this.inputs){this._add(this.inputs[h])}},_add:function(j){var i=this;var h=jQuery.extend(true,{},j);h.id=d.uuid();this.app.input_list[h.id]=h;var k=h.type;switch(k){case"conditional":this._addConditional(h);break;case"repeat":this._addRepeat(h);break;default:this._addRow(k,h)}},_addConditional:function(h){h.label=h.test_param.label;h.value=h.test_param.value;var j=this._addRow("conditional",h);for(var l in h.cases){var k=h.id+"-section-"+l;var n=new f(this.app,{inputs:h.cases[l].inputs,cls:"ui-table-plain"});var m=new e({label:"",help:h.help,$el:n.$el,highlight:true});this.table.add(m.$el);this.table.append(k)}},_addRepeat:function(h){var j=this;var m=new a.View({title_new:"Add "+h.title,max:h.max,onnew:function(){var i=h.id+"-section-"+d.uuid();var p=new f(j.app,{inputs:h.inputs,cls:"ui-table-plain"});m.add({id:i,title:h.title,$el:p.$el,ondel:function(){m.del(i);m.retitle(h.title);j.app.refresh()}});m.retitle(h.title);m.show(i);j.app.refresh()}});for(var l=0;l<h.min;l++){var k=h.id+"-section-"+d.uuid();var o=new f(j.app,{inputs:h.inputs,cls:"ui-table-plain"});m.add({id:k,title:h.title,$el:o.$el})}m.retitle(h.title);var n=new e({label:h.title,help:h.help,$el:m.$el,highlight:true});this.table.add(n.$el);this.table.append(h.id)},_addRow:function(j,h){var l=h.id;var i=null;switch(j){case"text":i=this._field_text(h);break;case"select":i=this._field_select(h);break;case"data":i=this._field_data(h);break;case"data_column":i=this._field_data_colum(h);break;case"conditional":i=this._field_conditional(h);break;case"hidden":i=this._field_hidden(h);break;case"integer":i=this._field_slider(h);break;case"float":i=this._field_slider(h);break;case"boolean":i=this._field_boolean(h);break}if(!i){if(h.options){i=this._field_select(h)}else{i=this._field_text(h)}console.debug("tools-form::_addRow() : Auto matched field type ("+j+").")}if(h.value!==undefined){i.value(h.value)}this.app.field_list[l]=i;var k=new e({label:h.label,help:h.help,$el:i.$el});this.app.element_list[l]=k;this.table.add(k.$el);this.table.append(l);return this.table.get(l)},_field_conditional:function(h){var j=this;var k=[];for(var l in h.test_param.options){var m=h.test_param.options[l];k.push({label:m[0],value:m[1]})}return new g.Select.View({id:"field-"+h.id,data:k,onchange:function(u){for(var s in h.cases){var o=h.cases[s];var r=h.id+"-section-"+s;var n=j.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(h){var i=this;var j=h.id;return new c.View(this.app,{id:"field-"+j,extensions:h.extensions,multiple:h.multiple,onchange:function(u){if(u instanceof Array){u=u[0]}var s=i.app.tree.references(j,"data_column");var m=i.app.datasets.filter(u);if(m&&s.length>0){console.debug("tool-form::field_data() - Selected dataset "+u+".");var w=m.get("metadata_column_types");if(!w){console.debug("tool-form::field_data() - FAILED: Could not find metadata for dataset "+u+".")}for(var o in s){var q=i.app.input_list[s[o]];var r=i.app.field_list[s[o]];if(!q||!r){console.debug("tool-form::field_data() - FAILED: Column not found.")}var n=q.numerical;var l=[];for(var v in w){var t=w[v];var k=(parseInt(v)+1);var p="Text";if(t=="int"||t=="float"){p="Number"}if(t=="int"||t=="float"||!n){l.push({label:"Column: "+k+" ["+p+"]",value:k})}}if(r){r.update(l);if(!r.exists(r.value())){r.value(r.first())}}}}else{console.debug("tool-form::field_data() - FAILED: Could not find dataset "+u+".")}}})},_field_select:function(h){var j=[];for(var k in h.options){var l=h.options[k];j.push({label:l[0],value:l[1]})}var m=g.Select;switch(h.display){case"checkboxes":m=g.Checkbox;break;case"radio":m=g.RadioButton;break}return new m.View({id:"field-"+h.id,data:j,multiple:h.multiple})},_field_data_colum:function(h){return new g.Select.View({id:"field-"+h.id,multiple:h.multiple})},_field_text:function(h){return new g.Input({id:"field-"+h.id,area:h.area})},_field_slider:function(h){var i=1;if(h.type=="float"){i=(h.max-h.min)/10000}return new g.Slider.View({id:"field-"+h.id,min:h.min||0,max:h.max||1000,step:i})},_field_hidden:function(h){return new g.Hidden({id:"field-"+h.id})},_field_boolean:function(h){return new g.RadioButton.View({id:"field-"+h.id,data:[{label:"Yes",value:"true"},{label:"No",value:"false"}]})}});return{View:f}}); \ No newline at end of file diff -r d1f6d05706d0f03c7a31cd5f8b3890c55e565af0 -r deb003947e0e02de4613912b14832944954576a5 static/scripts/packed/mvc/ui/ui-frames.js --- a/static/scripts/packed/mvc/ui/ui-frames.js +++ b/static/scripts/packed/mvc/ui/ui-frames.js @@ -1,1 +1,1 @@ -define([],function(){var a=Backbone.View.extend({options:{frame:{cols:6,rows:3},rows:1000,cell:130,margin:5,scroll:5,top_min:40,frame_max:9,visible:true,onchange:null},cols:0,top:0,top_max:0,frame_z:0,frame_counter:0,frame_counter_id:0,frame_list:[],frame_shadow:null,visible:null,initialize:function(c){var b=this;if(c){this.options=_.defaults(c,this.options)}this.visible=this.options.visible;this.top=this.top_max=this.options.top_min;this.setElement(this._template());$(this.el).append(this._template_background());$(this.el).append(this._template_menu());$(this.el_main).append($(this.el));var d="#frame-shadow";$(this.el).append(this._template_shadow(d.substring(1)));this.frame_shadow={id:d,screen_location:{},grid_location:{},grid_rank:null,grid_lock:false};this._frame_resize(this.frame_shadow,{width:0,height:0});this.frame_list[d]=this.frame_shadow;this._panel_refresh();if(!this.visible){this.hide()}else{this.show()}var b=this;$(window).resize(function(){if(b.visible){b._panel_refresh()}})},add:function(c){var f={title:"",content:null,target:"",type:null};if(c){c=_.defaults(c,f)}else{c=f}if(!c.content){return}if(this.frame_counter>=this.options.frame_max){alert("You have reached the maximum number of allowed frames ("+this.options.frame_max+").");return}var d="#frame-"+(this.frame_counter_id++);if($(d).length!==0){alert("This frame already exists. This page might contain multiple frame managers.");return}this.top=this.options.top_min;var e=null;if(c.type==="url"){e=$(this._template_frame_url(d.substring(1),c.title,c.content))}else{if(c.type==="other"){e=$(this._template_frame(d.substring(1),c.title));var b=e.find(".f-content");if(_.isFunction(c.content)){c.content(b)}else{b.append(c.content)}}}$(this.el).append(e);var g={id:d,screen_location:{},grid_location:{},grid_rank:null,grid_lock:false};c.width=this._to_pixel_coord("width",this.options.frame.cols);c.height=this._to_pixel_coord("height",this.options.frame.rows);this.frame_z=parseInt($(g.id).css("z-index"));this.frame_list[d]=g;this.frame_counter++;this._frame_resize(g,{width:c.width,height:c.height});this._frame_insert(g,{top:0,left:0},true);if(!this.visible){this.show()}},show:function(){this.visible=true;this.$el.find(".frame").fadeIn("fast");this.$el.find(this.frame_shadow.id).hide();this.$el.find(".frame-background").show();this._panel_refresh();this._menu_refresh()},hide:function(){if(this.event.type!==null){return}this.visible=false;this.$el.find(".frame").fadeOut("fast");this.$el.find(".frame-background").hide();this.$el.find(".frame-menu").hide();this._menu_refresh()},length:function(){return this.frame_counter},setOnChange:function(b){this.options.onchange=b},event:{type:null,target:null,xy:null},events:{mousemove:"_event_frame_mouse_move",mouseup:"_event_frame_mouse_up",mouseleave:"_event_frame_mouse_up",mousewheel:"_event_panel_scroll",DOMMouseScroll:"_event_panel_scroll","mousedown .frame":"_event_frame_mouse_down","mousedown .frame-background":"_event_hide","mousedown .frame-scroll-up":"_event_panel_scroll_up","mousedown .frame-scroll-down":"_event_panel_scroll_down","mousedown .f-close":"_event_frame_close","mousedown .f-pin":"_event_frame_lock"},_event_frame_mouse_down:function(b){if(this.event.type!==null){return}if($(b.target).hasClass("f-header")||$(b.target).hasClass("f-title")){this.event.type="drag"}if($(b.target).hasClass("f-resize")){this.event.type="resize"}if(this.event.type===null){return}b.preventDefault();this.event.target=this._frame_identify(b.target);if(this.event.target.grid_lock){this.event.type=null;return}this.event.xy={x:b.originalEvent.pageX,y:b.originalEvent.pageY};this._frame_drag_start(this.event.target)},_event_frame_mouse_move:function(h){if(this.event.type!="drag"&&this.event.type!="resize"){return}var f={x:h.originalEvent.pageX,y:h.originalEvent.pageY};var c={x:f.x-this.event.xy.x,y:f.y-this.event.xy.y};this.event.xy=f;var g=this._frame_screen(this.event.target);if(this.event.type=="resize"){g.width+=c.x;g.height+=c.y;var d=this.options.cell-this.options.margin-1;g.width=Math.max(g.width,d);g.height=Math.max(g.height,d);this._frame_resize(this.event.target,g);g.width=this._to_grid_coord("width",g.width)+1;g.height=this._to_grid_coord("height",g.height)+1;g.width=this._to_pixel_coord("width",g.width);g.height=this._to_pixel_coord("height",g.height);this._frame_resize(this.frame_shadow,g);this._frame_insert(this.frame_shadow,{top:this._to_grid_coord("top",g.top),left:this._to_grid_coord("left",g.left)})}if(this.event.type=="drag"){g.left+=c.x;g.top+=c.y;this._frame_offset(this.event.target,g);var b={top:this._to_grid_coord("top",g.top),left:this._to_grid_coord("left",g.left)};if(b.left!==0){b.left++}this._frame_insert(this.frame_shadow,b)}},_event_frame_mouse_up:function(b){if(this.event.type!="drag"&&this.event.type!="resize"){return}this._frame_drag_stop(this.event.target);this.event.type=null},_event_frame_close:function(c){if(this.event.type!==null){return}c.preventDefault();var d=this._frame_identify(c.target);var b=this;$(d.id).fadeOut("fast",function(){$(d.id).remove();delete b.frame_list[d.id];b.frame_counter--;b._panel_refresh(true);b._panel_animation_complete();if(b.visible&&b.frame_counter==0){b.hide()}})},_event_frame_lock:function(b){if(this.event.type!==null){return}b.preventDefault();var c=this._frame_identify(b.target);if(c.grid_lock){c.grid_lock=false;$(c.id).find(".f-pin").removeClass("toggle");$(c.id).find(".f-header").removeClass("f-not-allowed");$(c.id).find(".f-title").removeClass("f-not-allowed");$(c.id).find(".f-resize").show();$(c.id).find(".f-close").show()}else{c.grid_lock=true;$(c.id).find(".f-pin").addClass("toggle");$(c.id).find(".f-header").addClass("f-not-allowed");$(c.id).find(".f-title").addClass("f-not-allowed");$(c.id).find(".f-resize").hide();$(c.id).find(".f-close").hide()}},_event_hide:function(b){if(this.event.type!==null){return}this.hide()},_event_panel_scroll:function(b){if(this.event.type!==null||!this.visible){return}var c=$(b.srcElement).parents(".frame");if(c.length!==0){b.stopPropagation();return}b.preventDefault();var d=b.originalEvent.detail?b.originalEvent.detail:b.originalEvent.wheelDelta/-3;this._panel_scroll(d)},_event_panel_scroll_up:function(b){if(this.event.type!==null){return}b.preventDefault();this._panel_scroll(-this.options.scroll)},_event_panel_scroll_down:function(b){if(this.event.type!==null){return}b.preventDefault();this._panel_scroll(this.options.scroll)},_frame_identify:function(b){return this.frame_list["#"+$(b).closest(".frame").attr("id")]},_frame_drag_start:function(c){this._frame_focus(c,true);var b=this._frame_screen(c);this._frame_resize(this.frame_shadow,b);this._frame_grid(this.frame_shadow,c.grid_location);c.grid_location=null;$(this.frame_shadow.id).show();$(".f-cover").show()},_frame_drag_stop:function(c){this._frame_focus(c,false);var b=this._frame_screen(this.frame_shadow);this._frame_resize(c,b);this._frame_grid(c,this.frame_shadow.grid_location,true);this.frame_shadow.grid_location=null;$(this.frame_shadow.id).hide();$(".f-cover").hide();this._panel_animation_complete()},_to_grid_coord:function(d,c){var b=(d=="width"||d=="height")?1:-1;if(d=="top"){c-=this.top}return parseInt((c+b*this.options.margin)/this.options.cell,10)},_to_pixel_coord:function(d,e){var b=(d=="width"||d=="height")?1:-1;var c=(e*this.options.cell)-b*this.options.margin;if(d=="top"){c+=this.top}return c},_to_grid:function(b){return{top:this._to_grid_coord("top",b.top),left:this._to_grid_coord("left",b.left),width:this._to_grid_coord("width",b.width),height:this._to_grid_coord("height",b.height)}},_to_pixel:function(b){return{top:this._to_pixel_coord("top",b.top),left:this._to_pixel_coord("left",b.left),width:this._to_pixel_coord("width",b.width),height:this._to_pixel_coord("height",b.height)}},_is_collision:function(d){function b(g,f){return !(g.left>f.left+f.width-1||g.left+g.width-1<f.left||g.top>f.top+f.height-1||g.top+g.height-1<f.top)}for(var c in this.frame_list){var e=this.frame_list[c];if(e.grid_location===null){continue}if(b(d,e.grid_location)){return true}}return false},_location_rank:function(b){return(b.top*this.cols)+b.left},_menu_refresh:function(){if(this.visible){if(this.top==this.options.top_min){$(".frame-scroll-up").hide()}else{$(".frame-scroll-up").show()}if(this.top==this.top_max){$(".frame-scroll-down").hide()}else{$(".frame-scroll-down").show()}}if(this.options.onchange){this.options.onchange()}},_panel_animation_complete:function(){var b=this;$(".frame").promise().done(function(){b._panel_scroll(0,true)})},_panel_refresh:function(b){this.cols=parseInt($(window).width()/this.options.cell,10)+1;this._frame_insert(null,null,b)},_panel_scroll:function(g,b){var d=this.top-this.options.scroll*g;d=Math.max(d,this.top_max);d=Math.min(d,this.options.top_min);if(this.top!=d){for(var c in this.frame_list){var f=this.frame_list[c];if(f.grid_location!==null){var e={top:f.screen_location.top-(this.top-d),left:f.screen_location.left};this._frame_offset(f,e,b)}}this.top=d}this._menu_refresh()},_frame_insert:function(h,b,d){var c=[];if(h){h.grid_location=null;c.push([h,this._location_rank(b)])}var e=null;for(e in this.frame_list){var g=this.frame_list[e];if(g.grid_location!==null&&!g.grid_lock){g.grid_location=null;c.push([g,g.grid_rank])}}c.sort(function(k,f){var m=k[1];var l=f[1];return m<l?-1:(m>l?1:0)});for(e=0;e<c.length;e++){this._frame_place(c[e][0],d)}this.top_max=0;for(var e in this.frame_list){var h=this.frame_list[e];if(h.grid_location!==null){this.top_max=Math.max(this.top_max,h.grid_location.top+h.grid_location.height)}}this.top_max=$(window).height()-this.top_max*this.options.cell-2*this.options.margin;this.top_max=Math.min(this.top_max,this.options.top_min);this._menu_refresh()},_frame_place:function(h,c){h.grid_location=null;var f=this._to_grid(this._frame_screen(h));var b=false;for(var e=0;e<this.options.rows;e++){for(var d=0;d<Math.max(1,this.cols-f.width);d++){f.top=e;f.left=d;if(!this._is_collision(f)){b=true;break}}if(b){break}}if(b){this._frame_grid(h,f,c)}else{console.log("Grid dimensions exceeded.")}},_frame_focus:function(d,b){var c=this.frame_z+(b?1:0);$(d.id).css("z-index",c)},_frame_offset:function(e,d,c){e.screen_location.left=d.left;e.screen_location.top=d.top;if(c){this._frame_focus(e,true);var b=this;$(e.id).animate({top:d.top,left:d.left},"fast",function(){b._frame_focus(e,false)})}else{$(e.id).css({top:d.top,left:d.left})}},_frame_resize:function(c,b){$(c.id).css({width:b.width,height:b.height});c.screen_location.width=b.width;c.screen_location.height=b.height},_frame_grid:function(d,b,c){d.grid_location=b;this._frame_offset(d,this._to_pixel(b),c);d.grid_rank=this._location_rank(b)},_frame_screen:function(c){var b=c.screen_location;return{top:b.top,left:b.left,width:b.width,height:b.height}},_template:function(){return'<div class="galaxy-frame"></div>'},_template_frame:function(c,b){if(!b){b=""}return'<div id="'+c+'" class="frame corner"><div class="f-header corner"><span class="f-title">'+b+'</span><span class="f-icon f-close fa fa-trash-o"></span><span class="f-icon f-pin fa fa-thumb-tack"></span></div><div class="f-content"><div class="f-cover"></div></div><span class="f-resize f-icon corner fa fa-resize-full"></span></div>'},_template_frame_url:function(e,d,b){if(b.indexOf("?")==-1){b+="?"}else{b+="&"}b+="widget=True";var c=$(this._template_frame(e,d));c.find(".f-content").append('<iframe scrolling="auto" class="f-iframe" src="'+b+'"></iframe>');return c},_template_shadow:function(b){return'<div id="'+b+'" class="frame-shadow corner"></div>'},_template_background:function(){return'<div class="frame-background"></div>'},_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>'}});return{View:a}}); \ No newline at end of file +define([],function(){var a=Backbone.View.extend({options:{frame:{cols:6,rows:3},rows:1000,cell:130,margin:5,scroll:5,top_min:40,frame_max:9,visible:true,onchange:null},cols:0,top:0,top_max:0,frame_z:0,frame_counter:0,frame_counter_id:0,frame_list:[],frame_shadow:null,visible:null,initialize:function(c){var b=this;if(c){this.options=_.defaults(c,this.options)}this.visible=this.options.visible;this.top=this.top_max=this.options.top_min;this.setElement(this._template());$(this.el).append(this._templateBackground());$(this.el).append(this._templateMenu());$(this.el_main).append($(this.el));var d="#frame-shadow";$(this.el).append(this._templateShadow(d.substring(1)));this.frame_shadow={id:d,screen_location:{},grid_location:{},grid_rank:null,grid_lock:false};this._frameResize(this.frame_shadow,{width:0,height:0});this.frame_list[d]=this.frame_shadow;this._panelRefresh();if(!this.visible){this.hide()}else{this.show()}var b=this;$(window).resize(function(){if(b.visible){b._panelRefresh()}})},add:function(c){var f={title:"",content:null,target:"",type:null};if(c){c=_.defaults(c,f)}else{c=f}if(!c.content){return}if(this.frame_counter>=this.options.frame_max){alert("You have reached the maximum number of allowed frames ("+this.options.frame_max+").");return}var d="#frame-"+(this.frame_counter_id++);if($(d).length!==0){alert("This frame already exists. This page might contain multiple frame managers.");return}this.top=this.options.top_min;var e=null;if(c.type==="url"){e=$(this._templateFrameUrl(d.substring(1),c.title,c.content))}else{if(c.type==="other"){e=$(this._templateFrame(d.substring(1),c.title));var b=e.find(".f-content");if(_.isFunction(c.content)){c.content(b)}else{b.append(c.content)}}}$(this.el).append(e);var g={id:d,screen_location:{},grid_location:{},grid_rank:null,grid_lock:false};c.width=this._toPixelCoord("width",this.options.frame.cols);c.height=this._toPixelCoord("height",this.options.frame.rows);this.frame_z=parseInt($(g.id).css("z-index"));this.frame_list[d]=g;this.frame_counter++;this._frameResize(g,{width:c.width,height:c.height});this._frameInsert(g,{top:0,left:0},true);if(!this.visible){this.show()}},show:function(){this.visible=true;this.$el.find(".frame").fadeIn("fast");this.$el.find(this.frame_shadow.id).hide();this.$el.find(".frame-background").show();this._panelRefresh();this._menuRefresh()},hide:function(){if(this.event.type!==null){return}this.visible=false;this.$el.find(".frame").fadeOut("fast");this.$el.find(".frame-background").hide();this.$el.find(".frame-menu").hide();this._menuRefresh()},length:function(){return this.frame_counter},setOnChange:function(b){this.options.onchange=b},event:{type:null,target:null,xy:null},events:{mousemove:"_eventFrameMouseMove",mouseup:"_eventFrameMouseUp",mouseleave:"_eventFrameMouseUp",mousewheel:"_eventPanelScroll",DOMMouseScroll:"_eventPanelScroll","mousedown .frame":"_eventFrameMouseDown","mousedown .frame-background":"_eventHide","mousedown .frame-scroll-up":"_eventPanelScroll_up","mousedown .frame-scroll-down":"_eventPanelScroll_down","mousedown .f-close":"_eventFrameClose","mousedown .f-pin":"_eventFrameLock"},_eventFrameMouseDown:function(b){if(this.event.type!==null){return}if($(b.target).hasClass("f-header")||$(b.target).hasClass("f-title")){this.event.type="drag"}if($(b.target).hasClass("f-resize")){this.event.type="resize"}if(this.event.type===null){return}b.preventDefault();this.event.target=this._frameIdentify(b.target);if(this.event.target.grid_lock){this.event.type=null;return}this.event.xy={x:b.originalEvent.pageX,y:b.originalEvent.pageY};this._frameDragStart(this.event.target)},_eventFrameMouseMove:function(h){if(this.event.type!="drag"&&this.event.type!="resize"){return}var f={x:h.originalEvent.pageX,y:h.originalEvent.pageY};var c={x:f.x-this.event.xy.x,y:f.y-this.event.xy.y};this.event.xy=f;var g=this._frameScreen(this.event.target);if(this.event.type=="resize"){g.width+=c.x;g.height+=c.y;var d=this.options.cell-this.options.margin-1;g.width=Math.max(g.width,d);g.height=Math.max(g.height,d);this._frameResize(this.event.target,g);g.width=this._toGridCoord("width",g.width)+1;g.height=this._toGridCoord("height",g.height)+1;g.width=this._toPixelCoord("width",g.width);g.height=this._toPixelCoord("height",g.height);this._frameResize(this.frame_shadow,g);this._frameInsert(this.frame_shadow,{top:this._toGridCoord("top",g.top),left:this._toGridCoord("left",g.left)})}if(this.event.type=="drag"){g.left+=c.x;g.top+=c.y;this._frameOffset(this.event.target,g);var b={top:this._toGridCoord("top",g.top),left:this._toGridCoord("left",g.left)};if(b.left!==0){b.left++}this._frameInsert(this.frame_shadow,b)}},_eventFrameMouseUp:function(b){if(this.event.type!="drag"&&this.event.type!="resize"){return}this._frameDragStop(this.event.target);this.event.type=null},_eventFrameClose:function(c){if(this.event.type!==null){return}c.preventDefault();var d=this._frameIdentify(c.target);var b=this;$(d.id).fadeOut("fast",function(){$(d.id).remove();delete b.frame_list[d.id];b.frame_counter--;b._panelRefresh(true);b._panelAnimationComplete();if(b.visible&&b.frame_counter==0){b.hide()}})},_eventFrameLock:function(b){if(this.event.type!==null){return}b.preventDefault();var c=this._frameIdentify(b.target);if(c.grid_lock){c.grid_lock=false;$(c.id).find(".f-pin").removeClass("toggle");$(c.id).find(".f-header").removeClass("f-not-allowed");$(c.id).find(".f-title").removeClass("f-not-allowed");$(c.id).find(".f-resize").show();$(c.id).find(".f-close").show()}else{c.grid_lock=true;$(c.id).find(".f-pin").addClass("toggle");$(c.id).find(".f-header").addClass("f-not-allowed");$(c.id).find(".f-title").addClass("f-not-allowed");$(c.id).find(".f-resize").hide();$(c.id).find(".f-close").hide()}},_eventHide:function(b){if(this.event.type!==null){return}this.hide()},_eventPanelScroll:function(b){if(this.event.type!==null||!this.visible){return}var c=$(b.srcElement).parents(".frame");if(c.length!==0){b.stopPropagation();return}b.preventDefault();var d=b.originalEvent.detail?b.originalEvent.detail:b.originalEvent.wheelDelta/-3;this._panelScroll(d)},_eventPanelScroll_up:function(b){if(this.event.type!==null){return}b.preventDefault();this._panelScroll(-this.options.scroll)},_eventPanelScroll_down:function(b){if(this.event.type!==null){return}b.preventDefault();this._panelScroll(this.options.scroll)},_frameIdentify:function(b){return this.frame_list["#"+$(b).closest(".frame").attr("id")]},_frameDragStart:function(c){this._frameFocus(c,true);var b=this._frameScreen(c);this._frameResize(this.frame_shadow,b);this._frameGrid(this.frame_shadow,c.grid_location);c.grid_location=null;$(this.frame_shadow.id).show();$(".f-cover").show()},_frameDragStop:function(c){this._frameFocus(c,false);var b=this._frameScreen(this.frame_shadow);this._frameResize(c,b);this._frameGrid(c,this.frame_shadow.grid_location,true);this.frame_shadow.grid_location=null;$(this.frame_shadow.id).hide();$(".f-cover").hide();this._panelAnimationComplete()},_toGridCoord:function(d,c){var b=(d=="width"||d=="height")?1:-1;if(d=="top"){c-=this.top}return parseInt((c+b*this.options.margin)/this.options.cell,10)},_toPixelCoord:function(d,e){var b=(d=="width"||d=="height")?1:-1;var c=(e*this.options.cell)-b*this.options.margin;if(d=="top"){c+=this.top}return c},_toGrid:function(b){return{top:this._toGridCoord("top",b.top),left:this._toGridCoord("left",b.left),width:this._toGridCoord("width",b.width),height:this._toGridCoord("height",b.height)}},_toPixel:function(b){return{top:this._toPixelCoord("top",b.top),left:this._toPixelCoord("left",b.left),width:this._toPixelCoord("width",b.width),height:this._toPixelCoord("height",b.height)}},_isCollision:function(d){function b(g,f){return !(g.left>f.left+f.width-1||g.left+g.width-1<f.left||g.top>f.top+f.height-1||g.top+g.height-1<f.top)}for(var c in this.frame_list){var e=this.frame_list[c];if(e.grid_location===null){continue}if(b(d,e.grid_location)){return true}}return false},_locationRank:function(b){return(b.top*this.cols)+b.left},_menuRefresh:function(){if(this.visible){if(this.top==this.options.top_min){$(".frame-scroll-up").hide()}else{$(".frame-scroll-up").show()}if(this.top==this.top_max){$(".frame-scroll-down").hide()}else{$(".frame-scroll-down").show()}}if(this.options.onchange){this.options.onchange()}},_panelAnimationComplete:function(){var b=this;$(".frame").promise().done(function(){b._panelScroll(0,true)})},_panelRefresh:function(b){this.cols=parseInt($(window).width()/this.options.cell,10)+1;this._frameInsert(null,null,b)},_panelScroll:function(g,b){var d=this.top-this.options.scroll*g;d=Math.max(d,this.top_max);d=Math.min(d,this.options.top_min);if(this.top!=d){for(var c in this.frame_list){var f=this.frame_list[c];if(f.grid_location!==null){var e={top:f.screen_location.top-(this.top-d),left:f.screen_location.left};this._frameOffset(f,e,b)}}this.top=d}this._menuRefresh()},_frameInsert:function(h,b,d){var c=[];if(h){h.grid_location=null;c.push([h,this._locationRank(b)])}var e=null;for(e in this.frame_list){var g=this.frame_list[e];if(g.grid_location!==null&&!g.grid_lock){g.grid_location=null;c.push([g,g.grid_rank])}}c.sort(function(k,f){var m=k[1];var l=f[1];return m<l?-1:(m>l?1:0)});for(e=0;e<c.length;e++){this._framePlace(c[e][0],d)}this.top_max=0;for(var e in this.frame_list){var h=this.frame_list[e];if(h.grid_location!==null){this.top_max=Math.max(this.top_max,h.grid_location.top+h.grid_location.height)}}this.top_max=$(window).height()-this.top_max*this.options.cell-2*this.options.margin;this.top_max=Math.min(this.top_max,this.options.top_min);this._menuRefresh()},_framePlace:function(h,c){h.grid_location=null;var f=this._toGrid(this._frameScreen(h));var b=false;for(var e=0;e<this.options.rows;e++){for(var d=0;d<Math.max(1,this.cols-f.width);d++){f.top=e;f.left=d;if(!this._isCollision(f)){b=true;break}}if(b){break}}if(b){this._frameGrid(h,f,c)}else{console.log("Grid dimensions exceeded.")}},_frameFocus:function(d,b){var c=this.frame_z+(b?1:0);$(d.id).css("z-index",c)},_frameOffset:function(e,d,c){e.screen_location.left=d.left;e.screen_location.top=d.top;if(c){this._frameFocus(e,true);var b=this;$(e.id).animate({top:d.top,left:d.left},"fast",function(){b._frameFocus(e,false)})}else{$(e.id).css({top:d.top,left:d.left})}},_frameResize:function(c,b){$(c.id).css({width:b.width,height:b.height});c.screen_location.width=b.width;c.screen_location.height=b.height},_frameGrid:function(d,b,c){d.grid_location=b;this._frameOffset(d,this._toPixel(b),c);d.grid_rank=this._locationRank(b)},_frameScreen:function(c){var b=c.screen_location;return{top:b.top,left:b.left,width:b.width,height:b.height}},_template:function(){return'<div class="galaxy-frame"></div>'},_templateFrame:function(c,b){if(!b){b=""}return'<div id="'+c+'" class="frame corner"><div class="f-header corner"><span class="f-title">'+b+'</span><span class="f-icon f-close fa fa-trash-o"></span><span class="f-icon f-pin fa fa-thumb-tack"></span></div><div class="f-content"><div class="f-cover"></div></div><span class="f-resize f-icon corner fa fa-resize-full"></span></div>'},_templateFrameUrl:function(e,d,b){if(b.indexOf("?")==-1){b+="?"}else{b+="&"}b+="widget=True";var c=$(this._templateFrame(e,d));c.find(".f-content").append('<iframe scrolling="auto" class="f-iframe" src="'+b+'"></iframe>');return c},_templateShadow:function(b){return'<div id="'+b+'" class="frame-shadow corner"></div>'},_templateBackground:function(){return'<div class="frame-background"></div>'},_templateMenu: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>'}});return{View:a}}); \ No newline at end of file diff -r d1f6d05706d0f03c7a31cd5f8b3890c55e565af0 -r deb003947e0e02de4613912b14832944954576a5 static/style/blue/base.css --- a/static/style/blue/base.css +++ b/static/style/blue/base.css @@ -1278,6 +1278,8 @@ .upload-ftp .upload-ftp-help{margin-bottom:10px} .upload-ftp .upload-ftp-warning{text-align:center;margin-top:20px} .upload-settings .upload-settings-cover{position:absolute;width:100%;height:100%;top:0px;left:0px;background:#fff;opacity:0.4;cursor:no-drop} +.ui-table-row-error{-moz-border-radius:3px;border-radius:3px;background:#f9c7c5;padding:5px} +.ui-table-form-error{display:none}.ui-table-form-error .ui-table-form-error-text{padding-left:5px} .ui-form-slider .ui-form-slider-text{width:100px;float:left} .ui-form-slider .ui-form-slider-element{width:calc(100% - 110px);float:left;top:8px;left:10px} .ui-radiobutton label{height:23px;line-height:1em} diff -r d1f6d05706d0f03c7a31cd5f8b3890c55e565af0 -r deb003947e0e02de4613912b14832944954576a5 static/style/src/less/frame.less --- a/static/style/src/less/frame.less +++ b/static/style/src/less/frame.less @@ -1,18 +1,14 @@ -.galaxy-frame -{ - .corner - { +.galaxy-frame{ + .corner { -moz-border-radius: @border-radius-large; border-radius: @border-radius-large; } - .toggle - { + .toggle { color: gold; } - .frame-background - { + .frame-background { z-index : @zindex-navbar; position : absolute; display : none; @@ -25,8 +21,7 @@ overflow : auto; } - .frame-shadow - { + .frame-shadow { z-index : @zindex-navbar + 1; position : absolute; display : none; @@ -40,8 +35,7 @@ /* panel menu button */ - .frame-menu - { + .frame-menu { z-index : @zindex-navbar + 5; position : absolute; cursor : pointer; @@ -49,13 +43,11 @@ right : 10px; } - .frame-scroll-up - { + .frame-scroll-up { top : 50px; } - .frame-scroll-down - { + .frame-scroll-down { bottom : 20px; } @@ -63,8 +55,7 @@ frame components */ - .frame - { + .frame { z-index : @zindex-navbar + 2; overflow : hidden; position : absolute; @@ -72,8 +63,7 @@ border : 1px solid @navbar-default-border; -webkit-box-shadow: 0 0 5px rgba(0,0,0,0.3); - .f-content - { + .f-content{ position : absolute; overflow : hidden; background : @white; @@ -84,8 +74,7 @@ right : 3px; } - .f-cover - { + .f-cover{ position : absolute; display : none; top : 0px; @@ -96,15 +85,13 @@ background : @white; } - .f-iframe - { + .f-iframe{ border : none; width : 100%; height : 100%; } - .f-header - { + .f-header{ height : 17px; margin : 2px; cursor : pointer; @@ -113,8 +100,7 @@ color : @white; } - .f-title - { + .f-title { position : absolute; top : 2px; left : 16px; @@ -128,32 +114,27 @@ frame icons */ - .f-icon - { + .f-icon{ position : absolute; cursor : pointer; font-size : 14px; } - .f-not-allowed - { + .f-not-allowed{ cursor : not-allowed; } - .f-close - { + .f-close{ right : 5px; top : 3px; } - .f-pin - { + .f-pin{ left : 6px; top : 3px; } - .f-resize - { + .f-resize{ right : 0px; bottom : 0px; background : @white; diff -r d1f6d05706d0f03c7a31cd5f8b3890c55e565af0 -r deb003947e0e02de4613912b14832944954576a5 static/style/src/less/ui.less --- a/static/style/src/less/ui.less +++ b/static/style/src/less/ui.less @@ -1,3 +1,17 @@ +.ui-table-row-error { + -moz-border-radius: @border-radius-base; + border-radius: @border-radius-base; + background: @state-danger-bg; + padding: 5px; +} + +.ui-table-form-error { + display: none; + .ui-table-form-error-text { + padding-left: 5px; + } +} + .ui-form-slider { .ui-form-slider-text { &:extend(.form-control); 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.