web: cleanup commented code
This commit is contained in:
		
							parent
							
								
									28f23d09cf
								
							
						
					
					
						commit
						8a725e7e61
					
				| @ -36,58 +36,39 @@ function registerChart($container, series) { | |||||||
|   return $container.plot( |   return $container.plot( | ||||||
|     series, |     series, | ||||||
|     { /* general chart options */ |     { /* general chart options */ | ||||||
|       // series: {
 |  | ||||||
|       // },
 |  | ||||||
|       // yaxis: {
 |  | ||||||
|       //   /* ticks: 6, */
 |  | ||||||
|       // },
 |  | ||||||
|       xaxis: { |       xaxis: { | ||||||
|         mode: "time", |         mode: "time", | ||||||
|         timeformat: "%Y/%m/%d" |         timeformat: "%Y/%m/%d" | ||||||
|         /* ticks: 6, */ |       }, | ||||||
|  |       legend: { | ||||||
|  |         position: 'sw' | ||||||
|       }, |       }, | ||||||
|       grid: { |       grid: { | ||||||
|         markings: |         markings: | ||||||
|          function (axes) { |          function (axes) { | ||||||
|           var now = Date.now(); |           var now = Date.now(); | ||||||
|           var markings = [ |           var markings = [ | ||||||
|             // {
 |  | ||||||
|             //   xaxis: { to: now },        // past
 |  | ||||||
|             //   yaxis: { from: 0, to: 0 }, // =0
 |  | ||||||
|             //  color: '#d88',
 |  | ||||||
|             //  lineWidth:1
 |  | ||||||
|             // },
 |  | ||||||
|             { |             { | ||||||
|               xaxis: { to: now }, // past
 |               xaxis: { to: now }, // past
 | ||||||
|               yaxis: { to: 0 },   // <0
 |               yaxis: { to: 0 },   // <0
 | ||||||
|               color: '#ffdddd', |               color: '#ffdddd', | ||||||
|             }, |             }, | ||||||
| 
 |  | ||||||
|             // {
 |  | ||||||
|             //   xaxis: { from: now, to: now }, // now
 |  | ||||||
|             //  color: '#bbb',
 |  | ||||||
|             // },
 |  | ||||||
| 
 |  | ||||||
|             { |             { | ||||||
|               xaxis: { from: now }, // future
 |               xaxis: { from: now }, // future
 | ||||||
|               yaxis: { from: 0 },   // >0
 |               yaxis: { from: 0 },   // >0
 | ||||||
|               // color: '#dddddd',
 |  | ||||||
|               color: '#e0e0e0', |               color: '#e0e0e0', | ||||||
|             }, |             }, | ||||||
|             { |             { | ||||||
|               xaxis: { from: now }, // future
 |               xaxis: { from: now }, // future
 | ||||||
|               yaxis: { to: 0 },     // <0
 |               yaxis: { to: 0 },     // <0
 | ||||||
|               // color: '#ddbbbb',
 |  | ||||||
|               color: '#e8c8c8', |               color: '#e8c8c8', | ||||||
|             }, |             }, | ||||||
|             { |             { | ||||||
|               // xaxis: { from: now },      // future
 |  | ||||||
|               yaxis: { from: 0, to: 0 }, // =0
 |               yaxis: { from: 0, to: 0 }, // =0
 | ||||||
|               color: '#bb0000', |               color: '#bb0000', | ||||||
|               lineWidth:1 |               lineWidth:1 | ||||||
|             }, |             }, | ||||||
|           ]; |           ]; | ||||||
|           // console.log(markings);
 |  | ||||||
|           return markings; |           return markings; | ||||||
|         }, |         }, | ||||||
|         hoverable: true, |         hoverable: true, | ||||||
| @ -253,33 +234,20 @@ function addformDeletePosting() { | |||||||
| // SIDEBAR
 | // SIDEBAR
 | ||||||
| 
 | 
 | ||||||
| function sidebarToggle() { | function sidebarToggle() { | ||||||
|   //console.log('sidebarToggle');
 |  | ||||||
|   var visible = $('#sidebar').is(':visible'); |   var visible = $('#sidebar').is(':visible'); | ||||||
|   //console.log('sidebar visibility was',visible);
 |  | ||||||
|   // if opening sidebar, start an ajax fetch of its content
 |   // if opening sidebar, start an ajax fetch of its content
 | ||||||
|   if (!visible) { |   if (!visible) { | ||||||
|     //console.log('getting sidebar content');
 |  | ||||||
|     $.get("sidebar" |     $.get("sidebar" | ||||||
|          ,null |          ,null | ||||||
|          ,function(data) { |          ,function(data) { | ||||||
|             //console.log( "success" );
 |  | ||||||
|             $("#sidebar-body" ).html(data); |             $("#sidebar-body" ).html(data); | ||||||
|           }) |           }) | ||||||
|           .done(function() { |  | ||||||
|             //console.log( "success 2" );
 |  | ||||||
|           }) |  | ||||||
|           .fail(function() { |           .fail(function() { | ||||||
|             //console.log( "error" );
 |             alert("Loading the sidebar did fail"); | ||||||
|           }); |           }); | ||||||
|   } |   } | ||||||
|   // localStorage.setItem('sidebarVisible', !visible);
 |  | ||||||
|   // set a cookie to communicate the new sidebar state to the server
 |   // set a cookie to communicate the new sidebar state to the server
 | ||||||
|   $.cookie('showsidebar', visible ? '0' : '1'); |   $.cookie('showsidebar', visible ? '0' : '1'); | ||||||
|   // horizontally slide the sidebar in or out
 |  | ||||||
|   // how to make it smooth, without delayed content pop-in ?
 |  | ||||||
|   //$('#sidebar').animate({'width': 'toggle'});
 |  | ||||||
|   //$('#sidebar').animate({'width': visible ? 'hide' : '+=20m'});
 |  | ||||||
|   //$('#sidebar-spacer').width(200);
 |  | ||||||
|   $('#sidebar').animate({'width': visible ? 'hide' : 'show'}); |   $('#sidebar').animate({'width': visible ? 'hide' : 'show'}); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user