Commits

Shihab Hamid committed 29b6a5e

cleaning up parameters a bit

Comments (0)

Files changed (1)

 <html lang="en">
 <head>
 	<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
+	<script type="text/javascript">
+		// config
+		var targetDate = new Date('2012-07-29');				
+		var baseUrl = 'https://jdog.atlassian.net/';
+		var jql = 'project = wday and (fixVersion = "1.0" or fixVersion is EMPTY) and status not in (resolved, closed) and resolution is empty';
+		var defaultEstimate = 4; // default estimate in hours for unestimated issues
+	</script>
 	<style type="text/css">
 	<!--
 		body {
 			</div>
 		</div>
 	</div>
-	
-	<!-- <div style="display: table; width: 1200px; margin: 0px auto; margin-top: 50px">
-		<div style="display: table-row; width: 100%; border: 10px; solid white; border-radius: 40px;">
-			<div class="column">
-				<div class="capsule" id="today-created">
-					<div class="value">
-						!
-					</div>
-					<div class="description">
-						Issues Created
-					</div>
-				</div>
-			</div>
-			<div class="column">
-				<div class="capsule" id="today-resolved">
-					<div class="value">
-						!
-					</div>
-					<div class="description">
-						Issues Resolved
-					</div>
-				</div>
-			</div>
-			<div class="column">
-				<div class="capsule" id="today-worklogged">
-					<div class="value">
-						!
-					</div>
-					<div class="description">
-						Hours Logged
-					</div>
-				</div>
-			</div>
-		</div>
-	</div> -->
-	  	
+
   	<script>
 	    $(document).ready(function(){		
-			var targetDate = new Date("2012-07-29");
 			targetDate.setHours(0,0,0,0);			
 		
 			var refreshFn = function() {
 	     		$.ajax({
 			       	type: 'GET',
-			        url: "https://jdog.atlassian.net/rest/api/2/search?jql=project%20=%20wday%20and%20(fixVersion%20=%20%221.0%22%20or%20fixVersion%20is%20EMPTY)%20and%20status%20not%20%20in%20(resolved,%20closed)%20and%20resolution%20is%20empty&maxResults=1000&fields=key,timeoriginalestimate,timespent",
+			        url: "https://jdog.atlassian.net/rest/api/2/search?jql="+encodeURIComponent(jql)+"&maxResults=1000&fields=key,timeoriginalestimate,timespent",
 			        contentType: "application/json",
 			        dataType: 'jsonp',
 					jsonp: 'jsonp-callback',
 			
 						for (var i = 0; i < json.issues.length; i++)
 						{
-							var original = json.issues[i].fields.timeoriginalestimate || 4 * 60 * 60; // 4h by default
+							var original = json.issues[i].fields.timeoriginalestimate || defaultEstimate * 60 * 60; // 4h by default
 							var spent = json.issues[i].fields.timespent || 0;
 				
 							var left = original - spent;
 				       console.log(e.message);
 				    }
 			    });
-			
-				// $.ajax({
-				// 			       	type: 'GET',
-				// 			        url: "https://jdog.atlassian.net/rest/api/2/search?jql=project%20=%20wday%20and%20created%20%3E%20-1d&maxResults=0&fields=key",
-				// 			        contentType: "application/json",
-				// 			        dataType: 'jsonp',
-				// 	jsonp: 'jsonp-callback',
-				// 	success: function(json) {													
-				// 		$("#today-created .value").html(json.total);
-				//     },
-				//     error: function(e) {
-				//        console.log(e.message);
-				//     }
-				// 			    });
-				// 			
-				// $.ajax({
-				// 			       	type: 'GET',
-				// 			        url: "https://jdog.atlassian.net/rest/api/2/search?jql=project%20=%20wday%20and%20created%20%3E%20-1d&maxResults=0&fields=key",
-				// 			        contentType: "application/json",
-				// 			        dataType: 'jsonp',
-				// 	jsonp: 'jsonp-callback',
-				// 	success: function(json) {													
-				// 		$("#today-resolved .value").html("!");
-				//     },
-				//     error: function(e) {
-				//        console.log(e.message);
-				//     }
-				// 			    });
 			};
 		
 			refreshFn();