X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;ds=sidebyside;f=server%2Forg.argeo.slc.ria%2Fsrc%2Fargeo-ria-lib%2Fslc-web%2Fclass%2Forg%2Fargeo%2Fslc%2Fweb%2FTestList.js;h=0b0ac233c09bb32964f2a05bfd70f7eff2a3dc18;hb=be50355b5493246c88adbb172bb270d61a852b20;hp=28a9f193cad876b9e93e7cc67b9553cd9563add5;hpb=d8e9131cdd34b663a03008df8eb97616694259ce;p=gpl%2Fargeo-slc.git diff --git a/server/org.argeo.slc.ria/src/argeo-ria-lib/slc-web/class/org/argeo/slc/web/TestList.js b/server/org.argeo.slc.ria/src/argeo-ria-lib/slc-web/class/org/argeo/slc/web/TestList.js index 28a9f193c..0b0ac233c 100644 --- a/server/org.argeo.slc.ria/src/argeo-ria-lib/slc-web/class/org/argeo/slc/web/TestList.js +++ b/server/org.argeo.slc.ria/src/argeo-ria-lib/slc-web/class/org/argeo/slc/web/TestList.js @@ -56,7 +56,7 @@ qx.Class.define("org.argeo.slc.web.TestList", init : { "loadtestlist" : { label : "Load Collection", - icon : "resource/slc/view-refresh.png", + icon : "org.argeo.slc.ria/view-refresh.png", shortcut : "Control+l", enabled : true, menu : "Collection", @@ -68,7 +68,7 @@ qx.Class.define("org.argeo.slc.web.TestList", }, "polllistloading" : { label : "Auto load", - icon : "resource/slc/document-open-recent.png", + icon : "org.argeo.slc.ria/document-open-recent.png", shortcut : "Control+l", enabled : true, toggle : true, @@ -82,7 +82,7 @@ qx.Class.define("org.argeo.slc.web.TestList", /* "copyfullcollection" : { label : "Copy to...", - icon : "resource/slc/edit-copy.png", + icon : "org.argeo.slc.ria/edit-copy.png", shortcut : null, enabled : false, menu : "Collection", @@ -108,7 +108,7 @@ qx.Class.define("org.argeo.slc.web.TestList", */ "opentest" : { label : "Open", - icon : "resource/slc/media-playback-start.png", + icon : "org.argeo.slc.ria/media-playback-start.png", shortcut : "Control+o", enabled : false, menu : "Selection", @@ -130,7 +130,7 @@ qx.Class.define("org.argeo.slc.web.TestList", }, "download" : { label : "Download as...", - icon : "resource/slc/go-down.png", + icon : "org.argeo.slc.ria/go-down.png", shortcut : null, enabled : false, menu : "Selection", @@ -138,10 +138,10 @@ qx.Class.define("org.argeo.slc.web.TestList", callback : function(e){ }, command : null, submenu : [ - {'label':"Xsl", 'icon':'resource/slc/mime-xsl.png', 'commandId':'xsl'}, - {'label':"Xml", 'icon':'resource/slc/mime-xml.png', 'commandId':'xml'}, - {'label':"Excel", 'icon':'resource/slc/mime-xls.png', 'commandId':'xls'}, - {'label':"Pdf", 'icon':'resource/slc/mime-pdf.png', 'commandId':'pdf'} + {'label':"Xsl", 'icon':'org.argeo.slc.ria/mime-xsl.png', 'commandId':'xsl'}, + {'label':"Xml", 'icon':'org.argeo.slc.ria/mime-xml.png', 'commandId':'xml'}, + {'label':"Excel", 'icon':'org.argeo.slc.ria/mime-xls.png', 'commandId':'xls'}, + {'label':"Pdf", 'icon':'org.argeo.slc.ria/mime-pdf.png', 'commandId':'pdf'} ], submenuCallback : function(commandId){ var uuid = this.extractTestUuid(); @@ -166,9 +166,51 @@ qx.Class.define("org.argeo.slc.web.TestList", this.setEnabled(true); } }, + "attachments" : { + label : "Attachments", + icon : "org.argeo.slc.ria/document-save-as.png", + shortcut : null, + enabled : false, + menu : "Selection", + toolbar : "selection", + callback : function(e){ }, + command : null, + submenu : [], + submenuCallback : function(commandId){ + var split = commandId.split("__commandseparator__"); + var uuid = split[0]; + var contentType = split[1]; + var name = split[2]; + var url = org.argeo.slc.ria.SlcApi.buildGetAttachmentUrl(uuid, contentType, name); + var win = window.open(url); + }, + selectionChange : function(viewId, xmlNodes){ + if(viewId!="list")return; + this.clearMenus(); + this.setEnabled(false); + if(xmlNodes == null || !xmlNodes.length || xmlNodes.length != 1) return; + // Check slc:simple-attachment tags + var attachs = org.argeo.ria.util.Element.selectNodes(xmlNodes[0], "slc:attachments/slc:simple-attachment"); + if(attachs && attachs.length){ + var submenus = []; + for(var i=0;i