Changeset 4 for trunk/web-app
- Timestamp:
- Jan 17, 2011, 3:49:20 PM (12 years ago)
- Location:
- trunk/web-app
- Files:
-
- 1 added
- 1 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/web-app/css/metagenomics.css
r3 r4 473 473 display: none; 474 474 } 475 476 .disabled { 477 opacity: 0.5; 478 -moz-opacity:0.5; 479 -khtml-opacity:0.5; 480 filter:alpha(opacity=50); 481 } 482 483 .ui-dialog a:link, .ui-dialog a:visited, .ui-dialog a:hover { 484 color: #006dba; 485 text-decoration: none; 486 } -
trunk/web-app/js/assay.show.runDialogs.js
r2 r4 42 42 43 43 // Initialize date picker for add run dialog 44 $( "#run_date , #edit_run_date" ).datepicker({44 $( "#run_date" ).datepicker({ 45 45 changeMonth: true, 46 46 changeYear: true, … … 66 66 */ 67 67 function showEditRunDialog(id, name, date, machine, supplier, parameterFile) { 68 $( '#edit_run_id' ).val( id ); 69 70 $( '#edit_run_name' ).val( name ); 71 $( '#edit_run_date' ).val( date ); 72 $( '#edit_run_machine' ).val( machine ); 73 $( '#edit_run_supplier' ).val( supplier ); 74 75 editFile( 'editParameterFile', parameterFile) 76 $( "#editRunDialog" ).dialog( "open" ); 68 $( "#editRunDialog" ).load( baseUrl + "/run/editForm/" + id + "?assayId=" + assayId, [], function() { 69 // Initialize date picker for add run dialog 70 $( "#edit_run_date" ).datepicker({ 71 changeMonth: true, 72 changeYear: true, 73 dateFormat: 'yy-mm-dd' 74 }); 75 76 $( "#editRunDialog" ).dialog( "open" ); 77 } ); 77 78 } 78 79 -
trunk/web-app/js/assay.show.showRunDialog.js
r3 r4 15 15 */ 16 16 function showRun( id ) { 17 $( '#showRunDialog div.showRun' ).hide() 18 $( '#showRunDialog div#showRun_' + id ).show() 19 20 var titleEl = $( '#showRunDialog div#showRun_' + id + ' h2' ).first(); 21 titleEl.hide(); 22 $( "#showRunDialog" ).dialog( "option", "title", "Run " + titleEl.text() ); 23 $( "#showRunDialog" ).dialog( "open" ); 17 $( "#showRunDialog" ).load( baseUrl + "/run/show/" + id + "?assayId=" + assayId, [], function() { 18 var titleEl = $( '#showRunDialog h2' ).first(); 19 titleEl.hide(); 20 21 initializeUploadedFiles( '#showRunDialog' ); 22 initializePagination( '#showRunDialog' ); 23 24 $( "#showRunDialog" ).dialog( "option", "title", "Run " + titleEl.text() ); 25 $( "#showRunDialog" ).dialog( "open" ); 26 } ); 24 27 } -
trunk/web-app/js/assay.show.showSampleDialog.js
r3 r4 15 15 */ 16 16 function showSample( id ) { 17 $( '#showSampleDialog div.showSample' ).hide() 18 $( '#showSampleDialog div#showSample_' + id ).show() 19 20 var titleEl = $( '#showSampleDialog div#showSample_' + id + ' h2' ).first(); 21 titleEl.hide(); 22 $( "#showSampleDialog" ).dialog( "option", "title", "Sample " + titleEl.text() ); 23 $( "#showSampleDialog" ).dialog( "open" ); 17 $( "#showSampleDialog" ).load( baseUrl + "/assaySample/show/" + id, [], function() { 18 var titleEl = $( '#showSampleDialog h2' ).first(); 19 titleEl.hide(); 20 21 initializeUploadedFiles( "#showSampleDialog" ); 22 initializePagination( "#showSampleDialog" ); 23 24 $( "#showSampleDialog" ).dialog( "option", "title", "Sample " + titleEl.text() ); 25 $( "#showSampleDialog" ).dialog( "open" ); 26 } ); 24 27 } -
trunk/web-app/js/paginate.js
r2 r4 1 $(function() { 2 $('.paginate').each(function(idx, el) { 3 var $el = $(el); 4 $el.dataTable({ 5 bJQueryUI: true, 6 bFilter: false, 7 bLengthChange: false, 8 iCookieDuration: 86400, // Save cookie one day 9 sPaginationType: 'full_numbers', 10 iDisplayLength: 10, // Number of items shown on one page. 11 aoColumnDefs: [ 12 { "bSortable": false, "aTargets": ["nonsortable"] } // Disable sorting on all columns with th.nonsortable 13 ] 14 }); 15 }); 16 17 // Remove the top bar of the datatable and hide pagination with only one page 18 $(".dataTables_wrapper").each(function(idx, el) { 19 var $el = $(el); 20 21 // Hide pagination if only one page is present (that is: if no buttons can be clicked) 22 if($el.find('span span.ui-state-default:not(.ui-state-disabled)').size() == 0 ){ 23 $el.find('div.fg-toolbar').css( 'display', 'none' ); 24 } else { 25 $el.find('div.fg-toolbar').css( 'display', 'block' ); 26 $el.find( 'div.ui-toolbar' ).first().hide(); 27 28 // Check whether a h1, h2 or h3 is present above the table, and move it into the table 29 /* 30 var $previousElement = $el.prev(); 31 if( $previousElement != undefined && $previousElement.get(0) != undefined ) { 32 var tagName = $previousElement.get(0).tagName.toLowerCase(); 33 if( tagName == "h1" || tagName == "h2" || tagName == "h3" ) { 34 // Put the margin that was on the title onto the table 35 $el.css( "margin-top", $previousElement.css( "margin-top" ) ); 36 $previousElement.css( "margin-top", '4px' ); 37 $previousElement.css( "marginBottom", '4px' ); 38 39 // If so, move the element into the table 40 $previousElement.remove(); 41 $el.find( 'div.ui-toolbar' ).first().append( $previousElement ); 42 } 43 } 44 */ 45 } 1 function initializePagination( selector ) { 2 if( selector == undefined ) { 3 selector = '' 4 } 5 6 $( selector + ' .paginate').each(function(idx, el) { 7 var $el = $(el); 8 $el.dataTable({ 9 bJQueryUI: true, 10 bFilter: false, 11 bLengthChange: false, 12 iCookieDuration: 86400, // Save cookie one day 13 sPaginationType: 'full_numbers', 14 iDisplayLength: 10, // Number of items shown on one page. 15 aoColumnDefs: [ 16 { "bSortable": false, "aTargets": ["nonsortable"] } // Disable sorting on all columns with th.nonsortable 17 ] 46 18 }); 47 19 }); 20 21 // Remove the top bar of the datatable and hide pagination with only one page 22 $( selector + " .dataTables_wrapper").each(function(idx, el) { 23 var $el = $(el); 24 25 // Hide pagination if only one page is present (that is: if no buttons can be clicked) 26 if($el.find('span span.ui-state-default:not(.ui-state-disabled)').size() == 0 ){ 27 $el.find('div.fg-toolbar').css( 'display', 'none' ); 28 } else { 29 $el.find('div.fg-toolbar').css( 'display', 'block' ); 30 $el.find( 'div.ui-toolbar' ).first().hide(); 31 32 // Check whether a h1, h2 or h3 is present above the table, and move it into the table 33 /* 34 var $previousElement = $el.prev(); 35 if( $previousElement != undefined && $previousElement.get(0) != undefined ) { 36 var tagName = $previousElement.get(0).tagName.toLowerCase(); 37 if( tagName == "h1" || tagName == "h2" || tagName == "h3" ) { 38 // Put the margin that was on the title onto the table 39 $el.css( "margin-top", $previousElement.css( "margin-top" ) ); 40 $previousElement.css( "margin-top", '4px' ); 41 $previousElement.css( "marginBottom", '4px' ); 42 43 // If so, move the element into the table 44 $previousElement.remove(); 45 $el.find( 'div.ui-toolbar' ).first().append( $previousElement ); 46 } 47 } 48 */ 49 } 50 }); 51 52 } 53 54 $(function() { initializePagination(); });
Note: See TracChangeset
for help on using the changeset viewer.