Changeset 260
- Timestamp:
- Mar 12, 2010, 4:12:53 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 20 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/conf/BootStrap.groovy
r253 r260 183 183 name: 'Cage',type: TemplateFieldType.INTEGER)) 184 184 .addToFields(new TemplateField( 185 name: 'Some double', type: TemplateFieldType.DOUBLE))186 .addToFields(new TemplateField( 187 name: 'Some ontology', type: TemplateFieldType.ONTOLOGYTERM))185 name: 'SomeDouble', type: TemplateFieldType.DOUBLE)) 186 .addToFields(new TemplateField( 187 name: 'SomeOntology', type: TemplateFieldType.ONTOLOGYTERM)) 188 188 .with { if (!validate()) { errors.each { println it} } else save()} 189 189 -
trunk/grails-app/controllers/dbnp/studycapturing/WizardController.groovy
r257 r260 160 160 }.to "subjects" 161 161 on("next") { 162 println params 162 163 flash.errors = [:] 163 164 -
trunk/grails-app/taglib/dbnp/studycapturing/WizardTagLib.groovy
r257 r260 630 630 break 631 631 case 'ONTOLOGYTERM': 632 out << it.getClass() 632 // @see http://www.bioontology.org/wiki/index.php/NCBO_Widgets#Term-selection_field_on_a_form 633 // @see table-editor.js 634 //out << it.getClass() 635 out << textField( 636 name: attrs.name + '_' + it.name, 637 value: fieldValue, 638 rel: 'ontology-all-name', 639 size: 100 640 ) 633 641 break 634 642 default: -
trunk/grails-app/views/layouts/main.gsp
r247 r260 8 8 <link rel="shortcut icon" href="${resource(dir: 'images', file: 'favicon.ico')}" type="image/x-icon"/> 9 9 <g:javascript library="jquery"/> 10 <script src="${createLinkTo(dir: 'js', file: 'jquery-ui-1. 7.2.custom.min.js')}" type="text/javascript"></script>11 <link rel="stylesheet" href="${createLinkTo(dir: 'css/ jquery-ui', file: 'jquery-ui-1.7.2.custom.css')}"/>10 <script src="${createLinkTo(dir: 'js', file: 'jquery-ui-1.8rc3.custom.min.js')}" type="text/javascript"></script> 11 <link rel="stylesheet" href="${createLinkTo(dir: 'css/cupertino', file: 'jquery-ui-1.8rc3.custom.css')}"/> 12 12 <!-- layouthead //--> 13 13 <g:layoutHead/> -
trunk/grails-app/views/wizard/index.gsp
r257 r260 23 23 <script type="text/javascript" src="${resource(dir: 'js', file: 'swfobject.js')}"></script> 24 24 <script type="text/javascript" src="${resource(dir: 'js', file: 'table-editor.js')}"></script> 25 <script type="text/javascript" src="${resource(dir: 'js', file: 'ontology-chooser.js')}"></script> 25 26 <script type="text/javascript" src="${resource(dir: 'js', file: 'timepicker-0.2.1.js')}"></script> 26 27 <script type="text/javascript" src="${resource(dir: 'js', file: 'wizard.js')}"></script> 27 <script type="text/javascript" src="http://bioportal.bioontology.org/javascripts/widgets/form_complete.js"></script>28 28 </head> 29 29 <body> -
trunk/grails-app/views/wizard/pages/_study.gsp
r247 r260 18 18 <span class="info"> 19 19 <span class="title">Define the basic properties of your study</span> 20 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce laoreet leo nec leo vehicula quis scelerisque elit pulvinar. Vivamus arcu dui, adipiscing eu vestibulum id, consectetur et erat. Aenean risus mauris, placerat et lacinia vulputate, commodo eget ligula. Pellentesque ornare blandit metus ac dictum. Donec scelerisque feugiat quam, a congue ipsum malesuada nec. Donec vulputate, diam eget porta rhoncus, est mauris ullamcorper turpis, vitae dictum risus justo quis justo. Aenean blandit feugiat accumsan. Donec porttitor bibendum elementum. 20 Pick the study template of choice (currently a fixed set) and define your study values. In this prototype the 21 templated fields (below the 'note' box) are not yet handled so you can leave them empty for now. 21 22 </span> 22 23 … … 51 52 <wizard:templateElements entity="${study}" /> 52 53 54 <span class="info"> 55 <span class="title">Known issues</span> 56 <ul> 57 <li>the templated fields appear in random order</li> 58 <li>the templated fields are not yet handled / stored</li> 59 </ul> 60 </span> 61 53 62 </wizard:pageContent> -
trunk/grails-app/views/wizard/pages/_subjects.gsp
r247 r260 18 18 <span class="info"> 19 19 <span class="title">Add subjects to your study</span> 20 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce laoreet leo nec leo vehicula quis scelerisque elit pulvinar. Vivamus arcu dui, adipiscing eu vestibulum id, consectetur et erat. Aenean risus mauris, placerat et lacinia vulputate, commodo eget ligula. Pellentesque ornare blandit metus ac dictum. Donec scelerisque feugiat quam, a congue ipsum malesuada nec. Donec vulputate, diam eget porta rhoncus, est mauris ullamcorper turpis, vitae dictum risus justo quis justo. Aenean blandit feugiat accumsan. Donec porttitor bibendum elementum. 20 In this screen you can add subjects to your study based on a given template. Note that the 'species' select will probably 21 move to the template as an ontology reference and will not be asked anymore. 21 22 </span> 22 23 … … 56 57 </g:if> 57 58 59 <span class="info"> 60 <span class="title">Known issues</span> 61 <ul> 62 <li>autocomplete fields (like ontologies) deselect the selected rows and hence don't replicate</li> 63 <li>ontology fields should replicate value <i>and</i> hidden fields</li> 64 <li>no client-side validation is performed to check the type of an input field actually matched that of the datamodel</li> 65 <li>table columns are randomized on view as they are currently not sorted</li> 66 <li>ontology hidden fields should be processed by the back-end as well (not yet implemented)</li> 67 <li>ontology fields now show suggestions for <i>all</i> available ontologies. This has to be narrowed down in the future.</li> 68 </ul> 69 </span> 70 58 71 </wizard:pageContent> -
trunk/web-app/css/wizard.css
r238 r260 241 241 color: #fff; 242 242 } 243 244 243 /* END :: TABLE */ 244 245 /* START :: wizard autocomplete */ 246 .ui-autocomplete .ui-menu-item { 247 font-size: 10px; 248 } 249 .ui-autocomplete .about { 250 font-size: 8px; 251 color: #006DBA; 252 } 253 .ui-autocomplete .from { 254 font-size: 8px; 255 color: #666; 256 } 257 /* END :: wizard autocomplete */ -
trunk/web-app/js/table-editor.js
r247 r260 12 12 * $Date$ 13 13 */ 14 function TableEditor() { } 14 function TableEditor() { 15 } 15 16 TableEditor.prototype = { 16 17 tableIdentifier: null, 17 18 rowIdentifier: null, 18 19 columnIdentifier: null, 20 selected: null, 19 21 20 22 /** … … 51 53 filter: this.rowIdentifier, 52 54 stop: function() { 55 // remember selected rows 56 that.selected = $('.ui-selected', table); 57 53 58 // bind on change to columns in rows 54 $('.ui-selected', table).each(function() {55 that.attachColumnHandlers(this );59 that.selected.each(function() { 60 that.attachColumnHandlers(this,table); 56 61 }) 57 62 } … … 63 68 * @param row 64 69 */ 65 attachColumnHandlers: function(row ) {70 attachColumnHandlers: function(row,table) { 66 71 var that = this; 67 72 var count = 0; 73 74 // define regular expressions 75 var regAutoComplete = new RegExp("ui-autocomplete-input"); 76 68 77 $(this.columnIdentifier, $(row)).each(function() { 69 78 var input = $(':input', $(this)); 70 79 // does this column contain an input field 71 80 if (input) { 72 var type = $(input).attr('type'); 81 var inputElement = $(input) 82 var type = inputElement.attr('type'); 73 83 74 84 switch (type) { … … 76 86 // text input 77 87 var columnNumber = count; 78 $(input).bind('keyup', function() { 79 that.updateSingleInputElements(input, columnNumber, 'input'); 80 }) 88 89 // handle special cases 90 // if (inputElement.attr('rel') && regBp.test(inputElement.attr('rel'))) { 91 if (regAutoComplete.test(inputElement.attr('class'))) { 92 // this is a jquery-ui autocomplete field 93 inputElement.bind('autocompleteclose', function() { 94 // TODO: autocompletion deselects rows... which is what we don't want 95 // to happen of course... 96 that.updateSingleInputElements(input, columnNumber, 'input'); 97 }) 98 } else { 99 // regular text element 100 inputElement.bind('keyup', function() { 101 that.updateSingleInputElements(input, columnNumber, 'input'); 102 }); 103 } 81 104 break; 82 105 case 'select-one': 83 106 // single select 84 107 var columnNumber = count; 85 $(input).bind('change', function() {108 inputElement.bind('change', function() { 86 109 that.updateSingleInputElements(input, columnNumber, 'select'); 87 110 }); … … 90 113 // checkbox 91 114 var columnNumber = count; 92 $(input).bind('click', function() {115 inputElement.bind('click', function() { 93 116 that.updateSingleInputElements(input, columnNumber, 'input'); 94 117 }); … … 108 131 109 132 count++; 110 }) 133 }); 111 134 }, 112 135 … … 120 143 var that = this; 121 144 var e = $(element); 122 var c = e.parent(); 123 var r = c.parent(); 124 var t = r.parent(); 145 var c = e.parent(); // column 146 var r = c.parent(); // row 147 var t = r.parent(); // table 125 148 var v = this.getValue(e); 126 149 // TODO for multiples... … … 132 155 var myVal = that.getValue(me); 133 156 if (myVal != v) { 134 that.setValue(me, v);157 that.setValue(me, v); 135 158 } 136 159 }) … … 160 183 * @param value 161 184 */ 162 setValue: function(input, value) {185 setValue: function(input, value) { 163 186 var i = $(input); 164 187 165 188 switch (i.attr('type')) { 166 189 case 'checkbox': 167 return i.attr('checked', value);190 return i.attr('checked', value); 168 191 break; 169 192 default: -
trunk/web-app/js/wizard.js
r257 r260 38 38 attachDateTimePickers(); 39 39 40 // table handlers40 // handle and initialize table(s) 41 41 attachTableEvents(); 42 42 handleWizardTable(); 43 43 new TableEditor().init('div.table', 'div.row', 'div.column'); 44 44 45 // accordeon(s) 45 // initialize the ontology chooser 46 new OntologyChooser().init(); 47 48 // initialize accordeon(s) 46 49 $("#accordion").accordion(); 47 50 }
Note: See TracChangeset
for help on using the changeset viewer.