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)
|
catch(e)
|
||||||
{
|
{
|
||||||
resultString = "Action failed due to exception";
|
resultString = "Action failed due to exception";
|
||||||
resultString = e.toString();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
model.resultString = resultString;
|
model.resultString = resultString;
|
||||||
|
@@ -17,6 +17,9 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>Document Details</title>
|
<title>Document Details</title>
|
||||||
<link rel="stylesheet" type="text/css" href="${url.context}/css/office.css" />
|
<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/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/office_addin.js"></script>
|
||||||
</head>
|
</head>
|
||||||
@@ -142,8 +145,8 @@
|
|||||||
|
|
||||||
<div id="documentActions">
|
<div id="documentActions">
|
||||||
<div id="nonStatusText">
|
<div id="nonStatusText">
|
||||||
<#if d.isDocument>
|
|
||||||
<ul>
|
<ul>
|
||||||
|
<#if d.isDocument>
|
||||||
<#if d.isLocked >
|
<#if d.isLocked >
|
||||||
<#elseif hasAspect(d, "cm:workingcopy") == 1>
|
<#elseif hasAspect(d, "cm:workingcopy") == 1>
|
||||||
<li>
|
<li>
|
||||||
@@ -169,6 +172,7 @@
|
|||||||
</a>
|
</a>
|
||||||
<br />Start Advanced Workflow for the current document.
|
<br />Start Advanced Workflow for the current document.
|
||||||
</li>
|
</li>
|
||||||
|
<#if d.name?ends_with(".doc")>
|
||||||
<li>
|
<li>
|
||||||
<a href="#" onclick="OfficeAddin.runAction('${doc_actions}','makepdf','${d.id}', '');">
|
<a href="#" onclick="OfficeAddin.runAction('${doc_actions}','makepdf','${d.id}', '');">
|
||||||
<img src="${url.context}/images/office/makepdf.gif" alt="Transform to PDF" />
|
<img src="${url.context}/images/office/makepdf.gif" alt="Transform to PDF" />
|
||||||
@@ -176,6 +180,7 @@
|
|||||||
</a>
|
</a>
|
||||||
<br />Transform the current document to Adobe PDF format.
|
<br />Transform the current document to Adobe PDF format.
|
||||||
</li>
|
</li>
|
||||||
|
</#if>
|
||||||
<li>
|
<li>
|
||||||
<a href="${url.context}/navigate/showOfficeAddin/workspace/SpacesStore/${d.id}?ticket=${session.ticket}" rel="_blank">
|
<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" />
|
<img src="${url.context}/images/office/document_details.gif" alt="Open Full Details" />
|
||||||
@@ -183,11 +188,16 @@
|
|||||||
</a>
|
</a>
|
||||||
<br />Open the document details in the Alfresco Web Client.
|
<br />Open the document details in the Alfresco Web Client.
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
|
||||||
|
|
||||||
<#else>
|
<#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>
|
</#if>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="statusText"></div>
|
<div id="statusText"></div>
|
||||||
|
@@ -18,6 +18,9 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>My Alfresco</title>
|
<title>My Alfresco</title>
|
||||||
<link rel="stylesheet" type="text/css" href="${url.context}/css/office.css" />
|
<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/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/office_addin.js"></script>
|
||||||
<script type="text/javascript" src="${url.context}/scripts/office/my_alfresco.js"></script>
|
<script type="text/javascript" src="${url.context}/scripts/office/my_alfresco.js"></script>
|
||||||
@@ -59,7 +62,10 @@
|
|||||||
</#if>
|
</#if>
|
||||||
Modified: ${child.properties.modified?datetime} (${(child.size / 1024)?int}Kb)<br/>
|
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="#" 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>
|
<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>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</#if>
|
</#if>
|
||||||
|
@@ -1,6 +1,8 @@
|
|||||||
<#assign doc_actions="${url.serviceContext}/office/docActions">
|
<#assign doc_actions="${url.serviceContext}/office/docActions">
|
||||||
<#if args.p?exists><#assign path=args.p><#else><#assign path=""></#if>
|
<#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>
|
<#if docWorkflow?exists>
|
||||||
|
<#assign d=docWorkflow>
|
||||||
|
<#else>
|
||||||
<#-- resolve the path (from Company Home) into a node -->
|
<#-- resolve the path (from Company Home) into a node -->
|
||||||
<#if path?starts_with("/Company Home")>
|
<#if path?starts_with("/Company Home")>
|
||||||
<#if path?length=13>
|
<#if path?length=13>
|
||||||
@@ -13,11 +15,15 @@
|
|||||||
<#else>
|
<#else>
|
||||||
<#assign d=companyhome>
|
<#assign d=companyhome>
|
||||||
</#if>
|
</#if>
|
||||||
|
</#if>
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>My Tasks</title>
|
<title>My Tasks</title>
|
||||||
<link rel="stylesheet" type="text/css" href="${url.context}/css/office.css" />
|
<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/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/autocompleter.js"></script>
|
||||||
<script type="text/javascript" src="${url.context}/scripts/ajax/date_picker.js"></script>
|
<script type="text/javascript" src="${url.context}/scripts/ajax/date_picker.js"></script>
|
||||||
@@ -29,7 +35,7 @@
|
|||||||
<div id="tabBar">
|
<div id="tabBar">
|
||||||
<ul>
|
<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="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="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><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>
|
<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>
|
<head>
|
||||||
<title>Browse Spaces and Documents</title>
|
<title>Browse Spaces and Documents</title>
|
||||||
<link rel="stylesheet" type="text/css" href="${url.context}/css/office.css" />
|
<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/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/office_addin.js"></script>
|
||||||
<script type="text/javascript" src="${url.context}/scripts/office/navigation.js"></script>
|
<script type="text/javascript" src="${url.context}/scripts/office/navigation.js"></script>
|
||||||
<script type="text/javascript" src="/firebug.js"></script>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<div id="tabBar">
|
<div id="tabBar">
|
||||||
<ul>
|
<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="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>
|
<#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>
|
<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>
|
</#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>
|
<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 >
|
<#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>
|
<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="documentActionsNavigation">
|
||||||
<div id="nonStatusText">
|
<div id="nonStatusText">
|
||||||
<ul>
|
<ul>
|
||||||
<#if node.isDocument>
|
<#if !node.isDocument>
|
||||||
<li>
|
<li>
|
||||||
<a href="#" onclick="window.external.saveToAlfresco('${webdavPath}')">
|
<a href="#" onclick="window.external.saveToAlfresco('${webdavPath}')">
|
||||||
<img src="${url.context}/images/office/save_to_alfresco.gif" alt="Save to Alfresco" />
|
<img src="${url.context}/images/office/save_to_alfresco.gif" alt="Save to Alfresco" />
|
||||||
Save to Alfresco
|
Save to Alfresco
|
||||||
</a>
|
</a>
|
||||||
<br />Allows you to place the current document under Alfresco management.
|
<br />Save the document to the current Space.
|
||||||
</li>
|
</li>
|
||||||
</#if>
|
</#if>
|
||||||
<#if args.search?exists>
|
<#if args.search?exists>
|
||||||
|
@@ -8,6 +8,9 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>Browse Spaces and Documents</title>
|
<title>Browse Spaces and Documents</title>
|
||||||
<link rel="stylesheet" type="text/css" href="${url.context}/css/office.css" />
|
<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/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/office_addin.js"></script>
|
||||||
<script type="text/javascript" src="${url.context}/scripts/office/search.js"></script>
|
<script type="text/javascript" src="${url.context}/scripts/office/search.js"></script>
|
||||||
|
@@ -31,7 +31,7 @@ TABLE, TR, TD {
|
|||||||
ul {
|
ul {
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
list-style: none;
|
list-style: none;
|
||||||
padding: 2px 0px 0px 24px;
|
padding: 2px 0px 0px 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
input.button {
|
input.button {
|
||||||
@@ -288,6 +288,9 @@ input.button {
|
|||||||
height: 150px;
|
height: 150px;
|
||||||
width: 282px;
|
width: 282px;
|
||||||
}
|
}
|
||||||
|
#documentActions ul {
|
||||||
|
padding: 2px 0px 0px 24px;
|
||||||
|
}
|
||||||
#documentActions li a {
|
#documentActions li a {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
margin: 0px 0px 0px -22px;
|
margin: 0px 0px 0px -22px;
|
||||||
@@ -306,6 +309,9 @@ input.button {
|
|||||||
height: 89px;
|
height: 89px;
|
||||||
width: 282px;
|
width: 282px;
|
||||||
}
|
}
|
||||||
|
#documentActionsNavigation ul {
|
||||||
|
padding: 2px 0px 0px 24px;
|
||||||
|
}
|
||||||
#documentActionsNavigation li a {
|
#documentActionsNavigation li a {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
margin: 0px 0px 0px -22px;
|
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
|
// Remove any trailing hash
|
||||||
var href = window.location.href.replace("#", "")
|
var href = window.location.href.replace("#", "")
|
||||||
// Remove any previous "&st=" string
|
// Remove any "st" and "w" parameters
|
||||||
href = href.replace(/[?&]st=([^&$]+)/g, "");
|
href = OfficeAddin.removeParameters(href, "st|w");
|
||||||
// Remove any previous "&w=" string
|
|
||||||
href = href.replace(/[?&]w=([^&$]+)/g, "");
|
|
||||||
// Optionally add a status string
|
// Optionally add a status string
|
||||||
if (successMessage != "")
|
if (successMessage != "")
|
||||||
{
|
{
|
||||||
@@ -209,10 +207,8 @@ var OfficeMyTasks =
|
|||||||
{
|
{
|
||||||
// Remove any trailing hash
|
// Remove any trailing hash
|
||||||
var href = window.location.href.replace("#", "")
|
var href = window.location.href.replace("#", "")
|
||||||
// Remove any previous "&st=" strings
|
// Remove any previous "st", "w" or "wd" parameters
|
||||||
href = href.replace(/[?&]st=([^&$]+)/g, "");
|
href = OfficeAddin.removeParameters(href, "st|w|wd");
|
||||||
// Remove any previous "&w=" strings
|
|
||||||
href = href.replace(/[?&]w=([^&$]+)/g, "");
|
|
||||||
// Optionally add a status string
|
// Optionally add a status string
|
||||||
if (textResponse != "")
|
if (textResponse != "")
|
||||||
{
|
{
|
||||||
|
@@ -175,10 +175,8 @@ var OfficeNavigation =
|
|||||||
{
|
{
|
||||||
// Remove any trailing hash
|
// Remove any trailing hash
|
||||||
var href = window.location.href.replace("#", "")
|
var href = window.location.href.replace("#", "")
|
||||||
// Remove any previous "&st=" strings
|
// Remove any "st" and "cc" parameters
|
||||||
href = href.replace(/[?&]st=([^&$]+)/g, "");
|
href = OfficeAddin.removeParameters(href, "st|cc");
|
||||||
// Remove any previous "&cc=" strings
|
|
||||||
href = href.replace(/[?&]cc=([^&$]+)/g, "");
|
|
||||||
// Optionally add a status string
|
// Optionally add a status string
|
||||||
if (textResponse != "")
|
if (textResponse != "")
|
||||||
{
|
{
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
*/
|
*/
|
||||||
var OfficeAddin =
|
var OfficeAddin =
|
||||||
{
|
{
|
||||||
ANIM_LENGTH: 300,
|
ANIM_LENGTH: 500,
|
||||||
STATUS_FADE: 10000,
|
STATUS_FADE: 10000,
|
||||||
LIST_DEF_HEIGHT: 204,
|
LIST_DEF_HEIGHT: 204,
|
||||||
|
|
||||||
@@ -18,7 +18,8 @@ var OfficeAddin =
|
|||||||
{
|
{
|
||||||
var objResponse = Json.evaluate(this.queryObject.st);
|
var objResponse = Json.evaluate(this.queryObject.st);
|
||||||
var imgSuccess = (objResponse.statusCode ? "action_successful.gif" : "action_failed.gif");
|
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();
|
OfficeAddin.makeExternalLinks();
|
||||||
@@ -46,7 +47,7 @@ var OfficeAddin =
|
|||||||
return obj;
|
return obj;
|
||||||
},
|
},
|
||||||
|
|
||||||
showStatusText: function(statusText, statusImage, fadeOut)
|
showStatusText: function(statusText, statusImage, fadeOut, colBackground)
|
||||||
{
|
{
|
||||||
var e = $("statusText");
|
var e = $("statusText");
|
||||||
if (statusImage)
|
if (statusImage)
|
||||||
@@ -74,7 +75,8 @@ var OfficeAddin =
|
|||||||
OfficeAddin.hideStatusText.delay(OfficeAddin.STATUS_FADE);
|
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
|
// Remove any trailing hash
|
||||||
var href = window.location.href.replace("#", "")
|
var href = window.location.href.replace("#", "")
|
||||||
// Remove any previous "&st=" strings
|
// Remove any previous "st" parameters
|
||||||
href = href.replace(/[?&]st=([^&$]+)/g, "");
|
href = OfficeAddin.removeParameters(href, "st");
|
||||||
// Optionally add a status string
|
// Optionally add a status string
|
||||||
if (textResponse != "")
|
if (textResponse != "")
|
||||||
{
|
{
|
||||||
@@ -134,6 +136,27 @@ var OfficeAddin =
|
|||||||
}
|
}
|
||||||
|
|
||||||
return contextPath;
|
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