From cb963dc4386014be65d69fa5fefeda0f233b8380 Mon Sep 17 00:00:00 2001 From: militarpancho Date: Mon, 6 Feb 2017 14:08:13 +0100 Subject: [PATCH] Playground improved. This closes #8 --- senpy/static/css/main.css | 14 +++++++++++--- senpy/static/js/main.js | 8 +++++++- senpy/templates/index.html | 11 +++++++++-- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/senpy/static/css/main.css b/senpy/static/css/main.css index adeb4ed..8365597 100644 --- a/senpy/static/css/main.css +++ b/senpy/static/css/main.css @@ -70,12 +70,20 @@ body { border-radius: 20px; } #input_request { + margin-top: 5px; display:block; - width:150px; word-wrap:break-word; + white-space:pre; + overflow: auto; + margin-top: 20px; + margin-bottom: 20px; } -textarea -{ +#input_request a{ + width:100%; +} + + +textarea{ border:1px solid #999999; width:100%; margin:5px 0; diff --git a/senpy/static/js/main.js b/senpy/static/js/main.js index 6edac71..b8dcbe9 100644 --- a/senpy/static/js/main.js +++ b/senpy/static/js/main.js @@ -29,6 +29,7 @@ $(document).ready(function() { var response = JSON.parse($.ajax({type: "GET", url: "/api/plugins/" , async: false}).responseText); var defaultPlugin= JSON.parse($.ajax({type: "GET", url: "/api/plugins/default" , async: false}).responseText); html=""; + var availablePlugins = document.getElementById('availablePlugins'); plugins = response.plugins; for (r in plugins){ if (plugins[r]["name"]){ @@ -62,12 +63,17 @@ $(document).ready(function() { } } } + var pluginList = document.createElement('li'); + pluginList.innerHTML = "" + plugins[r]["name"] + "" + ": " + plugins[r]["description"] + availablePlugins.appendChild(pluginList) } document.getElementById('plugins').innerHTML = html; change_params(); + $(window).on('hashchange', hashchanged); hashchanged(); $('.tooltip-form').tooltip(); + }); @@ -113,7 +119,7 @@ function load_JSON(){ } var editor = new JSONEditor(container, options, response); document.getElementById("jsonraw").innerHTML = replaceURLWithHTMLLinks(JSON.stringify(response, undefined, 2)) - document.getElementById("input_request").innerHTML = "" + document.getElementById("input_request").innerHTML = ""+url+"" } diff --git a/senpy/templates/index.html b/senpy/templates/index.html index 9dcc077..d9fe0c6 100755 --- a/senpy/templates/index.html +++ b/senpy/templates/index.html @@ -48,8 +48,6 @@ - -
Follow us on GitHub
@@ -57,6 +55,15 @@
Enjoy.
+
+
+

Available Plugins

+
+
    +
    + +
    +