From: Charles du Jeu Date: Thu, 7 May 2009 16:11:50 +0000 (+0000) Subject: Attachment action and assiociated icons X-Git-Tag: argeo-slc-2.1.7~1901 X-Git-Url: http://git.argeo.org/?a=commitdiff_plain;h=7a3b9a150bbd8f6e7110b61fd85594e1a3fb9c53;p=gpl%2Fargeo-slc.git Attachment action and assiociated icons git-svn-id: https://svn.argeo.org/slc/trunk@2423 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- 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..620470192 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 @@ -166,6 +166,47 @@ qx.Class.define("org.argeo.slc.web.TestList", this.setEnabled(true); } }, + "attachments" : { + label : "Attachments", + icon : "resource/slc/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 url = org.argeo.slc.ria.SlcApi.buildGetAttachmentUrl(uuid, contentType); + 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