diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/docActions_get.js b/config/alfresco/templates/webscripts/org/alfresco/office/docActions_get.js new file mode 100644 index 0000000000..5eabe57c59 --- /dev/null +++ b/config/alfresco/templates/webscripts/org/alfresco/office/docActions_get.js @@ -0,0 +1,40 @@ +// Generate a PDF transform of the current object + +if (document.isDocument) +{ + var runAction = args['action']; + var result = "Action failed."; + + if (runAction == "makepdf") + { + var trans = document.transformDocument("application/pdf"); + result = "Action completed."; + } + else if (runAction == "delete") + { + var rc = document.remove(); + result = "Action completed."; + } + 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 diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/docActions_get_desc.xml b/config/alfresco/templates/webscripts/org/alfresco/office/docActions_get_desc.xml new file mode 100644 index 0000000000..124b43ee1f --- /dev/null +++ b/config/alfresco/templates/webscripts/org/alfresco/office/docActions_get_desc.xml @@ -0,0 +1,7 @@ + + Document Actions (Office Add-In) + Used by the Office Add-In to perform actions on managed documents + + user + required + \ No newline at end of file diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/documentDetails_get_desc.xml b/config/alfresco/templates/webscripts/org/alfresco/office/documentDetails_get_desc.xml new file mode 100644 index 0000000000..52d7d109cc --- /dev/null +++ b/config/alfresco/templates/webscripts/org/alfresco/office/documentDetails_get_desc.xml @@ -0,0 +1,7 @@ + + Document Details (Office Add-In) + Generate the Office Add-In Document Details page + + user + required + \ 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 new file mode 100644 index 0000000000..b264df59c3 --- /dev/null +++ b/config/alfresco/templates/webscripts/org/alfresco/office/documentDetails_get_html.ftl @@ -0,0 +1,115 @@ +<#assign doc_actions="${url.context}/scripts/office/docActions.js"> +<#if args.p?exists><#assign path=args.p><#else><#assign path=""> +<#-- resolve the path (from Company Home) into a node --> +<#if path?starts_with("/Company Home")> + <#if companyhome.childByNamePath[args.p[14..]]?exists> + <#assign d=companyhome.childByNamePath[args.p[14..]]> + <#else> + <#assign d=companyhome> + +<#else> + <#assign d=companyhome> + + + + + + + + + Document Details + + + + + +
+ +
+ +
Details
+ +
+ + + + + + + + +
+<#if d.isDocument> + ${d.name} + + ${d.name} + <#if d.isLocked > + Locked + +
+ + <#if d.properties.title?exists> + + <#else> + + + <#if d.properties.description?exists> + + <#else> + + + + + + + + + + +
Title:${d.properties.title}
Title:
Description:${d.properties.description}
Description:
Creator:${d.properties.creator}
Created:${d.properties.created?datetime}
Modifier:${d.properties.modifier}
Modified:${d.properties.modified?datetime}
Size:${d.size / 1024} Kb
Categories: + <#if d.hasAspect("cm:generalclassifiable")> + <#list d.properties.categories as category> + ${companyhome.nodeByReference[category].name}; + + <#else> + None. + +
+<#else> + The current document is not managed by Alfresco. + +
+
+ +
+Document Actions
+<#if d.isDocument> + + +<#else> + No actions available. + +
+ +
  +
+ + + + + diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/myAlfresco_get_desc.xml b/config/alfresco/templates/webscripts/org/alfresco/office/myAlfresco_get_desc.xml new file mode 100644 index 0000000000..77b9c76578 --- /dev/null +++ b/config/alfresco/templates/webscripts/org/alfresco/office/myAlfresco_get_desc.xml @@ -0,0 +1,7 @@ + + My Alfresco (Office Add-In) + Generate the Office Add-In My Alfresco page + + user + required + \ No newline at end of file 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 new file mode 100644 index 0000000000..e1490eb018 --- /dev/null +++ b/config/alfresco/templates/webscripts/org/alfresco/office/myAlfresco_get_html.ftl @@ -0,0 +1,92 @@ + + + + My Alfresco + + + + + +
+ +
+ +
My checked out documents
+ +
+ + +<#assign query="@cm\\:workingCopyOwner:${person.properties.userName}"> + <#list companyhome.childrenByLuceneSearch[query] as child> + <#if child.isDocument> + + + + + + + + + + +
+ Open ${child.name} + + ${child.name}
+<#if child.properties.description?exists> + ${child.properties.description}
+ + Modified: ${child.properties.modified?datetime}, Size: ${child.size / 1024} Kb
+ Check In +Make PDF... +
+
+
My Communities +
+ +
+ + +<#list companyhome.childrenByXPath["*[@cm:name='Communities']/*"] as child> + + + + + + + +
+ Open ${child.name} + + ${child.name}
+<#if child.properties.description?exists> + ${child.properties.description} + +
+
+ +
+Other Actions
+
+ +
+
+ +
  +
