Merged V2.2 to HEAD

8206: Merged V2.1 to V2.2
      8136: Fixed AR-2043: XPathMetadataExtractor extracts empty strings
      8169: Fixes to Office add-in for ACT-267 - saving over an existing non-versionable file.
      8172: Fix for AWC-1838
   8221: Merged V2.1 to V2.2
      8210: Fix for AR-1830 - Search not returning expected results for umulat characters
      8211: Fix for AWC-1463 - MyWebForms and MyWebFiles templates now check for existance of stores before displaying them
   8222: Merged V2.1 to V2.2
      8216: Fix for AWC-1357
   8223: Missing Serializable interface (for web UI clustering)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8485 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2008-03-10 16:37:24 +00:00
parent c473277dbc
commit 163bb15d5e
8 changed files with 66 additions and 30 deletions

View File

@@ -10,12 +10,14 @@ var OfficeNavigation =
CREATE_SPACE_TEMPLATE: 16,
OVERLAY_ANIM_LENGTH: 300,
OVERLAY_OPACITY: 0.7,
documentNames: [],
init: function()
{
$('overlayPanel').setStyle('opacity', 0);
OfficeNavigation.setupToggles();
OfficeNavigation.setupCreateSpace();
OfficeNavigation.getDocumentNames();
// Did we arrive here from the "Create collaboration space" shortcut?
if (window.queryObject.cc)
@@ -105,6 +107,16 @@ var OfficeNavigation =
panel.setStyle('display', 'block');
panel.setStyle('height', panel.defaultHeight);
},
getDocumentNames: function()
{
OfficeNavigation.documentNames = [];
$$("#documentList .notVersionable").each(function(doc, i)
{
OfficeNavigation.documentNames.push(doc.getText());
});
},
showCreateSpace: function()
{
@@ -223,16 +235,20 @@ var OfficeNavigation =
transition: Fx.Transitions.linear,
onComplete: function()
{
$('saveFilename').addEvent('keydown', function(event)
$('saveFilename').addEvent('keypress', function(event)
{
event = new Event(event);
if (event.key == 'enter')
{
OfficeNavigation.saveOK();
event.stop();
$('saveFilename').removeEvent('keypress');
}
else if (event.key == 'esc')
{
OfficeNavigation.saveCancel();
event.stop();
$('saveFilename').removeEvent('keypress');
}
});
$('saveFilename').focus();
@@ -240,17 +256,43 @@ var OfficeNavigation =
}).start({'opacity': 1});
this.fxOverlay.start(OfficeNavigation.OVERLAY_OPACITY);
this.popupPanel = panel;
this.popupPanel.currentPath = currentPath;
if (panel != null)
{
this.popupPanel = panel;
this.popupPanel.currentPath = currentPath;
}
},
saveOK: function()
{
// Shortcut for double-event firing issue
if (this.popupPanel == null)
{
return;
}
var filename = $('saveFilename').value;
var currentPath = this.popupPanel.currentPath;
var cancelSave = false;
if (filename.length > 0)
{
window.external.saveToAlfrescoAs(currentPath, filename);
// Trying to save over an existing non-versionable doc?
OfficeNavigation.documentNames.each(function(doc, i)
{
if ((doc == filename) || (doc == filename + ".doc"))
{
if (!confirm("The document exists and is not versionable. Overwrite this file?"))
{
cancelSave = true;
}
}
});
if (!cancelSave)
{
window.external.saveToAlfrescoAs(currentPath, filename);
}
}
OfficeNavigation.saveCancel();
},