Changeset 159
- Timestamp:
- Feb 2, 2010, 1:58:18 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/taglib/dbnp/studycapturing/WizardTagLib.groovy
r157 r159 287 287 */ 288 288 def speciesSelect = { attrs -> 289 // fetch the speciesOntology 290 // note that this is a bit nasty, probably the ontologyName should 291 // be configured in a configuration file... --> TODO 292 def speciesOntology = Ontology.findByName('NCBI Taxonomy') 293 289 294 // fetch all species 290 attrs.from = Term.findAll() // for now, all terms, should be refactored to be species ontology only! 291 def speciesOntology = Ontology.findAllByName('NCBI Taxonomy') 292 293 println speciesOntology 294 //println Term.findAllByOntology(speciesOntology) 295 attrs.from = Term.findAllByOntology(speciesOntology) 295 296 296 297 // got a name? 297 298 if (!attrs.name) { 299 // nope, use a default name 298 300 attrs.name = 'species' 299 301 } … … 355 357 // output columns for these subjectFields 356 358 template.subjectFields.each() { 357 println it.type358 359 out << '<div class="' + attrs.get('class') + '">' 359 360 … … 361 362 case 'STRINGLIST': 362 363 // render stringlist subjectfield 363 out << '<select><option>TODO</option></select>' 364 if (!it.listEntries.isEmpty()) { 365 out << select( 366 name: it.name, 367 from: it.listEntries 368 ) 369 } else { 370 out << '<span class="error">no values!!</span>' 371 } 364 372 break; 365 373 case 'INTEGER': 366 374 // render integer subjectfield 367 out << '<input type="text" value="TODO">' 375 out << textField( 376 name: it.name 377 ) 368 378 break; 369 379 default: 370 380 // unsupported field type 371 out << '< b>!! ' + it.type + '</b>'381 out << '<span class="error">unsuported type '+it.type+'</span>' 372 382 break; 373 383 } -
trunk/web-app/css/wizard.css
r157 r159 169 169 } 170 170 171 .wizard .table .row .error { 172 color: red; 173 font-size: 8px; 174 height: 10px; 175 } 176 171 177 .wizard .table input, .wizard .table select { 172 178 border: 1px solid #8e908f; … … 263 269 .wizard .groups .group .gallery li a.ui-icon-zoomin { float: left; } 264 270 .wizard .groups .group .gallery li img { width: 100%; cursor: move; } 271 272 .wizard .groups .group .gallery { 273 display: block; 274 float: left; 275 } 276 277 .wizard .groups .group .gallery li { 278 display: inline-block; 279 } 265 280 */ 266 .wizard .groups .group .gallery { 267 display: block; 268 float: left; 269 } 270 271 .wizard .groups .group .gallery li { 272 display: inline-block; 273 } 274 275 276 281 282 .wizard .groups .group ul.gallery { 283 background-color: red; 284 } 285 286 287 -
trunk/web-app/js/development.js
r145 r159 13 13 var d = '' 14 14 d += '<input type="button" class="prevnext" value="reload CSS" onclick="reloadCSS();return false;"/>' 15 d += '<input type="button" class="prevnext" value="reload JS" onclick="reloadJS();return false;"/>' 16 d += '<input type="button" class="prevnext" value="reload Both" onclick="reloadBoth();return false;"/>' 15 17 16 18 // insert into footer 17 $('#footer').html(d + "<br/>" +$('#footer').html())19 $('#footer').html(d + "<br/>" + $('#footer').html()) 18 20 }); 21 22 function reloadBoth() { 23 reloadCSS(); 24 reloadJS(); 25 } 19 26 20 27 function reloadCSS() { … … 22 29 23 30 var i,a,s; 24 a =document.getElementsByTagName('link');25 for (i=0;i<a.length;i++) {26 s =a[i];27 if (s.rel.toLowerCase().indexOf('stylesheet')>=0&&s.href) {28 var h =s.href.replace(/(&|\\?)forceReload=d /,'');29 s.href =h+(h.indexOf('?')>=0?'&':'?')+'forceReload='+(new Date().valueOf());31 a = document.getElementsByTagName('link'); 32 for (i = 0; i < a.length; i++) { 33 s = a[i]; 34 if (s.rel.toLowerCase().indexOf('stylesheet') >= 0 && s.href) { 35 var h = s.href.replace(/(&|\\?)forceReload=d /, ''); 36 s.href = h + (h.indexOf('?') >= 0 ? '&' : '?') + 'forceReload=' + (new Date().valueOf()); 30 37 } 31 38 } 32 39 } 40 41 function reloadJS() { 42 console.log('reloading js...'); 43 44 var i,j,a,s; 45 var head = document.getElementsByTagName('head')[0]; 46 var ignore = [ 47 /development.js/, 48 /topnav.js/, 49 /jquery/, 50 /login_panel.js/ 51 ]; 52 53 a = document.getElementsByTagName('script'); 54 for (i = a.length - 1; i >= 0; i--) { 55 s = a[i]; 56 57 // check if this script should be skipped 58 var deleteIt = true; 59 for (j = 0; j < ignore.length; j++) { 60 if (ignore[j].test(s.src)) { 61 deleteIt = false; 62 break; 63 } 64 } 65 66 // delete this script and reload it? 67 if (deleteIt) { 68 // delete it 69 head.removeChild(s) 70 71 // and load it again 72 var script = document.createElement('script'); 73 script.type = 'text/javascript'; 74 script.src = s.src 75 head.appendChild(script); 76 } 77 } 78 } -
trunk/web-app/js/wizard.js
r157 r159 20 20 // http://code.google.com/p/fbug/issues/detail?id=1899 21 21 var wizard = $('div#wizard') 22 wizard.html('<span style="color:red;font-size:8px;">Firefox 3.6 contains <a href="http://code.google.com/p/fbug/issues/detail?id=2746" target="_new">a bug</a> in combination with Firebug\'s XMLHttpRequest spy which causes the wizard to not function anymore. Please make sure you have firebug\'s XMLHttpRequest spy disabled use use Firefox 3.5.7 instead...</span>' + wizard.html()) 22 if (wizard.find("#warning").length == 0) { 23 wizard.html('<span id="warning" style="color:red;font-size:8px;">Firefox 3.6 contains <a href="http://code.google.com/p/fbug/issues/detail?id=2746" target="_new">a bug</a> in combination with Firebug\'s XMLHttpRequest spy which causes the wizard to not function anymore. Please make sure you have firebug\'s XMLHttpRequest spy disabled use use Firefox 3.5.7 instead...</span>' + wizard.html()) 24 } 23 25 } 24 26 … … 49 51 50 52 // handle special content 51 var specialContent = helpContent.html().match(/\[([^:]+)\:([^\]]+)\]/) 52 if (specialContent) { 53 // replace content by calling a helper function 54 eval(specialContent[1] + "('" + specialContent[2] + "',helpContent)"); 55 } 56 57 // attach tooltip 58 helpIcon.qtip({ 59 content: 'leftMiddle', 60 position: { 61 corner: { 62 tooltip: 'leftMiddle', 63 target: 'rightMiddle' 53 var html = (helpContent.html()) ? helpContent.html() : ''; 54 if (html) { 55 var specialContent = html.match(/\[([^:]+)\:([^\]]+)\]/) 56 if (specialContent) { 57 // replace content by calling a helper function 58 eval(specialContent[1] + "('" + specialContent[2] + "',helpContent)"); 59 } 60 61 // attach tooltip 62 helpIcon.qtip({ 63 content: 'leftMiddle', 64 position: { 65 corner: { 66 tooltip: 'leftMiddle', 67 target: 'rightMiddle' 68 } 69 }, 70 style: { 71 border: { 72 width: 5, 73 radius: 10 74 }, 75 padding: 10, 76 textAlign: 'center', 77 tip: true, 78 name: 'blue' 79 }, 80 content: helpContent.html(), 81 show: 'mouseover', 82 hide: 'mouseout', 83 api: { 84 beforeShow: function() { 85 // not used at this moment 86 } 64 87 } 65 }, 66 style: { 67 border: { 68 width: 5, 69 radius: 10 70 }, 71 padding: 10, 72 textAlign: 'center', 73 tip: true, 74 name: 'blue' 75 }, 76 content: helpContent.html(), 77 show: 'mouseover', 78 hide: 'mouseout', 79 api: { 80 beforeShow: function() { 81 // not used at this moment 82 } 83 } 84 }) 85 86 // remove helpcontent div as we don't need it anymore 87 helpContent.remove(); 88 }) 89 90 // remove helpcontent div as we don't need it anymore 91 helpContent.remove(); 92 } 88 93 }); 89 94 } … … 128 133 $(this).removeClass('highlight'); 129 134 } 130 )135 ) 131 136 }); 132 137 } … … 197 202 accept: '.subjects > ol > li', 198 203 drop: function(event, ui) { 199 /*200 $(this).addClass('ui-state-highlight').find('p').html('Dropped!');201 deleteImage(ui.draggable);202 function deleteImage($item) {203 $item.fadeOut(function() {204 var $list = $('ul',$trash).length ? $('ul',$trash) : $('<ul class="gallery ui-helper-reset"/>').appendTo($trash);205 206 $item.find('a.ui-icon-trash').remove();207 $item.append(recycle_icon).appendTo($list).fadeIn(function() {208 $item.animate({ width: '48px' }).find('img').animate({ height: '36px' });209 });210 });211 }212 */213 214 //console.log($(this))215 //console.log(ui.draggable)216 204 var group = $(this) 217 var list = $('ul', group).length ? $('ul',group) : $('<ul class="gallery ui-helper-reset"/>').appendTo(group);205 var list = $('ul', group).length ? $('ul', group) : $('<ul class="henk"/>').appendTo(group); 218 206 219 207 // append selected subjects to this group … … 221 209 // append to group 222 210 $(this).appendTo(list); 223 224 // make undraggable225 /*226 $(this).draggable('destroy');227 228 //$(this).css({ 'position': 'absolute' });229 230 // make all visible231 $(this).animate(232 {opacity: 100},233 200234 );235 */236 211 }); 237 238 212 239 213 … … 270 244 if (this != d) { 271 245 $(this).animate( 272 273 200274 );246 { opacity: 0 }, 247 200 248 ); 275 249 } 276 250 }); … … 284 258 if (this != d) { 285 259 $(this).animate( 286 287 200288 );260 {opacity: 100}, 261 200 262 ); 289 263 } 290 264 });
Note: See TracChangeset
for help on using the changeset viewer.