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 = default_params = {}; var plugins = []; var defaultPlugin = {}; var gplugins = {}; var pipeline = []; var converter = new showdown.Converter({simplifiedAutoLink: true}); function replaceURLWithHTMLLinks(text) { console.log('Text: ' + text); var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig; return text.replace(exp,'$1'); } function encodeHTML(text) { return text.replace(/&/g, '&') .replace(//g, '>') .replace(/"/g, '"') .replace(/'/g, '''); }; function hashchanged(){ console.log('Hash changed'); var hash = location.hash, hashPieces = hash.split('?'); loc = hashPieces[0] if( loc.length > 0 ){ if(loc[loc.length-1] == '.' ){ loc = loc.slice(0, -1) } console.log(loc) activeTab = $('[href=' + loc + ']'); activeTab && activeTab.tab('show'); } } function get_plugins(response){ for(ix in response.plugins){ plug = response.plugins[ix]; plugins[plug.name] = plug; } } function get_datasets(response){ datasets = response.datasets } function group_plugins(){ for (r in plugins){ ptype = plugins[r]['@type']; if(gplugins[ptype] == undefined){ gplugins[ptype] = [r]; }else{ gplugins[ptype].push(r); } } } function draw_plugins_selection(){ html=""; for (g in gplugins){ html += "" for (r in gplugins[g]){ plugin = plugins[gplugins[g][r]] if (!plugin["name"]){ console.log("No name for plugin ", plugin); continue; } html+= "" } // Two elements with plugin class // One from the evaluate tab and another one from the analyse tab $('#plugins-select').html(html) draw_plugin_pipeline(); } function draw_plugins_eval_selection(){ evaluable = JSON.parse($.ajax({type: "GET", url: "/api/plugins/?plugin_type=Evaluable" , async: false}).responseText).plugins; html=""; for (r in evaluable){ plugin = evaluable[r] if (!plugin["name"]){ console.log("No name for plugin ", plugin); continue; } html+= "