mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
ALFCOM-2442, ALFCOM-2440, ALFCOM-597, ALFCOM-2145, ALFCOM-2768, ETHREEOH-1545, ALFCOM-2764, ALFCOM-2104, ETHREEOH-1532, ETHREEOH-543, ETHREEOH-1523, ETHREEOH-1516, ETHREEOH-1028 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@14813 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
70 lines
1.9 KiB
JavaScript
70 lines
1.9 KiB
JavaScript
/*
|
|
* Prerequisites: mootools.v1.11.js
|
|
* office_addin.js
|
|
*/
|
|
var OfficeDocDetails =
|
|
{
|
|
init: function()
|
|
{
|
|
OfficeDocDetails.setupTabs();
|
|
},
|
|
|
|
setupTabs: function()
|
|
{
|
|
var tabs = $$('.tabBarInline li');
|
|
var tablinks = $$('.tabBarInline li a');
|
|
var panels = $$('.tabPanel');
|
|
|
|
tabs.each(function(tab, i)
|
|
{
|
|
// register 'click' event for each tab
|
|
tablinks[i].addEvent('click', function(e)
|
|
{
|
|
// highlight the current tab
|
|
tab.addClass('current');
|
|
// show the tab panel
|
|
panels[i].removeClass('tabPanelHidden');
|
|
|
|
// reset styles on all closed tasks
|
|
tabs.each(function(otherTab, j)
|
|
{
|
|
if (otherTab != tab)
|
|
{
|
|
// reset selected class
|
|
otherTab.removeClass('current');
|
|
// hide the tab panel
|
|
panels[j].addClass('tabPanelHidden');
|
|
}
|
|
});
|
|
});
|
|
});
|
|
},
|
|
|
|
showAddTagForm: function()
|
|
{
|
|
$("addTagLinkContainer").setStyle("display", "none");
|
|
$("addTagFormContainer").setStyle("display", "block");
|
|
$("addTagBox").focus();
|
|
},
|
|
|
|
hideAddTagForm: function()
|
|
{
|
|
$("addTagFormContainer").setStyle("display", "none");
|
|
$("addTagLinkContainer").setStyle("display", "block");
|
|
return false;
|
|
},
|
|
|
|
addTag: function(nodeId, tagName)
|
|
{
|
|
OfficeAddin.postAction(window.serviceContextPath + "/collaboration/tagActions", "add", nodeId, null, "t=" + encodeURIComponent(tagName));
|
|
return false;
|
|
},
|
|
|
|
removeTag: function(nodeId, tagName)
|
|
{
|
|
OfficeAddin.postAction(window.serviceContextPath + "/collaboration/tagActions", "remove", nodeId , null, "t=" + encodeURIComponent(tagName));
|
|
return false;
|
|
}
|
|
};
|
|
|
|
window.addEvent('domready', OfficeDocDetails.init); |