This repository has been archived on 2024-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
Lens/main.min.js

1 line
13 KiB
JavaScript
Raw Permalink Normal View History

2021-02-01 23:17:02 +01:00
function _instanceof(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function _classCallCheck(e,t){if(!_instanceof(e,t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),e}function htmlEntities(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}var NodeLinks=function(){"use strict";function t(e){_classCallCheck(this,t),this.elLinks=e,this.lookup={documents:"Documenti",transactions:"Contabilit&agrave;",questions:"Domande",events:"Eventi",feedbacks:"Feedbacks"}}return _createClass(t,[{key:"computeHTML",value:function(){var t=this;if(!this.elLinks)return"";var e,n=!(this.html='<div class="linkList">'),i=[],a=null;return Object.keys(this.elLinks).includes("to")&&(a=this.elLinks.to),null!=a&&(0<(e=Object.keys(a)).length&&!n&&(this.html+='<span>Risorse collegate:</span><div data-role="collapsibleset" data-theme="a" data-content-theme="a">',n=!0),e.forEach(function(e){i=a[e],t.html+='<div data-role="collapsible"><h3>'+t.lookup[e]+"</h3>",i.forEach(function(e){t.html+='<p><button type="button" onclick="location.href=\'api/view/UID/'+e.UID+"/render';\">"+htmlEntities(e.title)+"</button></p>"}),t.html+="</div>"}),0<e.length&&!n&&(this.html+="</div>")),n=!1,null!=(a=this.elLinks.from)&&(0<(e=Object.keys(a)).length&&!n&&(this.html+='<span>Fanno riferimento a questa risorsa:</span><div data-role="collapsibleset" data-theme="a" data-content-theme="a">',n=!0),e.forEach(function(e){i=a[e],t.html+='<div data-role="collapsible"><h3>'+t.lookup[e]+"</h3>",i.forEach(function(e){t.html+='<p><button type="button" onclick="location.href=\'api/view/UID/'+e.UID+"/render';\">"+htmlEntities(e.title)+"</a></p>"}),t.html+="</div>"}),0<e.length&&!n&&(this.html+="</div>")),this.html+="</div>",this.html}}]),t}(),Tags=function(){"use strict";function t(e){_classCallCheck(this,t),this.tags=e}return _createClass(t,[{key:"computeHTML",value:function(){var t=this;null!=this.tags&&0<this.tags.length&&(this.html+='<div data-role="collapsible"><h3>Tag</h3>',this.tags.forEach(function(e){t.html+='<p><a href="api/view/tags/'+encodeURI(e)+'/render">'+htmlEntities(e)+"</a></p>"}))}}]),t}();function eurSet(e){}var ElementPreviewList=function(){"use strict";function e(){_classCallCheck(this,e),this.k2it={planned:"Previsto il",executed:"Effettuato il",amount:"Importo",title:"Titolo",shortDescription:"Descrizione breve",htmlDescription:"Testo in html",createdDate:"Data di creazione",publishedDate:"Data di pubblicazione",lastEditedDate:"Data di ultima modifica",thumbnailUrl:"Url anteprima",documentUrl:"Url documento",startDate:"Data inizio",endDate:"Data fine",participants:"Partecipanti",isAssembly:"Tipo",publishResultsDate:"Data pubblicazione dei risultati",questionTitle:"Titolo domanda",questionText:"Domanda",answerTitle:"Titolo risposta",answerText:"Risposta",askDate:"Data richiesta",answerDate:"Data risposta",asker:"Richiedente",replier:"Rispondente"}}return _createClass(e,[{key:"itLookup",value:function(e){return this.k2it[e]?this.k2it[e]:e}},{key:"itLookupPairDict",value:function(e,t){return{value:e[t]?e[t]:"",name:this.itLookup(t)}}},{key:"textGen",value:function(e,t){return t&&e?"<span><h3>"+htmlEntities(e)+"</h3><br/><p>"+htmlEntities(t)+"</p></span>":""}},{key:"listgen",value:function(e,t,n,i){var a=1<arguments.length&&void 0!==t?t:[],s=2<arguments.length&&void 0!==n?n:[],r=3<arguments.length&&void 0!==i?i:[],o="";if(e&&0<a.length){o+="<h3>"+htmlEntities(e)+"</h3><br />";for(var l,c,h=0;h<a.length;h++){a[h]&&(l=s[h]?s[h]:s[0]?s[0]:"white",c="<span>",r[h]&&(c='<span style="text-decoration: underline;" onclick="location.href=\'api/view/UID/'+r[h]+"';\">"),o+=c+'<span class="w3-tag w3-'+l+'">'+htmlEntities(a[h])+"</span></span>")}return o}}},{key:"conditonalText