diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/docActions.get.html.ftl b/config/alfresco/templates/webscripts/org/alfresco/office/docActions.get.html.ftl new file mode 100644 index 0000000000..6d48b83dcf --- /dev/null +++ b/config/alfresco/templates/webscripts/org/alfresco/office/docActions.get.html.ftl @@ -0,0 +1,4 @@ +{ + "statusString":"${resultString}", + "statusCode":${resultCode?string} +} \ No newline at end of file diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/docActions.get.js b/config/alfresco/templates/webscripts/org/alfresco/office/docActions.get.js index 5eabe57c59..faec54c1ca 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/office/docActions.get.js +++ b/config/alfresco/templates/webscripts/org/alfresco/office/docActions.get.js @@ -1,40 +1,79 @@ -// Generate a PDF transform of the current object +// Client has requested certain actions on the current document -if (document.isDocument) +/* Inputs */ +var docId = args["d"], + runAction = args["a"]; + +/* Outputs */ +var resultString = "Action failed.", + resultCode = false; + +var doc = search.findNode("workspace://SpacesStore/" + docId); + +if (doc != null && doc.isDocument) { - var runAction = args['action']; - var result = "Action failed."; - - if (runAction == "makepdf") + try { - var trans = document.transformDocument("application/pdf"); - result = "Action completed."; + if (runAction == "makepdf") + { + resultString = "Could not convert document"; + var nodeTrans = doc.transformDocument("application/pdf"); + if (nodeTrans != null) + { + resultString = "Document converted"; + resultCode = true; + } + } + else if (runAction == "delete") + { + resultString = "Could not delete document"; + if (doc.remove()) + { + resultString = "Document deleted"; + resultCode = true; + } + } + else if (runAction == "checkout") + { + var workingCopy = doc.checkout(); + if (workingCopy != null) + { + resultString = "Document checked out"; + resultCode = true; + } + } + else if (runAction == "checkin") + { + var originalDoc = doc.checkin(); + if (originalDoc != null) + { + resultString = "Document checked in"; + resultCode = true; + } + } + else if (runAction == "makeversion") + { + resultString = "Could not version document"; + if (doc.addAspect("cm:versionable")) + { + resultString = "Document versioned"; + resultCode = true; + } + } + else if (runAction == "test") + { + resultString = "Test complete."; + resultCode = true; + } + else + { + resultString = "Unknown action."; + } } - else if (runAction == "delete") + catch(e) { - var rc = document.remove(); - result = "Action completed."; + resultString = "Action failed due to exception"; } - else if (runAction == "checkout") - { - var wc = null; - wc = document.checkout(); - result = "Action completed."; - } - else if (runAction == "checkin") - { - var wc = document.checkin(); - result = "Action completed."; - } - else if (runAction == "makeversion") - { - var wc = document.addAspect("cm:versionable"); - result = "Action completed."; - } - else - { - result = "Unknown action."; - } - - result; -} \ No newline at end of file +} +model.resultString = resultString; +model.resultCode = resultCode; \ No newline at end of file diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/documentDetails.get.html.ftl b/config/alfresco/templates/webscripts/org/alfresco/office/documentDetails.get.html.ftl index b264df59c3..09bc4a09fa 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/office/documentDetails.get.html.ftl +++ b/config/alfresco/templates/webscripts/org/alfresco/office/documentDetails.get.html.ftl @@ -1,8 +1,10 @@ -<#assign doc_actions="${url.context}/scripts/office/docActions.js"> +<#assign doc_actions="${url.context}/service/office/docActions"> <#if args.p?exists><#assign path=args.p><#else><#assign path="">#if> <#-- resolve the path (from Company Home) into a node --> <#if path?starts_with("/Company Home")> - <#if companyhome.childByNamePath[args.p[14..]]?exists> + <#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> @@ -10,32 +12,29 @@ <#else> <#assign d=companyhome> #if> - - - -
- ${d.name} + |
+ ${d.name}
<#if d.isLocked >
- ![]() ![]() -
-Document Actions + Version History
<#if d.isDocument>
-
-
+
+
+
+
Document Actions
+
+
+
diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/documentDetails.get.js b/config/alfresco/templates/webscripts/org/alfresco/office/documentDetails.get.js
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/myAlfresco.get.html.ftl b/config/alfresco/templates/webscripts/org/alfresco/office/myAlfresco.get.html.ftl
index e1490eb018..85630a2065 100644
--- a/config/alfresco/templates/webscripts/org/alfresco/office/myAlfresco.get.html.ftl
+++ b/config/alfresco/templates/webscripts/org/alfresco/office/myAlfresco.get.html.ftl
@@ -1,92 +1,112 @@
-
+<#assign doc_actions="${url.context}/service/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..]]>
+ <#else>
+ <#assign d=companyhome>
+ #if>
+<#else>
+ <#assign d=companyhome>
+#if>
+
+<#if d.isDocument>
+
+
+
+
My checked out documents
+My Checked Out Documents
-
-
-
My Communities
+
-
+
Other Actions
+
-Other Actions
-
--
-
-
+
+
\ No newline at end of file
diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/myAlfresco.get.js b/config/alfresco/templates/webscripts/org/alfresco/office/myAlfresco.get.js
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/myTasks.get.desc.xml b/config/alfresco/templates/webscripts/org/alfresco/office/myTasks.get.desc.xml
new file mode 100644
index 0000000000..b1ae5ea0e5
--- /dev/null
+++ b/config/alfresco/templates/webscripts/org/alfresco/office/myTasks.get.desc.xml
@@ -0,0 +1,7 @@
+
My Tasks
+
+![]() ![]()
+
+
+
Workflow
+
+
+
+
+
+
\ No newline at end of file
diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/myTasks.get.js b/config/alfresco/templates/webscripts/org/alfresco/office/myTasks.get.js
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/myTasksDetail.get.desc.xml b/config/alfresco/templates/webscripts/org/alfresco/office/myTasksDetail.get.desc.xml
new file mode 100644
index 0000000000..709eb59b4f
--- /dev/null
+++ b/config/alfresco/templates/webscripts/org/alfresco/office/myTasksDetail.get.desc.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
${task.name?html}:
+
+
+
+
+
+#if>
diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/navigation.get.html.ftl b/config/alfresco/templates/webscripts/org/alfresco/office/navigation.get.html.ftl
index 10bc53e85f..c8f942b5a0 100644
--- a/config/alfresco/templates/webscripts/org/alfresco/office/navigation.get.html.ftl
+++ b/config/alfresco/templates/webscripts/org/alfresco/office/navigation.get.html.ftl
@@ -1,161 +1,154 @@
-
-<#list template.parent.children as child>
- <#if child.name = "my_alfresco.ftl"><#assign office_home = child.id>
- <#elseif child.name = "navigation.ftl"><#assign office_browse = child.id>
- <#elseif child.name = "search.ftl"><#assign office_search = child.id>
- <#elseif child.name = "document_details.ftl"><#assign office_details = child.id>
- <#elseif child.name = "version_history.ftl"><#assign office_history = child.id>
- <#elseif child.name = "doc_actions.js"><#assign doc_actions = child.id>
- <#elseif child.name = "navigation.js"><#assign nav_script = child>
- #if>
-#list>
-<#if document.isDocument>
- <#assign thisSpace = document.parent>
+<#assign doc_actions="${url.context}/service/office/docActions">
+<#if node.isDocument>
+ <#assign thisSpace = node.parent>
<#else>
- <#assign thisSpace = document>
+ <#assign thisSpace = node>
#if>
+
-
-
-
Spaces in ${thisSpace.name}
+Spaces in ${thisSpace.name}
-
-
-
(No subspaces) |
+ Documents in ${thisSpace.name}
-
+Documents in ${thisSpace.name}
-
-
-
(No documents) |
+
-Document Actions -
Document Actions
+
+
-
-
-
-
\ No newline at end of file
diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/navigation.get.js b/config/alfresco/templates/webscripts/org/alfresco/office/navigation.get.js
new file mode 100644
index 0000000000..9e0cbf99dd
--- /dev/null
+++ b/config/alfresco/templates/webscripts/org/alfresco/office/navigation.get.js
@@ -0,0 +1,10 @@
+
+if ((args.n) && (args.n != ""))
+{
+ model.node = search.findNode("workspace://SpacesStore/" + args.n);
+}
+else
+{
+ model.node = companyhome;
+}
+model.path = args.p;
diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/search.get.html.ftl b/config/alfresco/templates/webscripts/org/alfresco/office/search.get.html.ftl
index d79c5b3d08..a415bef94a 100644
--- a/config/alfresco/templates/webscripts/org/alfresco/office/search.get.html.ftl
+++ b/config/alfresco/templates/webscripts/org/alfresco/office/search.get.html.ftl
@@ -1,150 +1,62 @@
-<#list template.parent.children as child>
- <#if child.name = "my_alfresco.ftl"><#assign office_home = child.id>
- <#elseif child.name = "navigation.ftl"><#assign office_browse = child.id>
- <#elseif child.name = "search.ftl"><#assign office_search = child.id>
- <#elseif child.name = "document_details.ftl"><#assign office_details = child.id>
- <#elseif child.name = "version_history.ftl"><#assign office_history = child.id>
- <#elseif child.name = "doc_actions.js"><#assign doc_actions = child.id>
- <#elseif child.name = "search.js"><#assign srch_script = child>
- #if>
-#list>
-
-<#if args.search?exists>
- <#assign searchString = args.search>
- <#if searchString != "">
- <#assign queryString = "TEXT:\"${searchString}\" @cm\\:title:${searchString}">
- #if>
-<#else>
- <#assign searchString = "">
- <#assign queryString = "">
-#if>
-
-<#if searchString != "">
- <#if args.maxresults?exists>
- <#assign maxresults=args.maxresults?number>
- <#else>
- <#assign maxresults=10>
- #if>
-
- <#assign rescount=1>
-
-
-
-
Search
+
-
-
-
Items Found
-
-
-
+ Items Found
+
+
+
+
+<#if (args.searchagain?exists)>
+
+#if>
-#if>
-
\ No newline at end of file
diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/search.get.js b/config/alfresco/templates/webscripts/org/alfresco/office/search.get.js
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/searchResults.get.desc.xml b/config/alfresco/templates/webscripts/org/alfresco/office/searchResults.get.desc.xml
new file mode 100644
index 0000000000..932e5fc90f
--- /dev/null
+++ b/config/alfresco/templates/webscripts/org/alfresco/office/searchResults.get.desc.xml
@@ -0,0 +1,7 @@
+
Version History for ${document.name}
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/source/web/css/office.css b/source/web/css/office.css
index c9a8a04d55..9b01355a32 100644
--- a/source/web/css/office.css
+++ b/source/web/css/office.css
@@ -1,119 +1,204 @@
html, body {
- height: 100%;
- overflow:hidden;
- font-family: tahoma, sans-serif;
- font-size: 11px;
- color: #0073e6;
- background: url("../images/taskpane/view_bg.gif") top;
+ height: 100%;
+ overflow: hidden;
+ font-family: tahoma, sans-serif;
+ font-size: 11px;
+ color: #0073e6;
+ background: url("../images/office/view_bg.gif") top;
}
-body {margin:0px;padding:0px;}
+body {
+ margin: 0px;
+ padding: 0px;
+}
+
+a {
+ color: #0073e6;
+ text-decoration: none;
+}
+
+a img {
+ border: 0px;
+}
+
+.bold {
+ font-weight: bold;
+}
#tabBar {
- float:left;
- width:100%;
- background:#d4eaff url("../images/taskpane/bg.gif") repeat-x bottom;
- font-size:93%;
- line-height:normal;
- }
+ float: left;
+ width: 100%;
+ background: #efefef;
+ border-bottom: 1px solid #ccc;
+}
#tabBar ul {
- margin:0;
- padding:10px 10px 0;
- list-style:none;
- }
- #tabBar li {
- float:left;
- background:url("../images/taskpane/norm_left.gif") no-repeat left top;
- margin:0;
- padding:0 0 0 9px;
- }
- #tabBar a {
- display:block;
- background:url("../images/taskpane/norm_right.gif") no-repeat right top;
- padding:5px 15px 4px 6px;
- text-decoration:none;
- font-weight:bold;
- color:#765;
- }
- #tabBar a:hover {
- color:#333;
- }
- #tabBar #current {
- background-image:url("../images/taskpane/norm_left_on.gif");
- }
- #tabBar #current a {
- background-image:url("../images/taskpane/norm_right_on.gif");
- color:#333;
- padding-bottom:5px;
- }
+ margin: 0px;
+ padding: 4px 10px 0px 4px;
+ list-style: none;
+}
+#tabBar li {
+ display: inline;
+ margin: 0px;
+ padding: 0px;
+}
+#tabBar a {
+ background: url("../images/office/tab_left.gif") no-repeat left top;
+ float:left;
+ margin: 0px;
+ padding: 0px 0px 0px 4px;
+ text-decoration: none;
+}
+#tabBar a span {
+ background: url("../images/office/tab_right.gif") no-repeat right top;
+ color: #666;
+ display: block;
+ float: none;
+ padding: 5px 15px 4px 6px;
+ height: 18px;
+}
-#spaceListHeader {width:100%;
- height:auto;
- padding:6px;}
+#tabBar a:hover span {
+ color: #FFF;
+}
+#tabBar a:hover {
+ background-position: 0% -42px;
+}
+#tabBar a:hover span {
+ background-position: 100% -42px;
+}
-#mycheckedoutdocsListHeader {width:100%;
- height:auto;
- padding:6px;}
+#tabBar #current a {
+ background-position: 0% -42px;
+}
+#tabBar #current a span {
+ background-position: 100% -42px;
+}
-#mytodoListHeader {width:100%;
- height:auto;
- padding:6px;}
+.header {
+ clear: both;
+ width: 282px;
+ padding: 6px 0px 2px 4px;
+ font-weight: bold;
+ float: left;
+}
-#contentListHeader {width:100%;
- height:auto;padding:6px;}
+.headerExtra {
+ font-weight: normal;
+ float: right;
+ margin-top: -13px;
+}
-#searchResultsListHeader {width:100%;
- height:auto;padding:6px;}
+.listBig {
+ clear: both;
+ float: left;
+ width: 282px;
+ height: 378px;
+ overflow: auto;
+ border: 1px solid #cccccc;
+ margin: 0px 4px 0px 4px;
+ background: #fff;
+}
+.listMedium {
+ clear: both;
+ float: left;
+ width: 282px;
+ height: 204px;
+ overflow: auto;
+ border: 1px solid #cccccc;
+ margin: 0px 4px 0px 4px;
+ background: #fff;
+}
-#detailsListHeader {width:100%;
- height:auto;padding:6px;}
+.listMediumGrow {
+ height: 354px !important;
+}
+.listMediumShrink {
+ height: 54px !important;
+}
-#versionListHeader {width:100%;
- height:auto;padding:6px;}
+.odd {
+ background-color: #f8f8f8 !important;
+ border-bottom: 1px solid #eee;
+}
+.even {
+ background-color: #ffffff !important;
+ border-bottom: 1px solid #eee;
+}
-#advWorkflowListHeader {width:100%;
- height:auto;padding:6px;}
+#currentSpaceInfo {
+ clear: both;
+ float: left;
+ width: 282px;
+ height: 34px;
+ overflow: none;
+ border: 1px solid #cccccc;
+ margin: 4px 4px 0px;
+ padding: 4px 0px 0px;
+ background: #fff;
+}
-#myTasksListHeader {width:100%;
- height:auto;padding:6px;}
+TABLE, TR, TD {
+ border: 0px;
+ border-collapse: collapse;
+ padding: 2px;
+}
-#simpleWorkflowHeader {width:100%;
- height:auto;padding:6px;}
+ul {
+ margin: 0px;
+ list-style: none;
+ padding: 2px 0px 0px 4px;
+}
-#currentSpaceInfo {width:100%;
- padding: 6px}
+#documentActions {
+ clear: both;
+ background-color: #ffffcc;
+ border: 1px solid #ccc;
+ float: left;
+ margin: 0px 4px;
+ height: 150px;
+ width: 282px;
+}
-#simpleWorkflowInfo {width:100%;
- padding: 6px}
+#documentActionsNavigation {
+ clear: both;
+ background-color: #ffffcc;
+ border: 1px solid #ccc;
+ float: left;
+ margin: 0px 4px;
+ height: 106px;
+ width: 282px;
+}
-#spaceList {width:97%;overflow:auto; border: 1px solid #cccccc;margin-left:6px;background:#fff;}
-#mycheckedoutdocsList {width:97%;overflow:auto; border: 1px solid #cccccc;margin-left:6px;background:#fff;}
-#mytodoList {width:97%;overflow:auto; border: 1px solid #cccccc;margin-left:6px;background:#fff;}
-#contentList {width:97%;overflow:auto; border: 1px solid #cccccc;margin-left:6px;background:#fff;}
-#searchResultsList {width:97%;overflow:auto; border: 1px solid #cccccc;margin-left:6px;background:#fff;}
-#detailsList {width:97%;overflow:auto; border: 1px solid #cccccc;margin-left:6px;background:#fff;}
-#versionList {width:97%;overflow:auto; border: 1px solid #cccccc;margin-left:6px;background:#fff;}
-#advWorkflowList {width:97%;overflow:auto; border: 1px solid #cccccc;margin-left:6px;background:#fff;}
-#myTasksList {width:97%;overflow:auto; border: 1px solid #cccccc;margin-left:6px;background:#fff;}
+#nonStatusText {
+ min-height: 100%;
+ position: relative;
+}
-TABLE {border:0px;
-padding:2px;}
+#searchResultsList {
+ min-height: 100%;
+ position: relative;
+}
-A {color:#0073e6; }
+#statusText {
+ border: none;
+ float: left;
+ margin: -22px 0px;
+ padding: 2px;
+ position: relative;
+ height: 17px;
+ width: 278px;
+}
-#bottomMargin {height:6px;}
+#search {
+ clear: both;
+ float: left;
+ width: 282px;
+ border: 1px solid #cccccc;
+ margin: 0px 4px;
+ background: #fff;
+}
-#documentActions ul {
- margin:0;
- padding:10px 10px 0;
- list-style:none;
- }
-
-#documentActions {width:97%;margin-left:6px;padding-top:6px;padding-bottom:6px;}
-
-#search {padding: 24px 0px 0px 10px;}
-
-input.button{
+input.button {
color:#0073e6;
font-size:11px;
font-weight:bold;
@@ -124,7 +209,22 @@ input.button{
border-right-color:#0073e6;
border-bottom-color:#0073e6;
filter:progid:DXImageTransform.Microsoft.Gradient
- (GradientType=0,StartColorStr='#ffffffff',EndColorStr='#6fb7ff');
+ (GradientType=0,StartColorStr='#ffffffff',EndColorStr='#6fb7ff');
cursor:pointer;
margin-left:6px;
- }
+}
+
+#taskDetails {
+ padding: 2px;
+}
+
+.taskItemSelected {
+ background-color: #ffe500 !important;
+}
+
+.taskResources {
+ border: 1px solid #ccc;
+ margin: 4px;
+ height: 128px;
+ overflow: auto;
+}
diff --git a/source/web/images/icons/make_versionable.gif b/source/web/images/icons/make_versionable.gif
new file mode 100644
index 0000000000..e98712cf31
Binary files /dev/null and b/source/web/images/icons/make_versionable.gif differ
diff --git a/source/web/images/office/action_failed.gif b/source/web/images/office/action_failed.gif
new file mode 100644
index 0000000000..0ad5d8d068
Binary files /dev/null and b/source/web/images/office/action_failed.gif differ
diff --git a/source/web/images/office/action_successful.gif b/source/web/images/office/action_successful.gif
new file mode 100644
index 0000000000..90d16c18e4
Binary files /dev/null and b/source/web/images/office/action_successful.gif differ
diff --git a/source/web/images/office/ajax_anim.gif b/source/web/images/office/ajax_anim.gif
new file mode 100644
index 0000000000..c014d6d580
Binary files /dev/null and b/source/web/images/office/ajax_anim.gif differ
diff --git a/source/web/images/office/make_versionable.gif b/source/web/images/office/make_versionable.gif
new file mode 100644
index 0000000000..e98712cf31
Binary files /dev/null and b/source/web/images/office/make_versionable.gif differ
diff --git a/source/web/images/office/my_tasks.gif b/source/web/images/office/my_tasks.gif
new file mode 100644
index 0000000000..6cee9ec039
Binary files /dev/null and b/source/web/images/office/my_tasks.gif differ
diff --git a/source/web/images/office/search_again.gif b/source/web/images/office/search_again.gif
new file mode 100644
index 0000000000..f6ecf2104a
Binary files /dev/null and b/source/web/images/office/search_again.gif differ
diff --git a/source/web/images/office/tab_left.gif b/source/web/images/office/tab_left.gif
new file mode 100644
index 0000000000..021624c09a
Binary files /dev/null and b/source/web/images/office/tab_left.gif differ
diff --git a/source/web/images/office/tab_right.gif b/source/web/images/office/tab_right.gif
new file mode 100644
index 0000000000..7c236f3a27
Binary files /dev/null and b/source/web/images/office/tab_right.gif differ
diff --git a/source/web/images/office/task_item.gif b/source/web/images/office/task_item.gif
new file mode 100644
index 0000000000..bf5bd91084
Binary files /dev/null and b/source/web/images/office/task_item.gif differ
diff --git a/source/web/images/office/task_overdue.gif b/source/web/images/office/task_overdue.gif
new file mode 100644
index 0000000000..cad27743ad
Binary files /dev/null and b/source/web/images/office/task_overdue.gif differ
diff --git a/source/web/images/office/task_today.gif b/source/web/images/office/task_today.gif
new file mode 100644
index 0000000000..2a96492496
Binary files /dev/null and b/source/web/images/office/task_today.gif differ
diff --git a/source/web/scripts/office/my_tasks.js b/source/web/scripts/office/my_tasks.js
new file mode 100644
index 0000000000..52de8127e7
--- /dev/null
+++ b/source/web/scripts/office/my_tasks.js
@@ -0,0 +1,98 @@
+/*
+ * Prerequisites: mootools.v1.1.js
+ */
+var OfficeMyTasks =
+{
+ init: function()
+ {
+ var tasks = $$('#taskList .taskItem');
+
+ tasks.each(function(task, i)
+ {
+ task.isOpen = false;
+
+ // register 'mouseenter' event for each task
+ task.addEvent('mouseenter', function(e)
+ {
+ if (task.isOpen)
+ return;
+
+ // highlight the item title
+ task.addClass('taskItemSelected');
+
+ // reset styles on all closed tasks
+ tasks.each(function(otherTask, j)
+ {
+ if ((otherTask != task) && (!otherTask.isOpen))
+ {
+ // reset selected class
+ otherTask.removeClass('taskItemSelected');
+ }
+ });
+ });
+
+ // register 'mouseleave' event for each task
+ task.addEvent('mouseleave', function(e)
+ {
+ if (task.isOpen)
+ return;
+
+ // unhighlight the item title
+ task.removeClass('taskItemSelected');
+ });
+
+ // register 'click' event for each task
+ task.addEvent('click', function(e)
+ {
+ if (!task.isOpen)
+ {
+ // open up this task
+ // flag this task as open
+ task.isOpen = true;
+
+ OfficeAddin.showStatusText("Loading task...", "ajax_anim.gif", false);
+
+ // ajax call to load task details
+ var actionURL = "/alfresco/service/office/myTasksDetail?t=" + task.id;
+ var myAjax = new Ajax(actionURL, {
+ method: 'get',
+ headers: {'If-Modified-Since': 'Sat, 1 Jan 2000 00:00:00 GMT'},
+ onComplete: function(textResponse, xmlResponse)
+ {
+ OfficeAddin.hideStatusText();
+ $("taskDetails").innerHTML = textResponse;
+ }
+ });
+ myAjax.request();
+
+ // close other open tasks
+ tasks.each(function(otherTask, j)
+ {
+ if (otherTask != task)
+ {
+ // close any other open tasks
+ otherTask.isOpen = false;
+
+ // unhighlight the item title
+ otherTask.removeClass('taskItemSelected');
+ }
+ });
+ }
+ });
+ });
+
+ $('taskList').addEvent('mouseleave', function(e)
+ {
+ // handler for mouse leaving the entire task list
+ tasks.each(function(task, i)
+ {
+ if (!task.isOpen)
+ {
+ task.removeClass('taskItemSelected');
+ }
+ });
+ });
+ }
+};
+
+window.addEvent('domready', OfficeMyTasks.init);
\ No newline at end of file
diff --git a/source/web/scripts/office/office_addin.js b/source/web/scripts/office/office_addin.js
new file mode 100644
index 0000000000..f99c452328
--- /dev/null
+++ b/source/web/scripts/office/office_addin.js
@@ -0,0 +1,160 @@
+/*
+ * Prerequisites: mootools.v1.1.js
+ */
+var OfficeAddin =
+{
+ ANIM_LENGTH: 300,
+ STATUS_FADE: 10000,
+ LIST_DEF_HEIGHT: 204,
+
+ init: function()
+ {
+ this.queryObject = OfficeAddin.toQueryObject(document.location.search);
+
+ /* Update needed after page load? */
+ if(this.queryObject.st)
+ {
+ var objResponse = Json.evaluate(this.queryObject.st);
+ var imgSuccess = (objResponse.statusCode ? "action_successful.gif" : "action_failed.gif");
+ OfficeAddin.showStatusText(objResponse.statusString, imgSuccess, true);
+ }
+
+ /* Have search box? */
+ if ($("searchText"))
+ {
+ $("searchText").addEvent("keydown", function(event)
+ {
+ event = new Event(event);
+ if (event.key == 'enter')
+ {
+ $("simpleSearchButton").click();
+ }
+ });
+ }
+
+ /* Have expandos? */
+ if ($("toggleSpaceList"))
+ {
+ $("toggleSpaceList").addEvent("click", function()
+ {
+ $("spaceList").removeClass("listMediumShrink");
+ $("spaceList").addClass("listMediumGrow");
+ $("documentList").removeClass("listMediumGrow");
+ $("documentList").addClass("listMediumShrink");
+ });
+ $("toggleDocumentList").addEvent("click", function()
+ {
+ $("documentList").removeClass("listMediumShrink");
+ $("documentList").addClass("listMediumGrow");
+ $("spaceList").removeClass("listMediumGrow");
+ $("spaceList").addClass("listMediumShrink");
+ });
+ }
+ },
+
+ toQueryObject: function(s)
+ {
+ var obj = {};
+ $A(s.substring(1).split('&')).each(function(param)
+ {
+ param = decodeURIComponent(param).split("=");
+ obj[param[0]] = param[1];
+ });
+ return obj;
+ },
+
+ showStatusText: function(statusText, statusImage, fadeOut)
+ {
+ var e = $("statusText");
+ if (statusImage)
+ {
+ statusText = " |