+ + + + \ No newline at end of file diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/navigation_get_desc.xml b/config/alfresco/templates/webscripts/org/alfresco/office/navigation_get_desc.xml new file mode 100644 index 0000000000..cf02239da3 --- /dev/null +++ b/config/alfresco/templates/webscripts/org/alfresco/office/navigation_get_desc.xml @@ -0,0 +1,7 @@ + + Navigation (Office Add-In) + Generate the Office Add-In Navigation page + + user + required + \ No newline at end of file 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 new file mode 100644 index 0000000000..10bc53e85f --- /dev/null +++ b/config/alfresco/templates/webscripts/org/alfresco/office/navigation_get_html.ftl @@ -0,0 +1,161 @@ + +<#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 document.isDocument> + <#assign thisSpace = document.parent> +<#else> + <#assign thisSpace = document> + + + +Basic Navigation + + + + + + + + +
+ +
+ + +
+ + + + + + + + + +
+ In: + + ${thisSpace.name} +
+<#if thisSpace.properties.description?exists> + ${thisSpace.properties.description} + + +      +<#if thisSpace = companyhome> +<#else> +go up to parent spaceUp + +
+
+ +
Spaces in ${thisSpace.name}
+ +
+ + +<#list thisSpace.children as child> + <#if child.isContainer> + + + + + + + + + +
+ Open ${child.name} + + ${child.name}
+<#if child.properties.description?exists> + ${child.properties.description} + +
+
+ +
Documents in ${thisSpace.name} +
+ +
+ + +<#list thisSpace.children as child> + <#if child.isDocument> + +<#assign webdavPath = (child.displayPath?substring(13) + '/' + child.name)?url('ISO-8859-1')?replace('%2F', '/')?replace('\'', '\\\'') /> + + + + + + + + +
+<#if child.name?ends_with(".doc")> + Open ${child.name} +<#else> + Open ${child.name} + + +<#if child.name?ends_with(".doc")> + ${child.name}
+<#else> + ${child.name}
+ +<#if child.properties.description?exists> + ${child.properties.description}
+ + Modified: ${child.properties.modified?datetime}, Size: ${child.size / 1024} Kb
+<#if child.isLocked > + Locked +<#elseif hasAspect(child, "cm:workingcopy") == 1> + Check In +<#else> + Check Out + +Make PDF... +<#if !child.isLocked > +Delete... + +
+
+ +
+Document Actions
+ +
+ +
  +
+ + + + \ No newline at end of file diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/search_get_desc.xml b/config/alfresco/templates/webscripts/org/alfresco/office/search_get_desc.xml new file mode 100644 index 0000000000..64ce3cb8cb --- /dev/null +++ b/config/alfresco/templates/webscripts/org/alfresco/office/search_get_desc.xml @@ -0,0 +1,7 @@ + + Search (Office Add-In) + Generate the Office Add-In Search page + + user + required + \ No newline at end of file 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 new file mode 100644 index 0000000000..d79c5b3d08 --- /dev/null +++ b/config/alfresco/templates/webscripts/org/alfresco/office/search_get_html.ftl @@ -0,0 +1,150 @@ +<#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 args.search?exists> + <#assign searchString = args.search> + <#if searchString != ""> + <#assign queryString = "TEXT:\"${searchString}\" @cm\\:title:${searchString}"> + +<#else> + <#assign searchString = ""> + <#assign queryString = ""> + + +<#if searchString != ""> + <#if args.maxresults?exists> + <#assign maxresults=args.maxresults?number> + <#else> + <#assign maxresults=10> + + + <#assign rescount=1> + + + + + + <#assign results = companyhome.childrenByLuceneSearch[queryString] > + <#if results?size = 0> + + <#else> + <#list results as child> + + <#if child.isDocument> + <#if child.name?ends_with(".pdf")> + <#assign openURL = "/alfresco${child.url}"> + <#assign hrefExtra = " target=\"_blank\""> + <#else> + <#assign webdavPath = (child.displayPath?substring(13) + '/' + child.name)?url('ISO-8859-1')?replace('%2F', '/')?replace('\'', '\\\'') /> + <#assign openURL = "#"> + <#assign hrefExtra = " onClick=\"window.external.openDocument('${webdavPath}')\""> + + <#else> + <#assign openURL = "/alfresco/template/workspace/SpacesStore/${child.id}/workspace/SpacesStore/${office_browse}?search=${searchString}&maxresults=${maxresults}"> + <#assign hrefExtra = ""> + + + + + + + <#if rescount = maxresults> + <#break> + + <#assign rescount=rescount + 1> + + + +
No results found.
+ Open ${child.name} + + ${child.name}
+ <#if child.properties.description?exists> + ${child.properties.description}
+ + <#if child.isDocument> + Modified: ${child.properties.modified?datetime}, Size: ${child.size / 1024} Kb
+ +
+ + + + + + +<#if !args.search?exists> + + + + +Search + + + + + + + <#if args.searchagain?exists> + <#assign onLoad = "onLoad = \"doSearch('${args.searchagain}', '${args.maxresults}');\""> + <#else> + <#assign onLoad = ""> + + + + + +
+ +
+ + + +
Items Found
+ +
+ + + +
+
+ +
  +
+ + + + + \ No newline at end of file diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/versionHistory_get_desc.xml b/config/alfresco/templates/webscripts/org/alfresco/office/versionHistory_get_desc.xml new file mode 100644 index 0000000000..469b35e9da --- /dev/null +++ b/config/alfresco/templates/webscripts/org/alfresco/office/versionHistory_get_desc.xml @@ -0,0 +1,7 @@ + + Version History (Office Add-In) + Generate the Office Add-In Version History page + + user + required + \ No newline at end of file diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/versionHistory_get_html.ftl b/config/alfresco/templates/webscripts/org/alfresco/office/versionHistory_get_html.ftl new file mode 100644 index 0000000000..084c8eab1c --- /dev/null +++ b/config/alfresco/templates/webscripts/org/alfresco/office/versionHistory_get_html.ftl @@ -0,0 +1,88 @@ +<#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 = "version.js"><#assign ver_script = child> + + + + + +Version History + + + + + + + + + + +
+ +
+ +
Version History for ${document.name}
+ +
+ + +<#if document.isDocument > + <#if hasAspect(document, "cm:versionable") == 1 > + + <#list document.versionHistory?sort_by("versionLabel")?reverse as record> + + + + + + <#else> + + + + + +<#else> + + + + + +
+ Open ${record.versionLabel} + + ${record.versionLabel}
+ Author: ${record.creator}
+ Date: ${record.createdDate?datetime}
+<#if record.description?exists> + Notes: ${record.description}
+ + +
+The current document is not versioned.
+Make Versionable +
+The current document is not managed by Alfresco. +
+
+ +
  +
