mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Office Addin - Javascript and CSS tweaks for IE6.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5994 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -152,7 +152,6 @@ else // Non document-based actions
|
||||
catch(e)
|
||||
{
|
||||
resultString = "Action failed due to exception";
|
||||
resultString = e.toString();
|
||||
}
|
||||
}
|
||||
model.resultString = resultString;
|
||||
|
@@ -17,6 +17,9 @@
|
||||
<head>
|
||||
<title>Document Details</title>
|
||||
<link rel="stylesheet" type="text/css" href="${url.context}/css/office.css" />
|
||||
<!--[if IE 6]>
|
||||
<link rel="stylesheet" type="text/css" href="${url.context}/css/office_ie6.css" />
|
||||
<![endif]-->
|
||||
<script type="text/javascript" src="${url.context}/scripts/ajax/mootools.v1.1.js"></script>
|
||||
<script type="text/javascript" src="${url.context}/scripts/office/office_addin.js"></script>
|
||||
</head>
|
||||
@@ -142,10 +145,10 @@
|
||||
|
||||
<div id="documentActions">
|
||||
<div id="nonStatusText">
|
||||
<#if d.isDocument>
|
||||
<ul>
|
||||
<#if d.isLocked >
|
||||
<#elseif hasAspect(d, "cm:workingcopy") == 1>
|
||||
<#if d.isDocument>
|
||||
<#if d.isLocked >
|
||||
<#elseif hasAspect(d, "cm:workingcopy") == 1>
|
||||
<li>
|
||||
<a href="#" onclick="OfficeAddin.runAction('${doc_actions}','checkin','${d.id}', '');">
|
||||
<img src="${url.context}/images/office/checkin.gif" alt="Check In">
|
||||
@@ -153,7 +156,7 @@
|
||||
</a>
|
||||
<br />Check in the current document.
|
||||
</li>
|
||||
<#else>
|
||||
<#else>
|
||||
<li>
|
||||
<a href="#" onclick="OfficeAddin.runAction('${doc_actions}','checkout','${d.id}', '');">
|
||||
<img src="${url.context}/images/office/checkout.gif" alt="Check Out">
|
||||
@@ -161,7 +164,7 @@
|
||||
</a>
|
||||
<br />Check out the current document to a working copy.
|
||||
</li>
|
||||
</#if>
|
||||
</#if>
|
||||
<li>
|
||||
<a href="${url.serviceContext}/office/myTasks?p=${path?url}&w=new">
|
||||
<img src="${url.context}/images/office/new_workflow.gif" alt="Start Workflow" />
|
||||
@@ -169,6 +172,7 @@
|
||||
</a>
|
||||
<br />Start Advanced Workflow for the current document.
|
||||
</li>
|
||||
<#if d.name?ends_with(".doc")>
|
||||
<li>
|
||||
<a href="#" onclick="OfficeAddin.runAction('${doc_actions}','makepdf','${d.id}', '');">
|
||||
<img src="${url.context}/images/office/makepdf.gif" alt="Transform to PDF" />
|
||||
@@ -176,6 +180,7 @@
|
||||
</a>
|
||||
<br />Transform the current document to Adobe PDF format.
|
||||
</li>
|
||||
</#if>
|
||||
<li>
|
||||
<a href="${url.context}/navigate/showOfficeAddin/workspace/SpacesStore/${d.id}?ticket=${session.ticket}" rel="_blank">
|
||||
<img src="${url.context}/images/office/document_details.gif" alt="Open Full Details" />
|
||||
@@ -183,11 +188,16 @@
|
||||
</a>
|
||||
<br />Open the document details in the Alfresco Web Client.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<#else>
|
||||
No actions available.
|
||||
<li>
|
||||
<a title="Save to Alfresco" href="${url.serviceContext}/office/navigation?p=${path?url}">
|
||||
<img src="${url.context}/images/office/save_to_alfresco.gif" alt="Save to Alfresco" />
|
||||
Save to Alfresco
|
||||
</a>
|
||||
<br />Allows you to place the current document under Alfresco management.
|
||||
</li>
|
||||
</#if>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="statusText"></div>
|
||||
|
@@ -18,6 +18,9 @@
|
||||
<head>
|
||||
<title>My Alfresco</title>
|
||||
<link rel="stylesheet" type="text/css" href="${url.context}/css/office.css" />
|
||||
<!--[if IE 6]>
|
||||
<link rel="stylesheet" type="text/css" href="${url.context}/css/office_ie6.css" />
|
||||
<![endif]-->
|
||||
<script type="text/javascript" src="${url.context}/scripts/ajax/mootools.v1.1.js"></script>
|
||||
<script type="text/javascript" src="${url.context}/scripts/office/office_addin.js"></script>
|
||||
<script type="text/javascript" src="${url.context}/scripts/office/my_alfresco.js"></script>
|
||||
@@ -59,7 +62,10 @@
|
||||
</#if>
|
||||
Modified: ${child.properties.modified?datetime} (${(child.size / 1024)?int}Kb)<br/>
|
||||
<a href="#" onclick="OfficeAddin.runAction('checkin','${child.id}', '');"><img src="${url.context}/images/office/checkin.gif" style="padding:3px 6px 2px 0px;" alt="Check In" title="Check In" /></a>
|
||||
<a href="${url.serviceContext}/office/myTasks?p=${path?url}&w=new&wd=${child.id}"><img src="${url.context}/images/office/new_workflow.gif" style="padding:3px 6px 2px 0px;" alt="Create Workflow..." title="Create Workflow..." /></a>
|
||||
<#if !child.name?ends_with(".pdf")>
|
||||
<a href="#" onclick="OfficeAddin.runAction('makepdf','${child.id}', '');"><img src="${url.context}/images/office/makepdf.gif" style="padding:3px 6px 2px 0px;" alt="Make PDF..." title="Make PDF" /></a>
|
||||
</#if>
|
||||
</td>
|
||||
</tr>
|
||||
</#if>
|
||||
|
@@ -1,23 +1,29 @@
|
||||
<#assign doc_actions="${url.serviceContext}/office/docActions">
|
||||
<#if args.p?exists><#assign path=args.p><#else><#assign path=""></#if>
|
||||
<#if args.n?exists><#assign node=args.n><#else><#assign node=companyhome></#if>
|
||||
<#-- resolve the path (from Company Home) into a node -->
|
||||
<#if path?starts_with("/Company Home")>
|
||||
<#if path?length=13>
|
||||
<#assign d=companyhome>
|
||||
<#elseif companyhome.childByNamePath[args.p[14..]]?exists>
|
||||
<#assign d=companyhome.childByNamePath[args.p[14..]]>
|
||||
<#if docWorkflow?exists>
|
||||
<#assign d=docWorkflow>
|
||||
<#else>
|
||||
<#-- resolve the path (from Company Home) into a node -->
|
||||
<#if path?starts_with("/Company Home")>
|
||||
<#if path?length=13>
|
||||
<#assign d=companyhome>
|
||||
<#elseif companyhome.childByNamePath[args.p[14..]]?exists>
|
||||
<#assign d=companyhome.childByNamePath[args.p[14..]]>
|
||||
<#else>
|
||||
<#assign d=companyhome>
|
||||
</#if>
|
||||
<#else>
|
||||
<#assign d=companyhome>
|
||||
</#if>
|
||||
<#else>
|
||||
<#assign d=companyhome>
|
||||
</#if>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>My Tasks</title>
|
||||
<link rel="stylesheet" type="text/css" href="${url.context}/css/office.css" />
|
||||
<!--[if IE 6]>
|
||||
<link rel="stylesheet" type="text/css" href="${url.context}/css/office_ie6.css" />
|
||||
<![endif]-->
|
||||
<script type="text/javascript" src="${url.context}/scripts/ajax/mootools.v1.1.js"></script>
|
||||
<script type="text/javascript" src="${url.context}/scripts/ajax/autocompleter.js"></script>
|
||||
<script type="text/javascript" src="${url.context}/scripts/ajax/date_picker.js"></script>
|
||||
@@ -29,7 +35,7 @@
|
||||
<div id="tabBar">
|
||||
<ul>
|
||||
<li><a title="My Alfresco" href="${url.serviceContext}/office/myAlfresco?p=${path?url}"><span><img src="${url.context}/images/office/my_alfresco.gif" alt="My Alfresco" /></span></a></li>
|
||||
<li><a title="Browse Spaces and Documents" href="${url.serviceContext}/office/navigation?p=${path?url}&n=${node.id}"><span><img src="${url.context}/images/office/navigator.gif" alt="Browse Spaces and Documents" /></span></a></li>
|
||||
<li><a title="Browse Spaces and Documents" href="${url.serviceContext}/office/navigation?p=${path?url}&n=${d.id}"><span><img src="${url.context}/images/office/navigator.gif" alt="Browse Spaces and Documents" /></span></a></li>
|
||||
<li><a title="Search Alfresco" href="${url.serviceContext}/office/search?p=${path?url}"><span><img src="${url.context}/images/office/search.gif" alt="Search Alfresco" /></span></a></li>
|
||||
<li><a title="View Details" href="${url.serviceContext}/office/documentDetails?p=${path?url}"><span><img src="${url.context}/images/office/document_details.gif" alt="View Details" /></span></a></li>
|
||||
<li id="current"><a title="My Tasks" href="${url.serviceContext}/office/myTasks?p=${path?url}"><span><img src="${url.context}/images/office/my_tasks.gif" alt="My Tasks" /></span></a></li>
|
||||
|
@@ -0,0 +1,5 @@
|
||||
// Was a document passed-in for New Workflow?
|
||||
if ((args.wd) && (args.wd != ""))
|
||||
{
|
||||
model.docWorkflow = search.findNode("workspace://SpacesStore/" + args.wd);
|
||||
}
|
||||
|
@@ -9,13 +9,14 @@
|
||||
<head>
|
||||
<title>Browse Spaces and Documents</title>
|
||||
<link rel="stylesheet" type="text/css" href="${url.context}/css/office.css" />
|
||||
<!--[if IE 6]>
|
||||
<link rel="stylesheet" type="text/css" href="${url.context}/css/office_ie6.css" />
|
||||
<![endif]-->
|
||||
<script type="text/javascript" src="${url.context}/scripts/ajax/mootools.v1.1.js"></script>
|
||||
<script type="text/javascript" src="${url.context}/scripts/office/office_addin.js"></script>
|
||||
<script type="text/javascript" src="${url.context}/scripts/office/navigation.js"></script>
|
||||
<script type="text/javascript" src="/firebug.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="tabBar">
|
||||
<ul>
|
||||
<li><a title="My Alfresco" href="${url.serviceContext}/office/myAlfresco?p=${path?url}"><span><img src="${url.context}/images/office/my_alfresco.gif" alt="My Alfresco" /></span></a></li>
|
||||
@@ -156,6 +157,7 @@
|
||||
<#else>
|
||||
<a href="#" onclick="OfficeAddin.runAction('${doc_actions}','checkout','${child.id}', '');"><img src="${url.context}/images/office/checkout.gif" style="padding:3px 6px 2px 0px;" alt="Check Out" title="Check Out" /></a>
|
||||
</#if>
|
||||
<a href="${url.serviceContext}/office/myTasks?p=${path?url}&w=new&wd=${child.id}"><img src="${url.context}/images/office/new_workflow.gif" style="padding:3px 6px 2px 0px;" alt="Create Workflow..." title="Create Workflow..." /></a>
|
||||
<a href="#" onclick="OfficeAddin.runAction('${doc_actions}','makepdf','${child.id}', '');"><img src="${url.context}/images/office/makepdf.gif" style="padding:3px 6px 2px 0px;" alt="Make PDF..." title="Make PDF" /></a>
|
||||
<#if !child.isLocked >
|
||||
<a href="#" onclick="OfficeAddin.runAction('${doc_actions}','delete','${child.id}', 'Are you sure you want to delete this document?');"><img src="${url.context}/images/office/delete.gif" style="padding:3px 6px 2px 0px;" alt="Delete..." title="Delete" /></a>
|
||||
@@ -176,13 +178,13 @@
|
||||
<div id="documentActionsNavigation">
|
||||
<div id="nonStatusText">
|
||||
<ul>
|
||||
<#if node.isDocument>
|
||||
<#if !node.isDocument>
|
||||
<li>
|
||||
<a href="#" onclick="window.external.saveToAlfresco('${webdavPath}')">
|
||||
<img src="${url.context}/images/office/save_to_alfresco.gif" alt="Save to Alfresco" />
|
||||
Save to Alfresco
|
||||
</a>
|
||||
<br />Allows you to place the current document under Alfresco management.
|
||||
<br />Save the document to the current Space.
|
||||
</li>
|
||||
</#if>
|
||||
<#if args.search?exists>
|
||||
|
@@ -8,6 +8,9 @@
|
||||
<head>
|
||||
<title>Browse Spaces and Documents</title>
|
||||
<link rel="stylesheet" type="text/css" href="${url.context}/css/office.css" />
|
||||
<!--[if IE 6]>
|
||||
<link rel="stylesheet" type="text/css" href="${url.context}/css/office_ie6.css" />
|
||||
<![endif]-->
|
||||
<script type="text/javascript" src="${url.context}/scripts/ajax/mootools.v1.1.js"></script>
|
||||
<script type="text/javascript" src="${url.context}/scripts/office/office_addin.js"></script>
|
||||
<script type="text/javascript" src="${url.context}/scripts/office/search.js"></script>
|
||||
|
@@ -31,7 +31,7 @@ TABLE, TR, TD {
|
||||
ul {
|
||||
margin: 0px;
|
||||
list-style: none;
|
||||
padding: 2px 0px 0px 24px;
|
||||
padding: 2px 0px 0px 2px;
|
||||
}
|
||||
|
||||
input.button {
|
||||
@@ -288,6 +288,9 @@ input.button {
|
||||
height: 150px;
|
||||
width: 282px;
|
||||
}
|
||||
#documentActions ul {
|
||||
padding: 2px 0px 0px 24px;
|
||||
}
|
||||
#documentActions li a {
|
||||
font-weight: bold;
|
||||
margin: 0px 0px 0px -22px;
|
||||
@@ -306,6 +309,9 @@ input.button {
|
||||
height: 89px;
|
||||
width: 282px;
|
||||
}
|
||||
#documentActionsNavigation ul {
|
||||
padding: 2px 0px 0px 24px;
|
||||
}
|
||||
#documentActionsNavigation li a {
|
||||
font-weight: bold;
|
||||
margin: 0px 0px 0px -22px;
|
||||
|
40
source/web/css/office_ie6.css
Normal file
40
source/web/css/office_ie6.css
Normal file
@@ -0,0 +1,40 @@
|
||||
.header {
|
||||
padding: 5px 0px 0px 4px;
|
||||
margin: 0px 0px 0px 0px;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
.toggle {
|
||||
margin-top: 0px;
|
||||
position: relative;
|
||||
top: -2px;
|
||||
}
|
||||
|
||||
.containerBig {
|
||||
margin: 0px 4px 0px 2px;
|
||||
}
|
||||
.containerMedium {
|
||||
margin: 0px 4px 0px 2px;
|
||||
}
|
||||
.containerSmall {
|
||||
margin: 0px 4px 0px 2px;
|
||||
}
|
||||
|
||||
.containerSearchResults {
|
||||
margin: 0px 4px 0px 2px;
|
||||
}
|
||||
|
||||
#currentSpaceInfo {
|
||||
margin: 0px 4px 0px 2px;
|
||||
}
|
||||
|
||||
#documentActions {
|
||||
margin: 0px 4px 0px 2px;
|
||||
}
|
||||
|
||||
#documentActionsNavigation {
|
||||
margin: 0px 4px 0px 2px;
|
||||
}
|
||||
#documentActionsNavigation ul {
|
||||
padding: 2px 0px 0px 24px;
|
||||
}
|
@@ -159,10 +159,8 @@ var OfficeMyTasks =
|
||||
{
|
||||
// Remove any trailing hash
|
||||
var href = window.location.href.replace("#", "")
|
||||
// Remove any previous "&st=" string
|
||||
href = href.replace(/[?&]st=([^&$]+)/g, "");
|
||||
// Remove any previous "&w=" string
|
||||
href = href.replace(/[?&]w=([^&$]+)/g, "");
|
||||
// Remove any "st" and "w" parameters
|
||||
href = OfficeAddin.removeParameters(href, "st|w");
|
||||
// Optionally add a status string
|
||||
if (successMessage != "")
|
||||
{
|
||||
@@ -209,10 +207,8 @@ var OfficeMyTasks =
|
||||
{
|
||||
// Remove any trailing hash
|
||||
var href = window.location.href.replace("#", "")
|
||||
// Remove any previous "&st=" strings
|
||||
href = href.replace(/[?&]st=([^&$]+)/g, "");
|
||||
// Remove any previous "&w=" strings
|
||||
href = href.replace(/[?&]w=([^&$]+)/g, "");
|
||||
// Remove any previous "st", "w" or "wd" parameters
|
||||
href = OfficeAddin.removeParameters(href, "st|w|wd");
|
||||
// Optionally add a status string
|
||||
if (textResponse != "")
|
||||
{
|
||||
|
@@ -175,10 +175,8 @@ var OfficeNavigation =
|
||||
{
|
||||
// Remove any trailing hash
|
||||
var href = window.location.href.replace("#", "")
|
||||
// Remove any previous "&st=" strings
|
||||
href = href.replace(/[?&]st=([^&$]+)/g, "");
|
||||
// Remove any previous "&cc=" strings
|
||||
href = href.replace(/[?&]cc=([^&$]+)/g, "");
|
||||
// Remove any "st" and "cc" parameters
|
||||
href = OfficeAddin.removeParameters(href, "st|cc");
|
||||
// Optionally add a status string
|
||||
if (textResponse != "")
|
||||
{
|
||||
|
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
var OfficeAddin =
|
||||
{
|
||||
ANIM_LENGTH: 300,
|
||||
ANIM_LENGTH: 500,
|
||||
STATUS_FADE: 10000,
|
||||
LIST_DEF_HEIGHT: 204,
|
||||
|
||||
@@ -18,7 +18,8 @@ var OfficeAddin =
|
||||
{
|
||||
var objResponse = Json.evaluate(this.queryObject.st);
|
||||
var imgSuccess = (objResponse.statusCode ? "action_successful.gif" : "action_failed.gif");
|
||||
OfficeAddin.showStatusText(objResponse.statusString, imgSuccess, true);
|
||||
var colBackground = (objResponse.statusCode ? "#50ff50" : "#ff5050");
|
||||
OfficeAddin.showStatusText(objResponse.statusString, imgSuccess, true, colBackground);
|
||||
}
|
||||
|
||||
OfficeAddin.makeExternalLinks();
|
||||
@@ -46,7 +47,7 @@ var OfficeAddin =
|
||||
return obj;
|
||||
},
|
||||
|
||||
showStatusText: function(statusText, statusImage, fadeOut)
|
||||
showStatusText: function(statusText, statusImage, fadeOut, colBackground)
|
||||
{
|
||||
var e = $("statusText");
|
||||
if (statusImage)
|
||||
@@ -74,7 +75,8 @@ var OfficeAddin =
|
||||
OfficeAddin.hideStatusText.delay(OfficeAddin.STATUS_FADE);
|
||||
}
|
||||
}
|
||||
fx.start('#ffffcc', '#ffffff');
|
||||
var colBackground = (colBackground == null) ? "#ffffcc" : colBackground;
|
||||
fx.start(colBackground, "#ffffff");
|
||||
}
|
||||
},
|
||||
|
||||
@@ -105,8 +107,8 @@ var OfficeAddin =
|
||||
{
|
||||
// Remove any trailing hash
|
||||
var href = window.location.href.replace("#", "")
|
||||
// Remove any previous "&st=" strings
|
||||
href = href.replace(/[?&]st=([^&$]+)/g, "");
|
||||
// Remove any previous "st" parameters
|
||||
href = OfficeAddin.removeParameters(href, "st");
|
||||
// Optionally add a status string
|
||||
if (textResponse != "")
|
||||
{
|
||||
@@ -134,6 +136,27 @@ var OfficeAddin =
|
||||
}
|
||||
|
||||
return contextPath;
|
||||
},
|
||||
|
||||
/* Removes params "param1|param2...|paramN" from a URL */
|
||||
removeParameters: function(theUrl, theParams)
|
||||
{
|
||||
var regexp = new RegExp("[?&](" + theParams + ")=([^&$]+)", "g");
|
||||
var url = theUrl.replace(regexp, "");
|
||||
|
||||
// Check that an href still contains a "?" after removing parameters
|
||||
var pos = url.indexOf("?");
|
||||
if (pos == -1)
|
||||
{
|
||||
// None found - do we have an "&" ?
|
||||
pos = url.indexOf("&");
|
||||
if (pos != -1)
|
||||
{
|
||||
// Yes - so replace the first one with a "?"
|
||||
url = url.substring(0, pos) + "?" + url.substring(pos+1);
|
||||
}
|
||||
}
|
||||
return url;
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user