From 1c8faf91dba0b89d7ee82be92d421a58a50b316c Mon Sep 17 00:00:00 2001 From: Fabien Benetou Date: Fri, 3 Feb 2023 09:23:51 +0100 Subject: [PATCH] global swaggerclient --- index.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index ffc7f94..aae4195 100644 --- a/index.html +++ b/index.html @@ -2294,19 +2294,19 @@ function addDropZone(position="0 1.4 -0.6", callback=setFeedbackHUD, radius=0.11 return el } +var swaggerclient // global scope to play with it from the console or in jxr AFRAME.registerComponent('issues-from-swagger', { init:function(){ let generatorName = this.attrName - var specUrl = 'swagger.v1.json' // from 'https://git.benetou.fr/swagger.v1.json' but copied to bypass CORS - var swaggerClient = new SwaggerClient(specUrl) + let specUrl = 'swagger.v1.json' // from 'https://git.benetou.fr/swagger.v1.json' but copied to bypass CORS + let swaggerClient = new SwaggerClient(specUrl) .then(function (swaggerClient) { - myclient = swaggerClient + swaggerclient = swaggerClient return swaggerClient.apis.issue.issueListIssues({owner: "utopiah", repo: "text-code-xr-engine"}) }, function (reason) { console.error("failed to load the spec" + reason) }) .then(function(issuesResult) { - console.log(issuesResult.obj) res = issuesResult.obj res.slice(0,maxItemsFromSources).map( (n,i) => addNewNote( n.title, "0 "+(1+i/10)+" -1.8", ".1 .1 .1", null, generatorName ) ) }, function (reason) {