Commits

Seph Soliman committed 2a9a073

* never display "today" as date since it may change.
* todo items now sorted
* attempt to preload css backgrounds to avoid flickering (but not very successfull)

  • Participants
  • Parent commits ee30795

Comments (0)

Files changed (2)

File src/js/widget.js

 		$("#reportdate_y").append('<option value="' + y + '">' + y + '</option>');
 	// }}}
 	
+	// Preload to avoid flickering {{{
+	$("#reportcontainer").addClass("sliding").removeClass("sliding");
+	$("#front").addClass("expanding").removeClass("expanding");
+	$("#front").addClass("expanded").removeClass("expanded");
+	// }}}
+
 	// * UI defaults {{{
 	$("#bc_username").val(BC_USERNAME);
 	$("#bc_password").val(BC_PASSWORD);
 	$("#show_project").hide();
 	$("#done").hide(); // * initially hide until user logs in
 	$("#reportbtn").attr('disabled', 'disabled');
+	$('#reportdate_text').text('on ' + monthNames[$('#reportdate_m').val()].short + ', ' + $('#reportdate_d').val());
 	// }}}
 	
 	// * ui hooks {{{
 				$("#todos").append('<option value="" disabled="disabled">'+displayName+'</option>');
 				
 				var items = list.items;
-				for(var i in items) {
-					var item = items[i];
+				var items_arr = [];
+				for(var n in items) items_arr.push(items[n]);
+				items_arr.sort(function(a,b) { return a.content.localeCompare(b.content) });
+				
+				for(var j in items_arr) {
+					var item = items_arr[j];
 					if(item.completed)
 						continue;
 					var displayName = strlimit(item.content, 40) + (item.completed ? ' (complete)' : '');

File src/widget.html

 							<span>Time:<input type="text" value="0,0" id="reporthours" /> hours</span>
 							<div id="reportdate_toggle"><span style="display:none" id="reportdate_arrow">&laquo;</span><span id="reportdate_text">today</span></div>
 						</div>
-						<select id="todos"><option disabled="disabled" value="">Select a to-do &raquo;</option></select><br/>
+						<select id="todos"><option disabled="disabled" value="">Select a to-do &raquo;</option><option disabled="disabled" value="">Select a project first</option></select><br/>
 						<input type="text" value="" id="reportdescription" name="description" /><br/>
 						<div id="reportdate"><select id="reportdate_m"><option/></select><select id="reportdate_d"><option/></select><select id="reportdate_y"><option/></select></div>
 						<input type="button" id="reportbtn" value="Report" /><img id="reportloader" src="images/ajax-loader-submit.gif" alt="Loading..." /><br/>