diff --git a/source/web/css/xforms.css b/source/web/css/xforms.css index d8c3cab8c8..60d9131ea9 100644 --- a/source/web/css/xforms.css +++ b/source/web/css/xforms.css @@ -78,6 +78,7 @@ .xformsFilePicker { width: 100%; + max-width: 400px; } .xformsFilePickerStatus @@ -94,11 +95,11 @@ .xformsFilePickerHeader { position: relative; - width: 100%; height: 30px; line-height: 30px; - background-color: lightgrey; padding-left: 2px; + background-color: #e3effa; + border: 1px solid #67a4e6; } .xformsFilePickerHeaderMenuTrigger @@ -111,10 +112,19 @@ .xformsFilePickerFooter { - background-color: lightgrey; text-align: center; height: 30px; line-height: 30px; + background-color: #e3effa; + border: 1px solid #67a4e6; +} + +.xformsFilePickerFileList +{ + overflow-y: auto; + background-color: white; + border-left: 1px solid #67a4e6; + border-right: 1px solid #67a4e6; } .xformsFilePickerRow @@ -126,21 +136,18 @@ .xformsFilePickerAddContent { - background-color: lightgrey; - position: absolute; - left: 10%; - right: 10%; - width: 80%; - margin-left: 4px; - line-height: 20px; + background-color: #ffffcc; + position: relative; + height: 30px; + line-height: 30px; } .xformsFilePickerParentPathMenu { position: absolute; - background-color: lightgrey; + background-color: #fefefe; border-style: outset; - border-width: 1px; + border: 1px solid #67a4e6; line-height: 20px; min-width: 100px; } diff --git a/source/web/scripts/ajax/xforms.js b/source/web/scripts/ajax/xforms.js index 05b902d903..176627604b 100644 --- a/source/web/scripts/ajax/xforms.js +++ b/source/web/scripts/ajax/xforms.js @@ -2428,9 +2428,9 @@ _showPicker: function(data) dojo.html.setClass(headerDiv, "xformsFilePickerHeader"); this.node.appendChild(headerDiv); headerDiv.appendChild(d.createTextNode("In: ")); - this.headerMenuTriggerLink = d.createElement("a"); this.headerMenuTriggerLink.filePickerWidget = this; + this.headerMenuTriggerLink.style.textDecoration = "none"; this.headerMenuTriggerLink.setAttribute("href", "javascript:void(0)"); this.headerMenuTriggerLink.setAttribute("webappRelativePath", currentPath); dojo.html.setClass(this.headerMenuTriggerLink, "xformsFilePickerHeaderMenuTrigger"); @@ -2440,6 +2440,7 @@ _showPicker: function(data) "onmouseover", function(event) { + event.currentTarget.style.backgroundColor = "#fefefe"; event.currentTarget.style.borderStyle = "inset"; }); dojo.event.connect(this.headerMenuTriggerLink, @@ -2449,6 +2450,8 @@ _showPicker: function(data) var w = event.currentTarget.filePickerWidget; if (!w.parentPathMenu) { + event.currentTarget.style.backgroundColor = + event.currentTarget.parentNode.style.backgroundColor; event.currentTarget.style.borderStyle = "solid"; } }); @@ -2539,6 +2542,7 @@ _showPicker: function(data) headerDiv.appendChild(headerRightDiv); this.contentDiv = d.createElement("div"); + dojo.html.setClass(this.contentDiv, "xformsFilePickerFileList"); this.node.appendChild(this.contentDiv); var footerDiv = d.createElement("div"); @@ -2563,7 +2567,7 @@ _showPicker: function(data) (this.statusDiv ? this.statusDiv.offsetHeight : 0) - footerDiv.offsetHeight - headerDiv.offsetHeight - 10) + "px"; - this.contentDiv.style.overflowY = "auto"; +// this.contentDiv.style.overflowY = "auto"; var childNodes = data.getElementsByTagName("child-node"); for (var i = 0; i < childNodes.length; i++) { @@ -2652,26 +2656,34 @@ _showAddContentPanel: function(addContentLink, currentPath) { var d = this.node.ownerDocument; this.addContentDiv = d.createElement("div"); - this.contentDiv.style.opacity = .3; dojo.html.setClass(this.addContentDiv, "xformsFilePickerAddContent"); - this.node.insertBefore(this.addContentDiv, this.contentDiv); + if (this.contentDiv.firstChild) + { + this.contentDiv.insertBefore(this.addContentDiv, this.contentDiv.firstChild); + } + else + { + this.contentDiv.appendChild(this.addContentDiv); + } var e = d.createElement("div"); e.style.marginLeft = "4px"; this.addContentDiv.appendChild(e); - e.appendChild(d.createTextNode("Upload a file to " + currentPath + " :")); + e.appendChild(d.createTextNode("Upload: ")); var fileInputDiv = d.createElement("div"); this.addContentDiv.appendChild(fileInputDiv); - fileInput = d.createElement("input"); + var fileInput = d.createElement("input"); fileInput.type = "file"; fileInput.widget = this; fileInput.name = this.node.getAttribute("id") + "_file_input"; fileInput.size = "35"; fileInput.setAttribute("webappRelativePath", currentPath); fileInputDiv.appendChild(fileInput); + fileInputDiv.style.position = "absolute"; + fileInputDiv.style.right = "10px"; + fileInputDiv.style.top = (.5 * this.addContentDiv.offsetHeight) - (.5 * fileInputDiv.offsetHeight) + "px"; - fileInput.style.margin = "4px 4px"; dojo.event.connect(fileInput, "onchange", function(event) @@ -2758,6 +2770,12 @@ _openParentPathMenu: function(target, path) parentNodes = path.split("/"); parentNodes[0] = "/"; } + + var pathTextDiv = d.createElement("div"); + pathTextDiv.style.fontWeight = "bold"; + pathTextDiv.style.paddingLeft = "5px"; + pathTextDiv.appendChild(d.createTextNode("Path")); + this.parentPathMenu.appendChild(pathTextDiv); var currentPathNodes = []; for (var i = 0; i < parentNodes.length; i++) { @@ -2770,13 +2788,9 @@ _openParentPathMenu: function(target, path) parentNodeDiv.setAttribute("webappRelativePath", path); this.parentPathMenu.appendChild(parentNodeDiv); parentNodeDiv.style.display = "block"; - parentNodeDiv.style.paddingLeft = i * 16 + "px"; - parentNodeDiv.style.border = "1px solid lightgrey"; + parentNodeDiv.style.paddingLeft = (i * 16) + parseInt(pathTextDiv.style.paddingLeft) + "px"; + parentNodeDiv.style.paddingRight = parseInt(pathTextDiv.style.paddingLeft) + "px"; parentNodeDiv.style.whiteSpace = "nowrap"; - if (i == parentNodes.length - 1) - { - parentNodeDiv.style.fontWeight = "bold"; - } var parentNodeImage = d.createElement("img"); parentNodeImage.align = "absmiddle"; @@ -2785,18 +2799,6 @@ _openParentPathMenu: function(target, path) parentNodeImage.setAttribute("src", alfresco_xforms_constants.WEBAPP_CONTEXT + "/images/icons/space_small.gif"); parentNodeDiv.appendChild(parentNodeImage); parentNodeDiv.appendChild(d.createTextNode(path)); - dojo.event.connect(parentNodeDiv, - "onmouseover", - function(event) - { - event.currentTarget.style.borderStyle = "inset"; - }); - dojo.event.connect(parentNodeDiv, - "onmouseout", - function(event) - { - event.currentTarget.style.borderStyle = "solid"; - }); dojo.event.connect(parentNodeDiv, "onclick", function(event)