1
0
mirror of https://github.com/gsi-upm/senpy synced 2024-12-22 13:08:13 +00:00

Playground improved. This closes #8

This commit is contained in:
militarpancho 2017-02-06 14:08:13 +01:00
parent 477cb18db1
commit cb963dc438
3 changed files with 27 additions and 6 deletions

View File

@ -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;

View File

@ -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 = "<a href=https://github.com/gsi-upm/senpy-plugins-community>" + plugins[r]["name"] + "</a>" + ": " + 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 = "<label>"+url+"</label>"
document.getElementById("input_request").innerHTML = "<a href='"+url+"'>"+url+"</a>"
}

View File

@ -48,8 +48,6 @@
</div>
</div>
</div>
<div class="col-lg-6 ">
<div class="panel panel-default">
<div class="panel-heading"><i class="fa fa-sign-in"></i> Follow us on <a href="http://www.github.com/gsi-upm/senpy">GitHub</a></div>
</div>
@ -57,6 +55,15 @@
<div class="panel-heading"><i class="fa fa-child"></i> Enjoy.</div>
</div>
</div>
<div class="col-lg-6 ">
<div class="well">
<h2>Available Plugins</h2>
<div>
<span><ul id=availablePlugins></ul></span>
</div>
</div>
</div>
</div>
</div>