Commits

Jonathan Doklovic  committed 140fc46

initial import

  • Participants

Comments (0)

Files changed (8)

File app/routes.coffee

+module.exports = (app) ->
+
+  app.get "/general", (req, res) ->
+    res.render "general",
+      headers: ({name: k, value: v} for k, v of req.headers)
+      method: req.method
+      scriptName: req.scriptName
+      pathInfo: req.pathInfo
+      queryString: req.queryString
+      host: req.host
+      port: req.port
+      scheme: req.scheme
+      input: req.input

File app/server.coffee

+module.exports = require("atlassian/router").createApp("app")
+require("./routes")(module.exports)

File app/views/general.mustache.parse

+<!DOCTYPE html>
+<html>
+  <head>
+    <meta charset="utf-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <title>${pluginName}</title>
+    <link rel="stylesheet" href="{{hostStylesheetUrl}}">
+    <link rel="stylesheet" href="public/css/styles.css">
+    <script src="{{hostScriptUrl}}"></script>
+    <script>RA.init();</script>
+  </head>
+  <body>
+    <h2>Request Properties</h2>
+    <table width="100%">
+      <tr>
+        <th align="left" colspan="2">properties</th>
+      </tr>
+      <tr>
+        <td>host base url</td>
+        <td>{{hostBaseUrl}}</td>
+      </tr>
+      <tr>
+        <td>client key</td>
+        <td>{{clientKey}}</td>
+      </tr>
+      <tr>
+        <td>user id</td>
+        <td>{{userId}}</td>
+      </tr>
+      <tr>
+        <td>method</td>
+        <td>{{method}}</td>
+      </tr>
+      <tr>
+        <td>script name</td>
+        <td>{{scriptName}}</td>
+      </tr>
+      <tr>
+        <td>path info</td>
+        <td>{{pathInfo}}</td>
+      </tr>
+      <tr>
+        <td>query string</td>
+        <td>{{queryString}}</td>
+      </tr>
+      <tr>
+        <td>host</td>
+        <td>{{host}}</td>
+      </tr>
+      <tr>
+        <td>port</td>
+        <td>{{port}}</td>
+      </tr>
+      <tr>
+        <td>scheme</td>
+        <td>{{scheme}}</td>
+      </tr>
+      <tr>
+        <th align="left" colspan="2">headers</th>
+      </tr>
+      {{#headers}}
+      <tr>
+        <td>{{name}}</td>
+        <td>{{value}}</td>
+      </tr>
+      {{/headers}}
+    </table>
+    <script src="public/js/client.js"></script>
+  </body>
+</html>

File atlassian-plugin.xml.parse

+#set( $D = '$' )
+<?xml version="1.0" ?>
+<atlassian-plugin key="${D}{namespace}.${D}{pluginFolder}" name="${pluginName}" plugins-version="2">
+
+    <plugin-info>
+        <description>${pluginDescription}</description>
+        <version>1</version>
+    </plugin-info>
+
+    <remote-plugin-container key="container" display-url="http://localhost:8000/${D}{namespace}.${D}{pluginFolder}">
+    </remote-plugin-container>
+
+    <general-page key="general" name="${pluginName} (general page)" url="/general" />
+
+</atlassian-plugin>

File lib/README.md

+Put Java jars on which your app depends in this directory.
+exports.app = require "./app/server"

File public/css/styles.css

+/* Application CSS styles go here. */

File public/js/client.js

+// Application client-side code goes here.