+ + + + \ No newline at end of file diff --git a/source/web/css/office.css b/source/web/css/office.css new file mode 100644 index 0000000000..c9a8a04d55 --- /dev/null +++ b/source/web/css/office.css @@ -0,0 +1,130 @@ +html, body { + height: 100%; + overflow:hidden; + font-family: tahoma, sans-serif; + font-size: 11px; + color: #0073e6; + background: url("../images/taskpane/view_bg.gif") top; +} + +body {margin:0px;padding:0px;} + +#tabBar { + float:left; + width:100%; + background:#d4eaff url("../images/taskpane/bg.gif") repeat-x bottom; + font-size:93%; + line-height:normal; + } +#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; + } + +#spaceListHeader {width:100%; + height:auto; + padding:6px;} + +#mycheckedoutdocsListHeader {width:100%; + height:auto; + padding:6px;} + +#mytodoListHeader {width:100%; + height:auto; + padding:6px;} + +#contentListHeader {width:100%; + height:auto;padding:6px;} + +#searchResultsListHeader {width:100%; + height:auto;padding:6px;} + +#detailsListHeader {width:100%; + height:auto;padding:6px;} + +#versionListHeader {width:100%; + height:auto;padding:6px;} + +#advWorkflowListHeader {width:100%; + height:auto;padding:6px;} + +#myTasksListHeader {width:100%; + height:auto;padding:6px;} + +#simpleWorkflowHeader {width:100%; + height:auto;padding:6px;} + +#currentSpaceInfo {width:100%; + padding: 6px} + +#simpleWorkflowInfo {width:100%; + padding: 6px} + +#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;} + +TABLE {border:0px; +padding:2px;} + +A {color:#0073e6; } + +#bottomMargin {height:6px;} + +#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{ + color:#0073e6; + font-size:11px; + font-weight:bold; + background-color:#cce6ff; + border:1px solid; + border-top-color:#0073e6; + border-left-color:#0073e6; + border-right-color:#0073e6; + border-bottom-color:#0073e6; + filter:progid:DXImageTransform.Microsoft.Gradient + (GradientType=0,StartColorStr='#ffffffff',EndColorStr='#6fb7ff'); + cursor:pointer; + margin-left:6px; + } diff --git a/source/web/images/office/add_aspect.gif b/source/web/images/office/add_aspect.gif new file mode 100644 index 0000000000..9cf68efa15 Binary files /dev/null and b/source/web/images/office/add_aspect.gif differ diff --git a/source/web/images/office/approve.gif b/source/web/images/office/approve.gif new file mode 100644 index 0000000000..9cf68efa15 Binary files /dev/null and b/source/web/images/office/approve.gif differ diff --git a/source/web/images/office/arrow_down.gif b/source/web/images/office/arrow_down.gif new file mode 100644 index 0000000000..dbe0e802dd Binary files /dev/null and b/source/web/images/office/arrow_down.gif differ diff --git a/source/web/images/office/arrow_up.gif b/source/web/images/office/arrow_up.gif new file mode 100644 index 0000000000..14478fd0f1 Binary files /dev/null and b/source/web/images/office/arrow_up.gif differ diff --git a/source/web/images/office/bg.gif b/source/web/images/office/bg.gif new file mode 100644 index 0000000000..c2e8725b56 Binary files /dev/null and b/source/web/images/office/bg.gif differ diff --git a/source/web/images/office/checkin.gif b/source/web/images/office/checkin.gif new file mode 100644 index 0000000000..e3a4ef7888 Binary files /dev/null and b/source/web/images/office/checkin.gif differ diff --git a/source/web/images/office/checkout.gif b/source/web/images/office/checkout.gif new file mode 100644 index 0000000000..788683033a Binary files /dev/null and b/source/web/images/office/checkout.gif differ diff --git a/source/web/images/office/delete.gif b/source/web/images/office/delete.gif new file mode 100644 index 0000000000..d4987804e7 Binary files /dev/null and b/source/web/images/office/delete.gif differ diff --git a/source/web/images/office/document.gif b/source/web/images/office/document.gif new file mode 100644 index 0000000000..b64a8730e0 Binary files /dev/null and b/source/web/images/office/document.gif differ diff --git a/source/web/images/office/document_details.gif b/source/web/images/office/document_details.gif new file mode 100644 index 0000000000..0d03711885 Binary files /dev/null and b/source/web/images/office/document_details.gif differ diff --git a/source/web/images/office/edit_properties.gif b/source/web/images/office/edit_properties.gif new file mode 100644 index 0000000000..9cf68efa15 Binary files /dev/null and b/source/web/images/office/edit_properties.gif differ diff --git a/source/web/images/office/folder_large.gif b/source/web/images/office/folder_large.gif new file mode 100644 index 0000000000..e22c27a06d Binary files /dev/null and b/source/web/images/office/folder_large.gif differ diff --git a/source/web/images/office/go_up.gif b/source/web/images/office/go_up.gif new file mode 100644 index 0000000000..584268b728 Binary files /dev/null and b/source/web/images/office/go_up.gif differ diff --git a/source/web/images/office/lock.gif b/source/web/images/office/lock.gif new file mode 100644 index 0000000000..cab285453c Binary files /dev/null and b/source/web/images/office/lock.gif differ diff --git a/source/web/images/office/makepdf.gif b/source/web/images/office/makepdf.gif new file mode 100644 index 0000000000..991b582244 Binary files /dev/null and b/source/web/images/office/makepdf.gif differ diff --git a/source/web/images/office/my_alfresco.gif b/source/web/images/office/my_alfresco.gif new file mode 100644 index 0000000000..bbaef9e2fc Binary files /dev/null and b/source/web/images/office/my_alfresco.gif differ diff --git a/source/web/images/office/navigator.gif b/source/web/images/office/navigator.gif new file mode 100644 index 0000000000..2138578cfe Binary files /dev/null and b/source/web/images/office/navigator.gif differ diff --git a/source/web/images/office/norm_left.gif b/source/web/images/office/norm_left.gif new file mode 100644 index 0000000000..bc0780768c Binary files /dev/null and b/source/web/images/office/norm_left.gif differ diff --git a/source/web/images/office/norm_left_on.gif b/source/web/images/office/norm_left_on.gif new file mode 100644 index 0000000000..a14056cfbf Binary files /dev/null and b/source/web/images/office/norm_left_on.gif differ diff --git a/source/web/images/office/norm_right.gif b/source/web/images/office/norm_right.gif new file mode 100644 index 0000000000..2ce2f96429 Binary files /dev/null and b/source/web/images/office/norm_right.gif differ diff --git a/source/web/images/office/norm_right_on.gif b/source/web/images/office/norm_right_on.gif new file mode 100644 index 0000000000..c6c750069e Binary files /dev/null and b/source/web/images/office/norm_right_on.gif differ diff --git a/source/web/images/office/placeholder.gif b/source/web/images/office/placeholder.gif new file mode 100644 index 0000000000..9cf68efa15 Binary files /dev/null and b/source/web/images/office/placeholder.gif differ diff --git a/source/web/images/office/reject.gif b/source/web/images/office/reject.gif new file mode 100644 index 0000000000..9cf68efa15 Binary files /dev/null and b/source/web/images/office/reject.gif differ diff --git a/source/web/images/office/run_script.gif b/source/web/images/office/run_script.gif new file mode 100644 index 0000000000..9cf68efa15 Binary files /dev/null and b/source/web/images/office/run_script.gif differ diff --git a/source/web/images/office/save_to_alfresco.gif b/source/web/images/office/save_to_alfresco.gif new file mode 100644 index 0000000000..76cdafb244 Binary files /dev/null and b/source/web/images/office/save_to_alfresco.gif differ diff --git a/source/web/images/office/search.gif b/source/web/images/office/search.gif new file mode 100644 index 0000000000..3caa93a6c2 Binary files /dev/null and b/source/web/images/office/search.gif differ diff --git a/source/web/images/office/space.gif b/source/web/images/office/space.gif new file mode 100644 index 0000000000..e8538fb399 Binary files /dev/null and b/source/web/images/office/space.gif differ diff --git a/source/web/images/office/start_workflow.gif b/source/web/images/office/start_workflow.gif new file mode 100644 index 0000000000..9cf68efa15 Binary files /dev/null and b/source/web/images/office/start_workflow.gif differ diff --git a/source/web/images/office/task.gif b/source/web/images/office/task.gif new file mode 100644 index 0000000000..b84dea40de Binary files /dev/null and b/source/web/images/office/task.gif differ diff --git a/source/web/images/office/update.gif b/source/web/images/office/update.gif new file mode 100644 index 0000000000..9cf68efa15 Binary files /dev/null and b/source/web/images/office/update.gif differ diff --git a/source/web/images/office/version_history.gif b/source/web/images/office/version_history.gif new file mode 100644 index 0000000000..cfae43b50f Binary files /dev/null and b/source/web/images/office/version_history.gif differ diff --git a/source/web/images/office/view_bg.gif b/source/web/images/office/view_bg.gif new file mode 100644 index 0000000000..f26f55e528 Binary files /dev/null and b/source/web/images/office/view_bg.gif differ diff --git a/source/web/images/office/workflow.gif b/source/web/images/office/workflow.gif new file mode 100644 index 0000000000..000df7c04c Binary files /dev/null and b/source/web/images/office/workflow.gif differ diff --git a/source/web/scripts/office/doc_details.js b/source/web/scripts/office/doc_details.js new file mode 100644 index 0000000000..0c178eee63 --- /dev/null +++ b/source/web/scripts/office/doc_details.js @@ -0,0 +1,110 @@ +var xmlHttp + +function showStatus(url) +{ + xmlHttp=GetXmlHttpObject() + if (xmlHttp==null) + { + alert ("Browser does not support HTTP Request") + return + } + xmlHttp.onreadystatechange=stateChanged + xmlHttp.open("GET",url,true) + xmlHttp.send(null) +} + +function stateChanged() +{ + if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") + { + document.getElementById("statusArea").innerHTML=xmlHttp.responseText + window.location.reload(); + } +} + +function GetXmlHttpObject() +{ + var objXMLHttp = null; + if (window.XMLHttpRequest) + { + objXMLHttp=new XMLHttpRequest(); + } + else if (window.ActiveXObject) + { + objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP"); + } + return objXMLHttp; +} + +function runAction(useTemplate, Action, Doc, Msg) +{ + if (Msg != "" && !confirm(Msg)) + { + return; + } + document.getElementById("statusArea").innerHTML="Running action..."; + showStatus("/alfresco/command/script/execute/workspace/SpacesStore/" + useTemplate + "/workspace/SpacesStore/" + Doc + "?action=" + Action); +} + + +function getWindowHeight() +{ + var windowHeight = 0; + if (typeof(window.innerHeight) == 'number') + { + windowHeight = window.innerHeight; + } + else + { + if (document.documentElement && document.documentElement.clientHeight) + { + windowHeight = document.documentElement.clientHeight; + } + else + { + if (document.body && document.body.clientHeight) + { + windowHeight = document.body.clientHeight; + } + } + } + return windowHeight; +} + +function setContent() +{ + if (document.getElementById) + { + var windowHeight = getWindowHeight(); + if (windowHeight > 0) + { + var detailsListHeaderElement = document.getElementById('detailsListHeader'); + var detailsListElement = document.getElementById('detailsList'); + var tabBarElement = document.getElementById('tabBar'); + var bottomMarginElement = document.getElementById('bottomMargin'); + var documentActionsElement = document.getElementById('documentActions'); + + var detailsListHeight = detailsListElement.offsetHeight; + var detailsListHeaderHeight = detailsListHeaderElement.offsetHeight; + var tabBarHeight = tabBarElement.offsetHeight; + var bottomMarginHeight = bottomMarginElement.offsetHeight; + var documentActionsHeight = documentActionsElement.offsetHeight; + + if (windowHeight > 0) + { + detailsListElement.style.height = ((windowHeight- (tabBarHeight + detailsListHeaderHeight + documentActionsHeight + bottomMarginHeight)) /3) * 2 + 'px'; + documentActionsElement.style.height = (windowHeight- (tabBarHeight + detailsListHeaderHeight + documentActionsHeight + bottomMarginHeight)) /3 + 'px'; + } + } + } +} + +window.onload = function() +{ + setContent(); +} + +window.onresize = function() +{ + setContent(); +} \ No newline at end of file diff --git a/source/web/scripts/office/my_alfresco.js b/source/web/scripts/office/my_alfresco.js new file mode 100644 index 0000000000..729e046e09 --- /dev/null +++ b/source/web/scripts/office/my_alfresco.js @@ -0,0 +1,182 @@ +var xmlHttp + +function GetXmlHttpObject() +{ + var objXMLHttp=null; + if (window.XMLHttpRequest) + { + objXMLHttp=new XMLHttpRequest() + } + else if (window.ActiveXObject) + { + objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP") + } + + return objXMLHttp; +} + +function showStatus(url) +{ + xmlHttp=GetXmlHttpObject(); + if (xmlHttp==null) + { + alert("Browser does not support HTTP Request"); + return; + } + xmlHttp.onreadystatechange=stateChanged; + xmlHttp.open("GET",url+"&sid="+Math.random(),true); + xmlHttp.send(null); +} + +function stateChanged() +{ + if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") + { + if (xmlHttp.responseText.indexOf("System Error") > 0) + { + var myWindow = window.open("", "_blank", "scrollbars,height=500,width=400"); + myWindow.document.write(xmlHttp.responseText); + document.getElementById("statusArea").innerHTML=""; + } + else + { + document.getElementById("statusArea").innerHTML=xmlHttp.responseText; + window.location.reload(); + } + } +} + +function runAction(Action, Doc, Msg) +{ + if (Msg != "" && !confirm(Msg)) + { + return; + } + document.getElementById("statusArea").innerHTML="Running action..."; + showStatus("/alfresco/command/script/execute/workspace/SpacesStore/${doc_actions}/workspace/SpacesStore/" + Doc + "?action=" + Action); +} + + +function getWindowHeight() { + var windowHeight = 0; + if (typeof(window.innerHeight) == 'number') { + windowHeight = window.innerHeight; + } + else { + if (document.documentElement && document.documentElement.clientHeight) { + windowHeight = document.documentElement.clientHeight; + } + else { + if (document.body && document.body.clientHeight) { + windowHeight = document.body.clientHeight; + } + } + } + return windowHeight; + } + function setContent() { + if (document.getElementById) { + var windowHeight = getWindowHeight(); + if (windowHeight > 0) { + var mycheckedoutdocsListElement = document.getElementById('mycheckedoutdocsList'); + var mytodoListElement = document.getElementById('mytodoList'); + var tabBarElement = document.getElementById('tabBar'); + var mycheckedoutdocsListHeaderElement = document.getElementById('mycheckedoutdocsListHeader'); + var mytodoListHeaderElement = document.getElementById('mytodoListHeader'); + var bottomMarginElement = document.getElementById('bottomMargin'); + var documentActionsElement = document.getElementById('documentActions'); + + var mycheckedoutdocsListHeight = mycheckedoutdocsListElement.offsetHeight; + var mytodoListHeight = mytodoListElement.offsetHeight; + var tabBarHeight = tabBarElement.offsetHeight; + var mycheckedoutdocsListHeaderHeight = mycheckedoutdocsListHeaderElement.offsetHeight; + var mytodoListHeaderHeight = mytodoListHeaderElement.offsetHeight; + var bottomMarginHeight = bottomMarginElement.offsetHeight; + var documentActionsHeight = documentActionsElement.offsetHeight; + + if (windowHeight > 0) { + mycheckedoutdocsListElement.style.height = (windowHeight- (tabBarHeight + mytodoListHeaderHeight + mycheckedoutdocsListHeaderHeight + documentActionsHeight + bottomMarginHeight)) /2 + 'px'; + mytodoListElement.style.height = (windowHeight- (tabBarHeight + mytodoListHeaderHeight + mycheckedoutdocsListHeaderHeight + documentActionsHeight + bottomMarginHeight)) /2 + 'px'; + } + + } + } + } + window.onload = function() { + setContent(); + stripe('mytodoList', '#fff', '#f6f8fa'); + stripe('mycheckedoutdocsList', '#fff', '#f6f8fa'); + } + window.onresize = function() { + setContent(); + } + + + + // this function is need to work around + // a bug in IE related to element attributes + function hasClass(obj) { + var result = false; + if (obj.getAttributeNode("class") != null) { + result = obj.getAttributeNode("class").value; + } + return result; + } + + function stripe(id) { + + // the flag we'll use to keep track of + // whether the current row is odd or even + var even = false; + + // if arguments are provided to specify the colours + // of the even & odd rows, then use the them; + // otherwise use the following defaults: + var evenColor = arguments[1] ? arguments[1] : "#fff"; + var oddColor = arguments[2] ? arguments[2] : "#eee"; + + // obtain a reference to the desired table + // if no such table exists, abort + var table = document.getElementById(id); + if (! table) { return; } + + // by definition, tables can have more than one tbody + // element, so we'll have to get the list of child + // <tbody>s + var tbodies = table.getElementsByTagName("tbody"); + + // and iterate through them... + for (var h = 0; h < tbodies.length; h++) { + + // find all the <tr> elements... + var trs = tbodies[h].getElementsByTagName("tr"); + + // ... and iterate through them + for (var i = 0; i < trs.length; i++) { + + // avoid rows that have a class attribute + // or backgroundColor style + if (!hasClass(trs[i]) && ! trs[i].style.backgroundColor) { + + // get all the cells in this row... + var tds = trs[i].getElementsByTagName("td"); + + // and iterate through them... + for (var j = 0; j < tds.length; j++) { + + var mytd = tds[j]; + + // avoid cells that have a class attribute + // or backgroundColor style + if (! hasClass(mytd) && ! mytd.style.backgroundColor) { + + mytd.style.backgroundColor = even ? evenColor : oddColor; + + } + } + } + // flip from odd to even, or vice-versa + even = ! even; + } + } + } diff --git a/source/web/scripts/office/navigation.js b/source/web/scripts/office/navigation.js new file mode 100644 index 0000000000..a881ff401d --- /dev/null +++ b/source/web/scripts/office/navigation.js @@ -0,0 +1,187 @@ + +var xmlHttp + +function GetXmlHttpObject() +{ + var objXMLHttp=null; + if (window.XMLHttpRequest) + { + objXMLHttp=new XMLHttpRequest() + } + else if (window.ActiveXObject) + { + objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP") + } + + return objXMLHttp; +} + +function showStatus(url) +{ + xmlHttp=GetXmlHttpObject(); + if (xmlHttp==null) + { + alert("Browser does not support HTTP Request"); + return; + } + xmlHttp.onreadystatechange=stateChanged; + xmlHttp.open("GET",url+"&sid="+Math.random(),true); + xmlHttp.send(null); +} + +function stateChanged() +{ + if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") + { + if (xmlHttp.responseText.indexOf("System Error") > 0) + { + var myWindow = window.open("", "_blank", "scrollbars,height=500,width=400"); + myWindow.document.write(xmlHttp.responseText); + document.getElementById("statusArea").innerHTML=""; + } + else + { + document.getElementById("statusArea").innerHTML=xmlHttp.responseText; + window.location.reload(); + } + } +} + + + + +function runAction(useTemplate, Action, Doc, Msg) +{ + if (Msg != "" && !confirm(Msg)) + { + return; + } + document.getElementById("statusArea").innerHTML="Running action..."; + showStatus("/alfresco/command/script/execute/workspace/SpacesStore/" + useTemplate + "/workspace/SpacesStore/" + Doc + "?action=" + Action); +} + +function getWindowHeight() { + var windowHeight = 0; + if (typeof(window.innerHeight) == 'number') { + windowHeight = window.innerHeight; + } + else { + if (document.documentElement && document.documentElement.clientHeight) { + windowHeight = document.documentElement.clientHeight; + } + else { + if (document.body && document.body.clientHeight) { + windowHeight = document.body.clientHeight; + } + } + } + return windowHeight; + } + function setContent() { + if (document.getElementById) { + var windowHeight = getWindowHeight(); + if (windowHeight > 0) { + var spaceListElement = document.getElementById('spaceList'); + var contentListElement = document.getElementById('contentList'); + var tabBarElement = document.getElementById('tabBar'); + var currentSpaceInfoElement = document.getElementById('currentSpaceInfo'); + var spaceListHeaderElement = document.getElementById('spaceListHeader'); + var contentListHeaderElement = document.getElementById('contentListHeader'); + var bottomMarginElement = document.getElementById('bottomMargin'); + var documentActionsElement = document.getElementById('documentActions'); + + var spaceListHeight = spaceListElement.offsetHeight; + var contentListHeight = contentListElement.offsetHeight; + var tabBarHeight = tabBarElement.offsetHeight; + var currentSpaceInfoHeight = currentSpaceInfoElement.offsetHeight; + var spaceListHeaderHeight = spaceListHeaderElement.offsetHeight; + var contentListHeaderHeight = contentListHeaderElement.offsetHeight; + var bottomMarginHeight = bottomMarginElement.offsetHeight; + var documentActionsHeight = documentActionsElement.offsetHeight; + + if (windowHeight > 0) { + spaceListElement.style.height = (windowHeight- (tabBarHeight + currentSpaceInfoHeight + spaceListHeaderHeight + contentListHeaderHeight + documentActionsHeight + bottomMarginHeight)) /2 + 'px'; + contentListElement.style.height = (windowHeight- (tabBarHeight + currentSpaceInfoHeight + spaceListHeaderHeight + contentListHeaderHeight + documentActionsHeight + bottomMarginHeight)) /2 + 'px'; + } + + } + } + } + window.onload = function() { + setContent(); + stripe('spaceList', '#fff', '#f6f8fa'); + stripe('contentList', '#fff', '#f6f8fa'); + } + window.onresize = function() { + setContent(); + } + + + + // this function is need to work around + // a bug in IE related to element attributes + function hasClass(obj) { + var result = false; + if (obj.getAttributeNode("class") != null) { + result = obj.getAttributeNode("class").value; + } + return result; + } + + function stripe(id) { + + // the flag we'll use to keep track of + // whether the current row is odd or even + var even = false; + + // if arguments are provided to specify the colours + // of the even & odd rows, then use the them; + // otherwise use the following defaults: + var evenColor = arguments[1] ? arguments[1] : "#fff"; + var oddColor = arguments[2] ? arguments[2] : "#eee"; + + // obtain a reference to the desired table + // if no such table exists, abort + var table = document.getElementById(id); + if (! table) { return; } + + // by definition, tables can have more than one tbody + // element, so we'll have to get the list of child + // <tbody>s + var tbodies = table.getElementsByTagName("tbody"); + + // and iterate through them... + for (var h = 0; h < tbodies.length; h++) { + + // find all the <tr> elements... + var trs = tbodies[h].getElementsByTagName("tr"); + + // ... and iterate through them + for (var i = 0; i < trs.length; i++) { + + // avoid rows that have a class attribute + // or backgroundColor style + if (!hasClass(trs[i]) && ! trs[i].style.backgroundColor) { + + // get all the cells in this row... + var tds = trs[i].getElementsByTagName("td"); + + // and iterate through them... + for (var j = 0; j < tds.length; j++) { + + var mytd = tds[j]; + + // avoid cells that have a class attribute + // or backgroundColor style + if (! hasClass(mytd) && ! mytd.style.backgroundColor) { + + mytd.style.backgroundColor = even ? evenColor : oddColor; + + } + } + } + // flip from odd to even, or vice-versa + even = ! even; + } + } + } diff --git a/source/web/scripts/office/search.js b/source/web/scripts/office/search.js new file mode 100644 index 0000000000..192a3c6203 --- /dev/null +++ b/source/web/scripts/office/search.js @@ -0,0 +1,203 @@ +var xmlHttp + +function GetXmlHttpObject() +{ + var objXMLHttp=null; + if (window.XMLHttpRequest) + { + objXMLHttp=new XMLHttpRequest() + } + else if (window.ActiveXObject) + { + objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP") + } + + return objXMLHttp; +} + +function showStatus(url) +{ +// alert(url); + xmlHttp=GetXmlHttpObject(); + if (xmlHttp==null) + { + alert("Browser does not support HTTP Request"); + return; + } + xmlHttp.onreadystatechange=stateChanged; + xmlHttp.open("GET",url+"&sid="+Math.random(),true); + xmlHttp.send(null); +} + +function stateChanged() +{ + if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") + { + if (xmlHttp.responseText.indexOf("System Error") > 0) + { + var myWindow = window.open("", "_blank", "scrollbars,height=500,width=400"); + myWindow.document.write(xmlHttp.responseText); + } + else + { + document.getElementById("searchResultsList").innerHTML=xmlHttp.responseText; + stripe('searchResultsList', '#fff', '#f6f8fa'); + } + document.getElementById("statusArea").innerHTML=""; + } +} + +function runSearch(useTemplate) +{ + document.getElementById("statusArea").innerHTML="Searching..."; + searchString = document.getElementById("searchText").value; + maxcount = document.getElementById("maxresults").value; + doSearch(useTemplate, searchString, maxcount); +} + +function doSearch(useTemplate, searchString, maxcount) +{ + showStatus("/alfresco/template/workspace/SpacesStore/"+ useTemplate + "/workspace/SpacesStore/" + useTemplate + "?search=" + searchString + "&maxresults=" + maxcount); +} + +function handleTextEnter(e) { + var keycode; + + // get the keycode + if (window.event) + { + keycode = window.event.keyCode; + } + else if (e) + { + keycode = e.which; + } + // if ENTER was pressed execute the query + if (keycode == 13) + { + runSearch(); + return false; + } + return true; +} + + +function getWindowHeight() { + var windowHeight = 0; + if (typeof(window.innerHeight) == 'number') { + windowHeight = window.innerHeight; + } + else { + if (document.documentElement && document.documentElement.clientHeight) { + windowHeight = document.documentElement.clientHeight; + } + else { + if (document.body && document.body.clientHeight) { + windowHeight = document.body.clientHeight; + } + } + } + return windowHeight; + } + +function setContent() { + if (document.getElementById) { + var windowHeight = getWindowHeight(); + if (windowHeight > 0) { + + var tabBarElement = document.getElementById('tabBar'); + var bottomMarginElement = document.getElementById('bottomMargin'); + var searchResultsListElement = document.getElementById('searchResultsList'); + var searchHeightElement = document.getElementById('search'); + var searchResultsListHeaderElement = document.getElementById('searchResultsListHeader'); + + var tabBarHeight = tabBarElement.offsetHeight; + var bottomMarginHeight = bottomMarginElement.offsetHeight; + var searchResultsListHeight = searchResultsListElement.offsetHeight; + var searchHeight = searchHeightElement.offsetHeight; + var searchResultsListHeaderHeight = searchResultsListHeaderElement.offsetHeight; + + if (windowHeight > 0) { + searchResultsListElement.style.height = windowHeight- (tabBarHeight + searchHeight + searchResultsListHeaderHeight + bottomMarginHeight) + 'px'; + } + + } + } + } + window.onload = function() { + setContent(); + stripe('searchResultsList', '#fff', '#f6f8fa'); + } + window.onresize = function() { + setContent(); + } + + + // this function is need to work around + // a bug in IE related to element attributes + function hasClass(obj) { + var result = false; + if (obj.getAttributeNode("class") != null) { + result = obj.getAttributeNode("class").value; + } + return result; + } + +function stripe(id) { + + // the flag we'll use to keep track of + // whether the current row is odd or even + var even = false; + + // if arguments are provided to specify the colours + // of the even & odd rows, then use the them; + // otherwise use the following defaults: + var evenColor = arguments[1] ? arguments[1] : "#fff"; + var oddColor = arguments[2] ? arguments[2] : "#eee"; + + // obtain a reference to the desired table + // if no such table exists, abort + var table = document.getElementById(id); + if (! table) { return; } + + // by definition, tables can have more than one tbody + // element, so we'll have to get the list of child + // <tbody>s + var tbodies = table.getElementsByTagName("tbody"); + + // and iterate through them... + for (var h = 0; h < tbodies.length; h++) { + + // find all the <tr> elements... + var trs = tbodies[h].getElementsByTagName("tr"); + + // ... and iterate through them + for (var i = 0; i < trs.length; i++) { + + // avoid rows that have a class attribute + // or backgroundColor style + if (!hasClass(trs[i]) && ! trs[i].style.backgroundColor) { + + // get all the cells in this row... + var tds = trs[i].getElementsByTagName("td"); + + // and iterate through them... + for (var j = 0; j < tds.length; j++) { + + var mytd = tds[j]; + + // avoid cells that have a class attribute + // or backgroundColor style + if (! hasClass(mytd) && ! mytd.style.backgroundColor) { + + mytd.style.backgroundColor = even ? evenColor : oddColor; + + } + } + } + // flip from odd to even, or vice-versa + even = ! even; + } + } + } + diff --git a/source/web/scripts/office/version.js b/source/web/scripts/office/version.js new file mode 100644 index 0000000000..4acbd9c869 --- /dev/null +++ b/source/web/scripts/office/version.js @@ -0,0 +1,173 @@ +var xmlHttp + +function GetXmlHttpObject() +{ + var objXMLHttp=null; + if (window.XMLHttpRequest) + { + objXMLHttp=new XMLHttpRequest() + } + else if (window.ActiveXObject) + { + objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP") + } + + return objXMLHttp; +} + +function showStatus(url) +{ + xmlHttp=GetXmlHttpObject(); + if (xmlHttp==null) + { + alert("Browser does not support HTTP Request"); + return; + } + xmlHttp.onreadystatechange=stateChanged; + xmlHttp.open("GET",url+"&sid="+Math.random(),true); + xmlHttp.send(null); +} + +function stateChanged() +{ + if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") + { + if (xmlHttp.responseText.indexOf("System Error") > 0) + { + var myWindow = window.open("", "_blank", "scrollbars,height=500,width=400"); + myWindow.document.write(xmlHttp.responseText); + document.getElementById("statusArea").innerHTML=""; + } + else + { + document.getElementById("statusArea").innerHTML=xmlHttp.responseText; + window.location.reload(); + } + } +} + +function runAction(useTemplate, Action, Doc, Msg) +{ + if (Msg != "" && !confirm(Msg)) + { + return; + } + document.getElementById("statusArea").innerHTML="Running action..."; + showStatus("/alfresco/command/script/execute/workspace/SpacesStore/" + useTemplate + "/workspace/SpacesStore/" + Doc + "?action=" + Action); +} + + +function getWindowHeight() { + var windowHeight = 0; + if (typeof(window.innerHeight) == 'number') { + windowHeight = window.innerHeight; + } + else { + if (document.documentElement && document.documentElement.clientHeight) { + windowHeight = document.documentElement.clientHeight; + } + else { + if (document.body && document.body.clientHeight) { + windowHeight = document.body.clientHeight; + } + } + } + return windowHeight; + } + function setContent() { + if (document.getElementById) { + var windowHeight = getWindowHeight(); + if (windowHeight > 0) { + var versionListHeaderElement = document.getElementById('versionListheader'); + var versionListElement = document.getElementById('versionList'); + var tabBarElement = document.getElementById('tabBar'); + var bottomMarginElement = document.getElementById('bottomMargin'); + + var versionListHeight = versionListElement.offsetHeight; + var versionListHeaderHeight = versionListHeaderElement.offsetHeight; + var tabBarHeight = tabBarElement.offsetHeight; + var bottomMarginHeight = bottomMarginElement.offsetHeight; + + if (windowHeight > 0) { + versionListElement.style.height = (windowHeight- (tabBarHeight + versionListHeaderHeight + bottomMarginHeight)) + 'px'; + } + + } + } + } + window.onload = function() { + setContent(); + stripe('versionList', '#fff', '#f6f8fa'); + } + window.onresize = function() { + setContent(); + } + + + // this function is need to work around + // a bug in IE related to element attributes + function hasClass(obj) { + var result = false; + if (obj.getAttributeNode("class") != null) { + result = obj.getAttributeNode("class").value; + } + return result; + } + + function stripe(id) { + + // the flag we'll use to keep track of + // whether the current row is odd or even + var even = false; + + // if arguments are provided to specify the colours + // of the even & odd rows, then use the them; + // otherwise use the following defaults: + var evenColor = arguments[1] ? arguments[1] : "#fff"; + var oddColor = arguments[2] ? arguments[2] : "#eee"; + + // obtain a reference to the desired table + // if no such table exists, abort + var table = document.getElementById(id); + if (! table) { return; } + + // by definition, tables can have more than one tbody + // element, so we'll have to get the list of child + // <tbody>s + var tbodies = table.getElementsByTagName("tbody"); + + // and iterate through them... + for (var h = 0; h < tbodies.length; h++) { + + // find all the <tr> elements... + var trs = tbodies[h].getElementsByTagName("tr"); + + // ... and iterate through them + for (var i = 0; i < trs.length; i++) { + + // avoid rows that have a class attribute + // or backgroundColor style + if (!hasClass(trs[i]) && ! trs[i].style.backgroundColor) { + + // get all the cells in this row... + var tds = trs[i].getElementsByTagName("td"); + + // and iterate through them... + for (var j = 0; j < tds.length; j++) { + + var mytd = tds[j]; + + // avoid cells that have a class attribute + // or backgroundColor style + if (! hasClass(mytd) && ! mytd.style.backgroundColor) { + + mytd.style.backgroundColor = even ? evenColor : oddColor; + + } + } + } + // flip from odd to even, or vice-versa + even = ! even; + } + } + }