Usability updates for Office Web Scripts

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6250 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Mike Hatfield
2007-07-13 17:11:28 +00:00
parent 4136af3cde
commit a483738354
7 changed files with 72 additions and 11 deletions

View File

@@ -226,6 +226,23 @@ var OfficeMyTasks =
}
});
myAjax.request();
},
refreshPage: function()
{
// Remove any trailing hash
var href = window.location.href.replace("#", "")
// Remove any previous "st", "w", "wd" or "t" parameters
href = OfficeAddin.removeParameters(href, "st|w|wd|t");
// Re-select a selected task after reload
var taskSel = $E('#taskList .taskItemSelected');
if (taskSel != null)
{
var taskId = taskSel.id;
href += (href.indexOf("?") == -1) ? "?" : "&";
href += "t=" + encodeURI(taskId);
}
window.location.href = href;
}
};

View File

@@ -204,6 +204,37 @@ var OfficeAddin =
var x = a.dueDate;
var y = b.dueDate;
return ((x < y) ? -1 : ((x > y) ? 1 : 0));
},
openWindowCallback: function(url, callback)
{
// Store the callback function for later
OfficeAddin.callbackFunction = callback;
// Register our "well known" callback function
window.alfrescoCallback = OfficeAddin.openWindowOnCallback;
// Use a named window so that only one dialog is active at a time
window.open(url, 'alfrescoDialog', 'width=1024,height=768');
},
openWindowOnCallback: function(fromTimeout)
{
if (typeof(fromTimeout)=='undefined')
{
window.setTimeout("OfficeAddin.openWindowOnCallback(true)", 10);
}
else
{
// Clear out the global callback function
window.alfrescoCallback = null;
try
{
OfficeAddin.callbackFunction();
}
catch (e)
{
}
OfficeAddin.callbackFunction = null;
}
}
};