1. Robert Massaioli
  2. Ping Me

Commits

Robert Massaioli  committed e6de9f4

The set ping page is cleaner.

Also colours actually work now.

  • Participants
  • Parent commits 7a5d6ad
  • Branches master

Comments (0)

Files changed (4)

File src/main/resources/atlassian-plugin.xml

View file
  • Ignore whitespace
     </web-resource>
 
     <web-resource name="Set Ping Resources" key="set-ping-resources">
+        <resource name="set-ping.css" type="download" location="css/set-ping.css" />
         <resource name="set-ping.js" type="download" location="js/set-ping.js" />
-        <resource name="set-ping.css" type="download" locaton="css/set-ping.css" />
-        <context>com.atlassian.jira.pingme.set-ping</context>
+        <context>com.atlassian.jira.pingme.ping-addition</context>
     </web-resource>
 
     <web-resource name="List User Pings Resources" key="list-user-pings">

File src/main/resources/css/set-ping.css

View file
  • Ignore whitespace
-// Something is not parsing right
-#datePreview.succeeding {
+#date-preview.succeeding {
    color: green;
 }
 
-#datePreview.failing {
+#date-preview.failing {
    color: red;
 }

File src/main/resources/js/set-ping.js

View file
  • Ignore whitespace
             var issueId = AJS.$("meta[name=issueId]").attr('content');
             console.log("Issue Id: " + issueId);
 
-            // TODO now send the AJAX request.
             AJS.$.ajax({
                 url: AJS.contextPath() + "/rest/pingme/latest/ping",
                 type: "POST",
 	                body: "You can manage your pings here: <a href=\"" + AJS.contextPath() + "/secure/ViewMyPings!default.jspa\">My Pings</a>",
 	                closeable: true
 	            });
-            }).fail(function (jqXHR, textStatus) {
-                console.log("TODO: let the user know that we failed to create the ping.");
+            }).fail(function (jqXHR) {
+                var error = JSON.parse(jqXHR.responseText);
                 AJS.messages.error("#status-messages", {
 	                title: "Could not create the ping.",
-	                body: "TODO why not?",
+	                body: error.message,
 	                closeable: true
 	            });
             });
     });
     
     setDatePreview();
+    AJS.$("#date-preview-container").removeClass("hidden"); // If javascript is not disabled then show the preview.
 });

File src/main/resources/templates/success.vm

View file
  • Ignore whitespace
         <title>$i18n.getText('ping-me-action.name')</title>
 
         $webResourceManager.requireResourcesForContext('com.atlassian.jira.pingme.datejs-resources')
-        $webResourceManager.requireResourcesForContext('com.atlassian.jira.pingme.set-ping')
+        $webResourceManager.requireResourcesForContext('com.atlassian.jira.pingme.ping-addition')
 
         <meta name="decorator" />
         <meta name="issueId" content="$!issueId"/>
     <body>
     	<form class="aui-panel">
 	        <h1>Ping Me Plugin for JIRA</h1>
+            <p>Create one or more pings for this issue.</p>
 	        <label for="date-input">When:</label>
 	        <input id="date-input" type="text" value="tomorrow" />
-	        <p id="date-preview-container">
+	        <p id="date-preview-container" class="hidden">
 	        	<strong>Preview:</strong> <span id="date-preview"></span>
 	        </p>
 	        <div id="status-messages"></div>