fixed urls and code

This commit is contained in:
dcore94 2022-03-28 16:42:02 +02:00
parent a518d8e153
commit cfbc9ac52c
4 changed files with 21 additions and 28 deletions

View File

@ -1,24 +1,25 @@
<div> <div>
<link rel="stylesheet" href="http://d4science-cdn-public:8984/resources/ccp/css/common.css"></link> <link rel="stylesheet" href="https://nubis1.int.d4science.net:8080/ccp/css/common.css"></link>
<link rel="stylesheet" href="http://d4science-cdn-public:8984/resources/ccp/js/codemirror-5.65.2/lib/codemirror.css"></link>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<template id="EXECUTION_FORM_TEMPLATE"> <template id="EXECUTION_FORM_TEMPLATE">
<form class="ccp-form ccp-execution-form " name="execution_form"> <div name="execution_form">
<h3></h3> <h3></h3>
<p class="description"></p> <p class="description"></p>
<div name="plexiglass" class="ccp-invisible"> <div name="plexiglass" class="ccp-invisible">
<span name="status"></span> <span name="status"></span>
<span class="fas fa-spinner fa-spin"></span> <span class="fas fa-spinner fa-spin"></span>
</div> </div>
<div class="ccp-inputs"> <form name="execution_form">
<div class="form-group"></div> <div class="ccp-inputs">
</div> <div class="form-group"></div>
</form> </div>
</form>
</div>
</template> </template>
<template id="EXECUTION_FORM_EMPTY_TEMPLATE"> <template id="EXECUTION_FORM_EMPTY_TEMPLATE">
<form class="ccp-form ccp-empty-execution-form" name="execution_form" style="min-width:200px;min-height:200px"> <div name="execution_form">
<i>Select a method</i> <i>Select a method</i>
</form> </div>
</template> </template>
<form name="execution_form"></form> <div name="execution_form"></div>
</div> </div>

View File

@ -6,8 +6,7 @@ class CCPExecutionForm extends HTMLElement{
#method; #method;
#serviceurl = "https://nubis1.int.d4science.net:8080" #serviceurl = "https://nubis1.int.d4science.net:8080"
//#cdnurl = "https://nubis1.int.d4science.net:8080/ccp/fragment.html" #cdnurl = "https://nubis1.int.d4science.net:8080/ccp/fragment.html"
#cdnurl = "http://d4science-cdn-public:8984/resources/ccp/executionformfragment.html"
constructor(){ constructor(){
super() super()
@ -64,10 +63,10 @@ class CCPExecutionForm extends HTMLElement{
#empty_executionform_bss = { #empty_executionform_bss = {
template : "#EXECUTION_FORM_EMPTY_TEMPLATE", template : "#EXECUTION_FORM_EMPTY_TEMPLATE",
target : "form[name=execution_form]", target : "div[name=execution_form]",
on_drop : ev=>{ on_drop : ev=>{
const id = ev.dataTransfer.getData('text/plain+ccpmethod'); if(ev.dataTransfer && ev.dataTransfer.getData('text/plain+ccpmethod')){
if(id){ const id = ev.dataTransfer.getData('text/plain+ccpmethod')
this.setAttribute("method", id); this.setAttribute("method", id);
ev.preventDefault() ev.preventDefault()
ev.stopPropagation() ev.stopPropagation()
@ -76,7 +75,6 @@ class CCPExecutionForm extends HTMLElement{
}, },
on_dragover : ev=>{ on_dragover : ev=>{
ev.preventDefault() ev.preventDefault()
ev.currentTarget.style.backgroundColor = "#eeffff"
}, },
} }
@ -85,8 +83,8 @@ class CCPExecutionForm extends HTMLElement{
target : "form[name=execution_form]", target : "form[name=execution_form]",
in : ()=>this.#data, in : ()=>this.#data,
on_drop : ev=>{ on_drop : ev=>{
const id = ev.dataTransfer.getData('text/plain+ccpmethod'); if(ev.dataTransfer && ev.dataTransfer.getData('text/plain+ccpmethod')){
if(id){ const id = ev.dataTransfer.getData('text/plain+ccpmethod');
this.setAttribute("method", id); this.setAttribute("method", id);
ev.preventDefault() ev.preventDefault()
ev.stopPropagation() ev.stopPropagation()
@ -94,8 +92,6 @@ class CCPExecutionForm extends HTMLElement{
}, },
on_dragover : ev=>{ on_dragover : ev=>{
ev.preventDefault() ev.preventDefault()
ev.currentTarget.style.backGround = "blue"
ev.currentTarget.style.backgroundColor = "#eeffff"
}, },
recurse : [ recurse : [
{ {

View File

@ -171,7 +171,7 @@ class CodeInputRenderer extends Renderer{
} }
connectedCallback(controller){ connectedCallback(controller){
const ta = controller.querySelector("textarea") /*const ta = controller.querySelector("textarea")
const opts = { const opts = {
lineNumbers: true, lineNumbers: true,
indentUnit: 4, indentUnit: 4,
@ -182,7 +182,7 @@ class CodeInputRenderer extends Renderer{
this.#codemirror = CodeMirror.fromTextArea(ta, opts) this.#codemirror = CodeMirror.fromTextArea(ta, opts)
this.#codemirror.setValue(this.schema.default) this.#codemirror.setValue(this.schema.default)
this.#codemirror.refresh() this.#codemirror.refresh()*/
} }
render(){ render(){
@ -193,8 +193,7 @@ class CodeInputRenderer extends Renderer{
${this.title} ${this.title}
<span class="ccp-help-icon" title="${this.description}" alt="${this.description}">?</span> <span class="ccp-help-icon" title="${this.description}" alt="${this.description}">?</span>
</label> </label>
<textarea> <textarea>${this.schema.default}</textarea>
</textarea>
</div> </div>
` `
return this.#html return this.#html

View File

@ -7,8 +7,7 @@ class CCPMethodList extends HTMLElement{
#dragged = null; #dragged = null;
#serviceurl = "https://nubis1.int.d4science.net:8080" #serviceurl = "https://nubis1.int.d4science.net:8080"
//#cdnurl = "https://nubis1.int.d4science.net:8080/ccp/fragment.html" #cdnurl = "https://nubis1.int.d4science.net:8080/ccp/fragment.html"
#cdnurl = "http://d4science-cdn-public:8984/resources/ccp/methodlistfragment.html"
constructor(){ constructor(){
super() super()
@ -78,14 +77,12 @@ class CCPMethodList extends HTMLElement{
target : "li", target : "li",
"in" : (e,d)=>this.#filtered, "in" : (e,d)=>this.#filtered,
on_dragstart : ev=>{ on_dragstart : ev=>{
ev.stopPropagation()
ev.dataTransfer.effectAllowed = 'move' ev.dataTransfer.effectAllowed = 'move'
ev.dataTransfer.setData('text/html', ev.currentTarget.innerHTML) ev.dataTransfer.setData('text/html', ev.currentTarget.innerHTML)
ev.dataTransfer.setData('text/plain+ccpmethod', ev.currentTarget.bss_input.data.id) ev.dataTransfer.setData('text/plain+ccpmethod', ev.currentTarget.bss_input.data.id)
}, },
on_dragend : ev=>{ on_dragend : ev=>{
ev.preventDefault() ev.preventDefault()
ev.stopPropagation()
}, },
recurse : [ recurse : [
{ {