@igea/oac_frontend 1.0.84 → 1.0.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -443,7 +443,8 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
443
443
|
const label = container.querySelector("label");
|
|
444
444
|
if (rokitInput) {
|
|
445
445
|
rokitInput.setAttribute("disabled", "true");
|
|
446
|
-
rokitInput.
|
|
446
|
+
if(rokitInput.value === "")
|
|
447
|
+
rokitInput.style.opacity = "0.0";
|
|
447
448
|
rokitInput.style.pointerEvents = "none";
|
|
448
449
|
|
|
449
450
|
// Aggiungo bottone IMG per upload
|
|
@@ -453,14 +454,19 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
453
454
|
&& next.classList.contains(imgClass))) {
|
|
454
455
|
// creo immagine
|
|
455
456
|
const img = document.createElement("img");
|
|
457
|
+
img._mode = "UPLOAD";
|
|
456
458
|
img.src = "/frontend/images/upload.png";
|
|
459
|
+
if(rokitInput.value !== ""){
|
|
460
|
+
img._mode = "DOWNLOAD";
|
|
461
|
+
img.src = "/frontend/images/download.png";
|
|
462
|
+
}
|
|
457
463
|
img.style.width = "24px"; img.style.height = "24px";
|
|
458
464
|
img.style["margin-left"] = "5px"; img.style["margin-right"] = "5px";
|
|
459
465
|
img.style.cursor = "pointer";
|
|
460
466
|
img.classList.add(imgClass);
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
467
|
+
|
|
468
|
+
console.log(rokitInput);
|
|
469
|
+
|
|
464
470
|
img.onclick = function(){
|
|
465
471
|
if(img._mode == "DOWNLOAD"){
|
|
466
472
|
window.open(rokitInput.value,"_BLANK");
|
|
@@ -45,10 +45,15 @@ document.addEventListener('DOMContentLoaded', function() {
|
|
|
45
45
|
class="fa-solid fa-link-slash"
|
|
46
46
|
style="margin-right:10px;"
|
|
47
47
|
></i>
|
|
48
|
-
|
|
48
|
+
<template v-if="labelIsAttachment(node)">
|
|
49
|
+
{{ urlFor(node) }}
|
|
50
|
+
</template>
|
|
51
|
+
<template v-else>
|
|
52
|
+
{{ classesLabelFor(node) + ' ' + classesTagFor(node) }}
|
|
53
|
+
</template>
|
|
49
54
|
<i v-if="labelIsAttachment(node)"
|
|
50
55
|
@click="downloadAttachment(node)"
|
|
51
|
-
style="margin-left:20px;"
|
|
56
|
+
style="margin-left:20px; cursor:pointer;"
|
|
52
57
|
class="fa-solid fa-file-arrow-down">
|
|
53
58
|
</i>
|
|
54
59
|
</div>
|
|
@@ -147,10 +152,18 @@ document.addEventListener('DOMContentLoaded', function() {
|
|
|
147
152
|
},
|
|
148
153
|
labelIsAttachment(node){
|
|
149
154
|
var label = node.label || '';
|
|
150
|
-
|
|
155
|
+
var iri = node.iri || '';
|
|
156
|
+
return label.indexOf("/backend/fuseki/attachment/") >= 0 || iri.indexOf("/backend/fuseki/attachment/") >= 0;
|
|
157
|
+
},
|
|
158
|
+
urlFor(node){
|
|
159
|
+
var label = node.label || '';
|
|
160
|
+
var url = node.iri || '';
|
|
161
|
+
if(label.indexOf("/backend/fuseki/attachment/")>=0)
|
|
162
|
+
url = label
|
|
163
|
+
return url.replace("<", "").replace(">", "");
|
|
151
164
|
},
|
|
152
165
|
downloadAttachment(node){
|
|
153
|
-
window.open(node
|
|
166
|
+
window.open(this.urlFor(node),"_BLANK");
|
|
154
167
|
},
|
|
155
168
|
classesLabelFor(node){
|
|
156
169
|
var label = node.label;
|