mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Moving to root below branch label
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2005 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
38
source/web/scripts/webdav.js
Normal file
38
source/web/scripts/webdav.js
Normal file
@@ -0,0 +1,38 @@
|
||||
//
|
||||
// Helper functions for launching WebDAV documents for editing
|
||||
// Gavin Cornwell 30-11-2005
|
||||
//
|
||||
|
||||
function openDoc(url)
|
||||
{
|
||||
var showDoc = true;
|
||||
var agent = navigator.userAgent.toLowerCase();
|
||||
|
||||
// work out the context path from the pathname (this means we dont't
|
||||
// have to rely on the context path being passed in an anyway)
|
||||
var contextPath = window.location.pathname.substring(0, window.location.pathname.indexOf("/", 1));
|
||||
var fullUrl = window.location.protocol + "//" + window.location.host + contextPath + url;
|
||||
|
||||
// if the link represents an Office document and we are in IE try and
|
||||
// open the file directly to get WebDAV editing capabilities
|
||||
if (agent.indexOf("msie") != -1)
|
||||
{
|
||||
if (fullUrl.indexOf(".doc") != -1 ||
|
||||
fullUrl.indexOf(".dot") != -1 ||
|
||||
fullUrl.indexOf(".xls") != -1 ||
|
||||
fullUrl.indexOf(".ppt") != -1)
|
||||
{
|
||||
var wordDoc = new ActiveXObject("SharePoint.OpenDocuments.1");
|
||||
if (wordDoc)
|
||||
{
|
||||
showDoc = false;
|
||||
wordDoc.EditDocument(fullUrl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (showDoc == true)
|
||||
{
|
||||
window.open(fullUrl, "_blank");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user