Commit a50f0267 authored by J. Fernando Sánchez's avatar J. Fernando Sánchez

Fixed Playground

parent b8339e39
......@@ -107,7 +107,7 @@ class Senpy(object):
candidates = self.filter_plugins(is_activated=True)
if len(candidates) > 0:
candidate = list(candidates.values())[0]
logger.debug("Default: {}".format(candidate))
logger.debug("Default: {}".format(candidate.name))
return candidate
else:
return None
......
var ONYX = "http://www.gsi.dit.upm.es/ontologies/onyx/ns#";
var RDF_TYPE = "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";
var plugins_params={};
function replaceURLWithHTMLLinks(text) {
console.log('Text: ' + text);
var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;
......@@ -15,6 +16,15 @@ function encodeHTML(text) {
.replace(/'/g, ''');
};
function hashchanged(){
var hash = location.hash
, hashPieces = hash.split('?');
if( hashPieces[0].length > 0 ){
activeTab = $('[href=' + hashPieces[0] + ']');
activeTab && activeTab.tab('show');
}
}
$(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);
......@@ -55,15 +65,18 @@ $(document).ready(function() {
}
document.getElementById('plugins').innerHTML = html;
change_params();
$(window).on('hashchange', hashchanged);
hashchanged();
$('.tooltip-form').tooltip();
});
function change_params(){
var plugin = document.getElementById("plugins").options[document.getElementById("plugins").selectedIndex].value;
html=""
for (param in plugins_params[plugin]){
if (param || plugins_params[plugin][param].length > 1){
html=""
html+= "<label> Parameter "+param+"</label>"
html+= "<select id=\""+param+"\" name=\""+param+"\">"
for (option in plugins_params[plugin][param]){
......@@ -93,3 +106,5 @@ function load_JSON(){
document.getElementById("input_request").innerHTML = "<label>"+url+"</label>"
}
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment