Pop-up info message panel for Checkin Checkout actions with info for the user. Panel fades away after a short time if not closed.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6245 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2007-07-13 15:18:06 +00:00
parent 29cd0fc407
commit e10fb4c065
3 changed files with 102 additions and 1 deletions

View File

@@ -104,6 +104,10 @@
MySpaces.Home="${home.nodeRef}"; MySpaces.Home="${home.nodeRef}";
</script> </script>
</div> </div>
<div id="spaceMessagePanel" class="spaceMessagePanel">
<div style="margin:2px;float:right"><img src="${url.context}/images/icons/close_portlet_panel.gif" style="cursor:pointer;" width="16" height="16" onclick="MySpaces.closeMessage();"></div>
<div class="spaceMessagePanelLabel"></div>
</div>
<div class="spaceFooter"> <div class="spaceFooter">
<#-- the count value is retrieved and set dynamically from the AJAX webscript output above --> <#-- the count value is retrieved and set dynamically from the AJAX webscript output above -->
<span class="spaceFooterText">Showing <span id="spaceCount">0</span> items(s)</span> <span class="spaceFooterText">Showing <span id="spaceCount">0</span> items(s)</span>
@@ -479,6 +483,28 @@ a.spaceBreadcrumbLink:link, a.spaceBreadcrumbLink:visited, a.spaceBreadcrumbLink
-moz-border-radius: 5px; -moz-border-radius: 5px;
} }
.spaceMessagePanel
{
position: absolute;
border: 1px solid #65696C;
background-color: #7E8387;
width: 250px;
*width: 260px;
height: 72px;
padding: 8px;
margin-left: 440px;
display: none;
z-index: 1;
-moz-border-radius: 7px;
}
.spaceMessagePanelLabel
{
color: white;
font-family: Trebuchet MS, Arial, Helvetica, sans-serif;
font-size: 12px;
}
#docUpdatePanel #docUpdatePanel
{ {
position: absolute; position: absolute;

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

View File

@@ -20,6 +20,10 @@ var MySpaces = {
{ {
MySpaces.removeModal(); MySpaces.removeModal();
var messagePanel = $('spaceMessagePanel');
messagePanel.setStyle('opacity', 0);
messagePanel.setStyle('display', 'block');
// show AJAX loading overlay // show AJAX loading overlay
$('spacePanelOverlayAjax').setStyle('visibility', 'visible'); $('spacePanelOverlayAjax').setStyle('visibility', 'visible');
$('spacePanel').setStyle('visibility', 'hidden'); $('spacePanel').setStyle('visibility', 'hidden');
@@ -669,7 +673,7 @@ var MySpaces = {
checkoutItem: function(name, noderef) checkoutItem: function(name, noderef)
{ {
MySpaces.applyModal(); MySpaces.applyModal();
// ajax call to check out item // ajax call to check out item
YAHOO.util.Connect.asyncRequest( YAHOO.util.Connect.asyncRequest(
"POST", "POST",
@@ -680,6 +684,7 @@ var MySpaces = {
if (response.responseText.indexOf("OK:") == 0) if (response.responseText.indexOf("OK:") == 0)
{ {
MySpaces.refreshList(); MySpaces.refreshList();
MySpaces.displayMessage("A working copy for the checked out item 'Working Copy of " + name + "' has been created.");
} }
else else
{ {
@@ -714,6 +719,7 @@ var MySpaces = {
if (response.responseText.indexOf("OK:") == 0) if (response.responseText.indexOf("OK:") == 0)
{ {
MySpaces.refreshList(); MySpaces.refreshList();
MySpaces.displayMessage("Item 'Working Copy of " + name + "' has been checked in.");
} }
else else
{ {
@@ -848,14 +854,83 @@ var MySpaces = {
MySpaces.start(); MySpaces.start();
}, },
/**
* Apply a semi-transparent modal overlay skin to the main panel area
*/
applyModal: function() applyModal: function()
{ {
$("spacePanelOverlay").setStyle('opacity', MySpaces.OVERLAY_OPACITY); $("spacePanelOverlay").setStyle('opacity', MySpaces.OVERLAY_OPACITY);
}, },
/**
* Remove the modal overlay skin from the main panel area
*/
removeModal: function() removeModal: function()
{ {
$("spacePanelOverlay").setStyle('opacity', 0); $("spacePanelOverlay").setStyle('opacity', 0);
},
/**
* Display a message bubble of helpful info to the user. Calling this function in quick
* succession will cause previous message to be lost as the new ones are displayed.
*
* @param message Message text to display
*/
displayMessage: function(message)
{
var panel = $("spaceMessagePanel");
if ($defined(panel.timeout))
{
clearTimeout(panel.timeout);
panel.timeout = null;
}
panel.setStyle("opacity", 0);
panel.setStyle("margin-top", -90);
panel.getChildren()[1].setHTML(message);
panel.fxMessage = new Fx.Styles(
panel,
{
duration: 2000,
transition: Fx.Transitions.sineInOut
});
panel.fxMessage.start({'margin-top': -70, 'opacity': [0, 0.75]});
panel.timeout = window.setTimeout(this.fadeOutMessage, 8000);
},
/**
* Timer callback function to fade out the message panel
*/
fadeOutMessage: function()
{
var panel = $("spaceMessagePanel");
panel.timeout = null;
var fxMessage = new Fx.Styles(
panel,
{
duration: 1000,
transition: Fx.Transitions.sineInOut
});
fxMessage.start({'margin-top': -90, 'opacity': [0]});
},
/**
* Close the message panel immediately when the user clicks the close icon
*/
closeMessage: function()
{
var panel = $("spaceMessagePanel");
if ($defined(panel.timeout))
{
clearTimeout(panel.timeout);
panel.timeout = null;
}
panel.fxMessage.stop();
panel.setStyle("opacity", 0);
} }
}; };