Anonymous avatar Anonymous committed a48ea89

- clean up and AUI-fy the UI

Comments (0)

Files changed (4)

src/main/resources/atlassian-plugin.xml

     <web-resource key="pde-plugin" name="PDE Web Resources">
         <dependency>com.atlassian.auiplugin:ajs</dependency>
         <resource type="download" name="plugin-data-editor.js" location="plugin-data-editor.js"/>
+        <resource type="download" name="plugin-data-editor.css" location="plugin-data-editor.css"/>
     </web-resource>
     
 </atlassian-plugin>

src/main/resources/plugin-data-editor.css

+#settings-key-group {
+    display: none;
+}
+
+#data-redo-last {
+    display: none;
+}
+
+#recent-lookups-container {
+    width: 500px;
+}

src/main/resources/plugin-data-editor.js

 
 AJS.$(document).ready(function() {
 
-    // toggle display of settings key input field
-    AJS.$('#data-type').bind('change', function() {
-        AJS.$('#settings-input').toggle(AJS.$('#data-type option:selected').val() == "keyed-ps");
+    AJS.$("#keyed-ps").change(function() {
+       AJS.$("#settings-key-group").toggle(AJS.$(this).attr("checked"));
+    });
+
+    AJS.$("#global-ps").change(function() {
+        AJS.$("#settings-key-group").toggle(!AJS.$(this).attr("checked"));
     });
 
     // TODO set selection based on what is currently selected (global isn't default if changed before and page refreshed)

src/main/resources/plugin-data-editor.vm

 
 <input id="baseUrl" type="hidden" value="$baseUrl">
 
-<table border="0" cellspacing="10" cellpadding="2">
-    <tr valign=top>
-        <td>
-            <h2>Key Lookup</h2>
+<h1>Plugin Data Editor</h1>
 
-            <div style="background-color:#b0c4de">
+<p>This screen provides read access to values stored with the <a href="https://developer.atlassian.com/display/SAL/Shared+Access+Layer+Documentation">SAL</a>
+    <a href="https://developer.atlassian.com/display/SAL/SAL+Services">PluginSettings API</a>.</p>
 
-                <h3>Type</h3>
-                <select id="data-type" name="data-type">
-                    <option value="global-ps" selected="selected">Global PluginSettings</option>
-                    <option value="keyed-ps">Keyed PluginSettings</option>
-                </select>
+<form class="aui">
+    <h2>PluginSettings Query</h2>
+    <fieldset class="group">
+        <div class="radio">
+            <input class="radio" type="radio" name="data-type" id="global-ps" checked="checked">
+            <label for="global-ps">Global</label>
+        </div>
+        <div class="radio">
+            <input class="radio" type="radio" name="data-type" id="keyed-ps">
+            <label for="keyed-ps">Keyed</label>
+        </div>
+        <div class="description">
+            PluginSettings can be stored in a global namespace or in a product-dependent
+            "key" namespace; for example, JIRA implements plugin settings per project using the project key.
+        </div>
+    </fieldset>
 
-                <div id="settings-input" style="display:none">
-                    <h3>Settings Key</h3>
-                    <input type="text" id="settings-key-text"/>
-                </div>
+    <fieldset class="field-group" id="settings-key-group">
+        <label for="settings-key-text">Settings Key<span class="aui-icon icon-required"></span></label>
+        <input type="text" class="text medium-field" id="settings-key-text">
+    </fieldset>
 
-                <h3>Data Key</h3>
-                <input type="text" id="data-key-text"/>
-                
-                <p><input type="button" id="data-key-submit" value="Lookup"/></p>
+    <fieldset class="field-group" id="data-key-group">
+        <label for="data-key-text">Data Key<span class="aui-icon icon-required"></span></label>
+        <input type="text" class="text long-field" id="data-key-text">
+    </fieldset>
 
-            </div>
-        </td>
-        <td>
-            <h2>Results</h2>
+    <div class="field-group">
+        <input type="button" class="button" id="data-key-submit" value="Lookup">
+    </div>
 
-            <div style="background-color:#b0c4de">
 
-                <h3 id="data-keys">
-                    <span id="data-key-result"><i>No lookups yet.</i></span>
-                    <span id="settings-key-result"></span>
-                </h3>
-                <span id="data-value">
-                </span>
+    <h2>Results</h2>
 
-                <div><input type="button" id="data-redo-last" value="Redo lookup" style="display:none;" /></div>
+    <div id="data-keys">
+        <span id="data-key-result"><i>No lookups yet.</i></span>
+        <span id="settings-key-result"></span>
+    </div>
 
-            </div>
+    <span id="data-value"></span>
 
-            <h3>Recent Lookups</h3>
+    <div class="field-group">
+        <input type="button" id="data-redo-last" value="Redo lookup">
+    </div>
 
-            <ul id="recent-lookups">
-            </ul>
-            <p><i>note: lookup history is currently only stored in this webpage, and will be lost on reload</i></p>
-        </td>
-    </tr>
-</table>
+    <div id="recent-lookups-container">
+        <div class="aui-message info closeable shadowed">
+            <p class="title">
+                <span class="aui-icon icon-info"></span>
+                <strong>Lookup history is not persistent.</strong>
+            </p>
+            <p>This information will not survive a page refresh.</p>
+        </div>
+        <ul id="recent-lookups"></ul>
+        
+    </div>
+    
+</form>
 
 </body>
 </html>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.